diff --git a/.all-contributorsrc b/.all-contributorsrc index fa42641973..ec91a7dec9 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1066,6 +1066,33 @@ "contributions": [ "doc" ] + }, + { + "login": "donicek", + "name": "Petr Kacer", + "avatar_url": "https://avatars.githubusercontent.com/u/8548012?v=4", + "profile": "https://github.com/donicek", + "contributions": [ + "bug" + ] + }, + { + "login": "ArmaanT", + "name": "Armaan Tobaccowalla", + "avatar_url": "https://avatars.githubusercontent.com/u/13340433?v=4", + "profile": "https://armaan.tobaccowalla.com", + "contributions": [ + "bug" + ] + }, + { + "login": "ChristopheVico", + "name": "Christophe Vico", + "avatar_url": "https://avatars.githubusercontent.com/u/56592817?v=4", + "profile": "https://github.com/ChristopheVico", + "contributions": [ + "bug" + ] } ], "repoType": "github", diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index 9ce8ce0469..693fbe5473 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -11,6 +11,12 @@ jobs: superchain: name: jsii/superchain runs-on: ubuntu-latest + strategy: + matrix: + node: ['10', '14'] + env: + # Node version whose images will be aliased to 'nightly' and 'latest' + DEFAULT_NODE_MAJOR_VERSION: 10 steps: - name: Check out uses: actions/checkout@v2 @@ -53,31 +59,45 @@ jobs: - name: Build Image if: steps.should-run.outputs.result == 'true' run: |- - docker build \ - --pull \ - --build-arg BUILD_TIMESTAMP="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - --build-arg COMMIT_ID='${{ github.sha }}' \ - --tag 'jsii/superchain:nightly' \ + docker build \ + --pull \ + --build-arg BUILD_TIMESTAMP="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --build-arg COMMIT_ID='${{ github.sha }}' \ + --build-arg NODE_MAJOR_VERSION=${{ matrix.node }} \ + --tag "jsii/superchain:node${{ matrix.node }}-nightly" \ ./superchain - name: Test Image if: steps.should-run.outputs.result == 'true' run: |- - docker run \ - --rm \ - --tty \ - --network=host \ - -v${{ github.workspace }}:${{ github.workspace }} \ - -w${{ github.workspace }} \ - 'jsii/superchain:nightly' \ + docker run \ + --rm \ + --tty \ + --network=host \ + -v${{ github.workspace }}:${{ github.workspace }} \ + -w${{ github.workspace }} \ + "jsii/superchain:node${{ matrix.node }}-nightly" \ bash -c "yarn install --frozen-lockfile && yarn build && yarn test" # Only when puhsing to main/release from now on - name: Publish (nightly) if: steps.should-run.outputs.result == 'true' && github.event_name == 'push' && github.ref != 'refs/heads/release' run: |- - docker push jsii/superchain:nightly + docker push jsii/superchain:node${{ matrix.node }}-nightly + + # If the current version is the default version, also tag this with the unqualified ':nightly' label + if [[ "${{ matrix.node }}" == "$DEFAULT_NODE_MAJOR_VERSION" ]]; then + docker tag jsii/superchain:node${{ matrix.node }}-nightly jsii/superchain:nightly + docker push jsii/superchain:nightly + fi - name: Publish (latest) if: steps.should-run.outputs.result == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/release' run: |- - docker tag jsii/superchain:nightly jsii/superchain:latest - docker push jsii/superchain:latest + # Alias 'nodeX-nightly's to 'nodeX', then push + docker tag jsii/superchain:node${{ matrix.node }}-nightly jsii/superchain:node${{ matrix.node }} + docker push jsii/superchain:node${{ matrix.node }} + + # If the current version is the default version, also tag this with the unqualified ':latest' label + if [[ "${{ matrix.node }}" == "$DEFAULT_NODE_MAJOR_VERSION" ]]; then + docker tag jsii/superchain:node${{ matrix.node }} jsii/superchain:latest + docker push jsii/superchain:latest + fi diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index d2dc0074ed..df2cee60e0 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -7,6 +7,7 @@ on: push: branches: [main] paths: [gh-pages/**] + workflow_dispatch: jobs: build: @@ -49,7 +50,7 @@ jobs: publish: name: Publish needs: build - if: github.event_name == 'push' + if: github.event_name == 'push' ||Β github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - name: Check out diff --git a/.mergify/config.yml b/.mergify/config.yml index 2f0cecc5a0..cab6bd1a58 100644 --- a/.mergify/config.yml +++ b/.mergify/config.yml @@ -30,7 +30,7 @@ pull_request_rules: - '#changes-requested-reviews-by=0' - status-success=Semantic Pull Request # Docker image validation - - status-success=jsii/superchain + - status-success~=^jsii/superchain # One test for each OS - status-success~=^Test \(ubuntu-.*$ - status-success~=^Test \(macos-.*$ @@ -79,7 +79,7 @@ pull_request_rules: - '#changes-requested-reviews-by=0' - status-success=Semantic Pull Request # Docker image validation - - status-success=jsii/superchain + - status-success~=^jsii/superchain # One test for each OS - status-success~=^Test \(ubuntu-.*$ - status-success~=^Test \(macos-.*$ @@ -128,7 +128,7 @@ pull_request_rules: - '#changes-requested-reviews-by=0' - status-success=Semantic Pull Request # Docker image validation - - status-success=jsii/superchain + - status-success~=^jsii/superchain # One test for each OS - status-success~=^Test \(ubuntu-.*$ - status-success~=^Test \(macos-.*$ diff --git a/CHANGELOG.md b/CHANGELOG.md index f781507fff..689d2353e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,26 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.27.0](https://github.com/aws/jsii/compare/v1.26.0...v1.27.0) (2021-04-02) + + +### Features + +* **go:** variadic type helpers to build slices ([#2755](https://github.com/aws/jsii/issues/2755)) ([16b6546](https://github.com/aws/jsii/commit/16b65468c27bf6569a35042279fadb2d5cc4c715)) +* **superchain:** also build a superchain image with Node 14 ([#2741](https://github.com/aws/jsii/issues/2741)) ([6364d51](https://github.com/aws/jsii/commit/6364d514edc1904aab5e0e9037a6025c9b335043)) + + +### Bug Fixes + +* **go:** dates are mistreated as strings ([#2730](https://github.com/aws/jsii/issues/2730)) ([2ba2ec4](https://github.com/aws/jsii/commit/2ba2ec47af1b3007844c00bd44aa81ccc7729040)), closes [#2659](https://github.com/aws/jsii/issues/2659) +* **go:** missing setter for R/W interface properties ([#2731](https://github.com/aws/jsii/issues/2731)) ([74d0d99](https://github.com/aws/jsii/commit/74d0d9999d6381ef8bec36a45141380f190e26b9)), closes [#2665](https://github.com/aws/jsii/issues/2665) +* **go:** protected property accessors missing ([#2738](https://github.com/aws/jsii/issues/2738)) ([94c799a](https://github.com/aws/jsii/commit/94c799a93ebedb12f1b7c9ae475eeac98d13a755)) +* **go:** unable to set an array of interfaces/enums ([#2754](https://github.com/aws/jsii/issues/2754)) ([0cd514e](https://github.com/aws/jsii/commit/0cd514e6e61d47116e9dc693916325fefb90c45d)), closes [#2686](https://github.com/aws/jsii/issues/2686) +* **python:** accept Sequence[T] for array parameters ([#2606](https://github.com/aws/jsii/issues/2606)) ([b09d578](https://github.com/aws/jsii/commit/b09d578464f1b408607bbb9645c65fbb5db318fa)), closes [aws/aws-cdk#13203](https://github.com/aws/aws-cdk/issues/13203) +* **python:** module import fails with: KeyError: '__all__' ([#2757](https://github.com/aws/jsii/issues/2757)) ([c32a889](https://github.com/aws/jsii/commit/c32a8895bdd7c84bd289ca053d15b97086bb5511)), closes [#2750](https://github.com/aws/jsii/issues/2750) +* **rosetta:** 'extract' does not translate samples in submodule READMEs ([#2744](https://github.com/aws/jsii/issues/2744)) ([0a3f01f](https://github.com/aws/jsii/commit/0a3f01fa73e94aea4c86adb64450f45340360b92)) +* **superchain:** use entrypoint to set up nvm ([#2736](https://github.com/aws/jsii/issues/2736)) ([0e247b6](https://github.com/aws/jsii/commit/0e247b6d9f432512559fb4642eebce0b1a854859)) + ## [1.26.0](https://github.com/aws/jsii/compare/v1.24.0...v1.26.0) (2021-03-22) diff --git a/README.md b/README.md index 59de047abd..96c6fd00df 100644 --- a/README.md +++ b/README.md @@ -65,131 +65,134 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Ari Palo

πŸ€” +
Armaan Tobaccowalla

πŸ›
BartΕ‚omiej Jurek

πŸ›
Ben Bridts

πŸ“–
Ben Farr

πŸ“–
Ben Walters

πŸ€”
Benjamin Macher

πŸ“– -
Benjamin Maizels

πŸ’» πŸ‘€ +
Benjamin Maizels

πŸ’» πŸ‘€
Bill Cauchois

πŸ€”
Brecht Verhoeve

πŸ€”
Breland Miley

πŸ’»
CaerusKaru

πŸ’» 🚧
Camilo BermΓΊdez

πŸ›
Campion Fellin

πŸ’» -
Carter Van Deuren

πŸ› +
Carter Van Deuren

πŸ› +
Christophe Vico

πŸ›
Christopher Currie

πŸ’» πŸ€”
Christopher Rybicki

πŸ“–
CyrusNajmabadi

πŸ› πŸ€”
Daniel Dinu

πŸ› πŸ’»
Daniel Schroeder

πŸ› πŸ’» πŸ“– πŸ€” 🚧 -
Dave Slotnick

πŸ› -
Donald Stufft

πŸ› πŸ’» πŸ€” πŸ‘€ +
Dave Slotnick

πŸ› +
Donald Stufft

πŸ› πŸ’» πŸ€” πŸ‘€
Dongie Agnir

πŸ’» πŸ‘€
Eduardo Sena S. Rosa

πŸ›
Elad Ben-Israel

πŸ› πŸ’» πŸ€” 🚧 πŸ‘€ πŸ“’
Eli Polonsky

πŸ› πŸ’» πŸ€” 🚧 πŸ‘€
Eric Z. Beard

πŸ“† -
Erik Karlsson

πŸ› -
Eugene Kozlov

πŸ’» +
Erik Karlsson

πŸ› +
Eugene Kozlov

πŸ’»
Fabio Gentile

πŸ›
Florian Eitel

πŸ€”
Graham Lea

πŸ€” πŸ‘€
Hamza Assyad

πŸ› πŸ’» πŸ€” πŸ‘€
Hari Pachuveetil

πŸ“ πŸ“– -
Hsing-Hui Hsu

πŸ’» πŸ“– πŸ€” πŸ‘€ -
James Kelley

πŸ› +
Hsing-Hui Hsu

πŸ’» πŸ“– πŸ€” πŸ‘€ +
James Kelley

πŸ›
James Mead

πŸ’»
James Siri

πŸ’» 🚧
Jason Del Ponte

πŸ€” πŸ‘€
Jason Fulghum

πŸ€” πŸ“† πŸ‘€
Jerry Kindall

πŸ“– πŸ€” -
Jimmy Gaussen

πŸ€” -
Jon Steinich

πŸ› πŸ€” πŸ’» +
Jimmy Gaussen

πŸ€” +
Jon Steinich

πŸ› πŸ€” πŸ’»
Joseph Lawson

πŸ‘€
Joseph Martin

πŸ›
Junix

πŸ›
Justin Taylor

πŸ›
Kyle Thomson

πŸ’» πŸ‘€ -
Leandro Padua

πŸ› -
Maja S Bratseth

πŸ› +
Leandro Padua

πŸ› +
Maja S Bratseth

πŸ›
Marcos Diez

πŸ›
Matthew Bonig

πŸ› πŸ“
Matthew Pirocchi

πŸ’» πŸ€” πŸ‘€
Mike Lane

πŸ›
Mitch Garnaat

πŸ› πŸ’» πŸ€” πŸ‘€ -
Mitchell Valine

πŸ› πŸ’» πŸ€” 🚧 πŸ‘€ -
Mohamad Soufan

πŸ“– +
Mitchell Valine

πŸ› πŸ’» πŸ€” 🚧 πŸ‘€ +
Mohamad Soufan

πŸ“–
Neta Nir

πŸ’» πŸ€” 🚧 πŸ‘€
Nick Lynch

πŸ› πŸ’» 🚧 πŸ‘€
Niranjan Jayakar

πŸ› πŸ’» πŸ€” 🚧 πŸ‘€
Noah Litov

πŸ’» 🚧 πŸ‘€
PIDZ - Bart

πŸ€” -
Petra Barus

πŸ’» -
Philip Cali

πŸ€” +
Petr Kacer

πŸ› +
Petra Barus

πŸ’» +
Philip Cali

πŸ€”
Quentin Loos

πŸ€”
Raphael

πŸ›
Richard H Boyd

πŸ›
Rico Huijbers

πŸ› πŸ’» πŸ€” 🚧 πŸ‘€ + +
Romain Marcadier

πŸ› πŸ’» 🎨 πŸ€” 🚧 πŸ‘€ πŸ“
SADIK KUZU

πŸ‘€
SK

πŸ€” - -
Sam Fink

πŸ’» πŸ‘€
Sam Goodwin

πŸ‘€
Sebastian Korfmann

πŸ› πŸ’» πŸ€”
Shane Witbeck

πŸ€” + +
Shiv Lakshminarayan

πŸ’» 🚧 πŸ‘€
Somaya

πŸ’» πŸ€” 🚧 πŸ‘€
The Gitter Badger

πŸ’» 🚧 - -
Thomas Poignant

πŸ›
Thomas Steinbach

πŸ›
Thorsten Hoeger

πŸ’»
Tim Wagner

πŸ› πŸ€” + +
Tobias Lidskog

πŸ’»
Ty Coghlan

πŸ›
Tyler van Hensbergen

πŸ€” - -
Vlad Hrybok

πŸ›
Vladimir Shchur

πŸ›
Yan Zhulanow

πŸ’»
ajnarang

πŸ€” + +
aniljava

πŸ’»
deccy-mcc

πŸ›
dependabot-preview[bot]

πŸ› 🚧 - -
dependabot[bot]

🚧
dheffx

πŸ›
gregswdl

πŸ›
mattBrzezinski

πŸ“– + +
mergify[bot]

🚧
seiyashima42

πŸ› πŸ’» πŸ“–
sullis

πŸ’» - -
vaneek

πŸ› diff --git a/gh-pages/content/specification/6-compliance-report.md b/gh-pages/content/specification/6-compliance-report.md index 9014b55c41..786904f37d 100644 --- a/gh-pages/content/specification/6-compliance-report.md +++ b/gh-pages/content/specification/6-compliance-report.md @@ -5,12 +5,12 @@ This section details the current state of each language binding with respect to our standard compliance suite. -| number | test | java (100.00%) | golang (67.52%) | Dotnet | Python | +| number | test | java (100.00%) | golang (77.78%) | Dotnet | Python | | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | -------------------------------------------- | ------ | ------ | | 1 | asyncOverrides_overrideCallsSuper | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2670) | β­• | β­• | | 2 | [arrayReturnedByMethodCanBeRead]("Array created in the kernel can be queried for its elements") | 🟒 | 🟒 | β­• | β­• | | 3 | [unionProperties]("Kernal values that accept a union type can be set, and are returned with the concrete type") | 🟒 | 🟒 | β­• | β­• | -| 4 | syncOverrides | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2670) | β­• | β­• | +| 4 | syncOverrides | 🟒 | 🟒 | β­• | β­• | | 5 | [useEnumFromScopedModule]("Property that accepts an enum type from a third-party package can be set, and read") | 🟒 | 🟒 | β­• | β­• | | 6 | [createObjectAndCtorOverloads]("Class can be instantiated with empty and non empty constructor") | 🟒 | βšͺ | β­• | β­• | | 7 | fail_syncOverrides_callsDoubleAsync_method | 🟒 | 🟒 | β­• | β­• | @@ -21,19 +21,19 @@ This section details the current state of each language binding with respect to | 12 | [classesCanSelfReferenceDuringClassInitialization]("Classes can reference other classes during initialization") | 🟒 | 🟒 | β­• | β­• | | 13 | [canObtainStructReferenceWithOverloadedSetter]("A class with a settable property of a union type can be returned from the kernel") | 🟒 | 🟒 | β­• | β­• | | 14 | [callbacksCorrectlyDeserializeArguments]("Runtime properly deserializes callback arguments from the kernel") | 🟒 | 🟒 | β­• | β­• | -| 15 | [canUseInterfaceSetters]("Read-write properties generate the corresponding setters in the target language") | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2665) | β­• | β­• | -| 16 | [propertyOverrides_interfaces]("Target language can override properties of host interfaces") | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2665) | β­• | β­• | +| 15 | [canUseInterfaceSetters]("Read-write properties generate the corresponding setters in the target language") | 🟒 | 🟒 | β­• | β­• | +| 16 | [propertyOverrides_interfaces]("Target language can override properties of host interfaces") | 🟒 | 🟒 | β­• | β­• | | 17 | syncOverrides_callsSuper | 🟒 | 🟒 | β­• | β­• | | 18 | [testJsiiAgent]("Asserts the correct value of the JSII_AGENT env variable for the kernel process") | 🟒 | 🟒 | β­• | β­• | | 19 | [doNotOverridePrivates_method_private]("Non public methods on the guest class do not override methods in the host class") | 🟒 | 🟒 | β­• | β­• | | 20 | [pureInterfacesCanBeUsedTransparently]("Guest implementation of a pure host interface can be used by host consumers accepting that interface") | 🟒 | 🟒 | β­• | β­• | | 21 | [nullShouldBeTreatedAsUndefined]("Null value of target language is treated as undefined by the host") | 🟒 | 🟒 | β­• | β­• | -| 22 | [primitiveTypes]("All Primitive types are set and read with their respective types") | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2659) | β­• | β­• | +| 22 | [primitiveTypes]("All Primitive types are set and read with their respective types") | 🟒 | 🟒 | β­• | β­• | | 23 | [reservedKeywordsAreSlugifiedInClassProperties]("TS code that uses reserved words as class property names get slugified so it is usable in the target language") | 🟒 | βšͺ | β­• | β­• | | 24 | [objectIdDoesNotGetReallocatedWhenTheConstructorPassesThisOut]("Ensure the JSII kernel can pass 'this' out to JSII remotes from within the constructor") | 🟒 | 🟒 | β­• | β­• | -| 25 | [interfaceBuilder]("Seems to be a duplicate of 'propertyOverrides_interfaces'?") | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2665) | β­• | β­• | -| 26 | unionTypes | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2686) | β­• | β­• | -| 27 | arrays | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2686) | β­• | β­• | +| 25 | [interfaceBuilder]("Seems to be a duplicate of 'propertyOverrides_interfaces'?") | 🟒 | 🟒 | β­• | β­• | +| 26 | unionTypes | 🟒 | 🟒 | β­• | β­• | +| 27 | arrays | 🟒 | 🟒 | β­• | β­• | | 28 | staticMapInClassCannotBeModified | 🟒 | βšͺ | β­• | β­• | | 29 | consts | 🟒 | 🟒 | β­• | β­• | | 30 | pureInterfacesCanBeUsedTransparently_WhenTransitivelyImplementing | 🟒 | 🟒 | β­• | β­• | @@ -52,10 +52,10 @@ This section details the current state of each language binding with respect to | 43 | doNotOverridePrivates_property_getter_public | 🟒 | 🟒 | β­• | β­• | | 44 | equalsIsResistantToPropertyShadowingResultVariable | 🟒 | 🟒 | β­• | β­• | | 45 | listInClassCanBeReadCorrectly | 🟒 | 🟒 | β­• | β­• | -| 46 | useNestedStruct | 🟒 | [πŸ”΄](https://github.com/aws/jsii/pull/2650) | β­• | β­• | +| 46 | useNestedStruct | 🟒 | 🟒 | β­• | β­• | | 47 | testFluentApiWithDerivedClasses | 🟒 | 🟒 | β­• | β­• | | 48 | interfacesCanBeUsedTransparently_WhenAddedToJsiiType | 🟒 | 🟒 | β­• | β­• | -| 49 | canOverrideProtectedGetter | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2673) | β­• | β­• | +| 49 | canOverrideProtectedGetter | 🟒 | 🟒 | β­• | β­• | | 50 | getAndSetEnumValues | 🟒 | 🟒 | β­• | β­• | | 51 | structs_nonOptionalequals | 🟒 | 🟒 | β­• | β­• | | 52 | testInterfaceParameter | 🟒 | 🟒 | β­• | β­• | @@ -66,10 +66,10 @@ This section details the current state of each language binding with respect to | 57 | eraseUnsetDataValues | 🟒 | 🟒 | β­• | β­• | | 58 | maps | 🟒 | 🟒 | β­• | β­• | | 59 | structs_containsNullChecks | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2672) | β­• | β­• | -| 60 | canOverrideProtectedSetter | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2673) | β­• | β­• | +| 60 | canOverrideProtectedSetter | 🟒 | 🟒 | β­• | β­• | | 61 | asyncOverrides_callAsyncMethod | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2670) | β­• | β­• | | 62 | nodeStandardLibrary | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2670) | β­• | β­• | -| 63 | dates | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2659) | β­• | β­• | +| 63 | dates | 🟒 | 🟒 | β­• | β­• | | 64 | collectionOfInterfaces_ListOfStructs | 🟒 | 🟒 | β­• | β­• | | 65 | objRefsAreLabelledUsingWithTheMostCorrectType | 🟒 | πŸ”΄ | β­• | β­• | | 66 | unionPropertiesWithBuilder | 🟒 | 🟒 | β­• | β­• | @@ -86,7 +86,7 @@ This section details the current state of each language binding with respect to | 77 | asyncOverrides_overrideThrows | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2670) | β­• | β­• | | 78 | callMethods | 🟒 | 🟒 | β­• | β­• | | 79 | returnAbstract | 🟒 | 🟒 | β­• | β­• | -| 80 | dynamicTypes | 🟒 | [πŸ”΄](https://github.com/aws/jsii/issues/2659) | β­• | β­• | +| 80 | dynamicTypes | 🟒 | 🟒 | β­• | β­• | | 81 | hashCodeIsResistantToPropertyShadowingResultVariable | 🟒 | βšͺ | β­• | β­• | | 82 | returnSubclassThatImplementsInterface976 | 🟒 | 🟒 | β­• | β­• | | 83 | structs_optionalEquals | 🟒 | βšͺ | β­• | β­• | diff --git a/gh-pages/content/user-guides/lib-author/toolchain/jsii.md b/gh-pages/content/user-guides/lib-author/toolchain/jsii.md index 9836f17b1b..7ee1a3bd74 100644 --- a/gh-pages/content/user-guides/lib-author/toolchain/jsii.md +++ b/gh-pages/content/user-guides/lib-author/toolchain/jsii.md @@ -59,9 +59,9 @@ reserved words in an identifier. [report bugs]: https://github.com/aws/jsii/issues/new/choose -#### `--strip-dependencies` +#### `--strip-deprecated` -The `--strip-dependencies` option modifies the compilation flow such that all +The `--strip-deprecated` option modifies the compilation flow such that all declarations (types, members) documented with the `@deprecated` tag will be erased from the visible API of the module: diff --git a/gh-pages/requirements-dev.txt b/gh-pages/requirements-dev.txt index 9ccd37c9a9..b70d221646 100644 --- a/gh-pages/requirements-dev.txt +++ b/gh-pages/requirements-dev.txt @@ -1,4 +1,4 @@ mkdocs~=1.1.2 mkdocs-awesome-pages-plugin~=2.5.0 -mkdocs-material~=7.0.6 +mkdocs-material~=7.0.7 mkdocs-git-revision-date-plugin~=0.3.1 diff --git a/lerna.json b/lerna.json index ff883ea7ac..e76080e488 100644 --- a/lerna.json +++ b/lerna.json @@ -10,5 +10,5 @@ "rejectCycles": true } }, - "version": "1.26.0" + "version": "1.27.0" } diff --git a/package.json b/package.json index f1fe2eebe2..fc23b75147 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,10 @@ }, "devDependencies": { "@jest/types": "^26.6.2", - "@typescript-eslint/eslint-plugin": "^4.18.0", - "@typescript-eslint/parser": "^4.18.0", + "@typescript-eslint/eslint-plugin": "^4.20.0", + "@typescript-eslint/parser": "^4.20.0", "all-contributors-cli": "^6.20.0", - "eslint": "^7.22.0", + "eslint": "^7.23.0", "eslint-config-prettier": "^8.1.0", "eslint-import-resolver-node": "^0.3.4", "eslint-import-resolver-typescript": "^2.4.0", diff --git a/packages/@jsii/Directory.Build.targets b/packages/@jsii/Directory.Build.targets index b2dbd0f68f..3cf4d06899 100644 --- a/packages/@jsii/Directory.Build.targets +++ b/packages/@jsii/Directory.Build.targets @@ -16,6 +16,6 @@ - + diff --git a/packages/@jsii/dotnet-runtime-test/package.json b/packages/@jsii/dotnet-runtime-test/package.json index 91b995b3b8..3a39a01677 100644 --- a/packages/@jsii/dotnet-runtime-test/package.json +++ b/packages/@jsii/dotnet-runtime-test/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@jsii/dotnet-runtime": "^0.0.0", - "@types/node": "^10.17.55", + "@types/node": "^10.17.56", "jsii-calc": "^3.20.120", "jsii-pacmak": "^0.0.0", "typescript": "~3.9.9" diff --git a/packages/@jsii/dotnet-runtime/package.json b/packages/@jsii/dotnet-runtime/package.json index 30e7c22155..30b6814209 100644 --- a/packages/@jsii/dotnet-runtime/package.json +++ b/packages/@jsii/dotnet-runtime/package.json @@ -39,10 +39,10 @@ }, "devDependencies": { "@jsii/runtime": "^0.0.0", - "@types/node": "^10.17.55", + "@types/node": "^10.17.56", "@types/semver": "^7.3.4", "jsii-build-tools": "^0.0.0", - "semver": "^7.3.4", + "semver": "^7.3.5", "typescript": "~3.9.9" } } diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/AssemblyTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/AssemblyTests.cs index d088abb2c6..75425a8687 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/AssemblyTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/AssemblyTests.cs @@ -370,7 +370,7 @@ public void ShouldDeserializeAllMembers() ""docs"": { ""summary"": ""hello"" } }"; - Assembly actual = JsonConvert.DeserializeObject(json); + Assembly actual = JsonConvert.DeserializeObject(json)!; Assert.Equal("jsii/0.9.0", actual.Schema, ignoreLineEndingDifferences: true); Assert.Equal("myName", actual.Name, ignoreLineEndingDifferences: true); @@ -406,7 +406,7 @@ public void ShouldDeserializeAllMembersWithNoTypes() ""docs"": {""summary"": ""hello""} }"; - Assembly actual = JsonConvert.DeserializeObject(json); + Assembly actual = JsonConvert.DeserializeObject(json)!; Assert.Equal("jsii/0.9.0", actual.Schema, ignoreLineEndingDifferences: true); Assert.Equal("myName", actual.Name, ignoreLineEndingDifferences: true); @@ -454,7 +454,7 @@ public void ShouldDeserializeAllMembersWithDotNetTarget() ""docs"": {""summary"": ""hello""} }"; - Assembly actual = JsonConvert.DeserializeObject(json); + Assembly actual = JsonConvert.DeserializeObject(json)!; Assert.Equal("jsii/0.9.0", actual.Schema, ignoreLineEndingDifferences: true); Assert.Equal("myName", actual.Name, ignoreLineEndingDifferences: true); @@ -599,7 +599,7 @@ public void ShouldNotDeserializeMissingDependencies() ""docs"": {} }"; - Assembly actual = JsonConvert.DeserializeObject(json); + Assembly actual = JsonConvert.DeserializeObject(json)!; Assert.Null(actual.Dependencies); } @@ -633,7 +633,7 @@ public void ShouldNotDeserializeMissingBundled() ""docs"": {} }"; - Assembly actual = JsonConvert.DeserializeObject(json); + Assembly actual = JsonConvert.DeserializeObject(json)!; Assert.Null(actual.Bundled); } @@ -667,7 +667,7 @@ public void ShouldNotDeserializeMissingDocs() ""bundled"": {} }"; - Assembly actual = JsonConvert.DeserializeObject(json); + Assembly actual = JsonConvert.DeserializeObject(json)!; Assert.Null(actual.Docs); } } diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/ClassTypeTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/ClassTypeTests.cs index dcff399c28..d958bfe999 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/ClassTypeTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/ClassTypeTests.cs @@ -381,7 +381,7 @@ public void ShouldDeserializeAllMembers() ""docs"": { ""summary"": ""hello"" } }"; - ClassType actual = JsonConvert.DeserializeObject(json); + ClassType actual = JsonConvert.DeserializeObject(json)!; Assert.True(actual.IsAbstract); Assert.Empty(actual.Properties); @@ -474,7 +474,7 @@ public void ShouldNotDeserializeMissingNamespace() ""docs"": {} }"; - ClassType actual = JsonConvert.DeserializeObject(json); + ClassType actual = JsonConvert.DeserializeObject(json)!; Assert.Null(actual.Namespace); } @@ -495,7 +495,7 @@ public void ShouldNotDeserializeMissingDocs() ""kind"": ""class"" }"; - ClassType actual = JsonConvert.DeserializeObject(json); + ClassType actual = JsonConvert.DeserializeObject(json)!; Assert.Null(actual.Docs); } @@ -517,7 +517,7 @@ public void ShouldNotDeserializeMissingProperties() ""docs"": {} }"; - ClassType actual = JsonConvert.DeserializeObject(json); + ClassType actual = JsonConvert.DeserializeObject(json)!; Assert.Null(actual.Properties); } @@ -539,7 +539,7 @@ public void ShouldNotDeserializeMissingMethods() ""docs"": {} }"; - ClassType actual = JsonConvert.DeserializeObject(json); + ClassType actual = JsonConvert.DeserializeObject(json)!; Assert.Null(actual.Methods); } @@ -561,7 +561,7 @@ public void ShouldNotDeserializeMissingBase() ""docs"": {} }"; - ClassType actual = JsonConvert.DeserializeObject(json); + ClassType actual = JsonConvert.DeserializeObject(json)!; Assert.Null(actual.Base); } @@ -583,7 +583,7 @@ public void ShouldNotDeserializeMissingInitializer() ""docs"": {} }"; - ClassType actual = JsonConvert.DeserializeObject(json); + ClassType actual = JsonConvert.DeserializeObject(json)!; Assert.Null(actual.Initializer); } @@ -605,7 +605,7 @@ public void ShouldNotDeserializeMissingInterfaces() ""docs"": {} }"; - ClassType actual = JsonConvert.DeserializeObject(json); + ClassType actual = JsonConvert.DeserializeObject(json)!; Assert.Null(actual.Interfaces); } @@ -627,7 +627,7 @@ public void DeserializesAsyncMethod() ""docs"": {} }"; - ClassType actual = JsonConvert.DeserializeObject(json); + ClassType actual = JsonConvert.DeserializeObject(json)!; Assert.Equal(1, actual.Methods?.Length); Assert.True(actual.Methods?[0]?.IsAsync); diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/CollectionTypeReferenceTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/CollectionTypeReferenceTests.cs index 6f848f5a50..0c9854e197 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/CollectionTypeReferenceTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/CollectionTypeReferenceTests.cs @@ -58,10 +58,10 @@ public void ShouldDeserializeAllMembers() } }"; - CollectionTypeReference actual = JsonConvert.DeserializeObject(json); + CollectionTypeReference actual = JsonConvert.DeserializeObject(json)!; - Assert.Equal(CollectionKind.Array, actual.Kind); - Assert.NotNull(actual.ElementType); + Assert.Equal(CollectionKind.Array, actual?.Kind); + Assert.NotNull(actual?.ElementType); } [Fact(DisplayName = Prefix + nameof(ShouldThrowOnMissingElementType))] diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/DocsTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/DocsTests.cs index 9a2759728e..61d34a2b96 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/DocsTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/DocsTests.cs @@ -50,7 +50,7 @@ public void ShouldDeserializeAllMembers() ""custom"": { ""custtag"": ""custval"" } }"; - Docs actual = JsonConvert.DeserializeObject(json); + Docs actual = JsonConvert.DeserializeObject(json)!; Assert.Equal("summary", actual.Summary); Assert.Equal("remarks", actual.Remarks); diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/EnumMemberTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/EnumMemberTests.cs index 0e5e2e0690..67a0650bc5 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/EnumMemberTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/EnumMemberTests.cs @@ -61,7 +61,7 @@ public void ShouldDeserializeAllMembers() ""docs"": { ""summary"": ""hello"" } }"; - EnumMember actual = JsonConvert.DeserializeObject(json); + EnumMember actual = JsonConvert.DeserializeObject(json)!; Assert.Equal("myName", actual?.Name, ignoreLineEndingDifferences: true); Assert.Equal("hello", actual?.Docs?.Summary); @@ -84,7 +84,7 @@ public void ShouldNotDeserializeMissingDocs() ""name"": ""myName"" }"; - EnumMember actual = JsonConvert.DeserializeObject(json); + EnumMember actual = JsonConvert.DeserializeObject(json)!; Assert.Null(actual.Docs); } diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/CallbackExtensions.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/CallbackExtensions.cs index cf53e98200..561afea55b 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/CallbackExtensions.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/CallbackExtensions.cs @@ -16,7 +16,8 @@ namespace Amazon.JSII.Runtime { internal static class CallbackExtensions { - public static object? InvokeCallback(this Callback callback, IReferenceMap referenceMap, IFrameworkToJsiiConverter converter, out string? error) + public static object? InvokeCallback(this Callback callback, IReferenceMap referenceMap, + IFrameworkToJsiiConverter converter, out string? error) { try { @@ -76,20 +77,22 @@ out object? result if (methodInfo == null) { - throw new InvalidOperationException($"Received callback for {deputy.GetType().Name}.{request.Method} method, but this method does not exist"); + throw new InvalidOperationException( + $"Received callback for {deputy.GetType().Name}.{request.Method} method, but this method does not exist"); } var attribute = methodInfo.GetAttribute()!; var parameters = methodInfo.GetParameters(); - + var converter = ServiceContainer.ServiceProvider.GetRequiredService(); - + var rehydratedArgs = Enumerable.Range(0, request.Arguments?.Length ?? 0) .Select(n => { var paramIndex = n >= parameters.Length ? parameters.Length - 1 : n; var requiredType = parameters[paramIndex].ParameterType; - if (!converter.TryConvert(attribute.Parameters[paramIndex], requiredType, referenceMap, request.Arguments![n], out var value)) + if (!converter.TryConvert(attribute.Parameters[paramIndex], requiredType, referenceMap, + request.Arguments![n], out var value)) { throw new JsiiException($"Unable to convert {request.Arguments![n]} to {requiredType.Name}"); } @@ -100,7 +103,7 @@ out object? result array.SetValue(value, 0); value = array; } - + if (!requiredType.IsInstanceOfType(value) && value is IConvertible) { value = Convert.ChangeType(value, requiredType, CultureInfo.InvariantCulture); @@ -120,7 +123,8 @@ out object? result if (n == parameters.Length - 1 && rehydratedArgs.Length > parameters.Length) { var allArgs = rehydratedArgs.TakeLast(rehydratedArgs.Length - parameters.Length + 1); - var array = Array.CreateInstance(parameters[parameters.Length - 1].ParameterType.GetElementType()!, + var array = Array.CreateInstance( + parameters[parameters.Length - 1].ParameterType.GetElementType()!, allArgs.Select(list => (list as Array)!.Length).Sum()); var idx = 0; foreach (var list in allArgs) @@ -150,7 +154,8 @@ private static CallbackResult InvokeGetter(GetRequest request, IReferenceMap ref var propertyInfo = ReflectionUtils.GetNativeProperty(deputy.GetType(), request.Property); if (propertyInfo == null) { - throw new InvalidOperationException($"Received callback for {deputy.GetType().Name}.{request.Property} getter, but this property does not exist"); + throw new InvalidOperationException( + $"Received callback for {deputy.GetType().Name}.{request.Property} getter, but this property does not exist"); } var attribute = propertyInfo.GetAttribute()!; @@ -158,7 +163,8 @@ private static CallbackResult InvokeGetter(GetRequest request, IReferenceMap ref var methodInfo = propertyInfo.GetMethod; if (methodInfo == null) { - throw new InvalidOperationException($"Received callback for {deputy.GetType().Name}.{request.Property} getter, but this property does not have a getter"); + throw new InvalidOperationException( + $"Received callback for {deputy.GetType().Name}.{request.Property} getter, but this property does not have a getter"); } return new CallbackResult(attribute, methodInfo.Invoke(deputy, Array.Empty())); @@ -172,16 +178,18 @@ private static void InvokeSetter(SetRequest request, IReferenceMap referenceMap) var propertyInfo = ReflectionUtils.GetNativeProperty(deputy.GetType(), request.Property); if (propertyInfo == null) { - throw new InvalidOperationException($"Received callback for {deputy.GetType().Name}.{request.Property} setter, but this property does not exist"); + throw new InvalidOperationException( + $"Received callback for {deputy.GetType().Name}.{request.Property} setter, but this property does not exist"); } var methodInfo = propertyInfo.SetMethod; if (methodInfo == null) { - throw new InvalidOperationException($"Received callback for {deputy.GetType().Name}.{request.Property} setter, but this property does not have a setter"); + throw new InvalidOperationException( + $"Received callback for {deputy.GetType().Name}.{request.Property} setter, but this property does not have a setter"); } - methodInfo.Invoke(deputy, new [] { FromKernel(request.Value, referenceMap) }); + methodInfo.Invoke(deputy, new[] {FromKernel(request.Value, referenceMap)}); } /* @@ -194,9 +202,9 @@ private static void InvokeSetter(SetRequest request, IReferenceMap referenceMap) var prop = jObject.Property("$jsii.byref", StringComparison.InvariantCulture); if (prop != null) { - var objId = prop.Value.Value(); - var interfaces = jObject.Property("$jsii.interfaces", StringComparison.InvariantCulture)?.Value - ?.Values()?.ToArray(); + var objId = prop.Value.Value()!; + string[]? interfaces = jObject.Property("$jsii.interfaces", StringComparison.InvariantCulture)?.Value + ?.Values()?.ToArray()!; return referenceMap.GetOrCreateNativeReference(new ByRefValue(objId, interfaces)); } @@ -224,6 +232,7 @@ private static void InvokeSetter(SetRequest request, IReferenceMap referenceMap) mapped[key] = value; } } + return mapped; } } @@ -231,13 +240,15 @@ private static void InvokeSetter(SetRequest request, IReferenceMap referenceMap) internal sealed class CallbackResult : OptionalValue { public CallbackResult(IOptionalValue optionalValue, object? value) - : this(optionalValue.Type, optionalValue.IsOptional, value) {} + : this(optionalValue.Type, optionalValue.IsOptional, value) + { + } - private CallbackResult(TypeReference type, bool isOptional, object? value): base(type, isOptional) + private CallbackResult(TypeReference type, bool isOptional, object? value) : base(type, isOptional) { Value = value; } public object? Value { get; } } -} +} \ No newline at end of file diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiClassAttribute.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiClassAttribute.cs index f7b99436f3..1d6cdf5574 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiClassAttribute.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiClassAttribute.cs @@ -11,13 +11,11 @@ public JsiiClassAttribute(System.Type nativeType, string fullyQualifiedName, str : base(nativeType, fullyQualifiedName) { Parameters = parametersJson == null - ? Array.Empty() - : JsonConvert.DeserializeObject(parametersJson); + ? Array.Empty() + : JsonConvert.DeserializeObject(parametersJson) + ?? throw new ArgumentException("Invalid JSON descriptor", nameof(parametersJson)); } - public Parameter[] Parameters - { - get; - } + public Parameter[] Parameters { get; } } -} +} \ No newline at end of file diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiMethodAttribute.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiMethodAttribute.cs index ffb6ca4f35..f757f657c8 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiMethodAttribute.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiMethodAttribute.cs @@ -20,7 +20,8 @@ public JsiiMethodAttribute( : JsonConvert.DeserializeObject(returnsJson); Parameters = parametersJson == null ? Array.Empty() - : JsonConvert.DeserializeObject(parametersJson); + : JsonConvert.DeserializeObject(parametersJson) + ?? throw new ArgumentException("Invalid JSON descriptor", nameof(parametersJson)); IsAsync = isAsync; IsOverride = isOverride; } @@ -31,9 +32,9 @@ public JsiiMethodAttribute( public Parameter[] Parameters { get; } - + public bool IsAsync { get; } - + public bool IsOverride { get; } } -} +} \ No newline at end of file diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiPropertyAttribute.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiPropertyAttribute.cs index 3b117101ba..dfddd5233b 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiPropertyAttribute.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiPropertyAttribute.cs @@ -10,7 +10,9 @@ public sealed class JsiiPropertyAttribute : Attribute, IOptionalValue public JsiiPropertyAttribute(string name, string typeJson, bool isOptional = false, bool isOverride = false) { Name = name ?? throw new ArgumentNullException(nameof(name)); - Type = JsonConvert.DeserializeObject(typeJson ?? throw new ArgumentNullException(nameof(typeJson))); + Type = JsonConvert.DeserializeObject(typeJson ?? + throw new ArgumentNullException(nameof(typeJson))) + ?? throw new ArgumentException("Invalid JSON descriptor", nameof(typeJson)); IsOptional = isOptional; IsOverride = isOverride; } @@ -20,7 +22,7 @@ public JsiiPropertyAttribute(string name, string typeJson, bool isOptional = fal public TypeReference Type { get; } public bool IsOptional { get; } - + public bool IsOverride { get; } } -} +} \ No newline at end of file diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/NodeProcess.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/NodeProcess.cs index 50d836c05e..9db0793119 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/NodeProcess.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/NodeProcess.cs @@ -61,9 +61,7 @@ public NodeProcess(IJsiiRuntimeProvider jsiiRuntimeProvider, ILoggerFactory logg _logger.LogDebug($"{startInfo.FileName} {startInfo.Arguments}"); // Registering shutdown hook to have JS process gracefully terminate. - AppDomain.CurrentDomain.ProcessExit += (snd, evt) => { - ((IDisposable)this).Dispose(); - }; + AppDomain.CurrentDomain.ProcessExit += (snd, evt) => { ((IDisposable) this).Dispose(); }; _process = Process.Start(startInfo); @@ -78,7 +76,6 @@ public NodeProcess(IJsiiRuntimeProvider jsiiRuntimeProvider, ILoggerFactory logg void StderrSink() { - string? line; using (var standardError = _process.StandardError) using (Stream stderr = Console.OpenStandardError()) @@ -86,13 +83,16 @@ void StderrSink() { while ((line = standardError.ReadLine()) != null) { - try { - var entry = JsonConvert.DeserializeObject(line); + try + { + var entry = JsonConvert.DeserializeObject(line) + ?? throw new Exception("Invalid JSON message"); if (entry.Stderr != null) { byte[] buffer = Convert.FromBase64String(entry.Stderr); stderr.Write(buffer, 0, buffer.Length); } + if (entry.Stdout != null) { byte[] buffer = Convert.FromBase64String(entry.Stdout); @@ -125,7 +125,8 @@ void IDisposable.Dispose() if (!_process.HasExited) { // Write "exit" message - StandardInput.WriteLine("{\"exit\":0}");; + StandardInput.WriteLine("{\"exit\":0}"); + ; } StandardInput.Dispose(); @@ -137,7 +138,8 @@ void IDisposable.Dispose() try { // Give the kernel 5 seconds to clean up after itself - if (!_process.WaitForExit(5_000)) { + if (!_process.WaitForExit(5_000)) + { // Kill the child process if needed _process.Kill(); } @@ -165,8 +167,10 @@ void IDisposable.Dispose() private static Tuple GetAssemblyFileVersion() { var assembly = typeof(NodeProcess).GetTypeInfo().Assembly; - var assemblyFileVersionAttribute = assembly.GetCustomAttribute(typeof(AssemblyFileVersionAttribute)) as AssemblyFileVersionAttribute; - var frameworkAttribute = assembly.GetCustomAttribute(typeof(TargetFrameworkAttribute)) as TargetFrameworkAttribute; + var assemblyFileVersionAttribute = + assembly.GetCustomAttribute(typeof(AssemblyFileVersionAttribute)) as AssemblyFileVersionAttribute; + var frameworkAttribute = + assembly.GetCustomAttribute(typeof(TargetFrameworkAttribute)) as TargetFrameworkAttribute; return new Tuple( frameworkAttribute?.FrameworkName ?? "Unknown", assemblyFileVersionAttribute?.Version ?? "Unknown" @@ -177,6 +181,6 @@ private sealed class ConsoleEntry { public string? Stderr { get; set; } public string? Stdout { get; set; } + } } - } -} +} \ No newline at end of file diff --git a/packages/@jsii/go-runtime-test/project/compliance.go b/packages/@jsii/go-runtime-test/project/compliance.go index a7c3dc94c5..d79f3d08c6 100644 --- a/packages/@jsii/go-runtime-test/project/compliance.go +++ b/packages/@jsii/go-runtime-test/project/compliance.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "strings" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) @@ -30,8 +30,8 @@ func (suite *ComplianceSuite) TearDownSuite() { } } -func (suite *ComplianceSuite) Assert() *assert.Assertions { - return assert.New(suite.T()) +func (suite *ComplianceSuite) Require() *require.Assertions { + return require.New(suite.T()) } func (suite *ComplianceSuite) reportForTest() map[string]string { diff --git a/packages/@jsii/go-runtime-test/project/compliance_test.go b/packages/@jsii/go-runtime-test/project/compliance_test.go index f51ac9543c..751af539fb 100644 --- a/packages/@jsii/go-runtime-test/project/compliance_test.go +++ b/packages/@jsii/go-runtime-test/project/compliance_test.go @@ -25,93 +25,88 @@ import ( "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/child" calclib "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/customsubmodulename" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) func (suite *ComplianceSuite) TestStatics() { - assert := suite.Assert() + require := suite.Require() - assert.Equal("hello ,Yoyo!", *calc.Statics_StaticMethod(jsii.String("Yoyo"))) - assert.Equal("default", *calc.Statics_Instance().Value()) + require.Equal("hello ,Yoyo!", *calc.Statics_StaticMethod(jsii.String("Yoyo"))) + require.Equal("default", *calc.Statics_Instance().Value()) newStatics := calc.NewStatics(jsii.String("new value")) calc.Statics_SetInstance(newStatics) - assert.Same(newStatics, calc.Statics_Instance()) - assert.Equal("new value", *calc.Statics_Instance().Value()) + require.Same(newStatics, calc.Statics_Instance()) + require.Equal("new value", *calc.Statics_Instance().Value()) // the float64 conversion is a bit annoying - can we do something about it? - assert.Equal(float64(100), *calc.Statics_NonConstStatic()) + require.Equal(float64(100), *calc.Statics_NonConstStatic()) } func (suite *ComplianceSuite) TestPrimitiveTypes() { - assert := suite.Assert() + require := suite.Require() types := calc.NewAllTypes() // boolean types.SetBooleanProperty(jsii.Bool(true)) - assert.Equal(true, *types.BooleanProperty()) + require.Equal(true, *types.BooleanProperty()) // string types.SetStringProperty(jsii.String("foo")) - assert.Equal("foo", *types.StringProperty()) + require.Equal("foo", *types.StringProperty()) // number types.SetNumberProperty(jsii.Number(1234)) - assert.Equal(float64(1234), *types.NumberProperty()) + require.Equal(float64(1234), *types.NumberProperty()) - // // json + // json mapProp := map[string]interface{}{"Foo": map[string]interface{}{"Bar": 123}} types.SetJsonProperty(&mapProp) - assert.Equal(float64(123), (*types.JsonProperty())["Foo"].(map[string]interface{})["Bar"]) + require.Equal(float64(123), (*types.JsonProperty())["Foo"].(map[string]interface{})["Bar"]) - suite.FailTest("Dates are currently treated as strings and fail going through the wire", "https://github.com/aws/jsii/issues/2659") - - // whoops - should accept time.Time, not string. - // date - types.SetDateProperty(jsii.String("12345")) - assert.Equal("12345", types.DateProperty()) + types.SetDateProperty(jsii.Time(time.Unix(0, 123000000))) + require.WithinDuration(time.Unix(0, 123000000), *types.DateProperty(), 0) } func (suite *ComplianceSuite) TestUseNestedStruct() { - suite.FailTest("Nested types are not namespaced", "https://github.com/aws/jsii/pull/2650") jcb.StaticConsumer_Consume(customsubmodulename.NestingClass_NestedStruct{ Name: jsii.String("Bond, James Bond"), }) } func (suite *ComplianceSuite) TestStaticMapInClassCanBeReadCorrectly() { - assert := suite.Assert() + require := suite.Require() result := *calc.ClassWithCollections_StaticMap() - assert.Equal("value1", *result["key1"]) - assert.Equal("value2", *result["key2"]) - assert.Equal(2, len(result)) + require.Equal("value1", *result["key1"]) + require.Equal("value2", *result["key2"]) + require.Equal(2, len(result)) } func (suite *ComplianceSuite) TestTestNativeObjectsWithInterfaces() { - assert := suite.Assert() + require := suite.Require() // create a pure and native object, not part of the jsii hierarchy, only implements a jsii interface pureNative := newPureNativeFriendlyRandom() generatorBoundToPureNative := calc.NewNumberGenerator(pureNative) - assert.Equal(pureNative, generatorBoundToPureNative.Generator()) - assert.Equal(float64(100000), *generatorBoundToPureNative.NextTimes100()) - assert.Equal(float64(200000), *generatorBoundToPureNative.NextTimes100()) + require.Equal(pureNative, generatorBoundToPureNative.Generator()) + require.Equal(float64(100000), *generatorBoundToPureNative.NextTimes100()) + require.Equal(float64(200000), *generatorBoundToPureNative.NextTimes100()) subclassNative := NewSubclassNativeFriendlyRandom() generatorBoundToPSubclassedObject := calc.NewNumberGenerator(subclassNative) - assert.Equal(subclassNative, generatorBoundToPSubclassedObject.Generator()) + require.Equal(subclassNative, generatorBoundToPSubclassedObject.Generator()) generatorBoundToPSubclassedObject.IsSameGenerator(subclassNative) - assert.Equal(float64(10000), *generatorBoundToPSubclassedObject.NextTimes100()) - assert.Equal(float64(20000), *generatorBoundToPSubclassedObject.NextTimes100()) + require.Equal(float64(10000), *generatorBoundToPSubclassedObject.NextTimes100()) + require.Equal(float64(20000), *generatorBoundToPSubclassedObject.NextTimes100()) } func (suite *ComplianceSuite) TestMaps() { - assert := suite.Assert() + require := suite.Require() // TODO: props should be optional calc2 := calc.NewCalculator(&calc.CalculatorProps{}) @@ -120,68 +115,67 @@ func (suite *ComplianceSuite) TestMaps() { calc2.Mul(jsii.Number(2)) result := *calc2.OperationsMap() - assert.Equal(2, len(*result["add"])) - assert.Equal(1, len(*result["mul"])) + require.Equal(2, len(*result["add"])) + require.Equal(1, len(*result["mul"])) resultAdd := *result["add"] - assert.Equal(float64(30), *resultAdd[1].Value()) + require.Equal(float64(30), *resultAdd[1].Value()) } func (suite *ComplianceSuite) TestDates() { - assert := suite.Assert() - suite.FailTest("Dates are represented as strings instead of date objects", "https://github.com/aws/jsii/issues/2659") + require := suite.Require() types := calc.NewAllTypes() - //types.SetDateProperty(time.Unix(128, 0)) - assert.Equal(time.Unix(128, 0), types.DateProperty()) + types.SetDateProperty(jsii.Time(time.Unix(128, 0))) + require.WithinDuration(time.Unix(128, 0), *types.DateProperty(), 0) // weak type types.SetAnyProperty(time.Unix(999, 0)) - assert.Equal(time.Unix(999, 0), types.AnyProperty()) + require.WithinDuration(time.Unix(999, 0), types.AnyProperty().(time.Time), 0) } func (suite *ComplianceSuite) TestCallMethods() { - assert := suite.Assert() + require := suite.Require() calc := calc.NewCalculator(&calc.CalculatorProps{}) calc.Add(jsii.Number(10)) - assert.Equal(float64(10), *calc.Value()) + require.Equal(float64(10), *calc.Value()) calc.Mul(jsii.Number(2)) - assert.Equal(float64(20), *calc.Value()) + require.Equal(float64(20), *calc.Value()) calc.Pow(jsii.Number(5)) - assert.Equal(float64(20*20*20*20*20), *calc.Value()) + require.Equal(float64(20*20*20*20*20), *calc.Value()) calc.Neg() - assert.Equal(float64(-3200000), *calc.Value()) + require.Equal(float64(-3200000), *calc.Value()) } func (suite *ComplianceSuite) TestNodeStandardLibrary() { - assert := suite.Assert() + require := suite.Require() obj := calc.NewNodeStandardLibrary() - assert.Equal("Hello, resource! SYNC!", *obj.FsReadFileSync()) - assert.NotEmpty(obj.OsPlatform()) - assert.Equal("6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50", *obj.CryptoSha256()) + require.Equal("Hello, resource! SYNC!", *obj.FsReadFileSync()) + require.NotEmpty(obj.OsPlatform()) + require.Equal("6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50", *obj.CryptoSha256()) suite.FailTest("Async methods are not implemented", "https://github.com/aws/jsii/issues/2670") - assert.Equal("Hello, resource!", obj.FsReadFile()) + require.Equal("Hello, resource!", obj.FsReadFile()) } func (suite *ComplianceSuite) TestDynamicTypes() { - assert := suite.Assert() + require := suite.Require() types := calc.NewAllTypes() types.SetAnyProperty(false) - assert.Equal(false, types.AnyProperty()) + require.Equal(false, types.AnyProperty()) // string types.SetAnyProperty("String") - assert.Equal("String", types.AnyProperty()) + require.Equal("String", types.AnyProperty()) // number types.SetAnyProperty(12.5) - assert.Equal(12.5, types.AnyProperty()) + require.Equal(12.5, types.AnyProperty()) // json (notice that when deserialized, it is deserialized as a map). types.SetAnyProperty(map[string]interface{}{ @@ -198,50 +192,48 @@ func (suite *ComplianceSuite) TestDynamicTypes() { v4 := v3[1] v5 := v4.(map[string]interface{}) v6 := v5["World"].(float64) - assert.Equal(float64(123), v6) + require.Equal(float64(123), v6) // array types.SetAnyProperty([]string{"Hello", "World"}) a := types.AnyProperty().([]interface{}) - assert.Equal("Hello", a[0].(string)) - assert.Equal("World", a[1].(string)) + require.Equal("Hello", a[0].(string)) + require.Equal("World", a[1].(string)) // array of any types.SetAnyProperty([]interface{}{"Hybrid", calclib.NewNumber(jsii.Number(12)), 123, false}) - assert.Equal(float64(123), (types.AnyProperty()).([]interface{})[2]) + require.Equal(float64(123), (types.AnyProperty()).([]interface{})[2]) // map types.SetAnyProperty(map[string]string{"MapKey": "MapValue"}) - assert.Equal("MapValue", ((types.AnyProperty()).(map[string]interface{}))["MapKey"]) + require.Equal("MapValue", ((types.AnyProperty()).(map[string]interface{}))["MapKey"]) // map of any types.SetAnyProperty(map[string]interface{}{"Goo": 19289812}) - assert.Equal(float64(19289812), ((types.AnyProperty()).(map[string]interface{}))["Goo"]) + require.Equal(float64(19289812), ((types.AnyProperty()).(map[string]interface{}))["Goo"]) // classes mult := calc.NewMultiply(calclib.NewNumber(jsii.Number(10)), calclib.NewNumber(jsii.Number(20))) types.SetAnyProperty(mult) - assert.Equal(mult, types.AnyProperty()) - assert.Equal(float64(200), *((types.AnyProperty()).(calc.Multiply)).Value()) + require.Equal(mult, types.AnyProperty()) + require.Equal(float64(200), *((types.AnyProperty()).(calc.Multiply)).Value()) // date types.SetAnyProperty(time.Unix(1234, 0)) - if types.AnyProperty() != time.Unix(1234, 0) { - suite.FailTest("Dates not supported", "https://github.com/aws/jsii/issues/2659") - } + require.WithinDuration(time.Unix(1234, 0), types.AnyProperty().(time.Time), 0) } func (suite *ComplianceSuite) TestArrayReturnedByMethodCanBeRead() { - assert := suite.Assert() + require := suite.Require() arr := *calc.ClassWithCollections_CreateAList() - assert.Contains(arr, jsii.String("one")) - assert.Contains(arr, jsii.String("two")) + require.Contains(arr, jsii.String("one")) + require.Contains(arr, jsii.String("two")) } func (suite *ComplianceSuite) TestUnionProperties() { - assert := suite.Assert() + require := suite.Require() calc3 := calc.NewCalculator(&calc.CalculatorProps{ InitialValue: jsii.Number(0), @@ -250,24 +242,24 @@ func (suite *ComplianceSuite) TestUnionProperties() { calc3.SetUnionProperty(calc.NewMultiply(calclib.NewNumber(jsii.Number(9)), calclib.NewNumber(jsii.Number(3)))) _, ok := calc3.UnionProperty().(calc.Multiply) - assert.True(ok) + require.True(ok) - assert.Equal(float64(9*3), *calc3.ReadUnionValue()) + require.Equal(float64(9*3), *calc3.ReadUnionValue()) calc3.SetUnionProperty(calc.NewPower(calclib.NewNumber(jsii.Number(10)), calclib.NewNumber(jsii.Number(3)))) _, ok = calc3.UnionProperty().(calc.Power) - assert.True(ok) + require.True(ok) } func (suite *ComplianceSuite) TestUseEnumFromScopedModule() { - assert := suite.Assert() + require := suite.Require() obj := calc.NewReferenceEnumFromScopedPackage() - assert.Equal(calclib.EnumFromScopedModule_VALUE2, obj.Foo()) + require.Equal(calclib.EnumFromScopedModule_VALUE2, obj.Foo()) obj.SetFoo(calclib.EnumFromScopedModule_VALUE1) - assert.Equal(calclib.EnumFromScopedModule_VALUE1, obj.LoadFoo()) + require.Equal(calclib.EnumFromScopedModule_VALUE1, obj.LoadFoo()) obj.SaveFoo(calclib.EnumFromScopedModule_VALUE2) - assert.Equal(calclib.EnumFromScopedModule_VALUE2, obj.Foo()) + require.Equal(calclib.EnumFromScopedModule_VALUE2, obj.Foo()) } func (suite *ComplianceSuite) TestCreateObjectAndCtorOverloads() { @@ -275,25 +267,25 @@ func (suite *ComplianceSuite) TestCreateObjectAndCtorOverloads() { } func (suite *ComplianceSuite) TestGetAndSetEnumValues() { - assert := suite.Assert() + require := suite.Require() calc := calc.NewCalculator(&calc.CalculatorProps{}) calc.Add(jsii.Number(9)) calc.Pow(jsii.Number(3)) - assert.Equal(composition.CompositeOperation_CompositionStringStyle_NORMAL, calc.StringStyle()) + require.Equal(composition.CompositeOperation_CompositionStringStyle_NORMAL, calc.StringStyle()) calc.SetStringStyle(composition.CompositeOperation_CompositionStringStyle_DECORATED) - assert.Equal(composition.CompositeOperation_CompositionStringStyle_DECORATED, calc.StringStyle()) - assert.Equal("<<[[{{(((1 * (0 + 9)) * (0 + 9)) * (0 + 9))}}]]>>", *calc.ToString()) + require.Equal(composition.CompositeOperation_CompositionStringStyle_DECORATED, calc.StringStyle()) + require.Equal("<<[[{{(((1 * (0 + 9)) * (0 + 9)) * (0 + 9))}}]]>>", *calc.ToString()) } func (suite *ComplianceSuite) TestListInClassCanBeReadCorrectly() { - assert := suite.Assert() + require := suite.Require() classWithCollections := calc.NewClassWithCollections(&map[string]*string{}, &[]*string{jsii.String("one"), jsii.String("two")}) val := *classWithCollections.Array() - assert.Equal("one", *val[0]) - assert.Equal("two", *val[1]) + require.Equal("one", *val[0]) + require.Equal("two", *val[1]) } type derivedFromAllTypes struct { @@ -312,50 +304,50 @@ func (suite *ComplianceSuite) AfterTest(suiteName, testName string) { } func (suite *ComplianceSuite) TestTestFluentApiWithDerivedClasses() { - assert := suite.Assert() + require := suite.Require() obj := newDerivedFromAllTypes() obj.SetStringProperty(jsii.String("Hello")) obj.SetNumberProperty(jsii.Number(12)) - assert.Equal("Hello", *obj.StringProperty()) - assert.Equal(float64(12), *obj.NumberProperty()) + require.Equal("Hello", *obj.StringProperty()) + require.Equal(float64(12), *obj.NumberProperty()) } func (suite *ComplianceSuite) TestCanLoadEnumValues() { - assert := suite.Assert() - assert.NotEmpty(calc.EnumDispenser_RandomStringLikeEnum()) - assert.NotEmpty(calc.EnumDispenser_RandomIntegerLikeEnum()) + require := suite.Require() + require.NotEmpty(calc.EnumDispenser_RandomStringLikeEnum()) + require.NotEmpty(calc.EnumDispenser_RandomIntegerLikeEnum()) } func (suite *ComplianceSuite) TestCollectionOfInterfaces_ListOfStructs() { - assert := suite.Assert() + require := suite.Require() list := *calc.InterfaceCollections_ListOfStructs() - assert.Equal("Hello, I'm String!", *list[0].RequiredString) + require.Equal("Hello, I'm String!", *list[0].RequiredString) } func (suite *ComplianceSuite) TestDoNotOverridePrivates_property_getter_public() { - assert := suite.Assert() + require := suite.Require() obj := doNotOverridePrivates.New() - assert.Equal("privateProperty", *obj.PrivatePropertyValue()) + require.Equal("privateProperty", *obj.PrivatePropertyValue()) // verify the setter override is not invoked. obj.ChangePrivatePropertyValue(jsii.String("MyNewValue")) - assert.Equal("MyNewValue", *obj.PrivatePropertyValue()) + require.Equal("MyNewValue", *obj.PrivatePropertyValue()) } func (suite *ComplianceSuite) TestEqualsIsResistantToPropertyShadowingResultVariable() { - assert := suite.Assert() + require := suite.Require() first := calc.StructWithJavaReservedWords{Default: jsii.String("one")} second := calc.StructWithJavaReservedWords{Default: jsii.String("one")} third := calc.StructWithJavaReservedWords{Default: jsii.String("two")} - assert.Equal(first, second) - assert.NotEqual(first, third) + require.Equal(first, second) + require.NotEqual(first, third) } type overridableProtectedMemberDerived struct { - calc.OverridableProtectedMember `overrides:"OverrideReadOnly,OverrideReadeWrite"` + calc.OverridableProtectedMember `overrides:"OverrideReadOnly,OverrideReadWrite"` } func newOverridableProtectedMemberDerived() *overridableProtectedMemberDerived { @@ -368,16 +360,14 @@ func (x *overridableProtectedMemberDerived) OverrideReadOnly() *string { return jsii.String("Cthulhu ") } -func (x *overridableProtectedMemberDerived) OverrideReadeWrite() *string { +func (x *overridableProtectedMemberDerived) OverrideReadWrite() *string { return jsii.String("Fhtagn!") } func (suite *ComplianceSuite) TestCanOverrideProtectedGetter() { - suite.FailTest("unable to access protected members", "https://github.com/aws/jsii/issues/2673") - - assert := suite.Assert() + require := suite.Require() overridden := newOverridableProtectedMemberDerived() - assert.Equal("Cthulhu Fhtagn!", *overridden.ValueFromProtected()) + require.Equal("Cthulhu Fhtagn!", *overridden.ValueFromProtected()) } type implementsAdditionalInterface struct { @@ -396,46 +386,46 @@ func (x implementsAdditionalInterface) ReturnStruct() *calc.StructB { } func (suite *ComplianceSuite) TestInterfacesCanBeUsedTransparently_WhenAddedToJsiiType() { - assert := suite.Assert() + require := suite.Require() expected := calc.StructB{RequiredString: jsii.String("It's Britney b**ch!")} delegate := newImplementsAdditionalInterface(expected) consumer := calc.NewConsumePureInterface(delegate) - assert.Equal(expected, *consumer.WorkItBaby()) + require.Equal(expected, *consumer.WorkItBaby()) } func (suite *ComplianceSuite) TestStructs_nonOptionalequals() { - assert := suite.Assert() + require := suite.Require() structA := calc.StableStruct{ReadonlyProperty: jsii.String("one")} structB := calc.StableStruct{ReadonlyProperty: jsii.String("one")} structC := calc.StableStruct{ReadonlyProperty: jsii.String("two")} - assert.Equal(structB, structA) - assert.NotEqual(structC, structA) + require.Equal(structB, structA) + require.NotEqual(structC, structA) } func (suite *ComplianceSuite) TestTestInterfaceParameter() { - assert := suite.Assert() + require := suite.Require() obj := calc.NewJSObjectLiteralForInterface() friendly := obj.GiveMeFriendly() - assert.Equal("I am literally friendly!", *friendly.Hello()) + require.Equal("I am literally friendly!", *friendly.Hello()) greetingAugmenter := calc.NewGreetingAugmenter() betterGreeting := greetingAugmenter.BetterGreeting(friendly) - assert.Equal("I am literally friendly! Let me buy you a drink!", *betterGreeting) + require.Equal("I am literally friendly! Let me buy you a drink!", *betterGreeting) } func (suite *ComplianceSuite) TestLiftedKwargWithSameNameAsPositionalArg() { - assert := suite.Assert() + require := suite.Require() // This is a replication of a test that mostly affects languages with keyword arguments (e.g: Python, Ruby, ...) bell := calc.NewBell() amb := calc.NewAmbiguousParameters(bell, &calc.StructParameterType{Scope: jsii.String("Driiiing!")}) - assert.Equal(bell, amb.Scope()) + require.Equal(bell, amb.Scope()) expected := calc.StructParameterType{Scope: jsii.String("Driiiing!")} - assert.Equal(expected, *amb.Props()) + require.Equal(expected, *amb.Props()) } type mulTen struct { @@ -449,31 +439,31 @@ func newMulTen(value *float64) mulTen { } func (suite *ComplianceSuite) TestCreationOfNativeObjectsFromJavaScriptObjects() { - assert := suite.Assert() + require := suite.Require() types := calc.NewAllTypes() jsObj := calclib.NewNumber(jsii.Number(44)) types.SetAnyProperty(jsObj) _, ok := (types.AnyProperty()).(calclib.Number) - assert.True(ok) + require.True(ok) suite.FailTest("??", "??") nativeObj := addTen.New(jsii.Number(10)) types.SetAnyProperty(nativeObj) result1 := types.AnyProperty() - assert.Equal(nativeObj, result1) + require.Equal(nativeObj, result1) nativeObj2 := newMulTen(jsii.Number(20)) types.SetAnyProperty(nativeObj2) unmarshalledNativeObj, ok := (types.AnyProperty()).(mulTen) - assert.True(ok) - assert.Equal(nativeObj2, unmarshalledNativeObj) + require.True(ok) + require.Equal(nativeObj2, unmarshalledNativeObj) } func (suite *ComplianceSuite) TestStructs_ReturnedLiteralEqualsNativeBuilt() { - assert := suite.Assert() + require := suite.Require() gms := calc.NewGiveMeStructs() returnedLiteral := gms.StructLiteral() @@ -482,30 +472,30 @@ func (suite *ComplianceSuite) TestStructs_ReturnedLiteralEqualsNativeBuilt() { Optional3: jsii.Bool(false), } - assert.Equal(*nativeBuilt.Optional1, *returnedLiteral.Optional1) - assert.Equal(nativeBuilt.Optional2, returnedLiteral.Optional2) - assert.Equal(*nativeBuilt.Optional3, *returnedLiteral.Optional3) - assert.EqualValues(nativeBuilt, *returnedLiteral) - assert.EqualValues(*returnedLiteral, nativeBuilt) + require.Equal(*nativeBuilt.Optional1, *returnedLiteral.Optional1) + require.Equal(nativeBuilt.Optional2, returnedLiteral.Optional2) + require.Equal(*nativeBuilt.Optional3, *returnedLiteral.Optional3) + require.EqualValues(nativeBuilt, *returnedLiteral) + require.EqualValues(*returnedLiteral, nativeBuilt) } func (suite *ComplianceSuite) TestClassesCanSelfReferenceDuringClassInitialization() { - assert := suite.Assert() + require := suite.Require() outerClass := child.NewOuterClass() - assert.NotNil(outerClass.InnerClass()) + require.NotNil(outerClass.InnerClass()) } func (suite *ComplianceSuite) TestCanObtainStructReferenceWithOverloadedSetter() { - assert := suite.Assert() - assert.NotNil(calc.ConfusingToJackson_MakeStructInstance()) + require := suite.Require() + require.NotNil(calc.ConfusingToJackson_MakeStructInstance()) } func (suite *ComplianceSuite) TestCallbacksCorrectlyDeserializeArguments() { - assert := suite.Assert() + require := suite.Require() renderer := NewTestCallbacksCorrectlyDeserializeArgumentsDataRenderer() - assert.Equal("{\n \"anumber\": 50,\n \"astring\": \"50\",\n \"custom\": \"value\"\n}", + require.Equal("{\n \"anumber\": 50,\n \"astring\": \"50\",\n \"custom\": \"value\"\n}", *renderer.Render(&calclib.MyFirstStruct{Anumber: jsii.Number(50), Astring: jsii.String("50")})) } @@ -526,24 +516,21 @@ func (r *testCallbacksCorrectlyDeserializeArgumentsDataRenderer) RenderMap(m *ma } func (suite *ComplianceSuite) TestCanUseInterfaceSetters() { - assert := suite.Assert() + require := suite.Require() obj := calc.ObjectWithPropertyProvider_Provide() - suite.FailTest("Setter are not generated for read-write properties", "https://github.com/aws/jsii/issues/2665") - - // obj.SetProperty("New Value") - assert.True(*obj.WasSet()) + obj.SetProperty(jsii.String("New Value")) + require.True(*obj.WasSet()) } func (suite *ComplianceSuite) TestPropertyOverrides_Interfaces() { - assert := suite.Assert() + require := suite.Require() interfaceWithProps := TestPropertyOverridesInterfacesIInterfaceWithProperties{} interact := calc.NewUsesInterfaceWithProperties(&interfaceWithProps) - assert.Equal("READ_ONLY_STRING", *interact.JustRead()) + require.Equal("READ_ONLY_STRING", *interact.JustRead()) - suite.FailTest("Not sure. Most likely related to the missing setters on interfaces", "https://github.com/aws/jsii/issues/2665") - assert.Equal("Hello!?", interact.WriteAndRead(jsii.String("Hello"))) + require.Equal("Hello!?", *interact.WriteAndRead(jsii.String("Hello"))) } type TestPropertyOverridesInterfacesIInterfaceWithProperties struct { @@ -561,24 +548,23 @@ func (i *TestPropertyOverridesInterfacesIInterfaceWithProperties) ReadWriteStrin return jsii.String(result) } -// Note this method is not currently part of the generated interface for some reason (https://github.com/aws/jsii/issues/2665). -func (i *TestPropertyOverridesInterfacesIInterfaceWithProperties) SetReadWriteString(value string) { - newVal := value + "!" +func (i *TestPropertyOverridesInterfacesIInterfaceWithProperties) SetReadWriteString(value *string) { + newVal := *value + "!" i.x = &newVal } func (suite *ComplianceSuite) TestTestJsiiAgent() { - assert := suite.Assert() - assert.Equal(fmt.Sprintf("%s/%s/%s", runtime.Version(), runtime.GOOS, runtime.GOARCH), *calc.JsiiAgent_Value()) + require := suite.Require() + require.Equal(fmt.Sprintf("%s/%s/%s", runtime.Version(), runtime.GOOS, runtime.GOARCH), *calc.JsiiAgent_Value()) } func (suite *ComplianceSuite) TestDoNotOverridePrivates_Method_Private() { - assert := suite.Assert() + require := suite.Require() obj := &TestDoNotOverridePrivatesMethodPrivateDoNotOverridePrivates{ DoNotOverridePrivates: calc.NewDoNotOverridePrivates(), } - assert.Equal("privateMethod", *obj.PrivateMethodValue()) + require.Equal("privateMethod", *obj.PrivateMethodValue()) } type TestDoNotOverridePrivatesMethodPrivateDoNotOverridePrivates struct { @@ -590,7 +576,7 @@ func (d *TestDoNotOverridePrivatesMethodPrivateDoNotOverridePrivates) privateMet } func (suite *ComplianceSuite) TestPureInterfacesCanBeUsedTransparently() { - assert := suite.Assert() + require := suite.Require() expected := &calc.StructB{ RequiredString: jsii.String("It's Britney b**ch!"), } @@ -599,7 +585,7 @@ func (suite *ComplianceSuite) TestPureInterfacesCanBeUsedTransparently() { expected: expected, } consumer := calc.NewConsumePureInterface(delegate) - assert.EqualValues(expected, consumer.WorkItBaby()) + require.EqualValues(expected, consumer.WorkItBaby()) } type TestPureInterfacesCanBeUsedTransparentlyIStructReturningDelegate struct { @@ -638,64 +624,64 @@ func (x myOverridableProtectedMember) OverrideMe() *string { } func (suite *ComplianceSuite) TestCanOverrideProtectedMethod() { - assert := suite.Assert() + require := suite.Require() challenge := "Cthulhu Fhtagn!" overridden := newMyOverridableProtectedMember() - assert.Equal(challenge, *overridden.ValueFromProtected()) + require.Equal(challenge, *overridden.ValueFromProtected()) } func (suite *ComplianceSuite) TestEraseUnsetDataValues() { - assert := suite.Assert() + require := suite.Require() opts := calc.EraseUndefinedHashValuesOptions{Option1: jsii.String("option1")} - assert.True(*calc.EraseUndefinedHashValues_DoesKeyExist(&opts, jsii.String("option1"))) + require.True(*calc.EraseUndefinedHashValues_DoesKeyExist(&opts, jsii.String("option1"))) - assert.Equal(map[string]interface{}{"prop2": "value2"}, *calc.EraseUndefinedHashValues_Prop1IsNull()) - assert.Equal(map[string]interface{}{"prop1": "value1"}, *calc.EraseUndefinedHashValues_Prop2IsUndefined()) + require.Equal(map[string]interface{}{"prop2": "value2"}, *calc.EraseUndefinedHashValues_Prop1IsNull()) + require.Equal(map[string]interface{}{"prop1": "value1"}, *calc.EraseUndefinedHashValues_Prop2IsUndefined()) - assert.False(*calc.EraseUndefinedHashValues_DoesKeyExist(&opts, jsii.String("option2"))) + require.False(*calc.EraseUndefinedHashValues_DoesKeyExist(&opts, jsii.String("option2"))) } func (suite *ComplianceSuite) TestStructs_containsNullChecks() { - assert := suite.Assert() + require := suite.Require() s := calclib.MyFirstStruct{} // <-- this struct has required fields obj := calc.NewGiveMeStructs() suite.FailTest("No validation of required fields in structs", "https://github.com/aws/jsii/issues/2672") // we expect a failure here when we pass the struct to js - assert.PanicsWithError("", func() { obj.ReadFirstNumber(&s) }) + require.PanicsWithError("", func() { obj.ReadFirstNumber(&s) }) } func (suite *ComplianceSuite) TestUnionPropertiesWithBuilder() { - assert := suite.Assert() + require := suite.Require() obj1 := calc.UnionProperties{Bar: 12, Foo: "Hello"} - assert.Equal(12, obj1.Bar) - assert.Equal("Hello", obj1.Foo) + require.Equal(12, obj1.Bar) + require.Equal("Hello", obj1.Foo) obj2 := calc.UnionProperties{Bar: "BarIsString"} - assert.Equal("BarIsString", obj2.Bar) - assert.Empty(obj2.Foo) + require.Equal("BarIsString", obj2.Bar) + require.Empty(obj2.Foo) allTypes := calc.NewAllTypes() obj3 := calc.UnionProperties{Bar: allTypes, Foo: 999} - assert.Same(allTypes, obj3.Bar) - assert.Equal(999, obj3.Foo) + require.Same(allTypes, obj3.Bar) + require.Equal(999, obj3.Foo) } func (suite *ComplianceSuite) TestTestNullIsAValidOptionalMap() { - assert := suite.Assert() - assert.Nil(calc.DisappointingCollectionSource_MaybeMap()) + require := suite.Require() + require.Nil(calc.DisappointingCollectionSource_MaybeMap()) } func (suite *ComplianceSuite) TestMapReturnedByMethodCanBeRead() { - assert := suite.Assert() + require := suite.Require() result := *calc.ClassWithCollections_CreateAMap() - assert.Equal("value1", *result["key1"]) - assert.Equal("value2", *result["key2"]) - assert.Equal(2, len(result)) + require.Equal("value1", *result["key1"]) + require.Equal("value2", *result["key2"]) + require.Equal(2, len(result)) } type myAbstractSuite struct { @@ -724,33 +710,47 @@ func (s *myAbstractSuite) SetProperty(value *string) { } func (suite *ComplianceSuite) TestAbstractMembersAreCorrectlyHandled() { - assert := suite.Assert() + require := suite.Require() abstractSuite := NewMyAbstractSuite(nil) - assert.Equal("Wrapped>", *abstractSuite.WorkItAll(jsii.String("Oomf!"))) + require.Equal("Wrapped>", *abstractSuite.WorkItAll(jsii.String("Oomf!"))) } func (suite *ComplianceSuite) TestCanOverrideProtectedSetter() { - suite.FailTest("unable to access protected members", "https://github.com/aws/jsii/issues/2673") - assert := suite.Assert() + require := suite.Require() challenge := "Bazzzzzzzzzzzaar..." - overridden := myOverridableProtectedMember{calc.NewOverridableProtectedMember()} + overridden := newTestCanOverrideProtectedSetterOverridableProtectedMember() overridden.SwitchModes() - assert.Equal(challenge, overridden.ValueFromProtected()) + require.Equal(challenge, *overridden.ValueFromProtected()) +} + +type TestCanOverrideProtectedSetterOverridableProtectedMember struct { + calc.OverridableProtectedMember `overrides:"OverrideReadWrite"` } +func (x TestCanOverrideProtectedSetterOverridableProtectedMember) SetOverrideReadWrite(val *string) { + x.OverridableProtectedMember.SetOverrideReadWrite(jsii.String(fmt.Sprintf("zzzzzzzzz%s", *val))) +} + +func newTestCanOverrideProtectedSetterOverridableProtectedMember() *TestCanOverrideProtectedSetterOverridableProtectedMember { + m := TestCanOverrideProtectedSetterOverridableProtectedMember{} + calc.NewOverridableProtectedMember_Override(&m) + return &m +} + + func (suite *ComplianceSuite) TestObjRefsAreLabelledUsingWithTheMostCorrectType() { - assert := suite.Assert() + require := suite.Require() ifaceRef := calc.Constructors_MakeInterface() v := ifaceRef - assert.NotNil(v) + require.NotNil(v) // TODO: I am not sure this is possible in Go (probably N/A) suite.FailTest("N/A?", "") classRef, ok := calc.Constructors_MakeClass().(calc.InbetweenClass) - assert.True(ok) - assert.NotNil(classRef) + require.True(ok) + require.NotNil(classRef) } func (suite *ComplianceSuite) TestStructs_StepBuilders() { @@ -762,17 +762,17 @@ func (suite *ComplianceSuite) TestStaticListInClassCannotBeModified() { } func (suite *ComplianceSuite) TestStructsAreUndecoratedOntheWayToKernel() { - assert := suite.Assert() + require := suite.Require() s := calc.StructB{RequiredString: jsii.String("Bazinga!"), OptionalBoolean: jsii.Bool(false)} j := calc.JsonFormatter_Stringify(s) var a map[string]interface{} if err := json.Unmarshal([]byte(*j), &a); err != nil { - assert.FailNowf(err.Error(), "unmarshal failed") + require.FailNowf(err.Error(), "unmarshal failed") } - assert.Equal( + require.Equal( map[string]interface{}{ "requiredString": "Bazinga!", "optionalBoolean": false, @@ -782,18 +782,18 @@ func (suite *ComplianceSuite) TestStructsAreUndecoratedOntheWayToKernel() { } func (suite *ComplianceSuite) TestReturnAbstract() { - assert := suite.Assert() + require := suite.Require() obj := calc.NewAbstractClassReturner() obj2 := obj.GiveMeAbstract() - assert.Equal("Hello, John!!", *obj2.AbstractMethod(jsii.String("John"))) - assert.Equal("propFromInterfaceValue", *obj2.PropFromInterface()) - assert.Equal(float64(42), *obj2.NonAbstractMethod()) + require.Equal("Hello, John!!", *obj2.AbstractMethod(jsii.String("John"))) + require.Equal("propFromInterfaceValue", *obj2.PropFromInterface()) + require.Equal(float64(42), *obj2.NonAbstractMethod()) iface := obj.GiveMeInterface() - assert.Equal("propFromInterfaceValue", *iface.PropFromInterface()) - assert.Equal("hello-abstract-property", *obj.ReturnAbstractFromProperty().AbstractProperty()) + require.Equal("propFromInterfaceValue", *iface.PropFromInterface()) + require.Equal("hello-abstract-property", *obj.ReturnAbstractFromProperty().AbstractProperty()) } func (suite *ComplianceSuite) TestCollectionOfInterfaces_MapOfInterfaces() { @@ -804,7 +804,7 @@ func (suite *ComplianceSuite) TestCollectionOfInterfaces_MapOfInterfaces() { } func (suite *ComplianceSuite) TestStructs_multiplePropertiesEquals() { - assert := suite.Assert() + require := suite.Require() structA := calc.DiamondInheritanceTopLevelStruct{ BaseLevelProperty: jsii.String("one"), FirstMidLevelProperty: jsii.String("two"), @@ -824,16 +824,16 @@ func (suite *ComplianceSuite) TestStructs_multiplePropertiesEquals() { TopLevelProperty: jsii.String("four"), } - assert.Equal(structA, structB) - assert.NotEqual(structA, structC) + require.Equal(structA, structB) + require.NotEqual(structA, structC) } func (suite *ComplianceSuite) TestAsyncOverrides_callAsyncMethod() { suite.FailTest("Async methods are not implemented", "https://github.com/aws/jsii/issues/2670") - assert := suite.Assert() + require := suite.Require() obj := calc.NewAsyncVirtualMethods() - assert.Equal(float64(128), *obj.CallMe()) - assert.Equal(float64(528), *obj.OverrideMe(jsii.Number(44))) + require.Equal(float64(128), *obj.CallMe()) + require.Equal(float64(528), *obj.OverrideMe(jsii.Number(44))) } type myDoNotOverridePrivates struct { @@ -849,18 +849,18 @@ func (s *myDoNotOverridePrivates) SetPrivateProperty(value string) { } func (suite *ComplianceSuite) TestDoNotOverridePrivates_property_getter_private() { - assert := suite.Assert() + require := suite.Require() obj := myDoNotOverridePrivates{calc.NewDoNotOverridePrivates()} - assert.Equal("privateProperty", *obj.PrivatePropertyValue()) + require.Equal("privateProperty", *obj.PrivatePropertyValue()) // verify the setter override is not invoked. obj.ChangePrivatePropertyValue(jsii.String("MyNewValue")) - assert.Equal("MyNewValue", *obj.PrivatePropertyValue()) + require.Equal("MyNewValue", *obj.PrivatePropertyValue()) } func (suite *ComplianceSuite) TestStructs_withDiamondInheritance_correctlyDedupeProperties() { - assert := suite.Assert() + require := suite.Require() s := calc.DiamondInheritanceTopLevelStruct{ BaseLevelProperty: jsii.String("base"), FirstMidLevelProperty: jsii.String("mid1"), @@ -868,10 +868,10 @@ func (suite *ComplianceSuite) TestStructs_withDiamondInheritance_correctlyDedupe TopLevelProperty: jsii.String("top"), } - assert.Equal("base", *s.BaseLevelProperty) - assert.Equal("mid1", *s.FirstMidLevelProperty) - assert.Equal("mid2", *s.SecondMidLevelProperty) - assert.Equal("top", *s.TopLevelProperty) + require.Equal("base", *s.BaseLevelProperty) + require.Equal("mid1", *s.FirstMidLevelProperty) + require.Equal("mid2", *s.SecondMidLevelProperty) + require.Equal("top", *s.TopLevelProperty) } type myDoNotOverridePrivates2 struct { @@ -883,13 +883,13 @@ func (s *myDoNotOverridePrivates2) PrivateProperty() string { } func (suite *ComplianceSuite) TestDoNotOverridePrivates_property_by_name_private() { - assert := suite.Assert() + require := suite.Require() obj := myDoNotOverridePrivates2{calc.NewDoNotOverridePrivates()} - assert.Equal("privateProperty", *obj.PrivatePropertyValue()) + require.Equal("privateProperty", *obj.PrivatePropertyValue()) } func (suite *ComplianceSuite) TestMapInClassCanBeReadCorrectly() { - assert := suite.Assert() + require := suite.Require() modifiableMap := map[string]*string{ "key": jsii.String("value"), @@ -897,8 +897,8 @@ func (suite *ComplianceSuite) TestMapInClassCanBeReadCorrectly() { classWithCollections := calc.NewClassWithCollections(&modifiableMap, &[]*string{}) result := *classWithCollections.Map() - assert.Equal("value", *result["key"]) - assert.Equal(1, len(result)) + require.Equal("value", *result["key"]) + require.Equal(1, len(result)) } type myAsyncVirtualMethods struct { @@ -911,11 +911,11 @@ func (s *myAsyncVirtualMethods) OverrideMe(mult float64) { func (suite *ComplianceSuite) TestAsyncOverrides_overrideThrows() { suite.FailTest("Async methods are not implemented", "https://github.com/aws/jsii/issues/2670") - assert := suite.Assert() + require := suite.Require() obj := myAsyncVirtualMethods{calc.NewAsyncVirtualMethods()} obj.CallMe() - assert.Panics(func() { obj.CallMe() }) + require.Panics(func() { obj.CallMe() }) } func (suite *ComplianceSuite) TestHashCodeIsResistantToPropertyShadowingResultVariable() { @@ -934,7 +934,7 @@ func (suite *ComplianceSuite) TestReturnSubclassThatImplementsInterface976() { t := suite.T() obj := calc.SomeTypeJsii976_ReturnReturn() - assert.Equal(t, 333.0, *obj.Foo()) + require.Equal(t, 333.0, *obj.Foo()) } func (suite *ComplianceSuite) TestStructs_OptionalEquals() { @@ -947,8 +947,8 @@ func (suite *ComplianceSuite) TestPropertyOverrides_Get_Calls_Super() { so := &testPropertyOverridesGetCallsSuper{} calc.NewSyncVirtualMethods_Override(so) - assert.Equal(t, "super:initial value", *so.RetrieveValueOfTheProperty()) - assert.Equal(t, "super:initial value", *so.TheProperty()) + require.Equal(t, "super:initial value", *so.RetrieveValueOfTheProperty()) + require.Equal(t, "super:initial value", *so.TheProperty()) } type testPropertyOverridesGetCallsSuper struct { @@ -967,7 +967,7 @@ func (suite *ComplianceSuite) TestUnmarshallIntoAbstractType() { c.Add(jsii.Number(120)) v := c.Curr() - assert.Equal(t, 120.0, *v.Value()) + require.Equal(t, 120.0, *v.Value()) } func (suite *ComplianceSuite) TestFail_SyncOverrides_CallsDoubleAsync_PropertyGetter() { @@ -978,7 +978,7 @@ func (suite *ComplianceSuite) TestFail_SyncOverrides_CallsDoubleAsync_PropertyGe defer func() { err := recover() - assert.NotNil(t, err, "expected a failure to occur") + require.NotNil(t, err, "expected a failure to occur") }() obj.CallerIsProperty() @@ -992,7 +992,7 @@ func (suite *ComplianceSuite) TestFail_SyncOverrides_CallsDoubleAsync_PropertySe defer func() { err := recover() - assert.NotNil(t, err, "expected a failure to occur") + require.NotNil(t, err, "expected a failure to occur") }() obj.SetCallerIsProperty(jsii.Number(12)) @@ -1002,9 +1002,9 @@ func (suite *ComplianceSuite) TestPropertyOverrides_Get_Set() { t := suite.T() so := syncOverrides.New() - assert.Equal(t, "I am an override!", *so.RetrieveValueOfTheProperty()) + require.Equal(t, "I am an override!", *so.RetrieveValueOfTheProperty()) so.ModifyValueOfTheProperty(jsii.String("New Value")) - assert.Equal(t, "New Value", *so.AnotherTheProperty) + require.Equal(t, "New Value", *so.AnotherTheProperty) } func (suite *ComplianceSuite) TestVariadicMethodCanBeInvoked() { @@ -1012,7 +1012,7 @@ func (suite *ComplianceSuite) TestVariadicMethodCanBeInvoked() { vm := calc.NewVariadicMethod(jsii.Number(1)) result := vm.AsArray(jsii.Number(3), jsii.Number(4), jsii.Number(5), jsii.Number(6)) - assert.Equal(t, []*float64{jsii.Number(1), jsii.Number(3), jsii.Number(4), jsii.Number(5), jsii.Number(6)}, *result) + require.Equal(t, []*float64{jsii.Number(1), jsii.Number(3), jsii.Number(4), jsii.Number(5), jsii.Number(6)}, *result) } func (suite *ComplianceSuite) TestCollectionTypes() { @@ -1022,11 +1022,11 @@ func (suite *ComplianceSuite) TestCollectionTypes() { // array at.SetArrayProperty(&[]*string{jsii.String("Hello"), jsii.String("World")}) - assert.Equal(t, "World", *(*at.ArrayProperty())[1]) + require.Equal(t, "World", *(*at.ArrayProperty())[1]) // map at.SetMapProperty(&map[string]calclib.Number{"Foo": calclib.NewNumber(jsii.Number(123))}) - assert.Equal(t, 123.0, *(*at.MapProperty())["Foo"].Value()) + require.Equal(t, 123.0, *(*at.MapProperty())["Foo"].Value()) } func (suite *ComplianceSuite) TestAsyncOverrides_OverrideAsyncMethodByParentClass() { @@ -1034,14 +1034,14 @@ func (suite *ComplianceSuite) TestAsyncOverrides_OverrideAsyncMethodByParentClas obj := overrideAsyncMethods.NewOverrideAsyncMethodsByBaseClass() suite.FailTest("Async methods are not implemented", "https://github.com/aws/jsii/issues/2670") - assert.Equal(t, 4452.0, obj.CallMe()) + require.Equal(t, 4452.0, obj.CallMe()) } func (suite *ComplianceSuite) TestTestStructsCanBeDowncastedToParentType() { t := suite.T() - assert.NotZero(t, calc.Demonstrate982_TakeThis()) - assert.NotZero(t, calc.Demonstrate982_TakeThisToo()) + require.NotZero(t, calc.Demonstrate982_TakeThis()) + require.NotZero(t, calc.Demonstrate982_TakeThisToo()) } func (suite *ComplianceSuite) TestPropertyOverrides_Get_Throws() { @@ -1052,11 +1052,11 @@ func (suite *ComplianceSuite) TestPropertyOverrides_Get_Throws() { defer func() { err := recover() - assert.NotNil(t, err, "expected an error!") + require.NotNil(t, err, "expected an error!") if e, ok := err.(error); ok { err = e.Error() } - assert.Equal(t, "Oh no, this is bad", err) + require.Equal(t, "Oh no, this is bad", err) }() so.RetrieveValueOfTheProperty() @@ -1074,13 +1074,13 @@ func (suite *ComplianceSuite) TestGetSetPrimitiveProperties() { t := suite.T() number := calclib.NewNumber(jsii.Number(20)) - assert.Equal(t, 20.0, *number.Value()) - assert.Equal(t, 40.0, *number.DoubleValue()) - assert.Equal(t, -30.0, *calc.NewNegate(calc.NewAdd(calclib.NewNumber(jsii.Number(20)), calclib.NewNumber(jsii.Number(10)))).Value()) - assert.Equal(t, 20.0, *calc.NewMultiply(calc.NewAdd(calclib.NewNumber(jsii.Number(5)), calclib.NewNumber(jsii.Number(5))), calclib.NewNumber(jsii.Number(2))).Value()) - assert.Equal(t, 3.0*3*3*3, *calc.NewPower(calclib.NewNumber(jsii.Number(3)), calclib.NewNumber(jsii.Number(4))).Value()) - assert.Equal(t, 999.0, *calc.NewPower(calclib.NewNumber(jsii.Number(999)), calclib.NewNumber(jsii.Number(1))).Value()) - assert.Equal(t, 1.0, *calc.NewPower(calclib.NewNumber(jsii.Number(999)), calclib.NewNumber(jsii.Number(0))).Value()) + require.Equal(t, 20.0, *number.Value()) + require.Equal(t, 40.0, *number.DoubleValue()) + require.Equal(t, -30.0, *calc.NewNegate(calc.NewAdd(calclib.NewNumber(jsii.Number(20)), calclib.NewNumber(jsii.Number(10)))).Value()) + require.Equal(t, 20.0, *calc.NewMultiply(calc.NewAdd(calclib.NewNumber(jsii.Number(5)), calclib.NewNumber(jsii.Number(5))), calclib.NewNumber(jsii.Number(2))).Value()) + require.Equal(t, 3.0*3*3*3, *calc.NewPower(calclib.NewNumber(jsii.Number(3)), calclib.NewNumber(jsii.Number(4))).Value()) + require.Equal(t, 999.0, *calc.NewPower(calclib.NewNumber(jsii.Number(999)), calclib.NewNumber(jsii.Number(1))).Value()) + require.Equal(t, 1.0, *calc.NewPower(calclib.NewNumber(jsii.Number(999)), calclib.NewNumber(jsii.Number(0))).Value()) } func (suite *ComplianceSuite) TestGetAndSetNonPrimitiveProperties() { @@ -1090,7 +1090,7 @@ func (suite *ComplianceSuite) TestGetAndSetNonPrimitiveProperties() { c.Add(jsii.Number(3200000)) c.Neg() c.SetCurr(calc.NewMultiply(calclib.NewNumber(jsii.Number(2)), c.Curr())) - assert.Equal(t, -6400000.0, *c.Value()) + require.Equal(t, -6400000.0, *c.Value()) } func (suite *ComplianceSuite) TestReservedKeywordsAreSlugifiedInStructProperties() { @@ -1103,7 +1103,7 @@ func (suite *ComplianceSuite) TestDoNotOverridePrivates_Method_Public() { obj := doNotOverridePrivates.New() - assert.Equal(t, "privateMethod", *obj.PrivateMethodValue()) + require.Equal(t, "privateMethod", *obj.PrivateMethodValue()) } func (suite *ComplianceSuite) TestDoNotOverridePrivates_Property_By_Name_Public() { @@ -1111,13 +1111,13 @@ func (suite *ComplianceSuite) TestDoNotOverridePrivates_Property_By_Name_Public( obj := doNotOverridePrivates.New() - assert.Equal(t, "privateProperty", *obj.PrivatePropertyValue()) + require.Equal(t, "privateProperty", *obj.PrivatePropertyValue()) } func (suite *ComplianceSuite) TestTestNullIsAValidOptionalList() { t := suite.T() - assert.Nil(t, calc.DisappointingCollectionSource_MaybeList()) + require.Nil(t, calc.DisappointingCollectionSource_MaybeList()) } func (suite *ComplianceSuite) TestMapInClassCannotBeModified() { @@ -1129,7 +1129,7 @@ func (suite *ComplianceSuite) TestAsyncOverrides_TwoOverrides() { obj := twoOverrides.New() suite.FailTest("Async methods are not implemented", "https://github.com/aws/jsii/issues/2670") - assert.Equal(t, 684.0, obj.CallMe()) + require.Equal(t, 684.0, obj.CallMe()) } func (suite *ComplianceSuite) TestPropertyOverrides_Set_Calls_Super() { @@ -1139,7 +1139,7 @@ func (suite *ComplianceSuite) TestPropertyOverrides_Set_Calls_Super() { calc.NewSyncVirtualMethods_Override(so) so.ModifyValueOfTheProperty(jsii.String("New Value")) - assert.Equal(t, "New Value:by override", *so.TheProperty()) + require.Equal(t, "New Value:by override", *so.TheProperty()) } type testPropertyOverridesSetCallsSuper struct { @@ -1158,14 +1158,14 @@ func (suite *ComplianceSuite) TestIso8601DoesNotDeserializeToDate() { w := wallClock.NewWallClock(nowAsISO) entropy := wallClock.NewEntropy(w) - assert.Equal(t, nowAsISO, *entropy.Increase()) + require.Equal(t, nowAsISO, *entropy.Increase()) } func (suite *ComplianceSuite) TestCollectionOfInterfaces_ListOfInterfaces() { t := suite.T() for _, obj := range *calc.InterfaceCollections_ListOfInterfaces() { - assert.Implements(t, (*calc.IBell)(nil), obj) + require.Implements(t, (*calc.IBell)(nil), obj) } } @@ -1173,13 +1173,12 @@ func (suite *ComplianceSuite) TestUndefinedAndNull() { t := suite.T() c := calc.NewCalculator(&calc.CalculatorProps{}) - assert.Nil(t, c.MaxValue()) + require.Nil(t, c.MaxValue()) c.SetMaxValue(nil) } func (suite *ComplianceSuite) TestStructs_SerializeToJsii() { t := suite.T() - t.Skip("DateTime fields are not implemented yet") firstStruct := calclib.MyFirstStruct{ Astring: jsii.String("FirstString"), @@ -1190,33 +1189,33 @@ func (suite *ComplianceSuite) TestStructs_SerializeToJsii() { doubleTrouble := calc.NewDoubleTrouble() derivedStruct := calc.DerivedStruct{ - NonPrimitive: doubleTrouble, - Bool: jsii.Bool(false), - // TODO: AnotherRequired: time.Now(), - Astring: jsii.String("String"), - Anumber: jsii.Number(1234), - FirstOptional: &[]*string{jsii.String("one"), jsii.String("two")}, + NonPrimitive: doubleTrouble, + Bool: jsii.Bool(false), + AnotherRequired: jsii.Time(time.Now()), + Astring: jsii.String("String"), + Anumber: jsii.Number(1234), + FirstOptional: &[]*string{jsii.String("one"), jsii.String("two")}, } gms := calc.NewGiveMeStructs() - assert.Equal(t, 999.0, *gms.ReadFirstNumber(&firstStruct)) - assert.Equal(t, 1234.0, *gms.ReadFirstNumber(&calclib.MyFirstStruct{ + require.Equal(t, 999.0, *gms.ReadFirstNumber(&firstStruct)) + require.Equal(t, 1234.0, *gms.ReadFirstNumber(&calclib.MyFirstStruct{ Anumber: derivedStruct.Anumber, Astring: derivedStruct.Astring, FirstOptional: derivedStruct.FirstOptional, })) - assert.Equal(t, doubleTrouble, gms.ReadDerivedNonPrimitive(&derivedStruct)) + require.Equal(t, doubleTrouble, gms.ReadDerivedNonPrimitive(&derivedStruct)) literal := *gms.StructLiteral() - assert.Equal(t, "optional1FromStructLiteral", *literal.Optional1) - assert.Equal(t, false, *literal.Optional3) - assert.Nil(t, literal.Optional2) + require.Equal(t, "optional1FromStructLiteral", *literal.Optional1) + require.Equal(t, false, *literal.Optional3) + require.Nil(t, literal.Optional2) } func (suite *ComplianceSuite) TestCanObtainReferenceWithOverloadedSetter() { t := suite.T() - assert.NotNil(t, calc.ConfusingToJackson_MakeInstance()) + require.NotNil(t, calc.ConfusingToJackson_MakeInstance()) } func (suite *ComplianceSuite) TestTestJsObjectLiteralToNative() { @@ -1225,17 +1224,17 @@ func (suite *ComplianceSuite) TestTestJsObjectLiteralToNative() { obj := calc.NewJSObjectLiteralToNative() obj2 := obj.ReturnLiteral() - assert.Equal(t, "Hello", *obj2.PropA()) - assert.Equal(t, 102.0, *obj2.PropB()) + require.Equal(t, "Hello", *obj2.PropA()) + require.Equal(t, 102.0, *obj2.PropB()) } func (suite *ComplianceSuite) TestClassWithPrivateConstructorAndAutomaticProperties() { t := suite.T() obj := calc.ClassWithPrivateConstructorAndAutomaticProperties_Create(jsii.String("Hello"), jsii.String("Bye")) - assert.Equal(t, "Bye", *obj.ReadWriteString()) + require.Equal(t, "Bye", *obj.ReadWriteString()) obj.SetReadWriteString(jsii.String("Hello")) - assert.Equal(t, "Hello", *obj.ReadOnlyString()) + require.Equal(t, "Hello", *obj.ReadOnlyString()) } func (suite *ComplianceSuite) TestArrayReturnedByMethodCannotBeModified() { @@ -1262,15 +1261,15 @@ func (suite *ComplianceSuite) TestCorrectlyDeserializesStructUnions() { OptionalStructA: a1, } - assert.True(t, *calc.StructUnionConsumer_IsStructA(a0)) - assert.True(t, *calc.StructUnionConsumer_IsStructA(a1)) - assert.False(t, *calc.StructUnionConsumer_IsStructA(b0)) - assert.False(t, *calc.StructUnionConsumer_IsStructA(b1)) + require.True(t, *calc.StructUnionConsumer_IsStructA(a0)) + require.True(t, *calc.StructUnionConsumer_IsStructA(a1)) + require.False(t, *calc.StructUnionConsumer_IsStructA(b0)) + require.False(t, *calc.StructUnionConsumer_IsStructA(b1)) - assert.False(t, *calc.StructUnionConsumer_IsStructB(a0)) - assert.False(t, *calc.StructUnionConsumer_IsStructB(a1)) - assert.True(t, *calc.StructUnionConsumer_IsStructB(b0)) - assert.True(t, *calc.StructUnionConsumer_IsStructB(b1)) + require.False(t, *calc.StructUnionConsumer_IsStructB(a0)) + require.False(t, *calc.StructUnionConsumer_IsStructB(a1)) + require.True(t, *calc.StructUnionConsumer_IsStructB(b0)) + require.True(t, *calc.StructUnionConsumer_IsStructB(b1)) } func (suite *ComplianceSuite) TestSubclassing() { @@ -1280,7 +1279,7 @@ func (suite *ComplianceSuite) TestSubclassing() { c := calc.NewCalculator(&calc.CalculatorProps{}) c.SetCurr(addTen.New(jsii.Number(33))) c.Neg() - assert.Equal(t, -43.0, *c.Value()) + require.Equal(t, -43.0, *c.Value()) } func (suite *ComplianceSuite) TestTestInterfaces() { @@ -1296,26 +1295,26 @@ func (suite *ComplianceSuite) TestTestInterfaces() { add := calc.NewAdd(calclib.NewNumber(jsii.Number(10)), calclib.NewNumber(jsii.Number(20))) friendly = add // friendlier = add // <-- shouldn't compile since Add implements IFriendly - assert.Equal(t, "Hello, I am a binary operation. What's your name?", *friendly.Hello()) + require.Equal(t, "Hello, I am a binary operation. What's your name?", *friendly.Hello()) multiply := calc.NewMultiply(calclib.NewNumber(jsii.Number(10)), calclib.NewNumber(jsii.Number(30))) friendly = multiply friendlier = multiply randomNumberGenerator = multiply // friendlyRandomGenerator = multiply // <-- shouldn't compile - assert.Equal(t, "Hello, I am a binary operation. What's your name?", *friendly.Hello()) - assert.Equal(t, "Goodbye from Multiply!", *friendlier.Goodbye()) - assert.Equal(t, 89.0, *randomNumberGenerator.Next()) + require.Equal(t, "Hello, I am a binary operation. What's your name?", *friendly.Hello()) + require.Equal(t, "Goodbye from Multiply!", *friendlier.Goodbye()) + require.Equal(t, 89.0, *randomNumberGenerator.Next()) friendlyRandomGenerator = calc.NewDoubleTrouble() - assert.Equal(t, "world", *friendlyRandomGenerator.Hello()) - assert.Equal(t, 12.0, *friendlyRandomGenerator.Next()) + require.Equal(t, "world", *friendlyRandomGenerator.Hello()) + require.Equal(t, 12.0, *friendlyRandomGenerator.Next()) poly := calc.NewPolymorphism() - assert.Equal(t, "oh, Hello, I am a binary operation. What's your name?", *poly.SayHello(friendly)) - assert.Equal(t, "oh, world", *poly.SayHello(friendlyRandomGenerator)) - assert.Equal(t, "oh, I am a native!", *poly.SayHello(friendlyRandom.NewPure())) - assert.Equal(t, "oh, SubclassNativeFriendlyRandom", *poly.SayHello(friendlyRandom.NewSubclass())) + require.Equal(t, "oh, Hello, I am a binary operation. What's your name?", *poly.SayHello(friendly)) + require.Equal(t, "oh, world", *poly.SayHello(friendlyRandomGenerator)) + require.Equal(t, "oh, I am a native!", *poly.SayHello(friendlyRandom.NewPure())) + require.Equal(t, "oh, SubclassNativeFriendlyRandom", *poly.SayHello(friendlyRandom.NewSubclass())) } func (suite *ComplianceSuite) TestReservedKeywordsAreSlugifiedInClassProperties() { @@ -1323,40 +1322,39 @@ func (suite *ComplianceSuite) TestReservedKeywordsAreSlugifiedInClassProperties( } func (suite *ComplianceSuite) TestObjectIdDoesNotGetReallocatedWhenTheConstructorPassesThisOut() { - reflector := NewPartiallyInitializedThisConsumerImpl(suite.Assert()) + reflector := NewPartiallyInitializedThisConsumerImpl(suite.Require()) calc.NewConstructorPassesThisOut(reflector) } type partiallyInitializedThisConsumerImpl struct { calc.PartiallyInitializedThisConsumer `overrides:"ConsumePartiallyInitializedThis"` - assert *assert.Assertions + require *require.Assertions } -func NewPartiallyInitializedThisConsumerImpl(assert *assert.Assertions) *partiallyInitializedThisConsumerImpl { - p := partiallyInitializedThisConsumerImpl{assert: assert} +func NewPartiallyInitializedThisConsumerImpl(assert *require.Assertions) *partiallyInitializedThisConsumerImpl { + p := partiallyInitializedThisConsumerImpl{require: assert} calc.NewPartiallyInitializedThisConsumer_Override(&p) return &p } -func (p *partiallyInitializedThisConsumerImpl) ConsumePartiallyInitializedThis(obj calc.ConstructorPassesThisOut, dt *string, ev calc.AllTypesEnum) *string { - epoch := time.Date(1970, time.January, 1, 0, 0, 0, 0, time.UTC).Format("2006-01-02T15:04:05.000Z07:00") +func (p *partiallyInitializedThisConsumerImpl) ConsumePartiallyInitializedThis(obj calc.ConstructorPassesThisOut, dt *time.Time, ev calc.AllTypesEnum) *string { + epoch := time.Date(1970, time.January, 1, 0, 0, 0, 0, time.UTC) - p.assert.NotNil(obj) - p.assert.Equal(epoch, *dt) - p.assert.Equal(calc.AllTypesEnum_THIS_IS_GREAT, ev) + p.require.NotNil(obj) + p.require.Equal(epoch, *dt) + p.require.Equal(calc.AllTypesEnum_THIS_IS_GREAT, ev) return jsii.String("OK") } func (suite *ComplianceSuite) TestInterfaceBuilder() { - assert := suite.Assert() + require := suite.Require() interact := calc.NewUsesInterfaceWithProperties(&TestInterfaceBuilderIInterfaceWithProperties{value: jsii.String("READ_WRITE")}) - assert.Equal("READ_ONLY", *interact.JustRead()) + require.Equal("READ_ONLY", *interact.JustRead()) - suite.FailTest("Not sure. Most likely related to the missing setters on interfaces", "https://github.com/aws/jsii/issues/2665") - assert.Equal("Hello", *interact.WriteAndRead(jsii.String("Hello"))) + require.Equal("Hello", *interact.WriteAndRead(jsii.String("Hello"))) } type TestInterfaceBuilderIInterfaceWithProperties struct { @@ -1377,22 +1375,22 @@ func (i *TestInterfaceBuilderIInterfaceWithProperties) SetReadWriteString(val *s func (suite *ComplianceSuite) TestUnionTypes() { - assert := suite.Assert() + require := suite.Require() types := calc.NewAllTypes() // single valued property types.SetUnionProperty(1234) - assert.Equal(float64(1234), types.UnionProperty()) + require.Equal(float64(1234), types.UnionProperty()) types.SetUnionProperty("Hello") - assert.Equal("Hello", types.UnionProperty()) + require.Equal("Hello", types.UnionProperty()) types.SetUnionProperty(calc.NewMultiply(calclib.NewNumber(jsii.Number(2)), calclib.NewNumber(jsii.Number(12)))) multiply, ok := types.UnionProperty().(calc.Multiply) - assert.True(ok) - assert.Equal(float64(24), *multiply.Value()) + require.True(ok) + require.Equal(float64(24), *multiply.Value()) // map m := map[string]interface{}{"Foo": calclib.NewNumber(jsii.Number(99))} @@ -1400,30 +1398,28 @@ func (suite *ComplianceSuite) TestUnionTypes() { unionMapProp := *types.UnionMapProperty() number, ok := unionMapProp["Foo"].(calclib.Number) - assert.True(ok) - assert.Equal(float64(99), *number.Value()) + require.True(ok) + require.Equal(float64(99), *number.Value()) // array - suite.FailTest("Unable to set an array of interfaces", "https://github.com/aws/jsii/issues/2686") a := []interface{}{123, calclib.NewNumber(jsii.Number(33))} types.SetUnionArrayProperty(&a) unionArrayProp := *types.UnionArrayProperty() number, ok = unionArrayProp[1].(calclib.Number) - assert.True(ok) - assert.Equal(33, *number.Value()) + require.True(ok) + require.Equal(float64(33), *number.Value()) } func (suite *ComplianceSuite) TestArrays() { - assert := suite.Assert() + require := suite.Require() sum := calc.NewSum() - suite.FailTest("Unable to set an array of interfaces", "https://github.com/aws/jsii/issues/2686") sum.SetParts(&[]calclib.NumericValue{calclib.NewNumber(jsii.Number(5)), calclib.NewNumber(jsii.Number(10)), calc.NewMultiply(calclib.NewNumber(jsii.Number(2)), calclib.NewNumber(jsii.Number(3)))}) - assert.Equal(10+5+(2*3), sum.Value()) - assert.Equal(5, *(*sum.Parts())[0].Value()) - assert.Equal(6, *(*sum.Parts())[2].Value()) - assert.Equal("(((0 + 5) + 10) + (2 * 3))", *sum.ToString()) + require.Equal(float64(10+5+(2*3)), *sum.Value()) + require.Equal(float64(5), *(*sum.Parts())[0].Value()) + require.Equal(float64(6), *(*sum.Parts())[2].Value()) + require.Equal("(((0 + 5) + 10) + (2 * 3))", *sum.ToString()) } func (suite *ComplianceSuite) TestStaticMapInClassCannotBeModified() { @@ -1432,19 +1428,19 @@ func (suite *ComplianceSuite) TestStaticMapInClassCannotBeModified() { func (suite *ComplianceSuite) TestConsts() { - assert := suite.Assert() + require := suite.Require() - assert.Equal("hello", *calc.Statics_Foo()) + require.Equal("hello", *calc.Statics_Foo()) obj := calc.Statics_ConstObj() - assert.Equal("world", *obj.Hello()) + require.Equal("world", *obj.Hello()) - assert.Equal(float64(1234), *calc.Statics_BAR()) - assert.Equal("world", *(*calc.Statics_ZooBar())["hello"]) + require.Equal(float64(1234), *calc.Statics_BAR()) + require.Equal("world", *(*calc.Statics_ZooBar())["hello"]) } func (suite *ComplianceSuite) TestReceiveInstanceOfPrivateClass() { - assert := suite.Assert() - assert.True(*calc.NewReturnsPrivateImplementationOfInterface().PrivateImplementation().Success()) + require := suite.Require() + require.True(*calc.NewReturnsPrivateImplementationOfInterface().PrivateImplementation().Success()) } func (suite *ComplianceSuite) TestMapReturnedByMethodCannotBeModified() { @@ -1452,11 +1448,11 @@ func (suite *ComplianceSuite) TestMapReturnedByMethodCannotBeModified() { } func (suite *ComplianceSuite) TestStaticListInClassCanBeReadCorrectly() { - assert := suite.Assert() + require := suite.Require() arr := *calc.ClassWithCollections_StaticArray() - assert.Contains(arr, jsii.String("one")) - assert.Contains(arr, jsii.String("two")) + require.Contains(arr, jsii.String("one")) + require.Contains(arr, jsii.String("two")) } func (suite *ComplianceSuite) TestFluentApi() { @@ -1465,20 +1461,20 @@ func (suite *ComplianceSuite) TestFluentApi() { func (suite *ComplianceSuite) TestCanLeverageIndirectInterfacePolymorphism() { provider := calc.NewAnonymousImplementationProvider() - assert := suite.Assert() - assert.Equal(float64(1337), *provider.ProvideAsClass().Value()) + require := suite.Require() + require.Equal(float64(1337), *provider.ProvideAsClass().Value()) suite.FailTest("Unable to reuse instances between parent/child interfaces", "https://github.com/aws/jsii/issues/2688") - assert.Equal(float64(1337), *provider.ProvideAsInterface().Value()) - assert.Equal("to implement", *provider.ProvideAsInterface().Verb()) + require.Equal(float64(1337), *provider.ProvideAsInterface().Value()) + require.Equal("to implement", *provider.ProvideAsInterface().Verb()) } func (suite *ComplianceSuite) TestPropertyOverrides_Set_Throws() { - assert := suite.Assert() + require := suite.Require() so := NewTestPropertyOverrides_Set_ThrowsSyncVirtualMethods() - assert.Panics(func() { so.ModifyValueOfTheProperty(jsii.String("Hii")) }) + require.Panics(func() { so.ModifyValueOfTheProperty(jsii.String("Hii")) }) } type testPropertyOverrides_Set_ThrowsSyncVirtualMethods struct { @@ -1501,14 +1497,14 @@ func (suite *ComplianceSuite) TestStructs_NonOptionalhashCode() { func (suite *ComplianceSuite) TestTestLiteralInterface() { - assert := suite.Assert() + require := suite.Require() obj := calc.NewJSObjectLiteralForInterface() friendly := obj.GiveMeFriendly() - assert.Equal("I am literally friendly!", *friendly.Hello()) + require.Equal("I am literally friendly!", *friendly.Hello()) gen := obj.GiveMeFriendlyGenerator() - assert.Equal("giveMeFriendlyGenerator", *gen.Hello()) - assert.Equal(float64(42), *gen.Next()) + require.Equal("giveMeFriendlyGenerator", *gen.Hello()) + require.Equal(float64(42), *gen.Next()) } func (suite *ComplianceSuite) TestReservedKeywordsAreSlugifiedInMethodNames() { @@ -1516,13 +1512,13 @@ func (suite *ComplianceSuite) TestReservedKeywordsAreSlugifiedInMethodNames() { } func (suite *ComplianceSuite) TestPureInterfacesCanBeUsedTransparently_WhenTransitivelyImplementing() { - assert := suite.Assert() + require := suite.Require() expected := calc.StructB{ RequiredString: jsii.String("It's Britney b**ch!"), } delegate := NewIndirectlyImplementsStructReturningDelegate(&expected) consumer := calc.NewConsumePureInterface(delegate) - assert.EqualValues(expected, *consumer.WorkItBaby()) + require.EqualValues(expected, *consumer.WorkItBaby()) } func NewIndirectlyImplementsStructReturningDelegate(expected *calc.StructB) calc.IStructReturningDelegate { @@ -1543,46 +1539,46 @@ func (i ImplementsStructReturningDelegate) ReturnStruct() *calc.StructB { func (suite *ComplianceSuite) TestExceptions() { - assert := suite.Assert() + require := suite.Require() calc3 := calc.NewCalculator(&calc.CalculatorProps{InitialValue: jsii.Number(20), MaximumValue: jsii.Number(30)}) calc3.Add(jsii.Number(3)) - assert.Equal(float64(23), *calc3.Value()) + require.Equal(float64(23), *calc3.Value()) // TODO: should assert the actual error here - not working for some reasons - assert.Panics(func() { + require.Panics(func() { calc3.Add(jsii.Number(10)) }) calc3.SetMaxValue(jsii.Number(40)) calc3.Add(jsii.Number(10)) - assert.Equal(float64(33), *calc3.Value()) + require.Equal(float64(33), *calc3.Value()) } func (suite *ComplianceSuite) TestSyncOverrides_CallsSuper() { - assert := suite.Assert() + require := suite.Require() obj := syncOverrides.New() obj.ReturnSuper = false obj.Multiplier = 1 - assert.Equal(float64(10*5), *obj.CallerIsProperty()) + require.Equal(float64(10*5), *obj.CallerIsProperty()) obj.ReturnSuper = true // js code returns n * 2 - assert.Equal(float64(10*2), *obj.CallerIsProperty()) + require.Equal(float64(10*2), *obj.CallerIsProperty()) } func (suite *ComplianceSuite) TestAsyncOverrides_OverrideCallsSuper() { - assert := suite.Assert() + require := suite.Require() obj := OverrideCallsSuper{AsyncVirtualMethods: calc.NewAsyncVirtualMethods()} suite.FailTest("Async methods are not implemented", "https://github.com/aws/jsii/issues/2670") - assert.Equal(1441, *obj.OverrideMe(jsii.Number(12))) - assert.Equal(1209, *obj.CallMe()) + require.Equal(1441, *obj.OverrideMe(jsii.Number(12))) + require.Equal(1209, *obj.CallMe()) } type OverrideCallsSuper struct { @@ -1596,39 +1592,35 @@ func (o *OverrideCallsSuper) OverrideMe(mult *float64) *float64 { func (suite *ComplianceSuite) TestSyncOverrides() { - assert := suite.Assert() + require := suite.Require() obj := syncOverrides.New() obj.ReturnSuper = false obj.Multiplier = 1 - assert.Equal(float64(10*5), *obj.CallerIsMethod()) + require.Equal(float64(10*5), *obj.CallerIsMethod()) // affect the result obj.Multiplier = 5 - assert.Equal(float64(10*5*5), *obj.CallerIsMethod()) + require.Equal(float64(10*5*5), *obj.CallerIsMethod()) // verify callbacks are invoked from a property - assert.Equal(float64(10*5*5), *obj.CallerIsProperty()) + require.Equal(float64(10*5*5), *obj.CallerIsProperty()) - suite.FailTest("Async methods are not implemented", "https://github.com/aws/jsii/issues/2670") - // and from an async method - obj.Multiplier = 3 - assert.Equal(float64(10*5*3), *obj.CallerIsAsync()) } func (suite *ComplianceSuite) TestAsyncOverrides_OverrideAsyncMethod() { - assert := suite.Assert() + require := suite.Require() obj := overrideAsyncMethods.New() suite.FailTest("Async methods are not implemented", "https://github.com/aws/jsii/issues/2670") - assert.Equal(float64(4452), obj.CallMe()) + require.Equal(float64(4452), obj.CallMe()) } func (suite *ComplianceSuite) TestFail_SyncOverrides_CallsDoubleAsync_Method() { - suite.Assert().Panics(func() { + suite.Require().Panics(func() { obj := syncOverrides.New() obj.CallAsync = true obj.CallerIsMethod() @@ -1636,9 +1628,9 @@ func (suite *ComplianceSuite) TestFail_SyncOverrides_CallsDoubleAsync_Method() { } func (suite *ComplianceSuite) TestCollectionOfInterfaces_MapOfStructs() { - assert := suite.Assert() + require := suite.Require() m := *calc.InterfaceCollections_MapOfStructs() - assert.Equal("Hello, I'm String!", *(*m["A"]).RequiredString) + require.Equal("Hello, I'm String!", *(*m["A"]).RequiredString) } // required to make `go test` recognize the suite. diff --git a/packages/@jsii/go-runtime-test/project/go.sum b/packages/@jsii/go-runtime-test/project/go.sum index 3c6e99ae33..ceb0e37170 100644 --- a/packages/@jsii/go-runtime-test/project/go.sum +++ b/packages/@jsii/go-runtime-test/project/go.sum @@ -4,15 +4,12 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/yuin/goldmark v1.2.1 h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= @@ -21,10 +18,8 @@ golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -32,7 +27,6 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod index 2fb26b01eb..f0b0020bc1 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod @@ -2,4 +2,7 @@ module github.com/aws/jsii-runtime-go go 1.16 -require github.com/Masterminds/semver/v3 v3.1.1 +require ( + github.com/Masterminds/semver/v3 v3.1.1 + github.com/stretchr/testify v1.7.0 +) diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum index 471bde90bb..46621f39b3 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum @@ -1,2 +1,14 @@ github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/api/api.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/api/api.go index 83d354b8b1..259a133d4a 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/api/api.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/api/api.go @@ -83,6 +83,10 @@ type EnumRef struct { MemberFQN string `json:"$jsii.enum"` } +type WireDate struct { + Timestamp string `json:"$jsii.date"` +} + type WireMap struct { MapData map[string]interface{} `json:"$jsii.map"` } diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/conversions.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/conversions.go index 1332aea503..97be302f36 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/conversions.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/conversions.go @@ -2,10 +2,15 @@ package kernel import ( "reflect" + "time" "github.com/aws/jsii-runtime-go/internal/api" ) +var ( + anyType = reflect.TypeOf((*interface{})(nil)).Elem() +) + // CastAndSetToPtr accepts a pointer to any type and attempts to cast the value // argument to be the same type. Then it sets the value of the pointer element // to be the newly cast data. This is used to cast payloads from JSII to @@ -97,15 +102,21 @@ func (c *Client) castAndSetToPtr(ptr reflect.Value, data reflect.Value) { } // arrays - if ptr.Kind() == reflect.Slice && data.Kind() == reflect.Slice { + if data.Kind() == reflect.Slice { len := data.Len() - ptr.Set(reflect.MakeSlice(ptr.Type(), len, len)) + var slice reflect.Value + if ptr.Kind() == reflect.Slice { + slice = reflect.MakeSlice(ptr.Type(), len, len) + } else { + slice = reflect.MakeSlice(reflect.SliceOf(anyType), len, len) + } // If return type is a slice, recursively cast elements for i := 0; i < len; i++ { - c.castAndSetToPtr(ptr.Index(i), data.Index(i)) + c.castAndSetToPtr(slice.Index(i), data.Index(i)) } + ptr.Set(slice) return } @@ -126,6 +137,11 @@ func (c *Client) CastPtrToRef(dataVal reflect.Value) interface{} { return nil } + // In case we got a time.Time value (or pointer to one). + if wireDate, isDate := castPtrToDate(dataVal); isDate { + return wireDate + } + switch dataVal.Kind() { case reflect.Map: result := api.WireMap{MapData: make(map[string]interface{})} @@ -180,7 +196,7 @@ func (c *Client) CastPtrToRef(dataVal reflect.Value) interface{} { case reflect.Slice: refs := make([]interface{}, dataVal.Len()) for i := 0; i < dataVal.Len(); i++ { - refs[i] = dataVal.Index(i).Interface() + refs[i] = c.CastPtrToRef(dataVal.Index(i)) } return refs @@ -192,6 +208,24 @@ func (c *Client) CastPtrToRef(dataVal reflect.Value) interface{} { return dataVal.Interface() } +// castPtrToDate obtains an api.WireDate from the provided reflect.Value if it +// represents a time.Time or *time.Time value. It accepts both a pointer and +// direct value as a convenience (when passing time.Time through an interface{} +// parameter, having to unwrap it as a pointer is annoying and unneeded). +func castPtrToDate(data reflect.Value) (wireDate api.WireDate, ok bool) { + var timestamp *time.Time + if timestamp, ok = data.Interface().(*time.Time); !ok { + var val time.Time + if val, ok = data.Interface().(time.Time); ok { + timestamp = &val + } + } + if ok { + wireDate.Timestamp = timestamp.Format(time.RFC3339Nano) + } + return +} + func castValToRef(data reflect.Value) (ref api.ObjectRef, ok bool) { if data.Kind() == reflect.Map { for _, k := range data.MapKeys() { @@ -234,13 +268,14 @@ func castValToRef(data reflect.Value) (ref api.ObjectRef, ok bool) { } // TODO: This should return a time.Time instead -func castValToDate(data reflect.Value) (date string, ok bool) { +func castValToDate(data reflect.Value) (date time.Time, ok bool) { if data.Kind() == reflect.Map { for _, k := range data.MapKeys() { v := reflect.ValueOf(data.MapIndex(k).Interface()) if k.Kind() == reflect.String && k.String() == "$jsii.date" && v.Kind() == reflect.String { - date = v.String() - ok = true + var err error + date, err = time.Parse(time.RFC3339Nano, v.String()) + ok = (err == nil) break } } @@ -282,7 +317,6 @@ func (c *Client) castValToMap(data reflect.Value, mapType reflect.Type) (m refle if mapType.Kind() == reflect.Map && mapType.Key().Kind() != reflect.String { return } - anyType := reflect.TypeOf((*interface{})(nil)).Elem() if mapType == anyType { mapType = reflect.TypeOf((map[string]interface{})(nil)) } diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/runtime.go b/packages/@jsii/go-runtime/jsii-runtime-go/runtime.go index 19ed07277a..47f978d8a2 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/runtime.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/runtime.go @@ -4,6 +4,7 @@ import ( "fmt" "reflect" "strings" + "time" "github.com/aws/jsii-runtime-go/internal/api" "github.com/aws/jsii-runtime-go/internal/kernel" @@ -371,7 +372,50 @@ func Close() { kernel.CloseClient() } -// Helpers to store primitives and return pointers to them -func Bool(v bool) *bool { return &v } +// Bool obtains a pointer to the provided bool. +func Bool(v bool) *bool { return &v } + +// Bools obtains a pointer to a slice of pointers to all the provided booleans. +func Bools(v ...bool) *[]*bool { + slice := make([]*bool, len(v)) + for i := 0; i < len(v); i++ { + slice[i] = Bool(v[i]) + } + return &slice +} + +// Number obtains a pointer to the provided float64. func Number(v float64) *float64 { return &v } -func String(v string) *string { return &v } + +// Numbers obtains a pointer to a slice of pointers to all the provided numbers. +func Numbers(v ...float64) *[]*float64 { + slice := make([]*float64, len(v)) + for i := 0; i < len(v); i++ { + slice[i] = Number(v[i]) + } + return &slice +} + +// String obtains a pointer to the provided string. +func String(v string) *string { return &v } + +// Strings obtains a pointer to a slice of pointers to all the provided strings. +func Strings(v ...string) *[]*string { + slice := make([]*string, len(v)) + for i := 0; i < len(v); i++ { + slice[i] = String(v[i]) + } + return &slice +} + +// Time obtains a pointer to the provided time.Time. +func Time(v time.Time) *time.Time { return &v } + +// Times obtains a pointer to a slice of pointers to all the provided time.Time. +func Times(v ...time.Time) *[]*time.Time { + slice := make([]*time.Time, len(v)) + for i := 0; i < len(v); i++ { + slice[i] = Time(v[i]) + } + return &slice +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/runtime_test.go b/packages/@jsii/go-runtime/jsii-runtime-go/runtime_test.go new file mode 100644 index 0000000000..dd25ee3f9e --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/runtime_test.go @@ -0,0 +1,44 @@ +package jsii + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +func TestBool(t *testing.T) { + assert.Equal(t, true, *Bool(true)) + assert.Equal(t, false, *Bool(false)) +} + +func TestBools(t *testing.T) { + assert.Equal(t, []*bool{Bool(true), Bool(false), Bool(false), Bool(true)}, *Bools(true, false, false, true)) +} + +func TestNumber(t *testing.T) { + assert.Equal(t, 123.45, *Number(123.45)) + assert.Equal(t, 1337.0, *Number(1337)) +} + +func TestNumbers(t *testing.T) { + assert.Equal(t, []*float64{Number(42), Number(1337)}, *Numbers(42, 1337)) +} + +func TestString(t *testing.T) { + assert.Equal(t, "Hello", *String("Hello")) +} + +func TestStrings(t *testing.T) { + assert.Equal(t, []*string{String("Hello"), String("World")}, *Strings("Hello", "World")) +} + +func TestTime(t *testing.T) { + now := time.Now() + assert.Equal(t, now, *Time(now)) +} + +func TestTimes(t *testing.T) { + now := time.Now() + assert.Equal(t, []*time.Time{Time(now)}, *Times(now)) +} diff --git a/packages/@jsii/go-runtime/package.json b/packages/@jsii/go-runtime/package.json index e8e93a873a..872c8df7d6 100644 --- a/packages/@jsii/go-runtime/package.json +++ b/packages/@jsii/go-runtime/package.json @@ -24,9 +24,9 @@ }, "devDependencies": { "@types/fs-extra": "^8.1.1", - "@types/node": "^10.17.55", + "@types/node": "^10.17.56", "codemaker": "^0.0.0", - "eslint": "^7.22.0", + "eslint": "^7.23.0", "fs-extra": "^9.1.0", "jsii-calc": "^3.20.120", "prettier": "^2.2.1", diff --git a/packages/@jsii/integ-test/package.json b/packages/@jsii/integ-test/package.json index b747e02aaf..c2a907f939 100644 --- a/packages/@jsii/integ-test/package.json +++ b/packages/@jsii/integ-test/package.json @@ -17,7 +17,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@octokit/rest": "^18.3.5", + "@octokit/rest": "^18.5.2", "dotenv": "^8.2.0", "fs-extra": "^9.1.0", "jest": "^26.6.3", @@ -29,10 +29,10 @@ "devDependencies": { "@types/dotenv": "^8.2.0", "@types/fs-extra": "^8.1.1", - "@types/jest": "^26.0.20", - "@types/node": "^10.17.55", + "@types/jest": "^26.0.22", + "@types/node": "^10.17.56", "@types/tar": "^4.0.4", - "eslint": "^7.22.0", + "eslint": "^7.23.0", "prettier": "^2.2.1", "typescript": "~3.9.9" } diff --git a/packages/@jsii/java-runtime-test/project/src/test/java/software/amazon/jsii/testing/ComplianceTest.java b/packages/@jsii/java-runtime-test/project/src/test/java/software/amazon/jsii/testing/ComplianceTest.java index dd42ffef80..b45edb4eb8 100644 --- a/packages/@jsii/java-runtime-test/project/src/test/java/software/amazon/jsii/testing/ComplianceTest.java +++ b/packages/@jsii/java-runtime-test/project/src/test/java/software/amazon/jsii/testing/ComplianceTest.java @@ -467,9 +467,6 @@ public void syncOverrides() { // verify callbacks are invoked from a property assertEquals(10 * 5 * 5, obj.getCallerIsProperty()); - // and from an async method - obj.multiplier = 3; - assertEquals(10 * 5 * 3, obj.callerIsAsync()); } /** diff --git a/packages/@jsii/java-runtime/package.json b/packages/@jsii/java-runtime/package.json index 18fa606e4a..cd6a63c999 100644 --- a/packages/@jsii/java-runtime/package.json +++ b/packages/@jsii/java-runtime/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@jsii/runtime": "^0.0.0", - "@types/node": "^10.17.55", + "@types/node": "^10.17.56", "jsii-build-tools": "^0.0.0", "typescript": "~3.9.9" } diff --git a/packages/@jsii/java-runtime/pom.xml.t.js b/packages/@jsii/java-runtime/pom.xml.t.js index 13b82e58c9..ae0381d875 100644 --- a/packages/@jsii/java-runtime/pom.xml.t.js +++ b/packages/@jsii/java-runtime/pom.xml.t.js @@ -65,7 +65,6 @@ process.stdout.write(` [13.0.0,20.0-a0) [5.7.0,5.8-a0) [3.5.13,4.0-a0) - [1.12,2.0-a0) @@ -128,13 +127,6 @@ process.stdout.write(` javax.annotation-api \${javax-annotations.version} - - - - org.zeroturnaround - zt-exec - \${zt-exec.version} - diff --git a/packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/JsiiRuntime.java b/packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/JsiiRuntime.java index 3db9444423..b9e7b121d0 100644 --- a/packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/JsiiRuntime.java +++ b/packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/JsiiRuntime.java @@ -5,9 +5,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import org.jetbrains.annotations.Nullable; -import org.zeroturnaround.exec.ProcessExecutor; -import org.zeroturnaround.exec.StartedProcess; -import org.zeroturnaround.exec.stream.LogOutputStream; import software.amazon.jsii.api.Callback; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; @@ -16,7 +13,6 @@ import java.io.*; import java.lang.reflect.InvocationTargetException; import java.nio.channels.Channels; -import java.nio.channels.Pipe; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Collections; @@ -48,7 +44,7 @@ public final class JsiiRuntime { /** * The child procesds. */ - private StartedProcess childProcess; + private Process childProcess; /** * Child's standard output. @@ -60,6 +56,11 @@ public final class JsiiRuntime { */ private Writer stdin; + /** + * The error stream sink for the child process. + */ + private ErrorStreamSink errorStreamSink; + /** * Handler for synchronous callbacks. Must be set using setCallbackHandler. */ @@ -72,6 +73,7 @@ public final class JsiiRuntime { /** * The main API of this class. Sends a JSON request to jsii-runtime and returns the JSON response. + * * @param request The JSON request * @return The JSON response * @throws JsiiException If the runtime returns an error response. @@ -109,6 +111,7 @@ JsonNode requestResponse(final JsonNode request) { /** * Handles an "error" response by extracting the message and stack trace * and throwing a JsiiException. + * * @param resp The response * @return Never */ @@ -124,6 +127,7 @@ private JsonNode processErrorResponse(final JsonNode resp) { /** * Processes a "callback" response, which is a request to invoke a synchronous callback * and send back the result. + * * @param resp The response. * @return The next response in the req/res chain. */ @@ -164,6 +168,7 @@ private JsonNode processCallbackResponse(final JsonNode resp) { /** * Sets the handler for sync callbacks. + * * @param callbackHandler The handler. */ public void setCallbackHandler(final JsiiCallbackHandler callbackHandler) { @@ -192,13 +197,35 @@ synchronized void terminate() { } } + // Cleaning up stdout (ensuring buffers are flushed, etc...) + if (stdout != null) { + try { + stdout.close(); + } catch (final IOException ioe) { + // Ignore - the stream might have already been closed. + } finally { + stdout = null; + } + } + + // Cleaning up error stream sink (ensuring all messages are flushed, etc...) + if (this.errorStreamSink != null) { + try { + this.errorStreamSink.close(); + } catch (final InterruptedException ie) { + // Ignore - we can no longer do anything about this... + } finally { + this.errorStreamSink = null; + } + } + if (childProcess != null) { // Wait for the child process to complete try { // Giving the process up to 5 seconds to clean up and exit - if (!childProcess.getProcess().waitFor(5, TimeUnit.SECONDS)) { + if (!childProcess.waitFor(5, TimeUnit.SECONDS)) { // If it's still not done, forcibly terminate it at this point. - childProcess.getProcess().destroyForcibly(); + childProcess.destroyForcibly(); } } catch (final InterruptedException ie) { throw new RuntimeException(ie); @@ -207,17 +234,6 @@ synchronized void terminate() { } } - // Cleaning up stdout (ensuring buffers are flushed, etc...) - if (stdout != null) { - try { - stdout.close(); - } catch (final IOException ioe) { - // Ignore - the stream might have already been closed. - } finally { - stdout = null; - } - } - // We shut down already, no need for the shutdown hook anymore if (this.shutdownHook != null) { try { @@ -257,20 +273,23 @@ private synchronized void startRuntimeIfNeeded() { } try { - final Pipe stdin = Pipe.open(); - this.stdin = Channels.newWriter(stdin.sink(), StandardCharsets.UTF_8.newEncoder(), -1); + final ProcessBuilder pb = new ProcessBuilder() + .command(jsiiRuntimeCommand) + .redirectError(ProcessBuilder.Redirect.PIPE) + .redirectOutput(ProcessBuilder.Redirect.PIPE) + .redirectInput(ProcessBuilder.Redirect.PIPE); + pb.environment().put("JSII_AGENT", String.format("Java/%s", System.getProperty("java.version"))); + if (jsiiDebug != null) { + pb.environment().put("JSII_DEBUG", jsiiDebug); + } - final Pipe stdout = Pipe.open(); - this.stdout = new BufferedReader(Channels.newReader(stdout.source(), StandardCharsets.UTF_8.newDecoder(), -1)); + this.childProcess = pb.start(); - final ProcessExecutor executor = new ProcessExecutor(jsiiRuntimeCommand) - .environment("JSII_AGENT", String.format("Java/%s", System.getProperty("java.version"))) - .environment("JSII_DEBUG", jsiiDebug) - .redirectInput(Channels.newInputStream(stdin.source())) - .redirectOutput(Channels.newOutputStream(stdout.sink())) - .redirectError(new ErrorStreamSink()); + this.stdin = new OutputStreamWriter(this.childProcess.getOutputStream(), StandardCharsets.UTF_8); + this.stdout = new BufferedReader(new InputStreamReader(this.childProcess.getInputStream(), StandardCharsets.UTF_8)); - this.childProcess = executor.start(); + this.errorStreamSink = new ErrorStreamSink(this.childProcess.getErrorStream()); + this.errorStreamSink.start(); } catch (final IOException ioe) { throw new UncheckedIOException(ioe); } @@ -300,6 +319,7 @@ private void handshake() { /** * Reads the next response from STDOUT of the child process. + * * @return The parsed JSON response. * @throws JsiiException if we couldn't parse the response. */ @@ -319,6 +339,7 @@ JsonNode readNextResponse() { /** * This will return the server process in case it is not already started. + * * @return A {@link JsiiClient} connected to the server process. */ public JsiiClient getClient() { @@ -335,7 +356,6 @@ public JsiiClient getClient() { * * @param expectedVersion The version this client expects from the runtime * @param actualVersion The actual version the runtime reports - * * @throws JsiiException if versions mismatch */ static void assertVersionCompatible(final String expectedVersion, final String actualVersion) { @@ -356,10 +376,56 @@ private static void notifyInspector(final JsonNode message, final MessageInspect inspector.inspect(message, type); } - private static final class ErrorStreamSink extends LogOutputStream { + /** + * This {@link Thread} takes the standard error output from a child process and handles it correctly as per the jsii + * runtime protocol. It is implemented in such a way that it is interruptible, drawing inspiration from how it's + * done at zt-exec (so credits to ZeroTurnaround & contributors). + * + * @see zt-exec + */ + private static final class ErrorStreamSink extends Thread { private final ObjectMapper objectMapper = new ObjectMapper(); + private final InputStream inputStream; + private final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + private boolean stop = false; + + public ErrorStreamSink(final InputStream inputStream) { + this.inputStream = inputStream; + this.setDaemon(true); + this.setName(this.getClass().getCanonicalName()); + this.setUncaughtExceptionHandler((thread, throwable) -> { + System.err.printf("Unexpected error in background thread \"%s\": %s%n", thread.getName(), throwable); + }); + } + + public void run() { + try { + while (!this.stop) { + while (this.inputStream.available() > 0) { + final int read = this.inputStream.read(); + this.buffer.write(read); + if (read == '\n') { + processLine(new String(buffer.toByteArray(), StandardCharsets.UTF_8)); + buffer.reset(); + } + } + // Short interruptible sleep, so we can be stopped by a signal... This is a bit ugly (busy-waiting) + // but is in fact the only way to be reliably interruptible with the InputStream API. + Thread.sleep(100); + } + } catch (final IOException ioe) { + throw new UncheckedIOException(ioe); + } catch (final InterruptedException ie) { + // Ignore - simply exit right away. + } + } + + public void close() throws InterruptedException { + this.stop = true; + this.join(); + } - public void processLine(final String line) { + private void processLine(final String line) { try { final JsonNode tree = objectMapper.readTree(line); final ConsoleOutput consoleOutput = objectMapper.treeToValue(tree, ConsoleOutput.class); diff --git a/packages/@jsii/kernel/package.json b/packages/@jsii/kernel/package.json index 111999ee13..6d8a8b51c4 100644 --- a/packages/@jsii/kernel/package.json +++ b/packages/@jsii/kernel/package.json @@ -39,11 +39,11 @@ "@scope/jsii-calc-base": "^0.0.0", "@scope/jsii-calc-lib": "^0.0.0", "@types/fs-extra": "^8.1.1", - "@types/jest": "^26.0.20", + "@types/jest": "^26.0.22", "@types/jest-expect-message": "^1.0.3", - "@types/node": "^10.17.55", + "@types/node": "^10.17.56", "@types/tar": "^4.0.4", - "eslint": "^7.22.0", + "eslint": "^7.23.0", "jest": "^26.6.3", "jest-expect-message": "^1.0.2", "jsii-build-tools": "^0.0.0", diff --git a/packages/@jsii/python-runtime/requirements.txt b/packages/@jsii/python-runtime/requirements.txt index fac88653cc..2fce16da48 100644 --- a/packages/@jsii/python-runtime/requirements.txt +++ b/packages/@jsii/python-runtime/requirements.txt @@ -3,7 +3,7 @@ mypy==0.812 pip~=21.0 pytest~=6.2 pytest-mypy~=0.8 -setuptools~=54.1 +setuptools~=54.2 wheel~=0.36 -e . diff --git a/packages/@jsii/python-runtime/setup.py b/packages/@jsii/python-runtime/setup.py index 44bd4f2090..15b337ffa8 100644 --- a/packages/@jsii/python-runtime/setup.py +++ b/packages/@jsii/python-runtime/setup.py @@ -32,7 +32,7 @@ install_requires=[ "attrs~=20.1", "cattrs~=1.0.0 ; python_version < '3.7'", - "cattrs~=1.3.0 ; python_version >= '3.7'", + "cattrs~=1.4.0 ; python_version >= '3.7'", "importlib_resources ; python_version < '3.7'", "python-dateutil", "typing_extensions~=3.7", diff --git a/packages/@jsii/runtime/package.json b/packages/@jsii/runtime/package.json index 47ba2513bf..b6469c57d7 100644 --- a/packages/@jsii/runtime/package.json +++ b/packages/@jsii/runtime/package.json @@ -40,9 +40,9 @@ "devDependencies": { "@scope/jsii-calc-base": "^0.0.0", "@scope/jsii-calc-lib": "^0.0.0", - "@types/jest": "^26.0.20", - "@types/node": "^10.17.55", - "eslint": "^7.22.0", + "@types/jest": "^26.0.22", + "@types/node": "^10.17.56", + "eslint": "^7.23.0", "jest": "^26.6.3", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", @@ -50,7 +50,7 @@ "source-map-loader": "^2.0.1", "ts-jest": "^26.5.4", "typescript": "~3.9.9", - "webpack": "^5.26.3", - "webpack-cli": "^4.5.0" + "webpack": "^5.28.0", + "webpack-cli": "^4.6.0" } } diff --git a/packages/@jsii/spec/package.json b/packages/@jsii/spec/package.json index b6bed3a93b..dcee06d607 100644 --- a/packages/@jsii/spec/package.json +++ b/packages/@jsii/spec/package.json @@ -34,9 +34,9 @@ "jsonschema": "^1.4.0" }, "devDependencies": { - "@types/jest": "^26.0.20", - "@types/node": "^10.17.55", - "eslint": "^7.22.0", + "@types/jest": "^26.0.22", + "@types/node": "^10.17.56", + "eslint": "^7.23.0", "jest": "^26.6.3", "jsii-build-tools": "^0.0.0", "prettier": "^2.2.1", diff --git a/packages/@scope/jsii-calc-base-of-base/package.json b/packages/@scope/jsii-calc-base-of-base/package.json index 11c7d906f6..5d903506b4 100644 --- a/packages/@scope/jsii-calc-base-of-base/package.json +++ b/packages/@scope/jsii-calc-base-of-base/package.json @@ -30,7 +30,7 @@ "test:update": "npm run build && UPDATE_DIFF=1 npm run test" }, "devDependencies": { - "@types/node": "^10.17.55", + "@types/node": "^10.17.56", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", diff --git a/packages/@scope/jsii-calc-base/package.json b/packages/@scope/jsii-calc-base/package.json index 4cb1811671..69812aad80 100644 --- a/packages/@scope/jsii-calc-base/package.json +++ b/packages/@scope/jsii-calc-base/package.json @@ -35,7 +35,7 @@ "@scope/jsii-calc-base-of-base": "^2.1.1" }, "devDependencies": { - "@types/node": "^10.17.55", + "@types/node": "^10.17.56", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", diff --git a/packages/@scope/jsii-calc-lib/package.json b/packages/@scope/jsii-calc-lib/package.json index 7b7524e88f..d3d3925a93 100644 --- a/packages/@scope/jsii-calc-lib/package.json +++ b/packages/@scope/jsii-calc-lib/package.json @@ -39,7 +39,7 @@ "@scope/jsii-calc-base-of-base": "^2.1.1" }, "devDependencies": { - "@types/node": "^10.17.55", + "@types/node": "^10.17.56", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", diff --git a/packages/codemaker/package.json b/packages/codemaker/package.json index e5889b2c7b..887ef6955e 100644 --- a/packages/codemaker/package.json +++ b/packages/codemaker/package.json @@ -37,9 +37,9 @@ }, "devDependencies": { "@types/fs-extra": "^8.1.1", - "@types/jest": "^26.0.20", - "@types/node": "^10.17.55", - "eslint": "^7.22.0", + "@types/jest": "^26.0.22", + "@types/node": "^10.17.56", + "eslint": "^7.23.0", "jest": "^26.6.3", "prettier": "^2.2.1", "typescript": "~3.9.9" diff --git a/packages/jsii-calc/package.json b/packages/jsii-calc/package.json index 44f9f4cf13..b80b735d1d 100644 --- a/packages/jsii-calc/package.json +++ b/packages/jsii-calc/package.json @@ -51,8 +51,8 @@ "@scope/jsii-calc-lib": "^0.0.0" }, "devDependencies": { - "@types/node": "^10.17.55", - "eslint": "^7.22.0", + "@types/node": "^10.17.56", + "eslint": "^7.23.0", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", diff --git a/packages/jsii-config/package.json b/packages/jsii-config/package.json index be845e8aaa..5f28eacf0c 100644 --- a/packages/jsii-config/package.json +++ b/packages/jsii-config/package.json @@ -20,11 +20,11 @@ }, "devDependencies": { "@types/inquirer": "^7.3.1", - "@types/jest": "^26.0.20", + "@types/jest": "^26.0.22", "@types/jest-expect-message": "^1.0.3", - "@types/node": "^10.17.55", - "@types/yargs": "^16.0.0", - "eslint": "^7.22.0", + "@types/node": "^10.17.56", + "@types/yargs": "^16.0.1", + "eslint": "^7.23.0", "jest": "^26.6.3", "jest-expect-message": "^1.0.2", "prettier": "^2.2.1", diff --git a/packages/jsii-diff/package.json b/packages/jsii-diff/package.json index c63138e49f..841cbdd203 100644 --- a/packages/jsii-diff/package.json +++ b/packages/jsii-diff/package.json @@ -42,12 +42,12 @@ }, "devDependencies": { "@types/fs-extra": "^8.1.1", - "@types/jest": "^26.0.20", + "@types/jest": "^26.0.22", "@types/jest-expect-message": "^1.0.3", - "@types/node": "^10.17.55", + "@types/node": "^10.17.56", "@types/tar-fs": "^2.0.0", - "@types/yargs": "^16.0.0", - "eslint": "^7.22.0", + "@types/yargs": "^16.0.1", + "eslint": "^7.23.0", "jest": "^26.6.3", "jest-expect-message": "^1.0.2", "jsii": "^0.0.0", diff --git a/packages/jsii-pacmak/lib/targets/go/dependencies.ts b/packages/jsii-pacmak/lib/targets/go/dependencies.ts new file mode 100644 index 0000000000..a0996b43a9 --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/go/dependencies.ts @@ -0,0 +1,17 @@ +/** + * Information about a module's dependency on "special" packages (either part of + * the go standard library, or generated as part of the current module). + */ +export interface SpecialDependencies { + /** Whether the jsii runtime library for go is needed */ + readonly runtime: boolean; + + /** Whether the package's initialization hook is needed */ + readonly init: boolean; + + /** Whether the internal type aliases package is needed */ + readonly internal: boolean; + + /** Whether go's standard library "time" module is needed */ + readonly time: boolean; +} diff --git a/packages/jsii-pacmak/lib/targets/go/package.ts b/packages/jsii-pacmak/lib/targets/go/package.ts index a0fab51c38..7aad56afc8 100644 --- a/packages/jsii-pacmak/lib/targets/go/package.ts +++ b/packages/jsii-pacmak/lib/targets/go/package.ts @@ -4,6 +4,7 @@ import { basename, dirname, join } from 'path'; import * as semver from 'semver'; import { VERSION } from '../../version'; +import { SpecialDependencies } from './dependencies'; import { EmitContext } from './emit-context'; import { ReadmeFile } from './readme-file'; import { @@ -184,16 +185,18 @@ export abstract class Package { code.line(); } - protected get usesRuntimePackage(): boolean { - return this.types.some((type) => type.usesRuntimePackage); - } - - protected get usesInitPackage(): boolean { - return this.types.some((type) => type.usesInitPackage); - } - - protected get usesInternalPackage(): boolean { - return this.types.some((type) => type.usesInternalPackage); + protected get specialDependencies(): SpecialDependencies { + return this.types + .map((t) => t.specialDependencies) + .reduce( + (acc, elt) => ({ + runtime: acc.runtime || elt.runtime, + init: acc.init || elt.init, + internal: acc.internal || elt.internal, + time: acc.time || elt.time, + }), + { runtime: false, init: false, internal: false, time: false }, + ); } /** @@ -229,18 +232,24 @@ export abstract class Package { private emitImports(code: CodeMaker) { const toImport = new Array(); - if (this.usesRuntimePackage) { + const specialDeps = this.specialDependencies; + + if (specialDeps.time) { + toImport.push({ module: 'time' }); + } + + if (specialDeps.runtime) { toImport.push(JSII_RT_MODULE); } - if (this.usesInitPackage) { + if (specialDeps.init) { toImport.push({ alias: JSII_INIT_ALIAS, module: `${this.root.goModuleName}/${JSII_INIT_PACKAGE}`, }); } - if (this.usesInternalPackage) { + if (specialDeps.internal) { toImport.push({ module: `${this.goModuleName}/${INTERNAL_PACKAGE_NAME}`, }); @@ -611,7 +620,9 @@ function importGoModules(code: CodeMaker, modules: readonly ImportedModule[]) { } function isBuiltIn(mod: ImportedModule): boolean { - return !mod.module.includes('/'); + // Standard library modules don't have any "." in their path, whereas any + // other module has a DNS portion in them, which must include a ".". + return !mod.module.includes('.'); } function isSpecial(mod: ImportedModule): boolean { diff --git a/packages/jsii-pacmak/lib/targets/go/types/class.ts b/packages/jsii-pacmak/lib/targets/go/types/class.ts index 6566dbdd27..142bd1edd4 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/class.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/class.ts @@ -3,6 +3,7 @@ import { Method, ClassType, Initializer } from 'jsii-reflect'; import { jsiiToPascalCase } from '../../../naming-util'; import * as comparators from '../comparators'; +import { SpecialDependencies } from '../dependencies'; import { EmitContext } from '../emit-context'; import { Package } from '../package'; import { @@ -155,18 +156,17 @@ export class GoClass extends GoType { ]; } - public get usesInitPackage() { - return ( - this.initializer != null || this.members.some((m) => m.usesInitPackage) - ); - } - - public get usesRuntimePackage() { - return this.initializer != null || this.members.length > 0; - } - - public get usesInternalPackage() { - return this.baseTypes.some((base) => this.pkg.isExternalType(base)); + public get specialDependencies(): SpecialDependencies { + return { + runtime: this.initializer != null || this.members.length > 0, + init: + this.initializer != null || + this.members.some((m) => m.specialDependencies.init), + internal: this.baseTypes.some((base) => this.pkg.isExternalType(base)), + time: + !!this.initializer?.specialDependencies.time || + this.members.some((m) => m.specialDependencies.time), + }; } protected emitInterface(context: EmitContext): void { @@ -276,9 +276,6 @@ export class GoClass extends GoType { } export class GoClassConstructor extends GoMethod { - public readonly usesInitPackage = true; - public readonly usesRuntimePackage = true; - private readonly constructorRuntimeCall: ClassConstructor; public constructor( @@ -289,6 +286,15 @@ export class GoClassConstructor extends GoMethod { this.constructorRuntimeCall = new ClassConstructor(this); } + public get specialDependencies(): SpecialDependencies { + return { + runtime: true, + init: true, + internal: false, + time: this.parameters.some((p) => p.reference.specialDependencies.time), + }; + } + public emit(context: EmitContext) { // Abstract classes cannot be directly created if (!this.parent.type.abstract) { @@ -332,8 +338,6 @@ export class GoClassConstructor extends GoMethod { export class ClassMethod extends GoMethod { public readonly runtimeCall: MethodCall; - public readonly usesInitPackage: boolean = false; - public readonly usesRuntimePackage = true; public constructor( public readonly parent: GoClass, @@ -371,11 +375,20 @@ export class ClassMethod extends GoMethod { public get instanceArg(): string { return this.parent.name.substring(0, 1).toLowerCase(); } + + public get specialDependencies(): SpecialDependencies { + return { + runtime: true, + init: this.method.static, + internal: false, + time: + !!this.parameters.some((p) => p.reference.specialDependencies.time) || + !!this.reference?.specialDependencies.time, + }; + } } export class StaticMethod extends ClassMethod { - public readonly usesInitPackage = true; - public constructor( public readonly parent: GoClass, public readonly method: Method, diff --git a/packages/jsii-pacmak/lib/targets/go/types/enum.ts b/packages/jsii-pacmak/lib/targets/go/types/enum.ts index 8e869b08b5..ea5ff70c5a 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/enum.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/enum.ts @@ -1,16 +1,13 @@ import { CodeMaker } from 'codemaker'; import { EnumType, EnumMember } from 'jsii-reflect'; +import { SpecialDependencies } from '../dependencies'; import { EmitContext } from '../emit-context'; import { Package } from '../package'; import { JSII_RT_ALIAS } from '../runtime'; import { GoType } from './go-type'; export class Enum extends GoType { - public readonly usesInitPackage = false; - public readonly usesRuntimePackage = false; - public readonly usesInternalPackage = false; - private readonly members: readonly GoEnumMember[]; public constructor(pkg: Package, public type: EnumType) { @@ -53,6 +50,15 @@ export class Enum extends GoType { public get dependencies(): Package[] { return []; } + + public get specialDependencies(): SpecialDependencies { + return { + runtime: false, + init: false, + internal: false, + time: false, + }; + } } class GoEnumMember { diff --git a/packages/jsii-pacmak/lib/targets/go/types/go-type-reference.ts b/packages/jsii-pacmak/lib/targets/go/types/go-type-reference.ts index 4383ec2f49..6f3d0c9dda 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/go-type-reference.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/go-type-reference.ts @@ -1,6 +1,7 @@ import { TypeReference } from 'jsii-reflect'; import * as log from '../../../logging'; +import { SpecialDependencies } from '../dependencies'; import { Package } from '../package'; import { GoType } from './go-type'; @@ -12,8 +13,7 @@ class PrimitiveMapper { number: 'float64', boolean: 'bool', any: 'interface{}', - // TODO: Resolve "time" package dependency where needed and change to "time.Time" - date: 'string', + date: 'time.Time', string: 'string', json: `map[string]interface{}`, }; @@ -60,6 +60,31 @@ export class GoTypeRef { return undefined; } + public get specialDependencies(): SpecialDependencies { + return { + runtime: false, + init: false, + internal: false, + time: containsDate(this.reference), + }; + + function containsDate(ref: TypeReference): boolean { + if (ref.primitive === 'date') { + return true; + } + if (ref.arrayOfType) { + return containsDate(ref.arrayOfType); + } + if (ref.mapOfType) { + return containsDate(ref.mapOfType); + } + if (ref.unionOfTypes) { + return ref.unionOfTypes.some(containsDate); + } + return false; + } + } + public get primitiveType() { if (this.reference.primitive) { return new PrimitiveMapper(this.reference.primitive).goPrimitive; diff --git a/packages/jsii-pacmak/lib/targets/go/types/go-type.ts b/packages/jsii-pacmak/lib/targets/go/types/go-type.ts index dd3839c4c3..7ccbe2f9c8 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/go-type.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/go-type.ts @@ -1,6 +1,7 @@ import { CodeMaker } from 'codemaker'; import { Type } from 'jsii-reflect'; +import { SpecialDependencies } from '../dependencies'; import { EmitContext } from '../emit-context'; import { Package } from '../package'; import { JSII_RT_ALIAS } from '../runtime'; @@ -36,9 +37,7 @@ export abstract class GoType { public abstract emitRegistration(code: CodeMaker): void; public abstract get dependencies(): Package[]; - public abstract get usesInitPackage(): boolean; - public abstract get usesRuntimePackage(): boolean; - public abstract get usesInternalPackage(): boolean; + public abstract get specialDependencies(): SpecialDependencies; public get namespace() { return this.pkg.packageName; diff --git a/packages/jsii-pacmak/lib/targets/go/types/interface.ts b/packages/jsii-pacmak/lib/targets/go/types/interface.ts index 54165f6ca8..bd24c151d0 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/interface.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/interface.ts @@ -2,6 +2,7 @@ import { CodeMaker } from 'codemaker'; import { InterfaceType, Method, Property } from 'jsii-reflect'; import * as comparators from '../comparators'; +import { SpecialDependencies } from '../dependencies'; import { EmitContext } from '../emit-context'; import { Package } from '../package'; import { JSII_RT_ALIAS, MethodCall } from '../runtime'; @@ -141,24 +142,26 @@ export class GoInterface extends GoType { code.close(')'); } - public get usesInitPackage() { - return ( - this.properties.some((p) => p.usesInitPackage) || - this.methods.some((m) => m.usesInitPackage) - ); - } - - public get usesRuntimePackage() { - return ( - this.properties.some((p) => p.usesRuntimePackage) || - this.methods.some((m) => m.usesRuntimePackage) + public get specialDependencies(): SpecialDependencies { + return [ + ...this.properties.map((p) => p.specialDependencies), + ...this.methods.map((m) => m.specialDependencies), + ].reduce( + (acc, elt) => ({ + runtime: acc.runtime || elt.runtime, + init: acc.init || elt.init, + internal: acc.internal, + time: acc.time || elt.time, + }), + { + runtime: false, + init: false, + internal: this.extends.some((base) => this.pkg.isExternalType(base)), + time: false, + }, ); } - public get usesInternalPackage() { - return this.extends.some((base) => this.pkg.isExternalType(base)); - } - public get extends(): GoInterface[] { return this.type.interfaces .map((iface) => this.pkg.root.findType(iface.fqn) as GoInterface) @@ -207,13 +210,18 @@ class InterfaceProperty extends GoProperty { public emit({ code, documenter }: EmitContext) { documenter.emit(this.property.docs); code.line(`${this.name}() ${this.returnType}`); + + if (!this.property.immutable) { + documenter.emit(this.property.docs); + code.line( + `Set${this.name}(${this.name[0].toLowerCase()} ${this.returnType})`, + ); + } } } class InterfaceMethod extends GoMethod { public readonly runtimeCall: MethodCall; - public readonly usesInitPackage = false; - public readonly usesRuntimePackage = true; public constructor( public readonly parent: GoInterface, @@ -246,6 +254,17 @@ class InterfaceMethod extends GoMethod { code.line(); } + public get specialDependencies(): SpecialDependencies { + return { + runtime: true, + init: false, + internal: false, + time: + this.parameters.some((p) => p.reference.specialDependencies.time) || + !!this.reference?.specialDependencies.time, + }; + } + private get returnTypeString(): string { return this.reference?.void ? '' : ` ${this.returnType}`; } diff --git a/packages/jsii-pacmak/lib/targets/go/types/struct.ts b/packages/jsii-pacmak/lib/targets/go/types/struct.ts index cafbaad0d7..a1424b9497 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/struct.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/struct.ts @@ -2,6 +2,7 @@ import * as assert from 'assert'; import { CodeMaker } from 'codemaker'; import { InterfaceType } from 'jsii-reflect'; +import { SpecialDependencies } from '../dependencies'; import { EmitContext } from '../emit-context'; import { Package } from '../package'; import { JSII_RT_ALIAS } from '../runtime'; @@ -13,10 +14,6 @@ import { GoProperty } from './type-member'; * Struct wraps a JSII datatype interface aka, structs */ export class Struct extends GoType { - public readonly usesRuntimePackage = false; - public readonly usesInitPackage = false; - public readonly usesInternalPackage = false; - private readonly properties: readonly GoProperty[]; public constructor(parent: Package, public readonly type: InterfaceType) { @@ -36,6 +33,15 @@ export class Struct extends GoType { return getMemberDependencies(this.properties); } + public get specialDependencies(): SpecialDependencies { + return { + runtime: false, + init: false, + internal: false, + time: this.properties.some((prop) => prop.specialDependencies.time), + }; + } + public emit(context: EmitContext): void { const { code, documenter } = context; documenter.emit(this.type.docs); diff --git a/packages/jsii-pacmak/lib/targets/go/types/type-member.ts b/packages/jsii-pacmak/lib/targets/go/types/type-member.ts index 5d27b7c696..843b73fd54 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/type-member.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/type-member.ts @@ -1,6 +1,7 @@ import { Callable, Method, Parameter, Property } from 'jsii-reflect'; import { jsiiToPascalCase } from '../../../naming-util'; +import { SpecialDependencies } from '../dependencies'; import { EmitContext } from '../emit-context'; import { GetProperty, JSII_RT_ALIAS, SetProperty } from '../runtime'; import { substituteReservedWords } from '../util'; @@ -16,8 +17,7 @@ export interface GoTypeMember { reference?: GoTypeRef; returnType: string; - usesInitPackage: boolean; - usesRuntimePackage: boolean; + specialDependencies: SpecialDependencies; } /* @@ -41,12 +41,13 @@ export class GoProperty implements GoTypeMember { } } - public get usesInitPackage() { - return this.static; - } - - public get usesRuntimePackage() { - return true; + public get specialDependencies(): SpecialDependencies { + return { + runtime: true, + init: this.static, + internal: false, + time: !!this.reference?.specialDependencies.time, + }; } public get static(): boolean { @@ -99,7 +100,7 @@ export class GoProperty implements GoTypeMember { public emitSetterDecl(context: EmitContext) { const { code } = context; - if (!this.property.protected && !this.immutable) { + if (!this.immutable) { code.line(`Set${this.name}(val ${this.returnType})`); } } @@ -157,8 +158,8 @@ export abstract class GoMethod implements GoTypeMember { } public abstract emit(context: EmitContext): void; - public abstract get usesInitPackage(): boolean; - public abstract get usesRuntimePackage(): boolean; + + public abstract get specialDependencies(): SpecialDependencies; public get returnsRef(): boolean { if ( diff --git a/packages/jsii-pacmak/lib/targets/python.ts b/packages/jsii-pacmak/lib/targets/python.ts index 4ec6c0c278..868d3c0840 100644 --- a/packages/jsii-pacmak/lib/targets/python.ts +++ b/packages/jsii-pacmak/lib/targets/python.ts @@ -533,7 +533,10 @@ abstract class BaseMethod implements PythonBase { liftedPropNames, ); - const paramType = toTypeName(param).pythonType(context); + const paramType = toTypeName(param).pythonType({ + ...context, + parameterType: true, + }); const paramDefault = param.optional ? ' = None' : ''; pythonParams.push(`${paramName}: ${paramType}${paramDefault}`); @@ -565,7 +568,10 @@ abstract class BaseMethod implements PythonBase { // Iterate over all of our props, and reflect them into our params. for (const prop of liftedProperties) { const paramName = toPythonParameterName(prop.name); - const paramType = toTypeName(prop).pythonType(context); + const paramType = toTypeName(prop).pythonType({ + ...context, + parameterType: true, + }); const paramDefault = prop.optional ? ' = None' : ''; pythonParams.push(`${paramName}: ${paramType}${paramDefault}`); @@ -1203,7 +1209,10 @@ class StructField implements PythonBase { public constructorDecl(context: EmitContext) { const opt = this.optional ? ' = None' : ''; - return `${this.pythonName}: ${this.typeAnnotation(context)}${opt}`; + return `${this.pythonName}: ${this.typeAnnotation({ + ...context, + parameterType: true, + })}${opt}`; } /** @@ -1597,6 +1606,8 @@ class PythonModule implements PythonType { code.line(`${member},`); } code.unindent(']'); + } else { + code.line('__all__: List[typing.Any] = []'); } // Finally, we'll use publication to ensure that all of the non-public names diff --git a/packages/jsii-pacmak/lib/targets/python/type-name.ts b/packages/jsii-pacmak/lib/targets/python/type-name.ts index ed1b164274..8f195fecd9 100644 --- a/packages/jsii-pacmak/lib/targets/python/type-name.ts +++ b/packages/jsii-pacmak/lib/targets/python/type-name.ts @@ -71,6 +71,13 @@ export interface NamingContext { * or not when emitting type signatures. */ readonly emittedTypes: Set; + + /** + * Whether the type is emitted for a parameter or not. This may change the + * exact type signature being emitted (e.g: Arrays are typing.Sequence[T] for + * parameters, and typing.List[T] otherwise). + */ + readonly parameterType?: boolean; } export function toTypeName(ref?: OptionalValue | TypeReference): TypeName { @@ -160,7 +167,8 @@ class List implements TypeName { } public pythonType(context: NamingContext) { - return `typing.List[${this.#element.pythonType(context)}]`; + const type = context.parameterType ? 'Sequence' : 'List'; + return `typing.${type}[${this.#element.pythonType(context)}]`; } public requiredImports(context: NamingContext) { diff --git a/packages/jsii-pacmak/package.json b/packages/jsii-pacmak/package.json index ea83eb90bc..7602c9fc3c 100644 --- a/packages/jsii-pacmak/package.json +++ b/packages/jsii-pacmak/package.json @@ -45,7 +45,7 @@ "fs-extra": "^9.1.0", "jsii-reflect": "^0.0.0", "jsii-rosetta": "^0.0.0", - "semver": "^7.3.4", + "semver": "^7.3.5", "spdx-license-list": "^6.4.0", "xmlbuilder": "^15.1.1", "yargs": "^16.2.0" @@ -58,11 +58,11 @@ "@types/clone": "^2.1.0", "@types/commonmark": "^0.27.4", "@types/fs-extra": "^8.1.1", - "@types/jest": "^26.0.20", - "@types/node": "^10.17.55", + "@types/jest": "^26.0.22", + "@types/node": "^10.17.56", "@types/semver": "^7.3.4", - "@types/yargs": "^16.0.0", - "eslint": "^7.22.0", + "@types/yargs": "^16.0.1", + "eslint": "^7.23.0", "jest": "^26.6.3", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.ts.snap index 6c73a2332c..d949ab5da1 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.ts.snap @@ -146,11 +146,10 @@ exports[`foo@1.2.3 depends on bar@^2.0.0-rc.42: /go/foo/jsii/jsii.go 1`] package jsii import ( + bar "bar/v2/jsii" _ "embed" _jsii_ "github.com/aws/jsii-runtime-go" - - bar "bar/v2/jsii" ) //go:embed foo-1.2.3.tgz @@ -656,11 +655,10 @@ exports[`foo@1.2.3 depends on bar@^4.5.6-pre.1337: /go/foo/jsii/jsii.go package jsii import ( + bar "bar/v4/jsii" _ "embed" _jsii_ "github.com/aws/jsii-runtime-go" - - bar "bar/v4/jsii" ) //go:embed foo-1.2.3.tgz diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap index b6a2ec1f24..a757769ea9 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap @@ -2842,6 +2842,8 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc.go 1`] = package jsiicalc import ( + "time" + _jsii_ "github.com/aws/jsii-runtime-go" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" @@ -3030,6 +3032,7 @@ func (a *jsiiProxy_AbstractClassReturner) GiveMeInterface() IInterfaceImplemente // Ensures abstract members implementations correctly register overrides in various languages. type AbstractSuite interface { Property() *string + SetProperty(val *string) SomeMethod(str *string) *string WorkItAll(seed *string) *string } @@ -3225,8 +3228,8 @@ type AllTypes interface { SetArrayProperty(val *[]*string) BooleanProperty() *bool SetBooleanProperty(val *bool) - DateProperty() *string - SetDateProperty(val *string) + DateProperty() *time.Time + SetDateProperty(val *time.Time) EnumProperty() AllTypesEnum SetEnumProperty(val AllTypesEnum) EnumPropertyValue() *float64 @@ -3312,8 +3315,8 @@ func (j *jsiiProxy_AllTypes) BooleanProperty() *bool { return returns } -func (j *jsiiProxy_AllTypes) DateProperty() *string { - var returns *string +func (j *jsiiProxy_AllTypes) DateProperty() *time.Time { + var returns *time.Time _jsii_.Get( j, "dateProperty", @@ -3517,7 +3520,7 @@ func (j *jsiiProxy_AllTypes) SetBooleanProperty(val *bool) { ) } -func (j *jsiiProxy_AllTypes) SetDateProperty(val *string) { +func (j *jsiiProxy_AllTypes) SetDateProperty(val *time.Time) { _jsii_.Set( j, "dateProperty", @@ -5807,7 +5810,7 @@ func (d *jsiiProxy_Default) PleaseCompile() { type DefaultedConstructorArgument interface { Arg1() *float64 Arg2() *string - Arg3() *string + Arg3() *time.Time } // The jsii proxy struct for DefaultedConstructorArgument @@ -5835,8 +5838,8 @@ func (j *jsiiProxy_DefaultedConstructorArgument) Arg2() *string { return returns } -func (j *jsiiProxy_DefaultedConstructorArgument) Arg3() *string { - var returns *string +func (j *jsiiProxy_DefaultedConstructorArgument) Arg3() *time.Time { + var returns *time.Time _jsii_.Get( j, "arg3", @@ -5846,7 +5849,7 @@ func (j *jsiiProxy_DefaultedConstructorArgument) Arg3() *string { } -func NewDefaultedConstructorArgument(arg1 *float64, arg2 *string, arg3 *string) DefaultedConstructorArgument { +func NewDefaultedConstructorArgument(arg1 *float64, arg2 *string, arg3 *time.Time) DefaultedConstructorArgument { _init_.Initialize() j := jsiiProxy_DefaultedConstructorArgument{} @@ -5860,7 +5863,7 @@ func NewDefaultedConstructorArgument(arg1 *float64, arg2 *string, arg3 *string) return &j } -func NewDefaultedConstructorArgument_Override(d DefaultedConstructorArgument, arg1 *float64, arg2 *string, arg3 *string) { +func NewDefaultedConstructorArgument_Override(d DefaultedConstructorArgument, arg1 *float64, arg2 *string, arg3 *time.Time) { _init_.Initialize() _jsii_.Create( @@ -6039,7 +6042,7 @@ type DerivedStruct struct { Astring *string \`json:"astring"\` // Deprecated. FirstOptional *[]*string \`json:"firstOptional"\` - AnotherRequired *string \`json:"anotherRequired"\` + AnotherRequired *time.Time \`json:"anotherRequired"\` Bool *bool \`json:"bool"\` // An example of a non primitive property. NonPrimitive DoubleTrouble \`json:"nonPrimitive"\` @@ -6056,7 +6059,7 @@ type DiamondBottom struct { Left *float64 \`json:"left"\` // Deprecated. Right *bool \`json:"right"\` - Bottom *string \`json:"bottom"\` + Bottom *time.Time \`json:"bottom"\` } type DiamondInheritanceBaseLevelStruct struct { @@ -7203,6 +7206,7 @@ func (j *jsiiProxy_IAnonymouslyImplementMe) Value() *float64 { type IAnotherPublicInterface interface { A() *string + SetA(a *string) } // The jsii proxy for IAnotherPublicInterface @@ -7287,6 +7291,8 @@ type IDeprecatedInterface interface { Method() // Deprecated: could be better MutableProperty() *float64 + // Deprecated: could be better + SetMutableProperty(m *float64) } // The jsii proxy for IDeprecatedInterface @@ -7326,6 +7332,8 @@ type IExperimentalInterface interface { Method() // Experimental. MutableProperty() *float64 + // Experimental. + SetMutableProperty(m *float64) } // The jsii proxy for IExperimentalInterface @@ -7362,6 +7370,7 @@ func (j *jsiiProxy_IExperimentalInterface) SetMutableProperty(val *float64) { type IExtendsPrivateInterface interface { MoreThings() *[]*string Private() *string + SetPrivate(p *string) } // The jsii proxy for IExtendsPrivateInterface @@ -7400,6 +7409,7 @@ func (j *jsiiProxy_IExtendsPrivateInterface) SetPrivate(val *string) { type IExternalInterface interface { Method() MutableProperty() *float64 + SetMutableProperty(m *float64) } // The jsii proxy for IExternalInterface @@ -7619,6 +7629,7 @@ func (i *jsiiProxy_IInterfaceWithOptionalMethodArguments) Hello(arg1 *string, ar type IInterfaceWithProperties interface { ReadOnlyString() *string ReadWriteString() *string + SetReadWriteString(r *string) } // The jsii proxy for IInterfaceWithProperties @@ -7657,6 +7668,7 @@ func (j *jsiiProxy_IInterfaceWithProperties) SetReadWriteString(val *string) { type IInterfaceWithPropertiesExtension interface { IInterfaceWithProperties Foo() *float64 + SetFoo(f *float64) } // The jsii proxy for IInterfaceWithPropertiesExtension @@ -7774,6 +7786,7 @@ type jsiiProxy_IJsii496 struct { type IMutableObjectLiteral interface { Value() *string + SetValue(v *string) } // The jsii proxy for IMutableObjectLiteral @@ -7802,7 +7815,9 @@ func (j *jsiiProxy_IMutableObjectLiteral) SetValue(val *string) { type INonInternalInterface interface { IAnotherPublicInterface B() *string + SetB(b *string) C() *string + SetC(c *string) } // The jsii proxy for INonInternalInterface @@ -7850,6 +7865,7 @@ func (j *jsiiProxy_INonInternalInterface) SetC(val *string) { type IObjectWithProperty interface { WasSet() *bool Property() *string + SetProperty(p *string) } // The jsii proxy for IObjectWithProperty @@ -8056,6 +8072,7 @@ func (j *jsiiProxy_IReturnsNumber) NumberProp() scopejsiicalclib.Number { type IStableInterface interface { Method() MutableProperty() *float64 + SetMutableProperty(m *float64) } // The jsii proxy for IStableInterface @@ -8373,7 +8390,7 @@ func (j *jsiiProxy_ImplementsPrivateInterface) SetPrivate(val *string) { type ImplictBaseOfBase struct { Foo scopejsiicalcbaseofbase.Very \`json:"foo"\` Bar *string \`json:"bar"\` - Goo *string \`json:"goo"\` + Goo *time.Time \`json:"goo"\` } type InbetweenClass interface { @@ -10772,7 +10789,7 @@ func (o *jsiiProxy_OptionalArgumentInvoker) InvokeWithoutOptional() { type OptionalConstructorArgument interface { Arg1() *float64 Arg2() *string - Arg3() *string + Arg3() *time.Time } // The jsii proxy struct for OptionalConstructorArgument @@ -10800,8 +10817,8 @@ func (j *jsiiProxy_OptionalConstructorArgument) Arg2() *string { return returns } -func (j *jsiiProxy_OptionalConstructorArgument) Arg3() *string { - var returns *string +func (j *jsiiProxy_OptionalConstructorArgument) Arg3() *time.Time { + var returns *time.Time _jsii_.Get( j, "arg3", @@ -10811,7 +10828,7 @@ func (j *jsiiProxy_OptionalConstructorArgument) Arg3() *string { } -func NewOptionalConstructorArgument(arg1 *float64, arg2 *string, arg3 *string) OptionalConstructorArgument { +func NewOptionalConstructorArgument(arg1 *float64, arg2 *string, arg3 *time.Time) OptionalConstructorArgument { _init_.Initialize() j := jsiiProxy_OptionalConstructorArgument{} @@ -10825,7 +10842,7 @@ func NewOptionalConstructorArgument(arg1 *float64, arg2 *string, arg3 *string) O return &j } -func NewOptionalConstructorArgument_Override(o OptionalConstructorArgument, arg1 *float64, arg2 *string, arg3 *string) { +func NewOptionalConstructorArgument_Override(o OptionalConstructorArgument, arg1 *float64, arg2 *string, arg3 *time.Time) { _init_.Initialize() _jsii_.Create( @@ -10899,6 +10916,7 @@ func NewOptionalStructConsumer_Override(o OptionalStructConsumer, optionalStruct type OverridableProtectedMember interface { OverrideReadOnly() *string OverrideReadWrite() *string + SetOverrideReadWrite(val *string) OverrideMe() *string SwitchModes() ValueFromProtected() *string @@ -11048,7 +11066,7 @@ type ParentStruct982 struct { } type PartiallyInitializedThisConsumer interface { - ConsumePartiallyInitializedThis(obj ConstructorPassesThisOut, dt *string, ev AllTypesEnum) *string + ConsumePartiallyInitializedThis(obj ConstructorPassesThisOut, dt *time.Time, ev AllTypesEnum) *string } // The jsii proxy struct for PartiallyInitializedThisConsumer @@ -11066,7 +11084,7 @@ func NewPartiallyInitializedThisConsumer_Override(p PartiallyInitializedThisCons ) } -func (p *jsiiProxy_PartiallyInitializedThisConsumer) ConsumePartiallyInitializedThis(obj ConstructorPassesThisOut, dt *string, ev AllTypesEnum) *string { +func (p *jsiiProxy_PartiallyInitializedThisConsumer) ConsumePartiallyInitializedThis(obj ConstructorPassesThisOut, dt *time.Time, ev AllTypesEnum) *string { var returns *string _jsii_.Invoke( @@ -11868,9 +11886,9 @@ func RootStructValidator_Validate(struct_ *RootStruct) { } type RuntimeTypeChecking interface { - MethodWithDefaultedArguments(arg1 *float64, arg2 *string, arg3 *string) + MethodWithDefaultedArguments(arg1 *float64, arg2 *string, arg3 *time.Time) MethodWithOptionalAnyArgument(arg interface{}) - MethodWithOptionalArguments(arg1 *float64, arg2 *string, arg3 *string) + MethodWithOptionalArguments(arg1 *float64, arg2 *string, arg3 *time.Time) } // The jsii proxy struct for RuntimeTypeChecking @@ -11902,7 +11920,7 @@ func NewRuntimeTypeChecking_Override(r RuntimeTypeChecking) { ) } -func (r *jsiiProxy_RuntimeTypeChecking) MethodWithDefaultedArguments(arg1 *float64, arg2 *string, arg3 *string) { +func (r *jsiiProxy_RuntimeTypeChecking) MethodWithDefaultedArguments(arg1 *float64, arg2 *string, arg3 *time.Time) { _jsii_.InvokeVoid( r, "methodWithDefaultedArguments", @@ -11919,7 +11937,7 @@ func (r *jsiiProxy_RuntimeTypeChecking) MethodWithOptionalAnyArgument(arg interf } // Used to verify verification of number of method arguments. -func (r *jsiiProxy_RuntimeTypeChecking) MethodWithOptionalArguments(arg1 *float64, arg2 *string, arg3 *string) { +func (r *jsiiProxy_RuntimeTypeChecking) MethodWithOptionalArguments(arg1 *float64, arg2 *string, arg3 *time.Time) { _jsii_.InvokeVoid( r, "methodWithOptionalArguments", diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap index 9b29fb48f5..6ee91b0691 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap @@ -1566,7 +1566,7 @@ class MyFirstStruct: *, anumber: jsii.Number, astring: builtins.str, - first_optional: typing.Optional[typing.List[builtins.str]] = None, + first_optional: typing.Optional[typing.Sequence[builtins.str]] = None, ) -> None: '''(deprecated) This is the first struct we have created in jsii. @@ -3309,7 +3309,7 @@ class ClassWithCollections( def __init__( self, map: typing.Mapping[builtins.str, builtins.str], - array: typing.List[builtins.str], + array: typing.Sequence[builtins.str], ) -> None: ''' :param map: - @@ -3466,7 +3466,7 @@ class ConfusingToJacksonStruct: def __init__( self, *, - union_property: typing.Optional[typing.Union[scope.jsii_calc_lib.IFriendly, typing.List[typing.Union[scope.jsii_calc_lib.IFriendly, "AbstractClass"]]]] = None, + union_property: typing.Optional[typing.Union[scope.jsii_calc_lib.IFriendly, typing.Sequence[typing.Union[scope.jsii_calc_lib.IFriendly, "AbstractClass"]]]] = None, ) -> None: ''' :param union_property: @@ -3704,7 +3704,7 @@ class DataRenderer(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DataRenderer"): *, anumber: jsii.Number, astring: builtins.str, - first_optional: typing.Optional[typing.List[builtins.str]] = None, + first_optional: typing.Optional[typing.Sequence[builtins.str]] = None, ) -> builtins.str: ''' :param anumber: (deprecated) An awesome number value. @@ -3945,13 +3945,13 @@ class DerivedStruct(scope.jsii_calc_lib.MyFirstStruct): *, anumber: jsii.Number, astring: builtins.str, - first_optional: typing.Optional[typing.List[builtins.str]] = None, + first_optional: typing.Optional[typing.Sequence[builtins.str]] = None, another_required: datetime.datetime, bool: builtins.bool, non_primitive: "DoubleTrouble", another_optional: typing.Optional[typing.Mapping[builtins.str, scope.jsii_calc_lib.NumericValue]] = None, optional_any: typing.Any = None, - optional_array: typing.Optional[typing.List[builtins.str]] = None, + optional_array: typing.Optional[typing.Sequence[builtins.str]] = None, ) -> None: '''A struct which derives from another struct. @@ -4948,10 +4948,10 @@ class GiveMeStructs(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.GiveMeStructs" non_primitive: "DoubleTrouble", another_optional: typing.Optional[typing.Mapping[builtins.str, scope.jsii_calc_lib.NumericValue]] = None, optional_any: typing.Any = None, - optional_array: typing.Optional[typing.List[builtins.str]] = None, + optional_array: typing.Optional[typing.Sequence[builtins.str]] = None, anumber: jsii.Number, astring: builtins.str, - first_optional: typing.Optional[typing.List[builtins.str]] = None, + first_optional: typing.Optional[typing.Sequence[builtins.str]] = None, ) -> scope.jsii_calc_lib.MyFirstStruct: '''Accepts a struct of type DerivedStruct and returns a struct of type FirstStruct. @@ -4988,10 +4988,10 @@ class GiveMeStructs(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.GiveMeStructs" non_primitive: "DoubleTrouble", another_optional: typing.Optional[typing.Mapping[builtins.str, scope.jsii_calc_lib.NumericValue]] = None, optional_any: typing.Any = None, - optional_array: typing.Optional[typing.List[builtins.str]] = None, + optional_array: typing.Optional[typing.Sequence[builtins.str]] = None, anumber: jsii.Number, astring: builtins.str, - first_optional: typing.Optional[typing.List[builtins.str]] = None, + first_optional: typing.Optional[typing.Sequence[builtins.str]] = None, ) -> "DoubleTrouble": '''Returns the boolean from a DerivedStruct struct. @@ -5025,7 +5025,7 @@ class GiveMeStructs(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.GiveMeStructs" *, anumber: jsii.Number, astring: builtins.str, - first_optional: typing.Optional[typing.List[builtins.str]] = None, + first_optional: typing.Optional[typing.Sequence[builtins.str]] = None, ) -> jsii.Number: '''Returns the "anumber" from a MyFirstStruct struct; @@ -7173,7 +7173,7 @@ class NullShouldBeTreatedAsUndefined( def give_me_undefined_inside_an_object( self, *, - array_with_three_elements_and_undefined_as_second_argument: typing.List[typing.Any], + array_with_three_elements_and_undefined_as_second_argument: typing.Sequence[typing.Any], this_should_be_undefined: typing.Any = None, ) -> None: ''' @@ -7213,7 +7213,7 @@ class NullShouldBeTreatedAsUndefinedData: def __init__( self, *, - array_with_three_elements_and_undefined_as_second_argument: typing.List[typing.Any], + array_with_three_elements_and_undefined_as_second_argument: typing.Sequence[typing.Any], this_should_be_undefined: typing.Any = None, ) -> None: ''' @@ -7293,7 +7293,7 @@ class ObjectRefsInCollections( @jsii.member(jsii_name="sumFromArray") def sum_from_array( self, - values: typing.List[scope.jsii_calc_lib.NumericValue], + values: typing.Sequence[scope.jsii_calc_lib.NumericValue], ) -> jsii.Number: '''Returns the sum of all values. @@ -10589,6 +10589,7 @@ import typing_extensions from .._jsii import * +__all__: List[typing.Any] = [] publication.publish() @@ -10629,7 +10630,7 @@ class MyClass( return typing.cast(None, jsii.invoke(self, "bar", [_bar])) @jsii.member(jsii_name="foo") - def foo(self, _values: typing.List[scope.jsii_calc_lib.Number]) -> None: + def foo(self, _values: typing.Sequence[scope.jsii_calc_lib.Number]) -> None: ''' :param _values: - ''' @@ -10749,7 +10750,7 @@ class MyStruct: self, *, base_map: typing.Mapping[builtins.str, scope.jsii_calc_base.BaseProps], - numbers: typing.List[scope.jsii_calc_lib.Number], + numbers: typing.Sequence[scope.jsii_calc_lib.Number], ) -> None: ''' :param base_map: @@ -10805,6 +10806,7 @@ import typing_extensions from .._jsii import * +__all__: List[typing.Any] = [] publication.publish() @@ -11161,6 +11163,7 @@ import typing_extensions from .._jsii import * +__all__: List[typing.Any] = [] publication.publish() diff --git a/packages/jsii-pacmak/test/generated-code/harness.ts b/packages/jsii-pacmak/test/generated-code/harness.ts index 1359ddc615..1aec8536dd 100644 --- a/packages/jsii-pacmak/test/generated-code/harness.ts +++ b/packages/jsii-pacmak/test/generated-code/harness.ts @@ -67,7 +67,7 @@ export function verifyGeneratedCodeFor( expect({ [TREE]: checkTree(outDir) }).toMatchSnapshot('/'); - if (targetName !== TargetName.PYTHON) { + if (targetName !== TargetName.PYTHON || process.env.SKIP_MYPY_CHECK) { return Promise.resolve(); } return runMypy(path.join(outDir, targetName)); diff --git a/packages/jsii-reflect/package.json b/packages/jsii-reflect/package.json index ac562886b2..3aaec8cdbd 100644 --- a/packages/jsii-reflect/package.json +++ b/packages/jsii-reflect/package.json @@ -43,10 +43,10 @@ "devDependencies": { "@scope/jsii-calc-lib": "^0.0.0", "@types/fs-extra": "^8.1.1", - "@types/jest": "^26.0.20", - "@types/node": "^10.17.55", - "@types/yargs": "^16.0.0", - "eslint": "^7.22.0", + "@types/jest": "^26.0.22", + "@types/node": "^10.17.56", + "@types/yargs": "^16.0.1", + "eslint": "^7.23.0", "jest": "^26.6.3", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", diff --git a/packages/jsii-rosetta/lib/jsii/assemblies.ts b/packages/jsii-rosetta/lib/jsii/assemblies.ts index 7221a8772e..0f3ab7545a 100644 --- a/packages/jsii-rosetta/lib/jsii/assemblies.ts +++ b/packages/jsii-rosetta/lib/jsii/assemblies.ts @@ -68,6 +68,18 @@ export function allSnippetSources( }); } + for (const [submoduleFqn, submodule] of Object.entries( + assembly.submodules ?? {}, + )) { + if (submodule.readme) { + ret.push({ + type: 'markdown', + markdown: submodule.readme.markdown, + where: removeSlashes(`${submoduleFqn}-README`), + }); + } + } + if (assembly.types) { Object.values(assembly.types).forEach((type) => { emitDocs(type.docs, `${assembly.name}.${type.name}`); diff --git a/packages/jsii-rosetta/package.json b/packages/jsii-rosetta/package.json index 17c338bbdb..7bcca21fa1 100644 --- a/packages/jsii-rosetta/package.json +++ b/packages/jsii-rosetta/package.json @@ -18,11 +18,11 @@ "devDependencies": { "@types/commonmark": "^0.27.4", "@types/fs-extra": "^8.1.1", - "@types/jest": "^26.0.20", + "@types/jest": "^26.0.22", "@types/mock-fs": "^4.13.0", - "@types/node": "^10.17.55", - "@types/yargs": "^16.0.0", - "eslint": "^7.22.0", + "@types/node": "^10.17.56", + "@types/yargs": "^16.0.1", + "eslint": "^7.23.0", "jest": "^26.6.3", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", diff --git a/packages/jsii-rosetta/test/jsii/assemblies.test.ts b/packages/jsii-rosetta/test/jsii/assemblies.test.ts index 4cfd0d2983..0e5d67d1e3 100644 --- a/packages/jsii-rosetta/test/jsii/assemblies.test.ts +++ b/packages/jsii-rosetta/test/jsii/assemblies.test.ts @@ -29,6 +29,33 @@ test('Extract snippet from README', () => { expect(snippets[0].visibleSource).toEqual('someExample();'); }); +test('Extract snippet from submodule READMEs', () => { + const snippets = Array.from( + allTypeScriptSnippets([ + { + assembly: fakeAssembly({ + submodules: { + 'my.submodule': { + readme: { + markdown: [ + 'Before the example.', + '```ts', + 'someExample();', + '```', + 'After the example.', + ].join('\n'), + }, + }, + }, + }), + directory: path.join(__dirname, 'fixtures'), + }, + ]), + ); + + expect(snippets[0].visibleSource).toEqual('someExample();'); +}); + test('Extract snippet from type docstring', () => { const snippets = Array.from( allTypeScriptSnippets([ diff --git a/packages/jsii/package.json b/packages/jsii/package.json index a1d093eca5..197ff1dccf 100644 --- a/packages/jsii/package.json +++ b/packages/jsii/package.json @@ -40,7 +40,7 @@ "deep-equal": "^2.0.5", "fs-extra": "^9.1.0", "log4js": "^6.3.0", - "semver": "^7.3.4", + "semver": "^7.3.5", "semver-intersect": "^1.4.0", "sort-json": "^2.0.0", "spdx-license-list": "^6.4.0", @@ -51,13 +51,13 @@ "@types/clone": "^2.1.0", "@types/deep-equal": "^1.0.1", "@types/fs-extra": "^8.1.1", - "@types/jest": "^26.0.20", + "@types/jest": "^26.0.22", "@types/jest-expect-message": "^1.0.3", - "@types/node": "^10.17.55", + "@types/node": "^10.17.56", "@types/semver": "^7.3.4", - "@types/yargs": "^16.0.0", + "@types/yargs": "^16.0.1", "clone": "^2.1.2", - "eslint": "^7.22.0", + "eslint": "^7.23.0", "jest": "^26.6.3", "jest-expect-message": "^1.0.2", "jsii-build-tools": "^0.0.0", diff --git a/packages/oo-ascii-tree/package.json b/packages/oo-ascii-tree/package.json index a8b120159e..d48aff54be 100644 --- a/packages/oo-ascii-tree/package.json +++ b/packages/oo-ascii-tree/package.json @@ -31,9 +31,9 @@ "package": "package-js" }, "devDependencies": { - "@types/jest": "^26.0.20", - "@types/node": "^10.17.55", - "eslint": "^7.22.0", + "@types/jest": "^26.0.22", + "@types/node": "^10.17.56", + "eslint": "^7.23.0", "jest": "^26.6.3", "jsii-build-tools": "^0.0.0", "prettier": "^2.2.1", diff --git a/superchain/Dockerfile b/superchain/Dockerfile index b5ed29d600..88eab6dbf1 100644 --- a/superchain/Dockerfile +++ b/superchain/Dockerfile @@ -83,29 +83,20 @@ RUN amazon-linux-extras install docker && yum clean all && rm -rf /var/cache/yum VOLUME /var/lib/docker -# Install Node using NVM (Node Version Manager) so we can have multiple Node versions installed and easily switch -# between them. $NVM_USE_VERSION becomes a global variable the container responds to to pick a Node version on startup, -# if set. -ENV NVM_DIR /usr/local/nvm - -RUN mkdir -p $NVM_DIR && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash - \ - && echo 'source "$NVM_DIR/nvm.sh"' >> $HOME/.bash_profile \ - && echo '[[ -z "$NVM_USE_VERSION" ]] || nvm use "$NVM_USE_VERSION"' >> $HOME/.bash_profile - -# Because we wrote things to .bash_profile, make the default shell a login shell so it gets sourced. -# Also set BASH_ENV to make bash source this EVEN if it's not a login shell (later on when the container -# gets executed) -SHELL [ "/bin/bash", "--login", "-c" ] -ENV BASH_ENV /root/.bash_profile - -# Source NVM into this shell and install Node 10 and 14. First installed version (10) becomes default. -RUN nvm install 10 \ - && nvm install 14 \ +# Install Node 10+ (configurable with '--build-arg NODE_MAJOR_VERSION=xxx') +# (Put this as late as possible in the Dockerfile so we get to reuse the layer cache +# for most of the multiple builds). +ARG NODE_MAJOR_VERSION=10 + +RUN curl -sL https://rpm.nodesource.com/setup_${NODE_MAJOR_VERSION}.x | bash - \ + && yum -y install nodejs \ + && yum clean all && rm -rf /var/cache/yum \ && npm set unsafe-perm true -# Can't install Yarn using yum anymore now that we're using nvm, so install it using NPM -RUN nvm exec 10 npm install -g yarn \ - && nvm exec 14 npm install -g yarn +# Install Yarn +RUN curl -sSL https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo \ + && yum -y install yarn \ + && yum clean all && rm -rf /var/cache/yum # Install some configuration COPY ssh_config /root/.ssh/config @@ -126,4 +117,4 @@ LABEL org.opencontainers.image.created=${BUILD_TIMESTAMP} org.opencontainers.image.revision=$COMMIT_ID \ org.opencontainers.image.authors="Amazon Web Services (https://aws.amazon.com)" -CMD ["/bin/bash", "--login"] +CMD ["/bin/bash"] diff --git a/superchain/README.md b/superchain/README.md index 97c74b1fa0..cc3e1caaa2 100644 --- a/superchain/README.md +++ b/superchain/README.md @@ -13,19 +13,29 @@ SDK | Version `OpenJDK 8` | Amazon Corretto `>= 8.242.08.1` `.NET SDK` | `>= 3.1.101` `mono` | `>= 6.8.0.105` -`Javascript` | `node >= 10.19.0` with `npm >= 6.13.4` - | `node >= 14.24.0` with `npm >= 6.13.4` - | (both managed via NVM) +`Javascript` | `node >= 10.19.0` OR `node >= 14.16.0` with `npm >= 6.14.11` (see [NodeJS and NPM](#nodejs-and-npm)) `PowerShell` | `pwsh >= 6.2.3` `Python 3` | `python3 >= 3.7.4` with `pip3 >= 20.0.2` `Go` | `go >= 1.16` -### Notes on Node.js +## NodeJS and NPM -You *must* use `bash` (not `sh`) to run commands in this container. +We build multiple versions of this image, for different versions of Node. They are available as: -By default, Node.js will be at version 10. To switch to Node 14, -pass `-e NVM_USE_VERSION=14` into the container at startup. +* `jsii/superchain:node10[-nightly]` +* `jsii/superchain:node14[-nightly]` + +The following labels are also available, and are aliases for the Node 10 images: + +* `jsii/superchain:nightly` +* `jsii/superchain:latest` + +If you are building this image from source, you can control the Node version with the +`NODE_MAJOR_VERSION` build argument: + +``` +docker build [...] --build-arg NODE_MAJOR_VERSION=14 . +``` ## Included Tools & Utilities diff --git a/superchain/build-local.sh b/superchain/build-local.sh index f415c6235b..c050121d4f 100755 --- a/superchain/build-local.sh +++ b/superchain/build-local.sh @@ -24,5 +24,6 @@ docker build --pull \ --build-arg BUILD_TIMESTAMP=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \ --build-arg COMMIT_ID=${COMMIT_ID} \ + --build-arg NODE_MAJOR_VERSION=10 \ -t "jsii/superchain:local" \ . diff --git a/tools/jsii-compliance/package.json b/tools/jsii-compliance/package.json index 2ebfb6acba..c966f55049 100644 --- a/tools/jsii-compliance/package.json +++ b/tools/jsii-compliance/package.json @@ -16,8 +16,8 @@ "tablemark": "^2.0.0" }, "devDependencies": { - "@types/node": "^10.17.55", - "eslint": "^7.22.0", + "@types/node": "^10.17.56", + "eslint": "^7.23.0", "prettier": "^2.2.1", "ts-node": "^9.1.1", "typescript": "~3.9.9" diff --git a/yarn.lock b/yarn.lock index 98e4f3bf18..58705523f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,34 +16,33 @@ dependencies: "@babel/highlight" "^7.12.13" -"@babel/compat-data@^7.13.8": - version "7.13.11" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.11.tgz#9c8fe523c206979c9a81b1e12fe50c1254f1aa35" - integrity sha512-BwKEkO+2a67DcFeS3RLl0Z3Gs2OvdXewuWjc1Hfokhb5eQWP9YRYH1/+VrVZvql2CfjOiNGqSAFOYt4lsqTHzg== +"@babel/compat-data@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.12.tgz#a8a5ccac19c200f9dd49624cac6e19d7be1236a1" + integrity sha512-3eJJ841uKxeV8dcN/2yGEUy+RfgQspPEgQat85umsE1rotuquQ2AbIub4S6j7c50a2d+4myc+zSlnXeIHrOnhQ== "@babel/core@^7.1.0", "@babel/core@^7.7.5": - version "7.13.10" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.10.tgz#07de050bbd8193fcd8a3c27918c0890613a94559" - integrity sha512-bfIYcT0BdKeAZrovpMqX2Mx5NrgAckGbwT982AkdS5GNfn3KMGiprlBAtmBcFZRUmpaufS6WZFP8trvx8ptFDw== + version "7.13.14" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.14.tgz#8e46ebbaca460a63497c797e574038ab04ae6d06" + integrity sha512-wZso/vyF4ki0l0znlgM4inxbdrUvCb+cVz8grxDq+6C9k6qbqoIJteQOKicaKjCipU3ISV+XedCqpL2RJJVehA== dependencies: "@babel/code-frame" "^7.12.13" "@babel/generator" "^7.13.9" - "@babel/helper-compilation-targets" "^7.13.10" - "@babel/helper-module-transforms" "^7.13.0" + "@babel/helper-compilation-targets" "^7.13.13" + "@babel/helper-module-transforms" "^7.13.14" "@babel/helpers" "^7.13.10" - "@babel/parser" "^7.13.10" + "@babel/parser" "^7.13.13" "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.0" - "@babel/types" "^7.13.0" + "@babel/traverse" "^7.13.13" + "@babel/types" "^7.13.14" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.1.2" - lodash "^4.17.19" semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.13.0", "@babel/generator@^7.13.9": +"@babel/generator@^7.13.9": version "7.13.9" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.13.9.tgz#3a7aa96f9efb8e2be42d38d80e2ceb4c64d8de39" integrity sha512-mHOOmY0Axl/JCTkxTU6Lf5sWOg/v8nUa+Xkt4zMTftX0wqmb6Sh7J8gvcehBw7q0AhrhAR+FDacKjCZ2X8K+Sw== @@ -52,12 +51,12 @@ jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-compilation-targets@^7.13.10": - version "7.13.10" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.10.tgz#1310a1678cb8427c07a753750da4f8ce442bdd0c" - integrity sha512-/Xju7Qg1GQO4mHZ/Kcs6Au7gfafgZnwm+a7sy/ow/tV1sHeraRUHbjdat8/UvDor4Tez+siGKDk6zIKtCPKVJA== +"@babel/helper-compilation-targets@^7.13.13": + version "7.13.13" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.13.tgz#2b2972a0926474853f41e4adbc69338f520600e5" + integrity sha512-q1kcdHNZehBwD9jYPh3WyXcsFERi39X4I59I3NadciWtNDyZ6x+GboOxncFK0kXlKIv6BJm5acncehXWUjWQMQ== dependencies: - "@babel/compat-data" "^7.13.8" + "@babel/compat-data" "^7.13.12" "@babel/helper-validator-option" "^7.12.17" browserslist "^4.14.5" semver "^6.3.0" @@ -78,34 +77,33 @@ dependencies: "@babel/types" "^7.12.13" -"@babel/helper-member-expression-to-functions@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.0.tgz#6aa4bb678e0f8c22f58cdb79451d30494461b091" - integrity sha512-yvRf8Ivk62JwisqV1rFRMxiSMDGnN6KH1/mDMmIrij4jztpQNRoHqqMG3U6apYbGRPJpgPalhva9Yd06HlUxJQ== +"@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.0" + "@babel/types" "^7.13.12" -"@babel/helper-module-imports@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.12.13.tgz#ec67e4404f41750463e455cc3203f6a32e93fcb0" - integrity sha512-NGmfvRp9Rqxy0uHSSVP+SRIW1q31a7Ji10cLBcqSDUngGentY4FRiHOFZFE1CLU5eiL0oE8reH7Tg1y99TDM/g== +"@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.12.13" + "@babel/types" "^7.13.12" -"@babel/helper-module-transforms@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.13.0.tgz#42eb4bd8eea68bab46751212c357bfed8b40f6f1" - integrity sha512-Ls8/VBwH577+pw7Ku1QkUWIyRRNHpYlts7+qSqBBFCW3I8QteB9DxfcZ5YJpOwH6Ihe/wn8ch7fMGOP1OhEIvw== +"@babel/helper-module-transforms@^7.13.14": + version "7.13.14" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.13.14.tgz#e600652ba48ccb1641775413cb32cfa4e8b495ef" + integrity sha512-QuU/OJ0iAOSIatyVZmfqB0lbkVP0kDRiKj34xy+QNsnVZi/PA6BoSoreeqnxxa9EHFAIL0R9XOaAR/G9WlIy5g== dependencies: - "@babel/helper-module-imports" "^7.12.13" - "@babel/helper-replace-supers" "^7.13.0" - "@babel/helper-simple-access" "^7.12.13" + "@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.12.11" "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.0" - "@babel/types" "^7.13.0" - lodash "^4.17.19" + "@babel/traverse" "^7.13.13" + "@babel/types" "^7.13.14" "@babel/helper-optimise-call-expression@^7.12.13": version "7.12.13" @@ -119,22 +117,22 @@ 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.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.13.0.tgz#6034b7b51943094cb41627848cb219cb02be1d24" - integrity sha512-Segd5me1+Pz+rmN/NFBOplMbZG3SqRJOBlY+mA0SxAv6rjj7zJqr1AVr3SfzUVTLCv7ZLU5FycOM/SBGuLPbZw== +"@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.0" + "@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.0" + "@babel/types" "^7.13.12" -"@babel/helper-simple-access@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.12.13.tgz#8478bcc5cacf6aa1672b251c1d2dde5ccd61a6c4" - integrity sha512-0ski5dyYIHEfwpWGx5GPWhH35j342JaflmCeQmsPWcrOQDtCN6C1zKAVRFVbK53lPW2c9TsuLLSUDf0tIGJ5hA== +"@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.12.13" + "@babel/types" "^7.13.12" "@babel/helper-split-export-declaration@^7.12.13": version "7.12.13" @@ -171,10 +169,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.10": - version "7.13.11" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.11.tgz#f93ebfc99d21c1772afbbaa153f47e7ce2f50b88" - integrity sha512-PhuoqeHoO9fc4ffMEVk4qb/w/s2iOSWohvbHxLtxui0eBg3Lg5gN1U8wp1V1u61hOWkPQJJyJzGH6Y+grwkq8Q== +"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.13": + version "7.13.13" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.13.tgz#42f03862f4aed50461e543270916b47dd501f0df" + integrity sha512-OhsyMrqygfk5v8HmWwOzlYjJrtLaFhF34MrfG/Z73DgYCI6ojNUTUp2TYbtnjo8PegeJp12eamsNettCQjKjVw== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -276,25 +274,24 @@ "@babel/parser" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.13.0.tgz#6d95752475f86ee7ded06536de309a65fc8966cc" - integrity sha512-xys5xi5JEhzC3RzEmSGrs/b3pJW/o87SypZ+G/PhaE7uqVQNv/jlmVIBXuoh5atqQ434LfXV+sf23Oxj0bchJQ== +"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.13.13": + version "7.13.13" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.13.13.tgz#39aa9c21aab69f74d948a486dd28a2dbdbf5114d" + integrity sha512-CblEcwmXKR6eP43oQGG++0QMTtCjAsa3frUuzHoiIJWpaIIi8dwMyEFUJoXRLxagGqCK+jALRwIO+o3R9p/uUg== dependencies: "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.13.0" + "@babel/generator" "^7.13.9" "@babel/helper-function-name" "^7.12.13" "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/parser" "^7.13.0" - "@babel/types" "^7.13.0" + "@babel/parser" "^7.13.13" + "@babel/types" "^7.13.13" debug "^4.1.0" globals "^11.1.0" - lodash "^4.17.19" -"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.0.tgz#74424d2816f0171b4100f0ab34e9a374efdf7f80" - integrity sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA== +"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.13", "@babel/types@^7.13.14", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.13.14" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.14.tgz#c35a4abb15c7cd45a2746d78ab328e362cbace0d" + integrity sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ== dependencies: "@babel/helper-validator-identifier" "^7.12.11" lodash "^4.17.19" @@ -1282,9 +1279,9 @@ "@octokit/types" "^6.0.3" "@octokit/core@^3.2.3": - version "3.3.1" - resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.3.1.tgz#c6bb6ba171ad84a5f430853a98892cfe8f93d8cd" - integrity sha512-Dc5NNQOYjgZU5S1goN6A/E500yXOfDUFRGQB8/2Tl16AcfvS3H9PudyOe3ZNE/MaVyHPIfC0htReHMJb1tMrvw== + version "3.3.2" + resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.3.2.tgz#128377d0e05d8b548b26fc6622570220b103bc69" + integrity sha512-Jx83n4tuX/z7QtxnPsAKxXPzH3vANtKmlCB3W3vt18JbkEaBYm+C8dgAlA1FNtqNk3L21pxsKNbWkUQAhiV7ng== dependencies: "@octokit/auth-token" "^2.4.4" "@octokit/graphql" "^4.5.8" @@ -1312,10 +1309,10 @@ "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^5.3.2": - version "5.3.2" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-5.3.2.tgz#b8ac43c5c3d00aef61a34cf744e315110c78deb4" - integrity sha512-NxF1yfYOUO92rCx3dwvA2onF30Vdlg7YUkMVXkeptqpzA3tRLplThhFleV/UKWFgh7rpKu1yYRbvNDUtzSopKA== +"@octokit/openapi-types@^6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-6.0.0.tgz#7da8d7d5a72d3282c1a3ff9f951c8133a707480d" + integrity sha512-CnDdK7ivHkBtJYzWzZm7gEkanA7gKH6a09Eguz7flHw//GacPJLmkHA3f3N++MJmlxD1Fl+mB7B32EEpSCwztQ== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" @@ -1323,9 +1320,9 @@ integrity sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw== "@octokit/plugin-paginate-rest@^2.6.2": - version "2.13.2" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.13.2.tgz#7b8244a0dd7a31135ba2adc58a533213837bfe87" - integrity sha512-mjfBcla00UNS4EI/NN7toEbUM45ow3kk4go+LxsXAFLQodsrXcIZbftUhXTqi6ZKd+r6bcqMI+Lv4dshLtFjww== + version "2.13.3" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.13.3.tgz#f0f1792230805108762d87906fb02d573b9e070a" + integrity sha512-46lptzM9lTeSmIBt/sVP/FLSTPGx6DCzAdSX3PfeJ3mTf4h9sGC26WpaQzMEq/Z44cOcmx8VsOhO+uEgE3cjYg== dependencies: "@octokit/types" "^6.11.0" @@ -1334,12 +1331,12 @@ resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.3.tgz#70a62be213e1edc04bb8897ee48c311482f9700d" integrity sha512-4RFU4li238jMJAzLgAwkBAw+4Loile5haQMQr+uhFq27BmyJXcXSKvoQKqh0agsZEiUlW6iSv3FAgvmGkur7OQ== -"@octokit/plugin-rest-endpoint-methods@4.13.5": - version "4.13.5" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.13.5.tgz#ad76285b82fe05fbb4adf2774a9c887f3534a880" - integrity sha512-kYKcWkFm4Ldk8bZai2RVEP1z97k1C/Ay2FN9FNTBg7JIyKoiiJjks4OtT6cuKeZX39tqa+C3J9xeYc6G+6g8uQ== +"@octokit/plugin-rest-endpoint-methods@5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.0.0.tgz#cf2cdeb24ea829c31688216a5b165010b61f9a98" + integrity sha512-Jc7CLNUueIshXT+HWt6T+M0sySPjF32mSFQAK7UfAg8qGeRI6OM1GSBxDLwbXjkqy2NVdnqCedJcP1nC785JYg== dependencies: - "@octokit/types" "^6.12.2" + "@octokit/types" "^6.13.0" deprecation "^2.3.1" "@octokit/request-error@^2.0.0", "@octokit/request-error@^2.0.5": @@ -1365,22 +1362,22 @@ once "^1.4.0" universal-user-agent "^6.0.0" -"@octokit/rest@^18.1.0", "@octokit/rest@^18.3.5": - version "18.3.5" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.3.5.tgz#a89903d46e0b4273bd3234674ec2777a651d68ab" - integrity sha512-ZPeRms3WhWxQBEvoIh0zzf8xdU2FX0Capa7+lTca8YHmRsO3QNJzf1H3PcuKKsfgp91/xVDRtX91sTe1kexlbw== +"@octokit/rest@^18.1.0", "@octokit/rest@^18.5.2": + version "18.5.2" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.5.2.tgz#0369e554b7076e3749005147be94c661c7a5a74b" + integrity sha512-Kz03XYfKS0yYdi61BkL9/aJ0pP2A/WK5vF/syhu9/kY30J8He3P68hv9GRpn8bULFx2K0A9MEErn4v3QEdbZcw== dependencies: "@octokit/core" "^3.2.3" "@octokit/plugin-paginate-rest" "^2.6.2" "@octokit/plugin-request-log" "^1.0.2" - "@octokit/plugin-rest-endpoint-methods" "4.13.5" + "@octokit/plugin-rest-endpoint-methods" "5.0.0" -"@octokit/types@^6.0.3", "@octokit/types@^6.11.0", "@octokit/types@^6.12.2", "@octokit/types@^6.7.1": - version "6.12.2" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.12.2.tgz#5b44add079a478b8eb27d78cf384cc47e4411362" - integrity sha512-kCkiN8scbCmSq+gwdJV0iLgHc0O/GTPY1/cffo9kECu1MvatLPh9E+qFhfRIktKfHEA6ZYvv6S1B4Wnv3bi3pA== +"@octokit/types@^6.0.3", "@octokit/types@^6.11.0", "@octokit/types@^6.13.0", "@octokit/types@^6.7.1": + version "6.13.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.13.0.tgz#779e5b7566c8dde68f2f6273861dd2f0409480d0" + integrity sha512-W2J9qlVIU11jMwKHUp5/rbVUeErqelCsO5vW5PKNb7wAXQVUz87Rc+imjlEvpvbH8yUb+KHmv8NEjVZdsdpyxA== dependencies: - "@octokit/openapi-types" "^5.3.2" + "@octokit/openapi-types" "^6.0.0" "@sinonjs/commons@^1.7.0": version "1.8.2" @@ -1402,9 +1399,9 @@ integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": - version "7.1.13" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.13.tgz#bc6eea53975fdf163aff66c086522c6f293ae4cf" - integrity sha512-CC6amBNND16pTk4K3ZqKIaba6VGKAQs3gMjEY17FVd56oI/ZWt9OhS6riYiWv9s8ENbYUi7p8lgqb0QHQvUKQQ== + 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" @@ -1465,14 +1462,19 @@ "@types/estree" "*" "@types/eslint@*": - version "7.2.7" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.7.tgz#f7ef1cf0dceab0ae6f9a976a0a9af14ab1baca26" - integrity sha512-EHXbc1z2GoQRqHaAT7+grxlTJ3WE2YNeD6jlpPoRc83cCoThRY+NUWjCUZaYmk51OICkPXn2hhphcWcWXgNW0Q== + version "7.2.8" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.8.tgz#45cd802380fcc352e5680e1781d43c50916f12ee" + integrity sha512-RTKvBsfz0T8CKOGZMfuluDNyMFHnu5lvNr4hWEsQeHXH6FcmIDIozOyWMh36nLGMwVd5UFNXC2xztA8lln22MQ== dependencies: "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@^0.0.46": +"@types/estree@*": + version "0.0.47" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.47.tgz#d7a51db20f0650efec24cd04994f523d93172ed4" + integrity sha512-c5ciR06jK8u9BstrmJyO97m+klJrrhCf9u3rLu3DEAJBirxRqSCvDQoYKmxuYwQI5SZChAWu+tq9oVlGRuzPAg== + +"@types/estree@^0.0.46": version "0.0.46" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.46.tgz#0fb6bfbbeabd7a30880504993369c4bf1deab1fe" integrity sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg== @@ -1525,10 +1527,10 @@ dependencies: "@types/jest" "*" -"@types/jest@*", "@types/jest@^26.0.20": - version "26.0.20" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.20.tgz#cd2f2702ecf69e86b586e1f5223a60e454056307" - integrity sha512-9zi2Y+5USJRxd0FsahERhBwlcvFh6D2GLQnY2FH2BzK8J9s9omvNHIbvABwIluXa0fD8XVKMLTO0aOEuUfACAA== +"@types/jest@*", "@types/jest@^26.0.22": + version "26.0.22" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.22.tgz#8308a1debdf1b807aa47be2838acdcd91e88fbe6" + integrity sha512-eeWwWjlqxvBxc4oQdkueW5OF/gtfSceKk4OnOAGlUSwS/liBRtZppbJuz1YkgbrbfGOoeBHun9fOvXnjNwrSOw== dependencies: jest-diff "^26.0.0" pretty-format "^26.0.0" @@ -1544,9 +1546,9 @@ integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= "@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/minimist@^1.2.0": version "1.2.1" @@ -1568,14 +1570,14 @@ "@types/node" "*" "@types/node@*", "@types/node@^14.14.33": - version "14.14.35" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.35.tgz#42c953a4e2b18ab931f72477e7012172f4ffa313" - integrity sha512-Lt+wj8NVPx0zUmUwumiVXapmaLUcAk3yPuHCFVXras9k5VT9TdhJqKqGVUQCD60OTMCl0qxJ57OiTL0Mic3Iag== + version "14.14.37" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.37.tgz#a3dd8da4eb84a996c36e331df98d82abd76b516e" + integrity sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw== -"@types/node@^10.17.55": - version "10.17.55" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.55.tgz#a147f282edec679b894d4694edb5abeb595fecbd" - integrity sha512-koZJ89uLZufDvToeWO5BrC4CR4OUfHnUz2qoPs/daQH6qq3IN62QFxCTZ+bKaCE0xaoCAJYE4AXre8AbghCrhg== +"@types/node@^10.17.56": + version "10.17.56" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.56.tgz#010c9e047c3ff09ddcd11cbb6cf5912725cdc2b3" + integrity sha512-LuAa6t1t0Bfw4CuSR0UITsm1hP17YL+u82kfHGrHUWdhlBtH7sa7jGY5z7glGaIj/WDYDkRtgGd+KCjCzxBW1w== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -1644,20 +1646,20 @@ dependencies: "@types/yargs-parser" "*" -"@types/yargs@^16.0.0": - version "16.0.0" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.0.tgz#0e033b23452da5d61b6c44747612cb80ac528751" - integrity sha512-2nN6AGeMwe8+O6nO9ytQfbMQOJy65oi1yK2y/9oReR08DaXSGtMsrLyCM1ooKqfICpCx4oITaR4LkOmdzz41Ww== +"@types/yargs@^16.0.1": + version "16.0.1" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.1.tgz#5fc5d41f69762e00fbecbc8d4bf9dea47d8726f4" + integrity sha512-x4HABGLyzr5hKUzBC9dvjciOTm11WVH1NWonNjGgxapnTHu5SWUqyqn0zQ6Re0yQU0lsQ6ztLCoMAKDGZflyxA== dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^4.18.0": - version "4.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.18.0.tgz#50fbce93211b5b690895d20ebec6fe8db48af1f6" - integrity sha512-Lzkc/2+7EoH7+NjIWLS2lVuKKqbEmJhtXe3rmfA8cyiKnZm3IfLf51irnBcmow8Q/AptVV0XBZmBJKuUJTe6cQ== +"@typescript-eslint/eslint-plugin@^4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.20.0.tgz#9d8794bd99aad9153092ad13c96164e3082e9a92" + integrity sha512-sw+3HO5aehYqn5w177z2D82ZQlqHCwcKSMboueo7oE4KU9QiC0SAgfS/D4z9xXvpTc8Bt41Raa9fBR8T2tIhoQ== dependencies: - "@typescript-eslint/experimental-utils" "4.18.0" - "@typescript-eslint/scope-manager" "4.18.0" + "@typescript-eslint/experimental-utils" "4.20.0" + "@typescript-eslint/scope-manager" "4.20.0" debug "^4.1.1" functional-red-black-tree "^1.0.1" lodash "^4.17.15" @@ -1665,60 +1667,60 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@4.18.0": - version "4.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.18.0.tgz#ed6c955b940334132b17100d2917449b99a91314" - integrity sha512-92h723Kblt9JcT2RRY3QS2xefFKar4ZQFVs3GityOKWQYgtajxt/tuXIzL7sVCUlM1hgreiV5gkGYyBpdOwO6A== +"@typescript-eslint/experimental-utils@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.20.0.tgz#a8ab2d7b61924f99042b7d77372996d5f41dc44b" + integrity sha512-sQNlf6rjLq2yB5lELl3gOE7OuoA/6IVXJUJ+Vs7emrQMva14CkOwyQwD7CW+TkmOJ4Q/YGmoDLmbfFrpGmbKng== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/scope-manager" "4.18.0" - "@typescript-eslint/types" "4.18.0" - "@typescript-eslint/typescript-estree" "4.18.0" + "@typescript-eslint/scope-manager" "4.20.0" + "@typescript-eslint/types" "4.20.0" + "@typescript-eslint/typescript-estree" "4.20.0" eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@^4.18.0": - version "4.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.18.0.tgz#a211edb14a69fc5177054bec04c95b185b4dde21" - integrity sha512-W3z5S0ZbecwX3PhJEAnq4mnjK5JJXvXUDBYIYGoweCyWyuvAKfGHvzmpUzgB5L4cRBb+cTu9U/ro66dx7dIimA== +"@typescript-eslint/parser@^4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.20.0.tgz#8dd403c8b4258b99194972d9799e201b8d083bdd" + integrity sha512-m6vDtgL9EABdjMtKVw5rr6DdeMCH3OA1vFb0dAyuZSa3e5yw1YRzlwFnm9knma9Lz6b2GPvoNSa8vOXrqsaglA== dependencies: - "@typescript-eslint/scope-manager" "4.18.0" - "@typescript-eslint/types" "4.18.0" - "@typescript-eslint/typescript-estree" "4.18.0" + "@typescript-eslint/scope-manager" "4.20.0" + "@typescript-eslint/types" "4.20.0" + "@typescript-eslint/typescript-estree" "4.20.0" debug "^4.1.1" -"@typescript-eslint/scope-manager@4.18.0": - version "4.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.18.0.tgz#d75b55234c35d2ff6ac945758d6d9e53be84a427" - integrity sha512-olX4yN6rvHR2eyFOcb6E4vmhDPsfdMyfQ3qR+oQNkAv8emKKlfxTWUXU5Mqxs2Fwe3Pf1BoPvrwZtwngxDzYzQ== +"@typescript-eslint/scope-manager@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.20.0.tgz#953ecbf3b00845ece7be66246608be9d126d05ca" + integrity sha512-/zm6WR6iclD5HhGpcwl/GOYDTzrTHmvf8LLLkwKqqPKG6+KZt/CfSgPCiybshmck66M2L5fWSF/MKNuCwtKQSQ== dependencies: - "@typescript-eslint/types" "4.18.0" - "@typescript-eslint/visitor-keys" "4.18.0" + "@typescript-eslint/types" "4.20.0" + "@typescript-eslint/visitor-keys" "4.20.0" -"@typescript-eslint/types@4.18.0": - version "4.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.18.0.tgz#bebe323f81f2a7e2e320fac9415e60856267584a" - integrity sha512-/BRociARpj5E+9yQ7cwCF/SNOWwXJ3qhjurMuK2hIFUbr9vTuDeu476Zpu+ptxY2kSxUHDGLLKy+qGq2sOg37A== +"@typescript-eslint/types@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.20.0.tgz#c6cf5ef3c9b1c8f699a9bbdafb7a1da1ca781225" + integrity sha512-cYY+1PIjei1nk49JAPnH1VEnu7OYdWRdJhYI5wiKOUMhLTG1qsx5cQxCUTuwWCmQoyriadz3Ni8HZmGSofeC+w== -"@typescript-eslint/typescript-estree@4.18.0": - version "4.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.18.0.tgz#756d3e61da8c16ab99185532c44872f4cd5538cb" - integrity sha512-wt4xvF6vvJI7epz+rEqxmoNQ4ZADArGQO9gDU+cM0U5fdVv7N+IAuVoVAoZSOZxzGHBfvE3XQMLdy+scsqFfeg== +"@typescript-eslint/typescript-estree@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.20.0.tgz#8b3b08f85f18a8da5d88f65cb400f013e88ab7be" + integrity sha512-Knpp0reOd4ZsyoEJdW8i/sK3mtZ47Ls7ZHvD8WVABNx5Xnn7KhenMTRGegoyMTx6TiXlOVgMz9r0pDgXTEEIHA== dependencies: - "@typescript-eslint/types" "4.18.0" - "@typescript-eslint/visitor-keys" "4.18.0" + "@typescript-eslint/types" "4.20.0" + "@typescript-eslint/visitor-keys" "4.20.0" debug "^4.1.1" globby "^11.0.1" is-glob "^4.0.1" semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/visitor-keys@4.18.0": - version "4.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.18.0.tgz#4e6fe2a175ee33418318a029610845a81e2ff7b6" - integrity sha512-Q9t90JCvfYaN0OfFUgaLqByOfz8yPeTAdotn/XYNm5q9eHax90gzdb+RJ6E9T5s97Kv/UHWKERTmqA0jTKAEHw== +"@typescript-eslint/visitor-keys@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.20.0.tgz#1e84db034da13f208325e6bfc995c3b75f7dbd62" + integrity sha512-NXKRM3oOVQL8yNFDNCZuieRIwZ5UtjNLYtmMx2PacEAGmbaEYtGgVHUHVyZvU/0rYZcizdrWjDo+WBtRPSgq+A== dependencies: - "@typescript-eslint/types" "4.18.0" + "@typescript-eslint/types" "4.20.0" eslint-visitor-keys "^2.0.0" "@webassemblyjs/ast@1.11.0": @@ -1842,22 +1844,22 @@ "@webassemblyjs/ast" "1.11.0" "@xtuc/long" "4.2.2" -"@webpack-cli/configtest@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.0.1.tgz#241aecfbdc715eee96bed447ed402e12ec171935" - integrity sha512-B+4uBUYhpzDXmwuo3V9yBH6cISwxEI4J+NO5ggDaGEEHb0osY/R7MzeKc0bHURXQuZjMM4qD+bSJCKIuI3eNBQ== +"@webpack-cli/configtest@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.0.2.tgz#2a20812bfb3a2ebb0b27ee26a52eeb3e3f000836" + integrity sha512-3OBzV2fBGZ5TBfdW50cha1lHDVf9vlvRXnjpVbJBa20pSZQaSkMJZiwA8V2vD9ogyeXn8nU5s5A6mHyf5jhMzA== -"@webpack-cli/info@^1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.2.2.tgz#ef3c0cd947a1fa083e174a59cb74e0b6195c236c" - integrity sha512-5U9kUJHnwU+FhKH4PWGZuBC1hTEPYyxGSL5jjoBI96Gx8qcYJGOikpiIpFoTq8mmgX3im2zAo2wanv/alD74KQ== +"@webpack-cli/info@^1.2.3": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.2.3.tgz#ef819d10ace2976b6d134c7c823a3e79ee31a92c" + integrity sha512-lLek3/T7u40lTqzCGpC6CAbY6+vXhdhmwFRxZLMnRm6/sIF/7qMpT8MocXCRQfz0JAh63wpbXLMnsQ5162WS7Q== dependencies: envinfo "^7.7.3" -"@webpack-cli/serve@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.3.0.tgz#2730c770f5f1f132767c63dcaaa4ec28f8c56a6c" - integrity sha512-k2p2VrONcYVX1wRRrf0f3X2VGltLWcv+JzXRBDmvCxGlCeESx4OXw91TsWeKOkp784uNoVQo313vxJFHXPPwfw== +"@webpack-cli/serve@^1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.3.1.tgz#911d1b3ff4a843304b9c3bacf67bb34672418441" + integrity sha512-0qXvpeYO6vaNoRBI52/UsbcaBydJCggoBBnIo/ovQQdn6fug0BgwsjorV1hVS7fMqGVTZGcVxv8334gjmbj5hw== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -1910,7 +1912,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.0.4, acorn@^8.0.5: +acorn@^8.0.4, acorn@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.1.0.tgz#52311fd7037ae119cbb134309e901aa46295b3fe" integrity sha512-LWCF/Wn0nfHOmJ9rzQApGnxnvgfROzGilS8936rqN/lfcYkY9MYZzdMqN+2NJ4SlTc+m5HiSa+kNfDtI64dwUA== @@ -1959,10 +1961,10 @@ ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^7.0.2: - version "7.2.1" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.2.1.tgz#a5ac226171912447683524fa2f1248fcf8bac83d" - integrity sha512-+nu0HDv7kNSOua9apAVc979qd932rrZeb3WOvoiD31A/p1mIE5/9bN2027pE2rOPYEdS3UHzsvof4hY+lM9/WQ== +ajv@^8.0.1: + version "8.0.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.0.2.tgz#1396e27f208ed56dd5638ab5a251edeb1c91d402" + integrity sha512-V0HGxJd0PiDF0ecHYIesTOqfd1gJguwQUOYfMfAWnRsWQEXfc5ifbUFhD3Wjc+O+y7VAqL+g07prq9gHQ/JOZQ== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -1991,11 +1993,11 @@ ansi-colors@^4.1.1: 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@^2.0.0: version "2.1.1" @@ -2384,9 +2386,9 @@ byte-size@^7.0.0: integrity sha512-crQdqyCwhokxwV1UyDzLZanhkugAgft7vt0qbbdt60C6Zf3CAiGmtUCylbtYwrU6loOUw3euGrNtW1J651ot1A== cacache@^15.0.5: - version "15.0.5" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.0.5.tgz#69162833da29170d6732334643c60e005f5f17d0" - integrity sha512-lloiL22n7sOjEEXdL8NAjTgv9a1u43xICE9/203qonkZUCj5X1UEWIdf2/Y0d6QcCtMzbKQyhrcDbdvlZTs/+A== + version "15.0.6" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.0.6.tgz#65a8c580fda15b59150fb76bf3f3a8e45d583099" + integrity sha512-g1WYDMct/jzW+JdWEyjaX2zoBkZ6ZT9VpOyp2I/VMtDsNLffNat3kqPFfi1eDRSK9/SuKGyORDHcQMcPF8sQ/w== dependencies: "@npmcli/move-file" "^1.0.1" chownr "^2.0.0" @@ -2402,7 +2404,7 @@ cacache@^15.0.5: p-map "^4.0.0" promise-inflight "^1.0.1" rimraf "^3.0.2" - ssri "^8.0.0" + ssri "^8.0.1" tar "^6.0.2" unique-filename "^1.1.1" @@ -2467,9 +2469,9 @@ camelcase@^6.0.0, camelcase@^6.2.0: integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== caniuse-lite@^1.0.30001181: - version "1.0.30001202" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001202.tgz#4cb3bd5e8a808e8cd89e4e66c549989bc8137201" - integrity sha512-ZcijQNqrcF8JNLjzvEiXqX4JUYxoZa7Pvcsd9UD8Kz4TvhTonOSNRsK+qtvpVL4l6+T1Rh4LFtLfnNWg6BGWCQ== + version "1.0.30001205" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001205.tgz#d79bf6a6fb13196b4bb46e5143a22ca0242e0ef8" + integrity sha512-TL1GrS5V6LElbitPazidkBMD9sa448bQDDLrumDqaggmKFcuU2JW1wTOHJPukAcOMtEmLcmDJEzfRrf+GjM0Og== capture-exit@^2.0.0: version "2.0.0" @@ -2691,9 +2693,9 @@ commander@^2.20.0: integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== commander@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.1.0.tgz#f2eaecf131f10e36e07d894698226e36ae0eb5ff" - integrity sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg== + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== commonmark@^0.29.3: version "0.29.3" @@ -3287,9 +3289,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" electron-to-chromium@^1.3.649: - version "1.3.690" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.690.tgz#54df63ec42fba6b8e9e05fe4be52caeeedb6e634" - integrity sha512-zPbaSv1c8LUKqQ+scNxJKv01RYFkVVF1xli+b+3Ty8ONujHjAMg+t/COmdZqrtnS1gT+g4hbSodHillymt1Lww== + version "1.3.703" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.703.tgz#6d9b9a75c42a40775f5930329e642b22b227317f" + integrity sha512-SVBVhNB+4zPL+rvtWLw7PZQkw/Eqj1HQZs22xtcqW36+xoifzEOEEDEpkxSMfB6RFeSIOcG00w6z5mSqLr1Y6w== emittery@^0.7.1: version "0.7.2" @@ -3522,10 +3524,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.22.0: - version "7.22.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.22.0.tgz#07ecc61052fec63661a2cab6bd507127c07adc6f" - integrity sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg== +eslint@^7.23.0: + 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" @@ -3619,9 +3621,9 @@ events@^3.2.0: integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== 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" @@ -4164,16 +4166,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.7.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.7.0.tgz#aed3bcefd80ad3ec0f0be2cf0c895110c0591795" + integrity sha512-Aipsz6ZKRxa/xQkZhNg0qIWXT6x6rD46f6x/PCnBomlttdIyAPak4YD9jTmKpZ72uROSMU87qJtcgpgHaVchiA== dependencies: type-fest "^0.20.2" globby@^11.0.1, globby@^11.0.2: - version "11.0.2" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.2.tgz#1af538b766a3b540ebfb58a32b2e2d5897321d83" - integrity sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og== + version "11.0.3" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.3.tgz#9b1f0cb523e171dd1ad8c7b2a9fb4b644b9593cb" + integrity sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" @@ -4222,7 +4224,7 @@ hard-rejection@^2.1.0: resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== -has-bigints@^1.0.0: +has-bigints@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== @@ -4237,7 +4239,7 @@ 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-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2: +has-symbols@^1.0.1, has-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== @@ -4290,17 +4292,10 @@ hosted-git-info@^2.1.4: resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== -hosted-git-info@^3.0.6: - version "3.0.8" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-3.0.8.tgz#6e35d4cc87af2c5f816e4cb9ce350ba87a3f370d" - integrity sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw== - dependencies: - lru-cache "^6.0.0" - -hosted-git-info@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.0.0.tgz#9f06639a90beff66cacae6e77f8387b431d61ddc" - integrity sha512-fqhGdjk4av7mT9fU/B01dUtZ+WZSc/XEXMoLXDVZukiQRXxeHSSz3AqbeWRJHtF8EQYHlAgB1NSAHU0Cm7aqZA== +hosted-git-info@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.0.2.tgz#5e425507eede4fea846b7262f0838456c4209961" + integrity sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg== dependencies: lru-cache "^6.0.0" @@ -5312,12 +5307,12 @@ jsbn@~0.1.0: integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= jsdom@^16.4.0: - version "16.5.1" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.5.1.tgz#4ced6bbd7b77d67fb980e64d9e3e6fb900f97dd6" - integrity sha512-pF73EOsJgwZekbDHEY5VO/yKXUkab/DuvrQB/ANVizbr6UAHJsDdHXuotZYwkJSGQl1JM+ivXaqY+XBDDL4TiA== + version "16.5.2" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.5.2.tgz#583fac89a0aea31dbf6237e7e4bedccd9beab472" + integrity sha512-JxNtPt9C1ut85boCbJmffaQ06NBnzkQY/MWO3YxPW8IWS38A26z+B1oBvA9LwKrytewdfymnhi4UNH3/RAgZrg== dependencies: abab "^2.0.5" - acorn "^8.0.5" + acorn "^8.1.0" acorn-globals "^6.0.0" cssom "^0.4.4" cssstyle "^2.3.0" @@ -5339,7 +5334,7 @@ jsdom@^16.4.0: webidl-conversions "^6.1.0" whatwg-encoding "^1.0.5" whatwg-mimetype "^2.3.0" - whatwg-url "^8.0.0" + whatwg-url "^8.5.0" ws "^7.4.4" xml-name-validator "^3.0.0" @@ -5635,16 +5630,21 @@ lodash._reinterpolate@^3.0.0: resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= +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.flatten@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" + integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8= + lodash.ismatch@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" integrity sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc= -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.template@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" @@ -5660,7 +5660,12 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash@4.x, lodash@^4.11.2, lodash@^4.17.15, 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.x, lodash@^4.11.2, lodash@^4.17.15, 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== @@ -6168,13 +6173,13 @@ normalize-package-data@^2.0.0, normalize-package-data@^2.3.0, normalize-package- validate-npm-package-license "^3.0.1" normalize-package-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.1.tgz#98dc56dfe6755d99b1c53f046e1e3d2dde55a1c7" - integrity sha512-D/ttLdxo71msR4FF3VgSwK4blHfE3/vGByz1NCeE7/Dh8reQOKNJJjk5L10mLq9jxa+ZHzT1/HLgxljzbXE7Fw== + version "3.0.2" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.2.tgz#cae5c410ae2434f9a6c1baa65d5bc3b9366c8699" + integrity sha512-6CdZocmfGaKnIHPVFhJJZ3GuR8SsLKvDANFp47Jmy51aKIr8akjAWTSxtpI+MBgBFdSMRyo4hMpDlT6dTffgZg== dependencies: - hosted-git-info "^4.0.0" - resolve "^1.17.0" - semver "^7.3.2" + hosted-git-info "^4.0.1" + resolve "^1.20.0" + semver "^7.3.4" validate-npm-package-license "^3.0.1" normalize-path@^2.1.1: @@ -6227,19 +6232,19 @@ npm-normalize-package-bin@^1.0.0, npm-normalize-package-bin@^1.0.1: resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2" integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== -npm-package-arg@^8.0.0, npm-package-arg@^8.0.1, npm-package-arg@^8.1.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-8.1.1.tgz#00ebf16ac395c63318e67ce66780a06db6df1b04" - integrity sha512-CsP95FhWQDwNqiYS+Q0mZ7FAEDytDZAkNxQqea6IaAFJTAY9Lhhqyl0irU/6PMc7BGfUmnsbHcqxJD7XuVM/rg== +npm-package-arg@^8.0.0, npm-package-arg@^8.0.1, npm-package-arg@^8.1.0, npm-package-arg@^8.1.2: + version "8.1.2" + resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-8.1.2.tgz#b868016ae7de5619e729993fbd8d11dc3c52ab62" + integrity sha512-6Eem455JsSMJY6Kpd3EyWE+n5hC+g9bSyHr9K9U2zqZb7+02+hObQ2c0+8iDk/mNF+8r1MhY44WypKJAkySIYA== dependencies: - hosted-git-info "^3.0.6" - semver "^7.0.0" + hosted-git-info "^4.0.1" + semver "^7.3.4" validate-npm-package-name "^3.0.0" npm-packlist@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-2.1.4.tgz#40e96b2b43787d0546a574542d01e066640d09da" - integrity sha512-Qzg2pvXC9U4I4fLnUrBmcIT4x0woLtUgxUi9eC+Zrcv1Xx5eamytGAfbDWQ67j7xOcQ2VW1I3su9smVTIdu7Hw== + version "2.1.5" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-2.1.5.tgz#43ef5bbb9f59b7c0ef91e0905f1dd707b4cfb33c" + integrity sha512-KCfK3Vi2F+PH1klYauoQzg81GQ8/GGjQRKYY6tRnpQUPKTs/1gBZSRWtTEd7jGdSn1LZL7gpAmJT+BcS55k2XQ== dependencies: glob "^7.1.6" ignore-walk "^3.0.3" @@ -6247,13 +6252,14 @@ npm-packlist@^2.1.4: npm-normalize-package-bin "^1.0.1" npm-pick-manifest@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-6.1.0.tgz#2befed87b0fce956790f62d32afb56d7539c022a" - integrity sha512-ygs4k6f54ZxJXrzT0x34NybRlLeZ4+6nECAIbr2i0foTnijtS1TJiyzpqtuUAJOps/hO0tNDr8fRV5g+BtRlTw== + version "6.1.1" + resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-6.1.1.tgz#7b5484ca2c908565f43b7f27644f36bb816f5148" + integrity sha512-dBsdBtORT84S8V8UTad1WlUyKIY9iMsAmqxHbLdeEeBNMLQDlDWWra3wYUx9EBEIiG/YwAy0XyNHDd2goAsfuA== dependencies: npm-install-checks "^4.0.0" - npm-package-arg "^8.0.0" - semver "^7.0.0" + npm-normalize-package-bin "^1.0.1" + npm-package-arg "^8.1.2" + semver "^7.3.4" npm-registry-fetch@^9.0.0: version "9.0.0" @@ -6558,9 +6564,9 @@ p-waterfall@^2.1.1: p-reduce "^2.0.0" pacote@^11.2.6: - version "11.3.0" - resolved "https://registry.yarnpkg.com/pacote/-/pacote-11.3.0.tgz#b2e16791a39cd4d9fb9fc1ec240cefe7ea518e6f" - integrity sha512-cygprcGpEVqvDzpuPMkGVXW/ooc2ibpoosuJ4YHcUXozDs9VJP7Vha+41pYppG2MVNis4t1BB8IygIBh7vVr2Q== + version "11.3.1" + resolved "https://registry.yarnpkg.com/pacote/-/pacote-11.3.1.tgz#6ce95dd230db475cbd8789fd1f986bec51b4bf7c" + integrity sha512-TymtwoAG12cczsJIrwI/euOQKtjrQHlD0k0oyt9QSmZGpqa+KdlxKdWR/YUjYizkixaVyztxt/Wsfo8bL3A6Fg== dependencies: "@npmcli/git" "^2.0.1" "@npmcli/installed-package-contents" "^1.0.6" @@ -6891,9 +6897,11 @@ q@^1.5.1: integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= qs@^6.9.4: - version "6.9.6" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee" - integrity sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ== + version "6.10.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.1.tgz#4931482fa8d647a5aab799c5271d2133b981fb6a" + integrity sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg== + dependencies: + side-channel "^1.0.4" qs@~6.5.2: version "6.5.2" @@ -6911,9 +6919,9 @@ query-string@^6.13.8: strict-uri-encode "^2.0.0" queue-microtask@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.2.tgz#abf64491e6ecf0f38a6502403d4cda04f372dfd3" - integrity sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg== + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== quick-lru@^4.0.1: version "4.0.1" @@ -6928,9 +6936,9 @@ randombytes@^2.1.0: safe-buffer "^5.1.0" 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-cmd-shim@^2.0.0: version "2.0.0" @@ -7250,7 +7258,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.9.0: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.20.0, resolve@^1.9.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -7318,9 +7326,9 @@ run-parallel@^1.1.9: queue-microtask "^1.2.2" rxjs@^6.4.0, rxjs@^6.6.0: - version "6.6.6" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.6.tgz#14d8417aa5a07c5e633995b525e1e3c0dec03b70" - integrity sha512-/oTwee4N4iWzAMAL9xdGKjkEHmIwupR3oXbQjCKywF1BeFohswF3vZdogbmEF6pZkOsXTzWkrZszrWpQTByYVg== + version "6.6.7" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" + integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" @@ -7389,10 +7397,10 @@ semver-intersect@^1.4.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4: - version "7.3.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" - integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== +semver@7.x, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, 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== dependencies: lru-cache "^6.0.0" @@ -7476,7 +7484,7 @@ shellwords@^0.1.1: resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== -side-channel@^1.0.3: +side-channel@^1.0.3, side-channel@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== @@ -7977,12 +7985,17 @@ symbol-tree@^3.2.4: integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== table@^6.0.4: - version "6.0.7" - resolved "https://registry.yarnpkg.com/table/-/table-6.0.7.tgz#e45897ffbcc1bcf9e8a87bf420f2c9e5a7a52a34" - integrity sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g== + version "6.0.9" + resolved "https://registry.yarnpkg.com/table/-/table-6.0.9.tgz#790a12bf1e09b87b30e60419bafd6a1fd85536fb" + integrity sha512-F3cLs9a3hL1Z7N4+EkSscsel3z55XT950AvB05bwayrNg5T1/gykXtigioTAjbltvbMSJvvhFCbnf6mX+ntnJQ== dependencies: - ajv "^7.0.2" - lodash "^4.17.20" + ajv "^8.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + lodash.clonedeep "^4.5.0" + lodash.flatten "^4.4.0" + lodash.truncate "^4.4.2" slice-ansi "^4.0.0" string-width "^4.2.0" @@ -8061,9 +8074,9 @@ terser-webpack-plugin@^5.1.1: terser "^5.5.1" terser@^5.5.1: - version "5.6.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.6.0.tgz#138cdf21c5e3100b1b3ddfddf720962f88badcd2" - integrity sha512-vyqLMoqadC1uR0vywqOZzriDYzgEkNJFK4q9GeyOBHIbiECHiWLKcWfbQWAUaPfxkjDhapSlZB9f7fkMrvkVjA== + version "5.6.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.6.1.tgz#a48eeac5300c0a09b36854bf90d9c26fb201973c" + integrity sha512-yv9YLFQQ+3ZqgWCUk+pvNJwgUTdlIxUk1WTN+RnaFJe2L7ipG2csPT0ra2XRm7Cs8cxN7QXmK1rFzEwYEQkzXw== dependencies: commander "^2.20.0" source-map "~0.7.2" @@ -8282,11 +8295,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.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.18.0: version "0.18.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" @@ -8297,6 +8305,11 @@ type-fest@^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.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.4.1.tgz#8bdf77743385d8a4f13ba95f610f5ccd68c728f8" @@ -8348,9 +8361,9 @@ typescript@~3.9.9: integrity sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w== uglify-js@^3.1.4: - version "3.13.1" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.13.1.tgz#2749d4b8b5b7d67460b4a418023ff73c3fefa60a" - integrity sha512-EWhx3fHy3M9JbaeTnO+rEqzCe1wtyQClv6q3YWq0voOj4E+bMZBErVS1GAHPDiRGONYq34M1/d8KuQMgvi6Gjw== + version "3.13.3" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.13.3.tgz#ce72a1ad154348ea2af61f50933c76cc8802276e" + integrity sha512-otIc7O9LyxpUcQoXzj2hL4LPWKklO6LJWoJUzNa8A17Xgi4fOeDC8FBDOLHnC/Slo1CQgsZMcM6as0M76BZaig== uid-number@0.0.6: version "0.0.6" @@ -8363,14 +8376,14 @@ umask@^1.1.0: integrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0= unbox-primitive@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.0.tgz#eeacbc4affa28e9b3d36b5eaeccc50b3251b1d3f" - integrity sha512-P/51NX+JXyxK/aigg1/ZgyccdAxm5K1+n8+tvqSntjOivPt19gvm1VC49RWYetsiub8WViUchdxl/KWHHB0kzA== + version "1.0.1" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" + integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== dependencies: function-bind "^1.1.1" - has-bigints "^1.0.0" - has-symbols "^1.0.0" - which-boxed-primitive "^1.0.1" + has-bigints "^1.0.1" + has-symbols "^1.0.2" + which-boxed-primitive "^1.0.2" union-value@^1.0.0: version "1.0.1" @@ -8481,9 +8494,9 @@ v8-compile-cache@^2.0.3, v8-compile-cache@^2.2.0: integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== v8-to-istanbul@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-7.1.0.tgz#5b95cef45c0f83217ec79f8fc7ee1c8b486aee07" - integrity sha512-uXUVqNUCLa0AH1vuVxzi+MI4RfxEOKt9pBgKwHbgH7st8Kv2P1m+jvWNnektzBh5QShF3ODgKmUFCf38LnVz1g== + version "7.1.1" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-7.1.1.tgz#04bfd1026ba4577de5472df4f5e89af49de5edda" + integrity sha512-p0BB09E5FRjx0ELN6RgusIPsSPhtgexSRcKETybEs6IGOTXJSZqfwxp7r//55nnu0f1AxltY5VvdVqy2vZf9AA== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" @@ -8559,15 +8572,15 @@ webidl-conversions@^6.1.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== -webpack-cli@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.5.0.tgz#b5213b84adf6e1f5de6391334c9fa53a48850466" - integrity sha512-wXg/ef6Ibstl2f50mnkcHblRPN/P9J4Nlod5Hg9HGFgSeF8rsqDGHJeVe4aR26q9l62TUJi6vmvC2Qz96YJw1Q== +webpack-cli@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.6.0.tgz#27ae86bfaec0cf393fcfd58abdc5a229ad32fd16" + integrity sha512-9YV+qTcGMjQFiY7Nb1kmnupvb1x40lfpj8pwdO/bom+sQiP4OBMKjHq29YQrlDWDPZO9r/qWaRRywKaRDKqBTA== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.0.1" - "@webpack-cli/info" "^1.2.2" - "@webpack-cli/serve" "^1.3.0" + "@webpack-cli/configtest" "^1.0.2" + "@webpack-cli/info" "^1.2.3" + "@webpack-cli/serve" "^1.3.1" colorette "^1.2.1" commander "^7.0.0" enquirer "^2.3.6" @@ -8595,10 +8608,10 @@ webpack-sources@^2.1.1: source-list-map "^2.0.1" source-map "^0.6.1" -webpack@^5.26.3: - version "5.26.3" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.26.3.tgz#bafd439abac08fbb82657ec855d038743b725ab8" - integrity sha512-z/F2lt2N1fZqaud1B4SzjL3OW03eULThbBXQ2OX4LSrZX4N9k1A5d0Rje3zS2g887DTWyAV0KGqEf64ois2dhg== +webpack@^5.28.0: + version "5.28.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.28.0.tgz#0de8bcd706186b26da09d4d1e8cbd3e4025a7c2f" + integrity sha512-1xllYVmA4dIvRjHzwELgW4KjIU1fW4PEuEnjsylz7k7H5HgPOctIq7W1jrt3sKH9yG5d72//XWzsHhfoWvsQVg== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.46" @@ -8636,16 +8649,16 @@ 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, whatwg-url@^8.4.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.4.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" -which-boxed-primitive@^1.0.1: +which-boxed-primitive@^1.0.1, which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==