From 4f197e6ee6683e16f60a61ac2313ca1734dae05f Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Mon, 13 Jul 2020 15:05:37 -0700 Subject: [PATCH 01/21] configured testing yml --- .github/workflows/testhomebrewrelease.yml | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/testhomebrewrelease.yml diff --git a/.github/workflows/testhomebrewrelease.yml b/.github/workflows/testhomebrewrelease.yml new file mode 100644 index 0000000000..9393172348 --- /dev/null +++ b/.github/workflows/testhomebrewrelease.yml @@ -0,0 +1,24 @@ +name: test homebrew release + +env: + HOMEBREW_REPO: opticdev/homebrew-optic + +on: + push: + branches: + - feature/brew-release-flow + +jobs: + # Triggers Homebrew Release - Configure homebrew/core fork repository in the env settings above + # Requires Repository Access Token (https://github.com/peter-evans/repository-dispatch#token) with repo:write scope + test-trigger-brew-release: + needs: release-npm + runs-on: ubuntu-latest + steps: + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@v1.1.0 + with: + token: ${{ secrets.REPO_ACCESS_TOKEN }} + repository: ${{ env.HOMEBREW_REPO }} + event-type: version-update + client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' From 0d88e29bf45104bfac03405c510670dbdfbe7484 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Mon, 13 Jul 2020 15:06:36 -0700 Subject: [PATCH 02/21] adjusted to make sure there are no dependencies --- .github/workflows/testhomebrewrelease.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/testhomebrewrelease.yml b/.github/workflows/testhomebrewrelease.yml index 9393172348..4b836f94d9 100644 --- a/.github/workflows/testhomebrewrelease.yml +++ b/.github/workflows/testhomebrewrelease.yml @@ -12,7 +12,6 @@ jobs: # Triggers Homebrew Release - Configure homebrew/core fork repository in the env settings above # Requires Repository Access Token (https://github.com/peter-evans/repository-dispatch#token) with repo:write scope test-trigger-brew-release: - needs: release-npm runs-on: ubuntu-latest steps: - name: Repository Dispatch From f65bad2c0a709d1b68070de9aacc274ce4ef38bc Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Mon, 13 Jul 2020 15:32:30 -0700 Subject: [PATCH 03/21] added configuration for debian testing --- .github/deployDebian/Dockerfile | 20 +++++++++++++++++++ .github/deployDebian/action.yml | 18 +++++++++++++++++ .github/deployDebian/entrypoint.sh | 31 ++++++++++++++++++++++++++++++ .github/workflows/testDebian.yml | 21 ++++++++++++++++++++ workspaces/local-cli/package.json | 2 +- 5 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 .github/deployDebian/Dockerfile create mode 100644 .github/deployDebian/action.yml create mode 100755 .github/deployDebian/entrypoint.sh create mode 100644 .github/workflows/testDebian.yml diff --git a/.github/deployDebian/Dockerfile b/.github/deployDebian/Dockerfile new file mode 100644 index 0000000000..758c590a1a --- /dev/null +++ b/.github/deployDebian/Dockerfile @@ -0,0 +1,20 @@ +# Container image that runs your code +FROM node:latest + +# install basics + +# RUN apt update +# RUN apt-get install -y git default-jre sudo apt-utils apt-transport-https +# RUN npm install -g @oclif/dev-cli +# RUN "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list +# RUN curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add +# RUN apt update +# RUN apt-get install -y sbt +# RUN apt-get install ruby-full -y +# RUN gem install deb-s3 + +# Copies your code file from your action repository to the filesystem path `/` of the container +COPY entrypoint.sh /entrypoint.sh + +# Code file to execute when the docker container starts up (`entrypoint.sh`) +ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/deployDebian/action.yml b/.github/deployDebian/action.yml new file mode 100644 index 0000000000..a2cda85135 --- /dev/null +++ b/.github/deployDebian/action.yml @@ -0,0 +1,18 @@ +name: 'Build Optic' +description: 'Builds Optic' +inputs: + AWS_ACCESS_KEY_ID: + description: "AWS_ACCESS_KEY_ID" + required: true + AWS_SECRET_ACCESS_KEY: + description: "AWS_SECRET_ACCESS_KEY" + required: true + BUCKET_NAME: + description: "BUCKET_NAME" + required: true + PACKAGE_NAME: + description: "PACKAGE_NAME" + required: true +runs: + using: 'docker' + image: 'Dockerfile' diff --git a/.github/deployDebian/entrypoint.sh b/.github/deployDebian/entrypoint.sh new file mode 100755 index 0000000000..1ceff54732 --- /dev/null +++ b/.github/deployDebian/entrypoint.sh @@ -0,0 +1,31 @@ +#!/bin/bash +echo "Installing Essentials" +apt update +apt install -y git default-jre sudo apt-utils apt-transport-https +npm install -g @oclif/dev-cli +echo "Installing SBT for Scala" +echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list +curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add +apt update +apt install -y sbt +echo "Cloning Optic" +cd /tmp +git clone https://github.com/opticdev/optic +cd optic +echo "Checking out specific branch (eventually this will just be release)" +git checkout feature/debian-release-flow +export PATH_TO_DEB="/tmp/optic/workspaces/local-cli/dist/deb/api_$(npm view $INPUT_NPM_PACKAGE_NAME version)-1_amd64.deb" +echo $PATH_TO_DEB +echo "Building Optic" +source sourceme.sh +optic_build +echo "Packing Debian Release" +cd ./workspaces/local-cli +npm install +oclif-dev pack:deb +echo "Installing Ruby" +apt install ruby-full -y +gem install deb-s3 +cd /tmp/optic/workspaces/local-cli/dist/deb/ +ls +deb-s3 upload -e --access-key-id=$INPUT_AWS_ACCESS_KEY_ID --secret-access-key=$INPUT_AWS_SECRET_ACCESS_KEY --bucket $INPUT_BUCKET_NAME $INPUT_PACKAGE_NAME --preserve-versions $PATH_TO_DEB \ No newline at end of file diff --git a/.github/workflows/testDebian.yml b/.github/workflows/testDebian.yml new file mode 100644 index 0000000000..d0da505709 --- /dev/null +++ b/.github/workflows/testDebian.yml @@ -0,0 +1,21 @@ +name: test debian +on: + push: + branches: + - feature/debian-release-flow + +env: + HOMEBREW_REPO: opticdev/homebrew-optic + PACKAGE_NAME: api + +jobs: + test-deploy-debian: + runs-on: ubuntu-latest + steps: + - uses: ./.github/deployDebian/ + with: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + BUCKET_NAME: optic-packages + PACKAGE_NAME: api + NPM_PACKAGE_NAME: "@useoptic/cli" \ No newline at end of file diff --git a/workspaces/local-cli/package.json b/workspaces/local-cli/package.json index ae49346146..e330585862 100644 --- a/workspaces/local-cli/package.json +++ b/workspaces/local-cli/package.json @@ -83,7 +83,7 @@ "scripts": { "postpack": "rm -f oclif.manifest.json", "posttest": "echo 'skipping posttest';#eslint . --ext .ts --config .eslintrc", - "prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme", + "prepack": "oclif-dev manifest && oclif-dev readme", "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"", "version": "oclif-dev readme && git add README.md", "ws:build": "tsc -b --verbose", From b69124b0bed20c678b2468a9c7195c219c223c1e Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Mon, 13 Jul 2020 15:33:50 -0700 Subject: [PATCH 04/21] added checkout --- .github/workflows/testDebian.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/testDebian.yml b/.github/workflows/testDebian.yml index d0da505709..8ff5adfe4b 100644 --- a/.github/workflows/testDebian.yml +++ b/.github/workflows/testDebian.yml @@ -12,6 +12,9 @@ jobs: test-deploy-debian: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 + with: + ref: feature/debian-release-flow - uses: ./.github/deployDebian/ with: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 4122d7f7a3f4db25bfda68e4f9031896bb1b15f0 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Mon, 13 Jul 2020 15:46:19 -0700 Subject: [PATCH 05/21] debugging --- .github/deployDebian/entrypoint.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/deployDebian/entrypoint.sh b/.github/deployDebian/entrypoint.sh index 1ceff54732..ebeef371f9 100755 --- a/.github/deployDebian/entrypoint.sh +++ b/.github/deployDebian/entrypoint.sh @@ -14,8 +14,6 @@ git clone https://github.com/opticdev/optic cd optic echo "Checking out specific branch (eventually this will just be release)" git checkout feature/debian-release-flow -export PATH_TO_DEB="/tmp/optic/workspaces/local-cli/dist/deb/api_$(npm view $INPUT_NPM_PACKAGE_NAME version)-1_amd64.deb" -echo $PATH_TO_DEB echo "Building Optic" source sourceme.sh optic_build @@ -27,5 +25,8 @@ echo "Installing Ruby" apt install ruby-full -y gem install deb-s3 cd /tmp/optic/workspaces/local-cli/dist/deb/ -ls +export PATH_TO_DEB="/tmp/optic/workspaces/local-cli/dist/deb/api_$(npm view $INPUT_NPM_PACKAGE_NAME version)-1_amd64.deb" +echo $PATH_TO_DEB +ls $PATH_TO_DEB +du $PATH_TO_DEB deb-s3 upload -e --access-key-id=$INPUT_AWS_ACCESS_KEY_ID --secret-access-key=$INPUT_AWS_SECRET_ACCESS_KEY --bucket $INPUT_BUCKET_NAME $INPUT_PACKAGE_NAME --preserve-versions $PATH_TO_DEB \ No newline at end of file From 3eada208051e41b4ed0a2c87ca3783ae90ce9848 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Mon, 13 Jul 2020 16:49:48 -0700 Subject: [PATCH 06/21] stuck --- .github/deployDebian/entrypoint.sh | 11 +++++++---- .github/workflows/testDebian.yml | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/deployDebian/entrypoint.sh b/.github/deployDebian/entrypoint.sh index ebeef371f9..45d7cae393 100755 --- a/.github/deployDebian/entrypoint.sh +++ b/.github/deployDebian/entrypoint.sh @@ -1,5 +1,6 @@ #!/bin/bash echo "Installing Essentials" +echo $INPUT_NPM_PACKAGE_NAME apt update apt install -y git default-jre sudo apt-utils apt-transport-https npm install -g @oclif/dev-cli @@ -8,9 +9,10 @@ echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.li curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add apt update apt install -y sbt + echo "Cloning Optic" cd /tmp -git clone https://github.com/opticdev/optic +git clone https://github.com/trulyronak/optic cd optic echo "Checking out specific branch (eventually this will just be release)" git checkout feature/debian-release-flow @@ -27,6 +29,7 @@ gem install deb-s3 cd /tmp/optic/workspaces/local-cli/dist/deb/ export PATH_TO_DEB="/tmp/optic/workspaces/local-cli/dist/deb/api_$(npm view $INPUT_NPM_PACKAGE_NAME version)-1_amd64.deb" echo $PATH_TO_DEB -ls $PATH_TO_DEB -du $PATH_TO_DEB -deb-s3 upload -e --access-key-id=$INPUT_AWS_ACCESS_KEY_ID --secret-access-key=$INPUT_AWS_SECRET_ACCESS_KEY --bucket $INPUT_BUCKET_NAME $INPUT_PACKAGE_NAME --preserve-versions $PATH_TO_DEB \ No newline at end of file +# ls $PATH_TO_DEB +# du $PATH_TO_DEB +/bin/bash +# deb-s3 upload -e --access-key-id=$INPUT_AWS_ACCESS_KEY_ID --secret-access-key=$INPUT_AWS_SECRET_ACCESS_KEY --bucket $INPUT_BUCKET_NAME $INPUT_PACKAGE_NAME --preserve-versions $PATH_TO_DEB \ No newline at end of file diff --git a/.github/workflows/testDebian.yml b/.github/workflows/testDebian.yml index 8ff5adfe4b..b333fb70af 100644 --- a/.github/workflows/testDebian.yml +++ b/.github/workflows/testDebian.yml @@ -12,9 +12,9 @@ jobs: test-deploy-debian: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - ref: feature/debian-release-flow + # - uses: actions/checkout@v2 + # with: + # ref: feature/debian-release-flow - uses: ./.github/deployDebian/ with: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 4c5e20621b4bbf01369c99610147a593817baba5 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Tue, 14 Jul 2020 11:03:26 -0700 Subject: [PATCH 07/21] finalized local testing --- .github/deployDebian/entrypoint.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/deployDebian/entrypoint.sh b/.github/deployDebian/entrypoint.sh index 45d7cae393..64e1b8fe85 100755 --- a/.github/deployDebian/entrypoint.sh +++ b/.github/deployDebian/entrypoint.sh @@ -1,6 +1,5 @@ #!/bin/bash echo "Installing Essentials" -echo $INPUT_NPM_PACKAGE_NAME apt update apt install -y git default-jre sudo apt-utils apt-transport-https npm install -g @oclif/dev-cli @@ -26,10 +25,5 @@ oclif-dev pack:deb echo "Installing Ruby" apt install ruby-full -y gem install deb-s3 -cd /tmp/optic/workspaces/local-cli/dist/deb/ export PATH_TO_DEB="/tmp/optic/workspaces/local-cli/dist/deb/api_$(npm view $INPUT_NPM_PACKAGE_NAME version)-1_amd64.deb" -echo $PATH_TO_DEB -# ls $PATH_TO_DEB -# du $PATH_TO_DEB -/bin/bash -# deb-s3 upload -e --access-key-id=$INPUT_AWS_ACCESS_KEY_ID --secret-access-key=$INPUT_AWS_SECRET_ACCESS_KEY --bucket $INPUT_BUCKET_NAME $INPUT_PACKAGE_NAME --preserve-versions $PATH_TO_DEB \ No newline at end of file +deb-s3 upload -e --access-key-id=$INPUT_AWS_ACCESS_KEY_ID --secret-access-key=$INPUT_AWS_SECRET_ACCESS_KEY --bucket $INPUT_BUCKET_NAME --codename $INPUT_PACKAGE_NAME --preserve-versions $PATH_TO_DEB \ No newline at end of file From 06d672259c1837e5cf7ff747d881a1e2867076d5 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Tue, 14 Jul 2020 11:04:31 -0700 Subject: [PATCH 08/21] added checkout --- .github/workflows/testDebian.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testDebian.yml b/.github/workflows/testDebian.yml index b333fb70af..4a6a9985e7 100644 --- a/.github/workflows/testDebian.yml +++ b/.github/workflows/testDebian.yml @@ -12,9 +12,9 @@ jobs: test-deploy-debian: runs-on: ubuntu-latest steps: - # - uses: actions/checkout@v2 - # with: - # ref: feature/debian-release-flow + - uses: actions/checkout@v2 # this part is required for github actions on the site + with: + ref: feature/debian-release-flow - uses: ./.github/deployDebian/ with: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From c232967fe2a9dfcb342d7b918d6db5058466efd2 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Tue, 14 Jul 2020 11:51:51 -0700 Subject: [PATCH 09/21] upload all types --- .github/deployDebian/entrypoint.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/deployDebian/entrypoint.sh b/.github/deployDebian/entrypoint.sh index 64e1b8fe85..70166a68db 100755 --- a/.github/deployDebian/entrypoint.sh +++ b/.github/deployDebian/entrypoint.sh @@ -25,5 +25,7 @@ oclif-dev pack:deb echo "Installing Ruby" apt install ruby-full -y gem install deb-s3 -export PATH_TO_DEB="/tmp/optic/workspaces/local-cli/dist/deb/api_$(npm view $INPUT_NPM_PACKAGE_NAME version)-1_amd64.deb" -deb-s3 upload -e --access-key-id=$INPUT_AWS_ACCESS_KEY_ID --secret-access-key=$INPUT_AWS_SECRET_ACCESS_KEY --bucket $INPUT_BUCKET_NAME --codename $INPUT_PACKAGE_NAME --preserve-versions $PATH_TO_DEB \ No newline at end of file +export PATH_TO_DEB_AMD="/tmp/optic/workspaces/local-cli/dist/deb/api_$(npm view $INPUT_NPM_PACKAGE_NAME version)-1_amd64.deb" +export PATH_TO_DEB_ARM="/tmp/optic/workspaces/local-cli/dist/deb/api_$(npm view $INPUT_NPM_PACKAGE_NAME version)-1_armel.deb" +deb-s3 upload -e --access-key-id=$INPUT_AWS_ACCESS_KEY_ID --secret-access-key=$INPUT_AWS_SECRET_ACCESS_KEY --bucket $INPUT_BUCKET_NAME --codename $INPUT_PACKAGE_NAME --preserve-versions $PATH_TO_DEB_AMD +deb-s3 upload -e --access-key-id=$INPUT_AWS_ACCESS_KEY_ID --secret-access-key=$INPUT_AWS_SECRET_ACCESS_KEY --bucket $INPUT_BUCKET_NAME --codename $INPUT_PACKAGE_NAME --preserve-versions $PATH_TO_DEB_ARM \ No newline at end of file From cdcdd56b83526c50637d964c36f9f9ad85ec77c7 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Tue, 14 Jul 2020 13:40:37 -0700 Subject: [PATCH 10/21] test org secret configuration --- .github/workflows/release.yml | 18 +++++++----------- .github/workflows/testhomebrewrelease.yml | 2 +- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d525a277dd..4084dad09d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,10 +8,7 @@ env: HOMEBREW_REPO: opticdev/homebrew-optic BUCKET_NAME: optic-packages PACKAGE_NAME: api - AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} - AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} # requires repo:write scope (https://github.com/peter-evans/repository-dispatch#token) on: push: @@ -72,11 +69,10 @@ jobs: needs: release-npm runs-on: ubuntu-latest steps: - - run: echo "Brew Release has not been configured yet" - # - name: Repository Dispatch - # uses: peter-evans/repository-dispatch@v1.1.0 - # with: - # token: ${{ env.REPO_ACCESS_TOKEN }} - # repository: ${{ env.HOMEBREW_REPO }} - # event-type: version-update - # client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@v1.1.1 + with: + token: ${{ secrets.HOMEBREW_UTILITY_ACCOUNT }} + repository: ${{ env.HOMEBREW_REPO }} + event-type: version-update + client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' diff --git a/.github/workflows/testhomebrewrelease.yml b/.github/workflows/testhomebrewrelease.yml index 4b836f94d9..88fee7d338 100644 --- a/.github/workflows/testhomebrewrelease.yml +++ b/.github/workflows/testhomebrewrelease.yml @@ -17,7 +17,7 @@ jobs: - name: Repository Dispatch uses: peter-evans/repository-dispatch@v1.1.0 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.HOMEBREW_UTILITY_ACCOUNT }} repository: ${{ env.HOMEBREW_REPO }} event-type: version-update client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' From ac4d1cacdc4c884a916cebff85c318d45c017480 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Tue, 14 Jul 2020 14:10:06 -0700 Subject: [PATCH 11/21] fixed secret accesssing issue --- .github/workflows/release.yml | 6 ++---- .github/workflows/testhomebrewrelease.yml | 5 +---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4084dad09d..3f60e1443a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,6 @@ name: Release env: - HOMEBREW_REPO: opticdev/homebrew-optic BUCKET_NAME: optic-packages PACKAGE_NAME: api NPM_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -66,13 +65,12 @@ jobs: # Triggers Homebrew Release - Configure homebrew/core fork repository in the env settings above # Requires Repository Access Token (https://github.com/peter-evans/repository-dispatch#token) with repo:write scope trigger-brew-release: - needs: release-npm runs-on: ubuntu-latest steps: - name: Repository Dispatch - uses: peter-evans/repository-dispatch@v1.1.1 + uses: peter-evans/repository-dispatch@v1.1.0 with: token: ${{ secrets.HOMEBREW_UTILITY_ACCOUNT }} - repository: ${{ env.HOMEBREW_REPO }} + repository: opticdev/homebrew-optic event-type: version-update client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' diff --git a/.github/workflows/testhomebrewrelease.yml b/.github/workflows/testhomebrewrelease.yml index 88fee7d338..ce707df83e 100644 --- a/.github/workflows/testhomebrewrelease.yml +++ b/.github/workflows/testhomebrewrelease.yml @@ -1,8 +1,5 @@ name: test homebrew release -env: - HOMEBREW_REPO: opticdev/homebrew-optic - on: push: branches: @@ -18,6 +15,6 @@ jobs: uses: peter-evans/repository-dispatch@v1.1.0 with: token: ${{ secrets.HOMEBREW_UTILITY_ACCOUNT }} - repository: ${{ env.HOMEBREW_REPO }} + repository: opticdev/homebrew-optic event-type: version-update client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' From 7479e56badef9af26a28bbfe7ad225d4460cf2a6 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Tue, 14 Jul 2020 14:17:06 -0700 Subject: [PATCH 12/21] just in case --- .github/workflows/testhomebrewrelease.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testhomebrewrelease.yml b/.github/workflows/testhomebrewrelease.yml index ce707df83e..4d47dd8740 100644 --- a/.github/workflows/testhomebrewrelease.yml +++ b/.github/workflows/testhomebrewrelease.yml @@ -14,7 +14,7 @@ jobs: - name: Repository Dispatch uses: peter-evans/repository-dispatch@v1.1.0 with: - token: ${{ secrets.HOMEBREW_UTILITY_ACCOUNT }} + token: ${{ secrets.HOMEBREW_REPO_ACCESS_TOKEN }} repository: opticdev/homebrew-optic event-type: version-update client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' From e53feb1854d447e780a62a9b121a4c6a9b0d95d3 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Tue, 14 Jul 2020 14:17:54 -0700 Subject: [PATCH 13/21] utility --- .github/workflows/testhomebrewrelease.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testhomebrewrelease.yml b/.github/workflows/testhomebrewrelease.yml index 4d47dd8740..ce707df83e 100644 --- a/.github/workflows/testhomebrewrelease.yml +++ b/.github/workflows/testhomebrewrelease.yml @@ -14,7 +14,7 @@ jobs: - name: Repository Dispatch uses: peter-evans/repository-dispatch@v1.1.0 with: - token: ${{ secrets.HOMEBREW_REPO_ACCESS_TOKEN }} + token: ${{ secrets.HOMEBREW_UTILITY_ACCOUNT }} repository: opticdev/homebrew-optic event-type: version-update client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' From 8cb5e47d570b8d8cf886c139aa702761f41193bb Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Tue, 14 Jul 2020 14:51:44 -0700 Subject: [PATCH 14/21] ready for release flow --- .github/workflows/release.yml | 2 +- .github/workflows/testhomebrewrelease.yml | 20 -------------------- 2 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 .github/workflows/testhomebrewrelease.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f60e1443a..9a39a80440 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -73,4 +73,4 @@ jobs: token: ${{ secrets.HOMEBREW_UTILITY_ACCOUNT }} repository: opticdev/homebrew-optic event-type: version-update - client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' + client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' \ No newline at end of file diff --git a/.github/workflows/testhomebrewrelease.yml b/.github/workflows/testhomebrewrelease.yml deleted file mode 100644 index ce707df83e..0000000000 --- a/.github/workflows/testhomebrewrelease.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: test homebrew release - -on: - push: - branches: - - feature/brew-release-flow - -jobs: - # Triggers Homebrew Release - Configure homebrew/core fork repository in the env settings above - # Requires Repository Access Token (https://github.com/peter-evans/repository-dispatch#token) with repo:write scope - test-trigger-brew-release: - runs-on: ubuntu-latest - steps: - - name: Repository Dispatch - uses: peter-evans/repository-dispatch@v1.1.0 - with: - token: ${{ secrets.HOMEBREW_UTILITY_ACCOUNT }} - repository: opticdev/homebrew-optic - event-type: version-update - client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' From 13c965858dfd10e0bfc44281d7e63f2552ba815a Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Tue, 14 Jul 2020 15:11:46 -0700 Subject: [PATCH 15/21] testing with org credentials --- .github/deployDebian/action.yml | 3 +++ .github/deployDebian/entrypoint.sh | 4 ++-- .github/workflows/release.yml | 28 +++++++++++----------------- .github/workflows/testDebian.yml | 3 ++- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/deployDebian/action.yml b/.github/deployDebian/action.yml index a2cda85135..b40d34c664 100644 --- a/.github/deployDebian/action.yml +++ b/.github/deployDebian/action.yml @@ -13,6 +13,9 @@ inputs: PACKAGE_NAME: description: "PACKAGE_NAME" required: true + PREFIX_NAME: + description: "The prefix for the package" + required: true runs: using: 'docker' image: 'Dockerfile' diff --git a/.github/deployDebian/entrypoint.sh b/.github/deployDebian/entrypoint.sh index 70166a68db..ecaedaa679 100755 --- a/.github/deployDebian/entrypoint.sh +++ b/.github/deployDebian/entrypoint.sh @@ -27,5 +27,5 @@ apt install ruby-full -y gem install deb-s3 export PATH_TO_DEB_AMD="/tmp/optic/workspaces/local-cli/dist/deb/api_$(npm view $INPUT_NPM_PACKAGE_NAME version)-1_amd64.deb" export PATH_TO_DEB_ARM="/tmp/optic/workspaces/local-cli/dist/deb/api_$(npm view $INPUT_NPM_PACKAGE_NAME version)-1_armel.deb" -deb-s3 upload -e --access-key-id=$INPUT_AWS_ACCESS_KEY_ID --secret-access-key=$INPUT_AWS_SECRET_ACCESS_KEY --bucket $INPUT_BUCKET_NAME --codename $INPUT_PACKAGE_NAME --preserve-versions $PATH_TO_DEB_AMD -deb-s3 upload -e --access-key-id=$INPUT_AWS_ACCESS_KEY_ID --secret-access-key=$INPUT_AWS_SECRET_ACCESS_KEY --bucket $INPUT_BUCKET_NAME --codename $INPUT_PACKAGE_NAME --preserve-versions $PATH_TO_DEB_ARM \ No newline at end of file +deb-s3 upload -e --access-key-id=$INPUT_AWS_ACCESS_KEY_ID --secret-access-key=$INPUT_AWS_SECRET_ACCESS_KEY --bucket $INPUT_BUCKET_NAME --prefix $INPUT_PREFIX_NAME --codename $INPUT_PACKAGE_NAME --preserve-versions $PATH_TO_DEB_AMD +deb-s3 upload -e --access-key-id=$INPUT_AWS_ACCESS_KEY_ID --secret-access-key=$INPUT_AWS_SECRET_ACCESS_KEY --bucket $INPUT_BUCKET_NAME --prefix $INPUT_PREFIX_NAME --codename $INPUT_PACKAGE_NAME --preserve-versions $PATH_TO_DEB_ARM \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d525a277dd..4eea5e8532 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,25 +46,19 @@ jobs: # Creates debian package for users to install, hosted on s3 release-deb: - needs: release-npm runs-on: ubuntu-latest steps: - - run: echo "Debian Release has not been configured yet" - # - uses: actions/checkout@v2 - # - uses: actions/setup-node@v1 - # with: - # node-version: 12 - # - run: npm ci - # - name: Install APT Utils - # run: sudo apt-get install apt-utils - # - run: sudo npm i -g @oclif/dev-cli - # - run: sudo oclif-dev pack:deb - # - uses: actions/setup-ruby@v1 - # with: - # ruby-version: '2.6' - # - run: sudo gem install deb-s3 - # - name: Upload to s3 - # run: sudo deb-s3 upload -e --access-key-id=${{ env.AWS_ACCESS_KEY_ID }} --secret-access-key=${{ env.AWS_SECRET_ACCESS_KEY }} --bucket $BUCKET_NAME --codename ${{ env.PACKAGE_NAME }} --preserve-versions dist/deb/legume_$(npm view ${{ env.PACKAGE_NAME }} version)-1_amd64.deb + - uses: actions/checkout@v2 # this part is required for github actions on the site + with: + ref: feature/debian-release-flow + - uses: ./.github/deployDebian/ + with: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + BUCKET_NAME: optic-packages + PACKAGE_NAME: api + NPM_PACKAGE_NAME: "@useoptic/cli" + PREFIX_NAME: deb # Triggers Homebrew Release - Configure homebrew/core fork repository in the env settings above # Requires Repository Access Token (https://github.com/peter-evans/repository-dispatch#token) with repo:write scope diff --git a/.github/workflows/testDebian.yml b/.github/workflows/testDebian.yml index 4a6a9985e7..48aee1efde 100644 --- a/.github/workflows/testDebian.yml +++ b/.github/workflows/testDebian.yml @@ -21,4 +21,5 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} BUCKET_NAME: optic-packages PACKAGE_NAME: api - NPM_PACKAGE_NAME: "@useoptic/cli" \ No newline at end of file + NPM_PACKAGE_NAME: "@useoptic/cli" + PREFIX_NAME: deb \ No newline at end of file From e44a906d2b7c8248a915ae82800dfd87831bfc9c Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Tue, 14 Jul 2020 15:25:46 -0700 Subject: [PATCH 16/21] ready for release flow --- .github/workflows/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4eea5e8532..19b5a187af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,8 +8,6 @@ env: HOMEBREW_REPO: opticdev/homebrew-optic BUCKET_NAME: optic-packages PACKAGE_NAME: api - AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} - AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} # requires repo:write scope (https://github.com/peter-evans/repository-dispatch#token) From 082de14f64a3ff5163387ba4260442f16dc81981 Mon Sep 17 00:00:00 2001 From: Aidan Cunniffe Date: Wed, 15 Jul 2020 16:37:21 -0400 Subject: [PATCH 17/21] removed core from optic repo. made it linkable --- Developer-setup.md | 2 +- package.json | 6 +- sourceme.sh | 19 ++- workspaces/cli-shared/package.json | 6 +- workspaces/domain-types/.gitignore | 2 - workspaces/domain-types/package.json | 21 --- .../src/avro-schemas/interaction-batch.json | 1 - workspaces/domain-types/src/index.ts | 9 -- workspaces/domain-types/src/optic-types.ts | 49 ------ workspaces/domain-types/tsconfig.json | 7 - workspaces/domain-utilities/.gitignore | 2 - workspaces/domain-utilities/package.json | 23 --- .../domain-utilities/src/coverage/index.ts | 11 -- workspaces/domain-utilities/src/diff/index.ts | 0 workspaces/domain-utilities/src/index.ts | 151 ------------------ workspaces/domain-utilities/tsconfig.json | 7 - workspaces/domain/.gitignore | 5 - workspaces/domain/package.json | 20 --- workspaces/domain/src/index.ts | 102 ------------ workspaces/domain/tsconfig.json | 7 - workspaces/local-cli/package.json | 2 +- workspaces/scripts/bump-core.js | 55 +++++++ workspaces/snapshot-tests/package.json | 6 +- workspaces/test-data/.gitignore | 2 - workspaces/test-data/package.json | 31 ---- .../test-data/src/__test/Helpers.test.ts | 96 ----------- .../src/helpers/InteractionHelper.ts | 148 ----------------- workspaces/test-data/src/helpers/Scenario.ts | 67 -------- workspaces/test-data/src/helpers/TAGS.ts | 11 -- workspaces/test-data/src/index.ts | 9 -- workspaces/test-data/src/scenarios/Arrays.ts | 126 --------------- .../test-data/src/scenarios/ObjectKeys.ts | 123 -------------- .../test-data/src/scenarios/Optionals.ts | 104 ------------ .../src/scenarios/UnknownConversions.ts | 126 --------------- workspaces/test-data/tsconfig.json | 7 - workspaces/ui/package.json | 4 +- yarn.lock | 22 +++ 37 files changed, 106 insertions(+), 1283 deletions(-) delete mode 100644 workspaces/domain-types/.gitignore delete mode 100644 workspaces/domain-types/package.json delete mode 100644 workspaces/domain-types/src/avro-schemas/interaction-batch.json delete mode 100644 workspaces/domain-types/src/index.ts delete mode 100644 workspaces/domain-types/src/optic-types.ts delete mode 100644 workspaces/domain-types/tsconfig.json delete mode 100644 workspaces/domain-utilities/.gitignore delete mode 100644 workspaces/domain-utilities/package.json delete mode 100644 workspaces/domain-utilities/src/coverage/index.ts delete mode 100644 workspaces/domain-utilities/src/diff/index.ts delete mode 100644 workspaces/domain-utilities/src/index.ts delete mode 100644 workspaces/domain-utilities/tsconfig.json delete mode 100644 workspaces/domain/.gitignore delete mode 100644 workspaces/domain/package.json delete mode 100644 workspaces/domain/src/index.ts delete mode 100644 workspaces/domain/tsconfig.json create mode 100644 workspaces/scripts/bump-core.js delete mode 100644 workspaces/test-data/.gitignore delete mode 100644 workspaces/test-data/package.json delete mode 100644 workspaces/test-data/src/__test/Helpers.test.ts delete mode 100644 workspaces/test-data/src/helpers/InteractionHelper.ts delete mode 100644 workspaces/test-data/src/helpers/Scenario.ts delete mode 100644 workspaces/test-data/src/helpers/TAGS.ts delete mode 100644 workspaces/test-data/src/index.ts delete mode 100644 workspaces/test-data/src/scenarios/Arrays.ts delete mode 100644 workspaces/test-data/src/scenarios/ObjectKeys.ts delete mode 100644 workspaces/test-data/src/scenarios/Optionals.ts delete mode 100644 workspaces/test-data/src/scenarios/UnknownConversions.ts delete mode 100644 workspaces/test-data/tsconfig.json diff --git a/Developer-setup.md b/Developer-setup.md index f81cf7ab60..aa109007a2 100644 --- a/Developer-setup.md +++ b/Developer-setup.md @@ -68,7 +68,7 @@ This error may be seen when running `npm start` to build and run a UI workspace. - If you run into further problems, please let us know the tools you are using, and the errors you are seeing, for reference. While we can't support every environment, it can be helpful to know where problems exist. In the mean time... - If you still see workspace-specific module resolution issues, run `yarn install` in the target workspace. Include this output in your issue report for reference. - Running `yarn run ws:build` in all workspaces should resolve the issue for the entire project: - - `domain-types`, `domain`, `domain-utilities`, `cli-config`, `cli-shared`, `client-utilities`, `proxy`, `cli-client`, `ui`, `cli-scripts`, `cli-server`, `test-data`, `local-cli`, `agent-cli`, `ci-cli` + - `cli-config`, `cli-shared`, `client-utilities`, `proxy`, `cli-client`, `ui`, `cli-scripts`, `cli-server`, `test-data`, `local-cli`, `agent-cli`, `ci-cli` - If `yarn run ws:build` throws errors about dependencies for one of the workspaces, it's possible Yarn didn't install the dependencies as expected. Try `yarn install` followed by another `yarn run ws:build` and let us know which workspace threw this error. ### Additional Notes diff --git a/package.json b/package.json index 3210a303f2..3d9220f640 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,10 @@ "publish-local": "OPTIC_PUBLISH_SCOPE=private node ./workspaces/scripts/publish.js", "publish-github": "OPTIC_PUBLISH_SCOPE=github node ./workspaces/scripts/publish.js", "publish": "OPTIC_PUBLISH_SCOPE=public node ./workspaces/scripts/publish.js", - "bump": "node ./workspaces/scripts/bump.js" + "bump": "node ./workspaces/scripts/bump.js", + "bump-core": "node ./workspaces/scripts/bump-core.js" }, "workspaces": [ - "workspaces/domain-types", - "workspaces/domain", - "workspaces/domain-utilities", "workspaces/saas-types", "workspaces/cli-config", "workspaces/cli-shared", diff --git a/sourceme.sh b/sourceme.sh index 37e475742e..6656e89db7 100755 --- a/sourceme.sh +++ b/sourceme.sh @@ -53,11 +53,26 @@ optic_build() { cd "$OPTIC_SRC_DIR" yarn install - yarn run build-domain optic_workspace_clean optic_workspace_build ) } +optic_build_with_linked_core() { + ( + set -o errexit + cd "$OPTIC_SRC_DIR" + + yarn link @useoptic/domain + yarn link @useoptic/domain-types + yarn link @useoptic/domain-utilities + + yarn install + + optic_workspace_clean + optic_workspace_build + + ) +} optic_build_for_release() { ( @@ -65,7 +80,7 @@ optic_build_for_release() { cd "$OPTIC_SRC_DIR" yarn install - yarn run build-domain-optimized + optic_workspace_clean optic_workspace_build ) diff --git a/workspaces/cli-shared/package.json b/workspaces/cli-shared/package.json index 0fdae63eac..ac29cb4ff9 100644 --- a/workspaces/cli-shared/package.json +++ b/workspaces/cli-shared/package.json @@ -18,9 +18,9 @@ "@useoptic/cli-client": "8.2.2", "@useoptic/cli-config": "8.2.2", "@useoptic/client-utilities": "8.2.2", - "@useoptic/domain": "8.2.2", - "@useoptic/domain-types": "8.2.2", - "@useoptic/domain-utilities": "8.2.2", + "@useoptic/domain": "8.2.3", + "@useoptic/domain-types": "8.2.3", + "@useoptic/domain-utilities": "8.2.3", "avsc": "^5.4.21", "proper-lockfile": "^4.1.1", "bottleneck": "^2.19.5", diff --git a/workspaces/domain-types/.gitignore b/workspaces/domain-types/.gitignore deleted file mode 100644 index e3fbd98336..0000000000 --- a/workspaces/domain-types/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -build -node_modules diff --git a/workspaces/domain-types/package.json b/workspaces/domain-types/package.json deleted file mode 100644 index b87916072f..0000000000 --- a/workspaces/domain-types/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@useoptic/domain-types", - "version": "8.2.2", - "scripts": { - "ws:build": "yarn run tsc -b --verbose && cp -R ./src/avro-schemas/ ./build/avro-schemas", - "ws:clean": "rm -rf build/*", - "ws:test": "echo domain-types" - }, - "repository": { - "type": "git", - "url": "ssh://git@github.com/useoptic/optic-package.git", - "directory": "workspaces/domain-types" - }, - "main": "build/index.js", - "types": "build/index.d.ts", - "dependencies": {}, - "devDependencies": {}, - "files": [ - "/build" - ] -} diff --git a/workspaces/domain-types/src/avro-schemas/interaction-batch.json b/workspaces/domain-types/src/avro-schemas/interaction-batch.json deleted file mode 100644 index 458f612f51..0000000000 --- a/workspaces/domain-types/src/avro-schemas/interaction-batch.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"record","name":"InteractionBatch","namespace":"com.useoptic.types.capture","fields":[{"name":"groupingIdentifiers","type":{"type":"record","name":"GroupingIdentifiers","fields":[{"name":"agentGroupId","type":"string"},{"name":"captureId","type":"string"},{"name":"agentId","type":"string"},{"name":"batchId","type":"string"}]}},{"name":"batchItems","type":{"type":"array","items":{"type":"record","name":"HttpInteraction","fields":[{"name":"uuid","type":"string"},{"name":"request","type":{"type":"record","name":"Request","fields":[{"name":"host","type":"string"},{"name":"method","type":"string"},{"name":"path","type":"string"},{"name":"query","type":{"type":"record","name":"ArbitraryData","fields":[{"name":"shapeHashV1Base64","type":["null","string"],"default":null},{"name":"asJsonString","type":["null","string"],"default":null},{"name":"asText","type":["null","string"],"default":null}]}},{"name":"headers","type":"ArbitraryData"},{"name":"body","type":{"type":"record","name":"Body","fields":[{"name":"contentType","type":["null","string"]},{"name":"value","type":"ArbitraryData"}]}}]}},{"name":"response","type":{"type":"record","name":"Response","fields":[{"name":"statusCode","type":"int"},{"name":"headers","type":"ArbitraryData"},{"name":"body","type":"Body"}]}},{"name":"tags","type":{"type":"array","items":{"type":"record","name":"HttpInteractionTag","fields":[{"name":"name","type":"string"},{"name":"value","type":"string"}]}}}]}}}]} \ No newline at end of file diff --git a/workspaces/domain-types/src/index.ts b/workspaces/domain-types/src/index.ts deleted file mode 100644 index ee39380729..0000000000 --- a/workspaces/domain-types/src/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from './optic-types'; -import path from 'path'; - -export const basePath = __dirname; -export const InteractionBatch = require(path.join( - basePath, - 'avro-schemas', - 'interaction-batch.json' -)); diff --git a/workspaces/domain-types/src/optic-types.ts b/workspaces/domain-types/src/optic-types.ts deleted file mode 100644 index 04f3d2eae0..0000000000 --- a/workspaces/domain-types/src/optic-types.ts +++ /dev/null @@ -1,49 +0,0 @@ -export interface IResponse { - statusCode: number; - headers: IArbitraryData; - body: IBody; -} - -export interface IBody { - contentType: string | null; - value: IArbitraryData; -} - -export interface IArbitraryData { - shapeHashV1Base64: string | null; - asJsonString: string | null; - asText: string | null; -} - -export interface IHttpInteraction { - uuid: string; - request: IRequest; - response: IResponse; - tags: IHttpInteractionTag[]; -} - -export interface IGroupingIdentifiers { - agentGroupId: string; - captureId: string; - agentId: string; - batchId: string; -} - -export interface IHttpInteractionTag { - name: string; - value: string; -} - -export interface IRequest { - host: string; - method: string; - path: string; - query: IArbitraryData; - headers: IArbitraryData; - body: IBody; -} - -export interface IInteractionBatch { - groupingIdentifiers: IGroupingIdentifiers; - batchItems: IHttpInteraction[]; -} diff --git a/workspaces/domain-types/tsconfig.json b/workspaces/domain-types/tsconfig.json deleted file mode 100644 index 7b8f9830c7..0000000000 --- a/workspaces/domain-types/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../config/tsconfig.json", - "compilerOptions": { - "outDir": "build", - "rootDir": "src" - } -} diff --git a/workspaces/domain-utilities/.gitignore b/workspaces/domain-utilities/.gitignore deleted file mode 100644 index e3fbd98336..0000000000 --- a/workspaces/domain-utilities/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -build -node_modules diff --git a/workspaces/domain-utilities/package.json b/workspaces/domain-utilities/package.json deleted file mode 100644 index ab4ed53724..0000000000 --- a/workspaces/domain-utilities/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@useoptic/domain-utilities", - "version": "8.2.2", - "scripts": { - "ws:test": "echo domain-utilities", - "ws:build": "yarn run tsc -b --verbose", - "ws:clean": "rm -rf build/*" - }, - "repository": { - "type": "git", - "url": "ssh://git@github.com/useoptic/optic-package.git", - "directory": "workspaces/domain-utilities" - }, - "main": "build/index.js", - "types": "build/index.d.ts", - "dependencies": { - "@useoptic/domain": "8.2.2" - }, - "devDependencies": {}, - "files": [ - "/build" - ] -} diff --git a/workspaces/domain-utilities/src/coverage/index.ts b/workspaces/domain-utilities/src/coverage/index.ts deleted file mode 100644 index 0f034b926a..0000000000 --- a/workspaces/domain-utilities/src/coverage/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { StableHashableWrapper } from '@useoptic/domain'; -import crypto from 'crypto'; - -function hasher(input: string) { - const sha1 = crypto.createHash('sha1'); - sha1.update(input); - const hex = sha1.digest('hex'); - return hex; -} - -export const StableHasher = StableHashableWrapper(hasher); diff --git a/workspaces/domain-utilities/src/diff/index.ts b/workspaces/domain-utilities/src/diff/index.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/workspaces/domain-utilities/src/index.ts b/workspaces/domain-utilities/src/index.ts deleted file mode 100644 index 91f94ea01b..0000000000 --- a/workspaces/domain-utilities/src/index.ts +++ /dev/null @@ -1,151 +0,0 @@ -import { StableHasher } from './coverage'; -import { DiffHelpers, JsonHelper, opticEngine } from '@useoptic/domain'; -import { IHttpInteraction } from '@useoptic/domain-types'; - -export { StableHasher } from './coverage'; - -export function universeFromEvents(events: any[]) { - const { contexts } = opticEngine.com.useoptic; - const { RfcServiceJSFacade } = contexts.rfc; - const rfcServiceFacade = RfcServiceJSFacade(); - const eventStore = rfcServiceFacade.makeEventStore(); - const rfcId = 'testRfcId'; - const eventsAsJson = opticEngine.EventSerialization.fromJs(events); - eventStore.append(rfcId, eventsAsJson); - const rfcService = rfcServiceFacade.makeRfcService(eventStore); - const rfcState = rfcService.currentState(rfcId); - return { - rfcState, - eventStore, - rfcId, - rfcService, - }; -} - -export function universeFromEventsAndAdditionalCommands( - events: any[], - commandsContext: any, - commands: any[] -) { - const { contexts } = opticEngine.com.useoptic; - const { RfcServiceJSFacade } = contexts.rfc; - const rfcServiceFacade = RfcServiceJSFacade(); - const eventStore = rfcServiceFacade.makeEventStore(); - const rfcId = 'testRfcId'; - const eventsAsJson = opticEngine.EventSerialization.fromJs(events); - //process the initial events - eventStore.append(rfcId, eventsAsJson); - const rfcService = rfcServiceFacade.makeRfcService(eventStore); - //tack on the additional commands - rfcService.handleCommands(rfcId, commandsContext, ...commands); - const rfcState = rfcService.currentState(rfcId); - return { - rfcState, - eventStore, - rfcId, - rfcService, - }; -} - -export function cachingResolversAndRfcStateFromEvents( - events: any[], - extraCommands: any[] -) { - const { rfcState } = universeFromEvents(events); - const resolvers = opticEngine.ShapesResolvers.newCachingResolver(rfcState); - return { resolvers, rfcState }; -} - -export function cachingResolversAndRfcStateFromEventsAndAdditionalCommands( - events: any[], - commandsContext: any, - additionalCommands: any[] -) { - const { rfcState } = universeFromEventsAndAdditionalCommands( - events, - commandsContext, - additionalCommands - ); - const resolvers = opticEngine.ShapesResolvers.newCachingResolver(rfcState); - return { resolvers, rfcState }; -} - -export function cachingResolversAndRfcStateFromEventsAndAdditionalCommandsSeq( - events: any[], - commandsContext: any, - additionalCommandsSeq: any -) { - return cachingResolversAndRfcStateFromEventsAndAdditionalCommands( - events, - commandsContext, - JsonHelper.seqToJsArray(additionalCommandsSeq) - ); -} - -export function rfcStateFromEvents(events: any[]) { - const { rfcState } = universeFromEvents(events); - return rfcState; -} - -export function reportFromEventsAndInteractions( - shapesResolvers: any, - events: any[], - interactions: any[] -) { - const rfcState = rfcStateFromEvents(events); - const report = opticEngine.com.useoptic.diff.helpers - .CoverageHelpers() - .getCoverage(shapesResolvers, rfcState, interactions); - return report; -} - -export function reportFromRfcStateAndInteractions( - shapesResolvers: any, - rfcState: any, - interactions: any[] -) { - const report = opticEngine.com.useoptic.diff.helpers - .CoverageHelpers() - .getCoverage(shapesResolvers, rfcState, interactions); - return report; -} - -export function serializeReport(report: any) { - const converter = new opticEngine.com.useoptic.CoverageReportConverter( - StableHasher - ); - return converter.toJs(report); -} - -export function deserializeInteractions(serializedInteractions: any) { - const parsedInteractions = serializedInteractions.map((x: object) => - JsonHelper.fromInteraction(x) - ); - const parsedInteractionsSeq = JsonHelper.jsArrayToSeq(parsedInteractions); - return parsedInteractionsSeq; -} - -export function diffFromRfcStateAndInteractions( - shapesResolvers: any, - rfcState: any, - interactions: IHttpInteraction[] -) { - const diffResults = DiffHelpers.groupByDiffs( - shapesResolvers, - rfcState, - deserializeInteractions(interactions) - ); - return diffResults; -} -export function normalizedDiffFromRfcStateAndInteractions( - shapesResolvers: any, - rfcState: any, - interactions: IHttpInteraction[] -) { - const diffResults = DiffHelpers.groupByNormalizedDiffs( - shapesResolvers, - rfcState, - deserializeInteractions(interactions) - ); - return diffResults; -} diff --git a/workspaces/domain-utilities/tsconfig.json b/workspaces/domain-utilities/tsconfig.json deleted file mode 100644 index 7b8f9830c7..0000000000 --- a/workspaces/domain-utilities/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../config/tsconfig.json", - "compilerOptions": { - "outDir": "build", - "rootDir": "src" - } -} diff --git a/workspaces/domain/.gitignore b/workspaces/domain/.gitignore deleted file mode 100644 index 2eada6e60c..0000000000 --- a/workspaces/domain/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -build -node_modules - -# the build process should inject the built domain here. It should not be in version control but it should be in the npm package -src/domain.js diff --git a/workspaces/domain/package.json b/workspaces/domain/package.json deleted file mode 100644 index d1c5eedf9b..0000000000 --- a/workspaces/domain/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@useoptic/domain", - "version": "8.2.2", - "scripts": { - "ws:test": "echo domain", - "ws:build": "yarn run tsc -b && cp ./src/domain.js ./build/domain.js", - "ws:clean": "rm -rf build/*" - }, - "repository": { - "type": "git", - "url": "ssh://git@github.com/useoptic/optic-package.git", - "directory": "workspaces/domain" - }, - "main": "build/index.js", - "types": "build/index.d.ts", - "dependencies": {}, - "files": [ - "/build" - ] -} diff --git a/workspaces/domain/src/index.ts b/workspaces/domain/src/index.ts deleted file mode 100644 index 4da8297369..0000000000 --- a/workspaces/domain/src/index.ts +++ /dev/null @@ -1,102 +0,0 @@ -export const opticEngine = require('./domain.js'); - -const { contexts, diff } = opticEngine.com.useoptic; - -export function setLogger(f: Function) { - const wrapper = new opticEngine.com.useoptic.LoggerWrapper(f); - opticEngine.Logger.setLoggerImplementation(wrapper); -} -export const ShapesCommands = contexts.shapes.Commands; -export const ShapesHelper = contexts.shapes.ShapesHelper(); -export const RequestsHelper = contexts.requests.RequestsServiceHelper(); -export const ContentTypesHelper = contexts.requests.ContentTypes(); - -export const RfcCommands = contexts.rfc.Commands; -export const RequestsCommands = contexts.requests.Commands; -export const RfcCommandContext = contexts.rfc.RfcCommandContext; -export const ScalaJSHelpers = opticEngine.ScalaJSHelpers; - -export const CompareEquality = opticEngine.com.useoptic.CompareEquality(); - -export const Facade = contexts.rfc.RfcServiceJSFacade(); -export const Queries = (eventStore: any, service: any, aggregateId: string) => - new opticEngine.Queries(eventStore, service, aggregateId); - -export function commandsToJson(commands: any[]) { - return commands.map((x) => - JSON.parse(opticEngine.CommandSerialization.toJsonString(x)) - ); -} - -export function commandsFromJson(commands: any[]) { - return opticEngine.CommandSerialization.fromJsonString( - JSON.stringify(commands) - ); -} - -export function commandsToJs(commandSequence: any) { - return opticEngine.CommandSerialization.toJs(commandSequence); -} - -export function commandToJs(command: any) { - return opticEngine.CommandSerialization.toJs(command); -} - -export const JsonHelper = opticEngine.com.useoptic.JsonHelper(); - -function fromJs(x: any) { - if (typeof x === 'undefined') { - return JsonHelper.toNone(); - } - return JsonHelper.toSome(JsonHelper.fromString(JSON.stringify(x))); -} - -export const mapScala = (collection: any) => (handler: any) => { - return ScalaJSHelpers.toJsArray(collection).map(handler); -}; - -export const filterScala = (collection: any) => (handler: any) => { - return ScalaJSHelpers.toJsArray(collection).filter(handler); -}; - -export const getOrUndefined = (option: any) => { - return ScalaJSHelpers.getOrUndefined(option); -}; - -export const getOrUndefinedJson = (option: any) => { - return ScalaJSHelpers.getOrUndefinedJson(option); -}; - -export const headOrUndefined = (seq: any) => { - return ScalaJSHelpers.headOrUndefined(seq); -}; - -export const everyScala = (collection: any) => (handler: any) => { - return ScalaJSHelpers.toJsArray(collection).every(handler); -}; -export const lengthScala = (collection: any) => { - return ScalaJSHelpers.length(collection); -}; -export const toOption = (undefOr: any) => { - return ScalaJSHelpers.toOption(undefOr); -}; -export const getIndex = (collection: any) => (index: number) => { - return ScalaJSHelpers.getIndex(collection, index); -}; -export const getJson = (j: any) => { - return ScalaJSHelpers.getJson(j); -}; - -export const InteractionDiffer = diff.InteractionDiffer; -export const BodyUtilities = opticEngine.com.useoptic.diff.interactions.BodyUtilities(); -export const ContentTypeHelpers = opticEngine.com.useoptic.diff.interactions.ContentTypeHelpers(); -export const OasProjectionHelper = opticEngine.com.useoptic.OASProjectionHelper(); -export const StableHashableWrapper = - opticEngine.com.useoptic.StableHashableWrapper; - -export const DiffManagerFacade = opticEngine.com.useoptic.DiffManagerFacade(); -export const DiffPreviewer = opticEngine.com.useoptic.ux.DiffPreviewer; -export const DiffHelpers = opticEngine.com.useoptic.diff.helpers.DiffHelpers(); -export const DiffResultHelper = opticEngine.com.useoptic.ux.DiffResultHelper(); -export const UrlCounterHelper = opticEngine.com.useoptic.UrlCounterHelper(); -export const OpticIds = opticEngine.com.useoptic.OpticIdsJs(); diff --git a/workspaces/domain/tsconfig.json b/workspaces/domain/tsconfig.json deleted file mode 100644 index 7b8f9830c7..0000000000 --- a/workspaces/domain/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../config/tsconfig.json", - "compilerOptions": { - "outDir": "build", - "rootDir": "src" - } -} diff --git a/workspaces/local-cli/package.json b/workspaces/local-cli/package.json index 688d4a25de..85821be315 100644 --- a/workspaces/local-cli/package.json +++ b/workspaces/local-cli/package.json @@ -21,7 +21,7 @@ "@useoptic/cli-scripts": "8.2.2", "@useoptic/cli-server": "8.2.2", "@useoptic/cli-shared": "8.2.2", - "@useoptic/domain": "8.2.2", + "@useoptic/domain": "8.2.3", "analytics-node": "^3.4.0-beta.1", "cli-ux": "^5.4.1", "colors": "^1.4.0", diff --git a/workspaces/scripts/bump-core.js b/workspaces/scripts/bump-core.js new file mode 100644 index 0000000000..d87cea59b4 --- /dev/null +++ b/workspaces/scripts/bump-core.js @@ -0,0 +1,55 @@ +// this script is meant to be run via `yarn bump ` +const path = require('path'); +const fs = require('fs-extra'); + +async function main(targetVersion) { + const packageJson = await fs.readJson('./package.json'); + const { workspaces } = packageJson; + console.log(`setting workspace versions to ${targetVersion}`); + console.log(workspaces.map((x) => ` - ${x}\n`).join('')); + const tasks = workspaces.map((workspace) => { + const task = new Promise(async (resolve, reject) => { + try { + const targetPackage = await fs.readJson(`./${workspace}/package.json`); + resolve({ + workspace, + package: targetPackage, + }); + } catch (e) { + reject(e); + } + }); + return task; + }); + const results = await Promise.all(tasks); + const packageNames = [ + '@useoptic/domain', + '@useoptic/domain-types', + '@useoptic/domain-utilities', + ]; + console.log(packageNames.map((x) => ` - ${x}\n`).join('')); + const updateVersionTasks = results.map((result) => { + const task = new Promise(async (resolve, reject) => { + try { + packageNames.map((packageName) => { + if (result.package.dependencies[packageName]) { + result.package.dependencies[packageName] = targetVersion; + } + }); + await fs.writeJson( + `./${result.workspace}/package.json`, + result.package, + { spaces: 2 } + ); + } catch (e) { + reject(e); + } + }); + return task; + }); + await Promise.all(updateVersionTasks); + console.log(`Done!`); +} + +const [, , targetVersion] = process.argv; +main(targetVersion); diff --git a/workspaces/snapshot-tests/package.json b/workspaces/snapshot-tests/package.json index b0100ed022..88e892fe89 100644 --- a/workspaces/snapshot-tests/package.json +++ b/workspaces/snapshot-tests/package.json @@ -12,9 +12,9 @@ "directory": "workspaces/snapshot-tests" }, "dependencies": { - "@useoptic/domain-types": "8.2.2", - "@useoptic/domain": "8.2.2", - "@useoptic/domain-utilities": "8.2.2", + "@useoptic/domain-types": "8.2.3", + "@useoptic/domain": "8.2.3", + "@useoptic/domain-utilities": "8.2.3", "dataloader": "^2.0.0", "fs-extra": "^9.0.0" }, diff --git a/workspaces/test-data/.gitignore b/workspaces/test-data/.gitignore deleted file mode 100644 index e3fbd98336..0000000000 --- a/workspaces/test-data/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -build -node_modules diff --git a/workspaces/test-data/package.json b/workspaces/test-data/package.json deleted file mode 100644 index 8d2ee44f2a..0000000000 --- a/workspaces/test-data/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@useoptic/test-data", - "version": "8.1.0", - "scripts": { - "ws:build": "yarn run tsc -b --verbose", - "ws:clean": "rm -rf build/*", - "ws:test": "echo cli-client", - "test": "yarn run ws:build && jest --testPathPattern=build/__test", - "generate": "yarn run ws:build && node build/index.js" - }, - "repository": { - "type": "git", - "url": "ssh://git@github.com/useoptic/optic-package.git", - "directory": "workspaces/test-data" - }, - "main": "build/index.js", - "types": "build/index.d.ts", - "dependencies": { - "@useoptic/domain": "8.1.0", - "@useoptic/domain-types": "8.1.0", - "deepcopy": "^2.0.0", - "md5": "^2.2.1" - }, - "devDependencies": { - "@types/md5": "^2.2.0", - "jest": "^26.0.1" - }, - "files": [ - "/build" - ] -} diff --git a/workspaces/test-data/src/__test/Helpers.test.ts b/workspaces/test-data/src/__test/Helpers.test.ts deleted file mode 100644 index 143e694ef2..0000000000 --- a/workspaces/test-data/src/__test/Helpers.test.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { Scenario } from '../helpers/Scenario'; -import { newBody, newInteraction } from '../helpers/InteractionHelper'; -import { TAGS } from '../helpers/TAGS'; -// @ts-ignore -const { expect } = global; - -test('Scenario path can be created', () => { - const result = Scenario('GET /user/:userId/profile', ({ AddPath }) => { - AddPath('user', ':userId', 'profile'); - }); - - expect(result.commands).toHaveLength(3); -}); - -test('Baseline Interactions can be created', () => { - const result = Scenario( - 'GET /user/:userId/profile', - ({ AddPath, LearnBaseline }) => { - AddPath('user', ':userId', 'profile'); - - const interaction1 = newInteraction('/user/abc/profile', 'GET'); - interaction1.withResponseBody(newBody({ name: 'Aidan', age: 26 })); - - const interaction2 = interaction1.fork((a) => { - a.withResponseBody( - a.responseBody?.fork((i) => { - i.name = 'Dev'; - delete i.age; - }) - ); - }); - - LearnBaseline(interaction1, interaction2); - } - ); - - expect(result.commands).toHaveLength(13); - expect(result.events).toHaveLength(18); -}); - -test('Multiple cases can be created', () => { - const result = Scenario( - 'GET /user/:userId/profile', - ({ AddPath, LearnBaseline, when }) => { - AddPath('user', ':userId', 'profile'); - - const interaction1 = newInteraction('/user/abc/profile', 'GET'); - interaction1.withResponseBody(newBody({ name: 'Aidan', age: 26 })); - - LearnBaseline(interaction1); - - when( - 'name is missing', - interaction1.fork((i) => { - i.withResponseBody( - i.responseBody?.fork((body) => { - delete body.name; - }) - ); - }), - TAGS.OMMITED_REQUIRED_FIELD - ); - - when( - 'age missing', - interaction1.fork((i) => { - i.withResponseBody( - i.responseBody?.fork((body) => { - delete body.age; - }) - ); - }), - TAGS.OMMITED_REQUIRED_FIELD - ); - } - ); - expect(result.scenarios).toHaveLength(2); -}); - -test('Body can be forked', () => { - const original = newBody({ name: 'Aidan' }); - const changed = original.fork((a) => { - a.name = 'Dev'; - }); - - expect(original.value.name).not.toBe(changed.value.name); -}); - -test('Interaction can be forked', () => { - const original = newInteraction('/user/123/profile', 'GET'); - const changed = original.fork((a) => { - a.withUrl('/user/235/profile'); - }); - - expect(original.url).not.toBe(changed.url); -}); diff --git a/workspaces/test-data/src/helpers/InteractionHelper.ts b/workspaces/test-data/src/helpers/InteractionHelper.ts deleted file mode 100644 index 78c9e31ac9..0000000000 --- a/workspaces/test-data/src/helpers/InteractionHelper.ts +++ /dev/null @@ -1,148 +0,0 @@ -//@ts-ignore -import deepCopy from 'deepcopy'; -import { IHttpInteraction } from '@useoptic/domain-types'; - -export function newInteraction(url: string, method: string) { - return new InteractionHelper(url, method); -} - -export function newBody(body: any) { - return new BodyHelper(body); -} - -export class InteractionHelper { - public url: string; - public method: string; - public statusCode: number = 200; - public requestBody: BodyHelper | null = null; - public responseBody: BodyHelper | null = null; - - constructor(url: string, method: string) { - this.url = url; - this.method = method; - } - - withUrl = (url: string) => { - this.url = url; - }; - withMethod = (method: string) => { - this.method = method; - return this; - }; - withRequestBody = (body: BodyHelper | null | undefined) => { - if (!body) { - this.requestBody = null; - return this; - } - this.requestBody = body; - return this; - }; - withStatusCode = (statusCode: number) => { - this.statusCode = statusCode; - return this; - }; - withResponseBody = (body: BodyHelper | null | undefined) => { - if (!body) { - this.responseBody = null; - return this; - } - this.responseBody = body; - return this; - }; - - copy = () => { - const interaction = new InteractionHelper(this.url, this.method); - interaction.withRequestBody(this.requestBody?.copy() || null); - interaction.withResponseBody(this.responseBody?.copy() || null); - interaction.withStatusCode(this.statusCode); - return interaction; - }; - - fork = (mutation: (a: InteractionHelper) => void) => { - const a = this.copy(); - mutation(a); - return a; - }; - - toInteraction(uuid = 'id'): IHttpInteraction { - return { - tags: [], - uuid, - response: { - statusCode: this.statusCode, - headers: { - shapeHashV1Base64: null, - asJsonString: null, - asText: null, - }, - body: - this.responseBody === null - ? { - contentType: null, - value: { - shapeHashV1Base64: null, - asJsonString: null, - asText: null, - }, - } - : { - contentType: 'application/json', - value: { - shapeHashV1Base64: null, - asJsonString: JSON.stringify(this.responseBody.value), - asText: null, - }, - }, - }, - request: { - host: 'example.com', - method: this.method, - path: this.url, - query: { - shapeHashV1Base64: null, - asJsonString: null, - asText: null, - }, - headers: { - shapeHashV1Base64: null, - asJsonString: null, - asText: null, - }, - body: - this.requestBody === null - ? { - contentType: null, - value: { - shapeHashV1Base64: null, - asJsonString: null, - asText: null, - }, - } - : { - contentType: 'application/json', - value: { - shapeHashV1Base64: null, - asJsonString: JSON.stringify(this.requestBody.value), - asText: null, - }, - }, - }, - }; - } -} - -class BodyHelper { - public value: any; - - constructor(value: any) { - this.value = value; - } - - copy = () => new BodyHelper(deepCopy(this.value)); - - fork = (handler: (a: any) => any) => { - const a = deepCopy(this.value); - handler(a); - return new BodyHelper(a); - }; -} diff --git a/workspaces/test-data/src/helpers/Scenario.ts b/workspaces/test-data/src/helpers/Scenario.ts deleted file mode 100644 index 9e842f4359..0000000000 --- a/workspaces/test-data/src/helpers/Scenario.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { opticEngine } from '@useoptic/domain'; -const TestDataHelper = opticEngine.com.useoptic.TestDataHelper; -import { IHttpInteraction } from '@useoptic/domain-types'; -import md5 from 'md5'; -import { InteractionHelper } from './InteractionHelper'; - -interface ScenarioBlockContext { - AddPath: (...components: string[]) => void; - LearnBaseline: (...interactions: InteractionHelper[]) => void; - // DiffAgainst: (interaction: IHttpInteraction) => void; - - when: (caseName: string, interaction: InteractionHelper, tag: string) => void; -} - -interface StagedScenario { - scenario: string; - case: string; - events: any[]; - tag: string; - interaction: IHttpInteraction; -} - -export function Scenario( - name: string, - block: (context: ScenarioBlockContext) => void -) { - const commands: any[] = []; - const prefix = md5(name).substr(0, 12); - const helper = TestDataHelper.withPrefix(prefix); - - const scenarios: StagedScenario[] = []; - - const context: ScenarioBlockContext = { - AddPath: (...components) => { - const result = helper.AddPath(components); - result.forEach((i: any) => commands.push(i)); - }, - LearnBaseline: (...interactions) => { - const baselineInteractions = interactions.map((i, index) => - i.toInteraction(index.toString()) - ); - - const result = helper.LearnBaseline(commands, baselineInteractions); - result.forEach((i: any) => commands.push(i)); - }, - when: (caseName: string, interaction, tag: string) => { - scenarios.push({ - scenario: name, - case: caseName, - events: [], - tag, - interaction: interaction.toInteraction('last'), - }); - }, - }; - - block(context); - const events = helper.FinalizeEvents(commands); - - scenarios.forEach((s) => (s.events = events)); - scenarios.forEach((i) => allScenarios.push(i)); - - return { commands, events, scenarios }; -} - -//storage -export const allScenarios: StagedScenario[] = []; diff --git a/workspaces/test-data/src/helpers/TAGS.ts b/workspaces/test-data/src/helpers/TAGS.ts deleted file mode 100644 index 2451f30493..0000000000 --- a/workspaces/test-data/src/helpers/TAGS.ts +++ /dev/null @@ -1,11 +0,0 @@ -export const TAGS = { - OMMITED_REQUIRED_FIELD: 'OMMITED_REQUIRED_FIELD', - PROVIDED_NEW_FIELD: 'PROVIDED_NEW_FIELD', - PROVIDED_DIFFERENT_TYPE_TO_KNOWN_FIELD: - 'PROVIDED_DIFFERENT_TYPE_TO_KNOWN_FIELD', - ARRAY_ITEM_DOES_NOT_MATCH_ASSERTION: 'ARRAY_ITEM_DOES_NOT_MATCH_ASSERTION', - ARRAY_ITEM_IS_NULL_AND_DOES_NOT_MATCH_ASSERTION: 'ARRAY_CONTAINS_NULL', - UNKNOWN_NULLABLE_PROVIDED_WITH_VALUE: 'UNKNOWN_NULLABLE_PROVIDED_WITH_VALUE', - UNKNOWN_LIST_PROVIDED_WITH_ITEMS: 'UNKNOWN_LIST_PROVIDED_WITH_ITEMS', - NO_DIFF_EXPECTED: 'NO_DIFF_EXPECTED', -}; diff --git a/workspaces/test-data/src/index.ts b/workspaces/test-data/src/index.ts deleted file mode 100644 index df7f9a0238..0000000000 --- a/workspaces/test-data/src/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { allScenarios } from './helpers/Scenario'; - -//Require all scenarios -require('./scenarios/ObjectKeys'); -require('./scenarios/UnknownConversions'); -require('./scenarios/Arrays'); -require('./scenarios/Optionals'); - -console.log(`Collected ${allScenarios.length}`); diff --git a/workspaces/test-data/src/scenarios/Arrays.ts b/workspaces/test-data/src/scenarios/Arrays.ts deleted file mode 100644 index af3bee78bf..0000000000 --- a/workspaces/test-data/src/scenarios/Arrays.ts +++ /dev/null @@ -1,126 +0,0 @@ -import { Scenario } from '../helpers/Scenario'; -import { newBody, newInteraction } from '../helpers/InteractionHelper'; -import { TAGS } from '../helpers/TAGS'; - -const newExampleEvent = (name: string, attending: number) => ({ - name, - attending, -}); - -Scenario('Empty Array at Root', ({ AddPath, LearnBaseline, when }) => { - const exampleBodyBase: any = []; - - const interaction = newInteraction('/events', 'GET'); - interaction.withResponseBody(newBody(exampleBodyBase)); - - const baseBody = interaction.requestBody; - - AddPath('events'); - LearnBaseline(interaction); - - when( - 'when unknown and provided with items', - interaction.withResponseBody( - baseBody?.fork((body) => { - body = [ - newExampleEvent('Computer Time', 55), - newExampleEvent('Cooking Class', 19), - ]; - }) - ), - TAGS.UNKNOWN_LIST_PROVIDED_WITH_ITEMS - ); -}); - -Scenario('Nested Array', ({ AddPath, LearnBaseline, when }) => { - const exampleBodyBase: any = { - colors: ['#00FFFF', '#FF00FF', '#C0C0C0'], - }; - - const interaction = newInteraction('/colors', 'GET'); - interaction.withResponseBody(newBody(exampleBodyBase)); - - const baseBody = interaction.requestBody; - - AddPath('colors'); - LearnBaseline(interaction); - - when( - 'when presented with an empty array', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.colors = []; - }) - ), - TAGS.NO_DIFF_EXPECTED - ); - - when( - 'when provided with only items that do not match', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.colors = [1, 2, 3, true]; - }) - ), - TAGS.ARRAY_ITEM_DOES_NOT_MATCH_ASSERTION - ); - - when( - 'when provided with some items that match and some that do not', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.colors = ['#e2e2e2', true]; - }) - ), - TAGS.ARRAY_ITEM_DOES_NOT_MATCH_ASSERTION - ); - - when( - 'when provided with items that match and null', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.colors = ['#e2e2e2', null]; - }) - ), - TAGS.ARRAY_ITEM_IS_NULL_AND_DOES_NOT_MATCH_ASSERTION - ); -}); - -Scenario('Array of arrays', ({ AddPath, LearnBaseline, when }) => { - const exampleBodyBase: any = { - athletes: [ - ['Brooks', { sport: 'golf' }], - ['Woods', { sport: 'golf' }], - ], - }; - - //should be learned as List[OneOf[String, Object]] - - const interaction = newInteraction('/athletes', 'GET'); - interaction.withResponseBody(newBody(exampleBodyBase)); - - const baseBody = interaction.requestBody; - - AddPath('athletes'); - LearnBaseline(interaction); - - when( - 'when provided with items that match', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.athletes = [['Brooks', { sport: 'golf' }]]; - }) - ), - TAGS.NO_DIFF_EXPECTED - ); - - when( - 'when the object part of the OneOf has a new field, it should create a diff', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.athletes = [['Brooks', { sport: 'golf', rank: 1 }]]; - }) - ), - TAGS.PROVIDED_NEW_FIELD - ); -}); diff --git a/workspaces/test-data/src/scenarios/ObjectKeys.ts b/workspaces/test-data/src/scenarios/ObjectKeys.ts deleted file mode 100644 index 1708de750f..0000000000 --- a/workspaces/test-data/src/scenarios/ObjectKeys.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { Scenario } from '../helpers/Scenario'; -import { newBody, newInteraction } from '../helpers/InteractionHelper'; -import { TAGS } from '../helpers/TAGS'; - -Scenario( - 'Root Shape is an Object with Keys', - ({ AddPath, LearnBaseline, when }) => { - const exampleBodyBase = { - firstName: 'Aidan', - lastName: 'C', - age: 26, - cities: ['San Fransisco', 'New York', 'Durham'], - }; - - const interaction = newInteraction('/users/1234/profile', 'GET'); - interaction.withResponseBody(newBody(exampleBodyBase)); - - const baseBody = interaction.requestBody; - - AddPath('users', ':userId', 'profile'); - LearnBaseline(interaction); - - when( - 'a known field is missing', - interaction.withResponseBody( - baseBody?.fork((body) => { - delete body.lastName; - }) - ), - TAGS.OMMITED_REQUIRED_FIELD - ); - - when( - 'a known field is provided the wrong shape', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.age = 'Twenty-Six'; - }) - ), - TAGS.PROVIDED_DIFFERENT_TYPE_TO_KNOWN_FIELD - ); - - when( - 'an extra field is provided', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.favoriteColor = 'Syracuse-Orange'; - }) - ), - TAGS.PROVIDED_NEW_FIELD - ); - - when( - 'field is array of primitives, and > 1 item does not match expected type', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.cities = [...body.cities, 27707]; - }) - ), - TAGS.ARRAY_ITEM_DOES_NOT_MATCH_ASSERTION - ); - } -); - -Scenario('Nested Object Keys', ({ AddPath, LearnBaseline, when }) => { - const exampleBodyBase = { - location: { - principality: { - city: 'San Fransisco', - population: 830000, - }, - }, - }; - - const interaction = newInteraction('/locations/sf', 'GET'); - interaction.withResponseBody(newBody(exampleBodyBase)); - - const interaction2 = interaction.fork((i) => { - i.withResponseBody( - i.responseBody?.fork((base) => { - base.location.coordinates = { - latitude: '37.7749° N', - longitude: '122.4194° W', - }; - }) - ); - }); - - const baseBody = interaction.requestBody; - - AddPath('locations', ':code'); - LearnBaseline(interaction, interaction2); - - when( - 'a new field is provided in a required nested object', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.location.principality.motto = 'Experientia Docet'; - }) - ), - TAGS.PROVIDED_NEW_FIELD - ); - - when( - 'a new field is provided in an optional nested object', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.location.coordinates.format = 'DMS'; - }) - ), - TAGS.PROVIDED_NEW_FIELD - ); - - when( - 'the wrong value is provided to an optional field', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.location.coordinates = 'N/A'; - }) - ), - TAGS.PROVIDED_DIFFERENT_TYPE_TO_KNOWN_FIELD - ); -}); diff --git a/workspaces/test-data/src/scenarios/Optionals.ts b/workspaces/test-data/src/scenarios/Optionals.ts deleted file mode 100644 index 6ce7abae5f..0000000000 --- a/workspaces/test-data/src/scenarios/Optionals.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { Scenario } from '../helpers/Scenario'; -import { newBody, newInteraction } from '../helpers/InteractionHelper'; -import { TAGS } from '../helpers/TAGS'; - -Scenario('Nested optionals', ({ AddPath, LearnBaseline, when }) => { - const exampleBodyBase = { - name: { - first: 'Bob', - last: 'C', - }, - rivals: ['user1', 'user2', 'user3'], - stats: { - rank: 1, - }, - }; - - const interaction = newInteraction('/users/1234/profile', 'GET'); - interaction.withResponseBody(newBody(exampleBodyBase)); - - //makes stats empty by default - const interaction2 = interaction.fork((i) => - i.withResponseBody( - i.responseBody?.fork((body) => { - delete body.stats; - delete body.rivals; - }) - ) - ); - - const baseBody = interaction.requestBody; - - AddPath('users', ':userId', 'profile'); - LearnBaseline(interaction, interaction2); - - when( - 'an optional field is omitted', - interaction.withResponseBody( - baseBody?.fork((body) => { - delete body.stats; - }) - ), - TAGS.NO_DIFF_EXPECTED - ); - - when( - 'an optional field is provided but the type does not match', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.stats = 'N/A'; - }) - ), - TAGS.PROVIDED_DIFFERENT_TYPE_TO_KNOWN_FIELD - ); - - when( - 'an optional field is provided but is null', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.stats = null; - }) - ), - TAGS.PROVIDED_DIFFERENT_TYPE_TO_KNOWN_FIELD - ); - - when( - 'an optional field is provided but one of its fields is missing', - interaction.withResponseBody( - baseBody?.fork((body) => { - delete body.stats.rank; - }) - ), - TAGS.OMMITED_REQUIRED_FIELD - ); - - when( - 'an optional array field is provided but it contains no items', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.rivals = []; - }) - ), - TAGS.NO_DIFF_EXPECTED - ); - - when( - 'an optional array field is provided but it has the wrong typed items', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.rivals = [true, true, '123']; - }) - ), - TAGS.ARRAY_ITEM_DOES_NOT_MATCH_ASSERTION - ); - - when( - 'an optional array field is provided but it was provided an object', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.rivals = [{ userId: 'alpha' }, { userId: ' beta' }]; - }) - ), - TAGS.ARRAY_ITEM_DOES_NOT_MATCH_ASSERTION - ); -}); diff --git a/workspaces/test-data/src/scenarios/UnknownConversions.ts b/workspaces/test-data/src/scenarios/UnknownConversions.ts deleted file mode 100644 index 7dd4aa72c9..0000000000 --- a/workspaces/test-data/src/scenarios/UnknownConversions.ts +++ /dev/null @@ -1,126 +0,0 @@ -import { Scenario } from '../helpers/Scenario'; -import { newBody, newInteraction } from '../helpers/InteractionHelper'; -import { TAGS } from '../helpers/TAGS'; - -Scenario( - 'Unknowns diffed against real values', - ({ AddPath, LearnBaseline, when }) => { - const exampleBodyBase = { - nullable: null, - emptyArray: [], - }; - - const interaction = newInteraction('/unknown', 'GET'); - interaction.withResponseBody(newBody(exampleBodyBase)); - - const baseBody = interaction.requestBody; - - AddPath('unknown'); - LearnBaseline(interaction); - - when( - 'a nullable[unknown] is provided with a concrete type', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.nullable = 'nullable string'; - }) - ), - TAGS.UNKNOWN_NULLABLE_PROVIDED_WITH_VALUE - ); - - when( - 'a list[unknown] is provided with concrete types', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.emptyArray = [1, 2, 3, 4, 5]; - }) - ), - TAGS.UNKNOWN_LIST_PROVIDED_WITH_ITEMS - ); - } -); - -Scenario( - 'Unknowns arrays, with complex types', - ({ AddPath, LearnBaseline, when }) => { - const exampleBodyBase = { - users: [], - }; - - const interaction = newInteraction('/users', 'GET'); - interaction.withResponseBody(newBody(exampleBodyBase)); - - const baseBody = interaction.requestBody; - - AddPath('users'); - LearnBaseline(interaction); - - when( - 'when unknown replaced by an object', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.users = [{ name: 'Bob' }, { name: 'Tim' }, { name: 'Mary' }]; - }) - ), - TAGS.UNKNOWN_NULLABLE_PROVIDED_WITH_VALUE - ); - - when( - 'when unknown replaced by an object with optional fields', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.users = [ - { name: 'Bob' }, - { name: 'Tim', age: 12 }, - { name: 'Mary' }, - ]; - }) - ), - TAGS.UNKNOWN_NULLABLE_PROVIDED_WITH_VALUE - ); - - when( - 'when unknown replaced by one of list items', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.users = [12, 'ABC', false]; - }) - ), - TAGS.UNKNOWN_NULLABLE_PROVIDED_WITH_VALUE - ); - - when( - 'when unknown replaced by possible null item (first item)', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.users = [null, { name: 'Tim' }, { name: 'Mary' }]; - }) - ), - TAGS.UNKNOWN_NULLABLE_PROVIDED_WITH_VALUE - ); - - when( - 'when unknown replaced by possible null item (last item)', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.users = [{ name: 'Tim' }, { name: 'Mary' }, null]; - }) - ), - TAGS.UNKNOWN_NULLABLE_PROVIDED_WITH_VALUE - ); - - when( - 'when unknown replaced by array of tuples', - interaction.withResponseBody( - baseBody?.fork((body) => { - body.users = [ - ['aidan', 767834], - ['bob', 653737], - ['charles', 293737], - ]; - }) - ), - TAGS.UNKNOWN_NULLABLE_PROVIDED_WITH_VALUE - ); - } -); diff --git a/workspaces/test-data/tsconfig.json b/workspaces/test-data/tsconfig.json deleted file mode 100644 index 7b8f9830c7..0000000000 --- a/workspaces/test-data/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../config/tsconfig.json", - "compilerOptions": { - "outDir": "build", - "rootDir": "src" - } -} diff --git a/workspaces/ui/package.json b/workspaces/ui/package.json index 54d5eef1bc..38d68cd635 100644 --- a/workspaces/ui/package.json +++ b/workspaces/ui/package.json @@ -16,8 +16,8 @@ "@material-ui/icons": "^4.9.1", "@material-ui/lab": "^4.0.0-alpha.46", "@useoptic/cli-client": "8.2.2", - "@useoptic/domain": "8.2.2", - "@useoptic/domain-utilities": "8.2.2", + "@useoptic/domain": "8.2.3", + "@useoptic/domain-utilities": "8.2.3", "bottleneck": "^2.19.5", "camelcase": "^5.2.0", "classnames": "^2.2.6", diff --git a/yarn.lock b/yarn.lock index e00a25f658..d36da25922 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2835,6 +2835,28 @@ lodash.unescape "4.0.1" semver "5.5.0" +"@useoptic/domain-types@8.2.3": + version "8.2.3" + resolved "https://registry.yarnpkg.com/@useoptic/domain-types/-/domain-types-8.2.3.tgz#fc4788e85f3326beed988db0853078fbc60c4e94" + integrity sha512-izxH/sfwF6MBwWhvAmQpCyDhHCMur5T9cjIjb+hhW/sHQOUBKMGomJSemw3Mby7NSwMr8F6ag6BS7F5mJopE/g== + +"@useoptic/domain-utilities@8.2.3": + version "8.2.3" + resolved "https://registry.yarnpkg.com/@useoptic/domain-utilities/-/domain-utilities-8.2.3.tgz#db3aef4b829ee512b167f3e1f7329f8edccc85cb" + integrity sha512-2YacJ5TQvYjW3TF3zCOaZ7GC98uaMWY1aIpnJoF451vR4oAQare6gMwJaygOrpnd4mDRRoUvX8HAMz6GOYfSBQ== + dependencies: + "@useoptic/domain" "8.2.1" + +"@useoptic/domain@8.2.1": + version "8.2.1" + resolved "https://registry.yarnpkg.com/@useoptic/domain/-/domain-8.2.1.tgz#f13018cb3aa6ef4271ab76bc674196032b20c295" + integrity sha512-dxyuaIJaGvKG8XcoZqW3hzwv3QIbY1WPLY/YhapA1HnVta+m5/mw+b9Yo1IbP0uusc+UI8DeBsYj4zY6JMrejw== + +"@useoptic/domain@8.2.3": + version "8.2.3" + resolved "https://registry.yarnpkg.com/@useoptic/domain/-/domain-8.2.3.tgz#feee0588137387076a4701222a1ebd2a17b4614f" + integrity sha512-OCG5gYq2pJZYaiBP6M7xH7lEfQO8dHtkQ3N3q1svZfpFWysJtBKsXmJrp2a2rrf50i3H1o5QceBcCXWI2kGrzQ== + "@webassemblyjs/ast@1.8.5": version "1.8.5" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" From ccbbb8d94f50ae74c62de71b003d29c1266785e4 Mon Sep 17 00:00:00 2001 From: Aidan Cunniffe Date: Wed, 15 Jul 2020 16:40:27 -0400 Subject: [PATCH 18/21] cleanup workflows --- .github/workflows/build.yml | 28 ---------------------------- .github/workflows/featurepeek.yml | 2 -- 2 files changed, 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e771e24701..b46b305aff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,30 +20,6 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: "checkout source" - uses: actions/checkout@v2 - - name: "Set up JDK 1.8" - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - - name: pwd - run: pwd - - name: "where is the code" - run: echo $GITHUB_WORKSPACE - - name: ls - run: ls -la $GITHUB_WORKSPACE - - name: "list sbt projects" - run: cd "$GITHUB_WORKSPACE/core" && sbt projects - - name: "build domain.js artifact" - run: cd "$GITHUB_WORKSPACE/core" && sbt fullOptJS - env: - SBT_OPTS: "-Xmx2G -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=2G -Xss2M -Duser.timezone=GMT" - - name: "check artifact" - run: ls -la "$GITHUB_WORKSPACE/core/optic/js/target/scala-2.12/optic-core-opt.js" - - name: "copy artifact" - run: cp "$GITHUB_WORKSPACE/core/optic/js/target/scala-2.12/optic-core-opt.js" "$GITHUB_WORKSPACE/workspaces/domain/src/domain.js" - - name: "set up node.js" uses: actions/setup-node@v1 with: @@ -52,7 +28,3 @@ jobs: run: yarn install - name: "build workspaces" run: yarn wsrun --stages --report --fast-exit ws:build - - name: "check domain src directory" - run: ls -laR "$GITHUB_WORKSPACE/workspaces/domain/src" - - name: "check domain build directory" - run: ls -laR "$GITHUB_WORKSPACE/workspaces/domain/build" diff --git a/.github/workflows/featurepeek.yml b/.github/workflows/featurepeek.yml index 1fbf9c68a5..4eab6c3a08 100644 --- a/.github/workflows/featurepeek.yml +++ b/.github/workflows/featurepeek.yml @@ -16,8 +16,6 @@ jobs: run: yarn run bump "0.1.0-pr.$GITHUB_RUN_ID" - name: "yarn install, post version changes" run: yarn install - - name: "build domain" - run: yarn run build-domain - name: "build workspaces" run: yarn wsrun --stages --report --fast-exit ws:build - name: Install dependencies From 06798eb588fb5d8325a4ce0be5c724945d18a83b Mon Sep 17 00:00:00 2001 From: Aidan Cunniffe Date: Wed, 15 Jul 2020 16:44:04 -0400 Subject: [PATCH 19/21] check out the code before building it --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b46b305aff..b70dddef30 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,8 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: "checkout source" + uses: actions/checkout@v2 - name: "set up node.js" uses: actions/setup-node@v1 with: From 29e281889edeec590e454bda57c1a74fae4fa76e Mon Sep 17 00:00:00 2001 From: Dev Doshi Date: Thu, 16 Jul 2020 10:26:23 -0400 Subject: [PATCH 20/21] mockttp should be a runtime dependency for cli-shared --- workspaces/cli-shared/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workspaces/cli-shared/package.json b/workspaces/cli-shared/package.json index ac29cb4ff9..d77d55d8a8 100644 --- a/workspaces/cli-shared/package.json +++ b/workspaces/cli-shared/package.json @@ -26,6 +26,7 @@ "bottleneck": "^2.19.5", "colors": "^1.4.0", "fs-extra": "^9.0.0", + "mockttp": "^0.19.2", "ora": "^4.0.4", "tree-kill": "^1.2.2", "uuid": "^8.0.0", @@ -33,8 +34,7 @@ "whatwg-mimetype": "^2.3.0" }, "devDependencies": { - "@types/whatwg-mimetype": "^2.1.0", - "mockttp": "^0.19.2" + "@types/whatwg-mimetype": "^2.1.0" }, "files": [ "/build" From e290ddbc36d635696a9f9793773e72130f6eae5e Mon Sep 17 00:00:00 2001 From: Aidan Cunniffe Date: Thu, 16 Jul 2020 10:34:50 -0400 Subject: [PATCH 21/21] hotfix for mockttp issue and version bump --- workspaces/agent-cli/package.json | 4 ++-- workspaces/ci-cli/package.json | 6 +++--- workspaces/cli-client/package.json | 6 +++--- workspaces/cli-config/package.json | 2 +- workspaces/cli-scripts/package.json | 4 ++-- workspaces/cli-server/package.json | 12 ++++++------ workspaces/cli-shared/package.json | 8 ++++---- workspaces/client-utilities/package.json | 2 +- workspaces/local-cli/package.json | 12 ++++++------ workspaces/saas-types/package.json | 2 +- workspaces/snapshot-tests/package.json | 2 +- workspaces/ui/package.json | 4 ++-- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/workspaces/agent-cli/package.json b/workspaces/agent-cli/package.json index 31868083be..bba817f65c 100644 --- a/workspaces/agent-cli/package.json +++ b/workspaces/agent-cli/package.json @@ -1,6 +1,6 @@ { "name": "@useoptic/agent-cli", - "version": "8.2.2", + "version": "8.2.3", "author": "@useoptic", "bin": { "optic-agent": "./bin/run" @@ -15,7 +15,7 @@ "@oclif/command": "^1", "@oclif/config": "^1", "@oclif/plugin-help": "^3", - "@useoptic/cli-shared": "8.2.2", + "@useoptic/cli-shared": "8.2.3", "dotenv": "^8.2.0", "jwt-decode": "^2.2.0", "tslib": "^1", diff --git a/workspaces/ci-cli/package.json b/workspaces/ci-cli/package.json index c24d3f2359..492377fe1c 100644 --- a/workspaces/ci-cli/package.json +++ b/workspaces/ci-cli/package.json @@ -1,6 +1,6 @@ { "name": "@useoptic/ci-cli", - "version": "8.2.2", + "version": "8.2.3", "author": "@useoptic", "bin": { "optic-ci": "./bin/run" @@ -15,8 +15,8 @@ "@oclif/command": "^1", "@oclif/config": "^1", "@oclif/plugin-help": "^3", - "@useoptic/cli-config": "8.2.2", - "@useoptic/cli-shared": "8.2.2", + "@useoptic/cli-config": "8.2.3", + "@useoptic/cli-shared": "8.2.3", "dotenv": "^8.2.0", "jwt-decode": "^2.2.0", "tslib": "^1", diff --git a/workspaces/cli-client/package.json b/workspaces/cli-client/package.json index 213b697110..28520dfcb2 100644 --- a/workspaces/cli-client/package.json +++ b/workspaces/cli-client/package.json @@ -1,6 +1,6 @@ { "name": "@useoptic/cli-client", - "version": "8.2.2", + "version": "8.2.3", "scripts": { "ws:build": "yarn run tsc -b --verbose", "ws:clean": "rm -rf build/*", @@ -14,8 +14,8 @@ "main": "build/index.js", "types": "build/index.d.ts", "dependencies": { - "@useoptic/cli-config": "8.2.2", - "@useoptic/client-utilities": "8.2.2", + "@useoptic/cli-config": "8.2.3", + "@useoptic/client-utilities": "8.2.3", "bottleneck": "^2.19.5", "cross-fetch": "^3.0.4" }, diff --git a/workspaces/cli-config/package.json b/workspaces/cli-config/package.json index a763a3d789..976ee5c3fa 100644 --- a/workspaces/cli-config/package.json +++ b/workspaces/cli-config/package.json @@ -1,6 +1,6 @@ { "name": "@useoptic/cli-config", - "version": "8.2.2", + "version": "8.2.3", "scripts": { "ws:test": "echo config", "ws:build": "yarn run tsc -b --verbose", diff --git a/workspaces/cli-scripts/package.json b/workspaces/cli-scripts/package.json index 0ee0f29612..980eb6cc87 100644 --- a/workspaces/cli-scripts/package.json +++ b/workspaces/cli-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@useoptic/cli-scripts", - "version": "8.2.2", + "version": "8.2.3", "scripts": { "ws:test": "echo scripts", "ws:build": "yarn run tsc -b --verbose", @@ -16,7 +16,7 @@ "dependencies": { "node-notifier": "^7.0.0", "analytics-node": "^3.4.0-beta.1", - "@useoptic/cli-shared": "8.2.2" + "@useoptic/cli-shared": "8.2.3" }, "devDependencies": { "@types/node-notifier": "^6.0.1" diff --git a/workspaces/cli-server/package.json b/workspaces/cli-server/package.json index 819bbcbefe..8c6de74df2 100644 --- a/workspaces/cli-server/package.json +++ b/workspaces/cli-server/package.json @@ -1,6 +1,6 @@ { "name": "@useoptic/cli-server", - "version": "8.2.2", + "version": "8.2.3", "scripts": { "ws:build": "yarn run tsc -b --verbose", "ws:clean": "rm -rf build/*", @@ -14,11 +14,11 @@ "main": "build/index.js", "types": "build/index.d.ts", "dependencies": { - "@useoptic/cli-client": "8.2.2", - "@useoptic/cli-config": "8.2.2", - "@useoptic/cli-scripts": "8.2.2", - "@useoptic/cli-shared": "8.2.2", - "@useoptic/ui": "8.2.2", + "@useoptic/cli-client": "8.2.3", + "@useoptic/cli-config": "8.2.3", + "@useoptic/cli-scripts": "8.2.3", + "@useoptic/cli-shared": "8.2.3", + "@useoptic/ui": "8.2.3", "avsc": "^5.4.18", "body-parser": "^1.19.0", "cors": "^2.8.5", diff --git a/workspaces/cli-shared/package.json b/workspaces/cli-shared/package.json index d77d55d8a8..4dc5e26354 100644 --- a/workspaces/cli-shared/package.json +++ b/workspaces/cli-shared/package.json @@ -1,6 +1,6 @@ { "name": "@useoptic/cli-shared", - "version": "8.2.2", + "version": "8.2.3", "scripts": { "ws:build": "yarn run tsc -b --verbose", "ws:clean": "rm -rf build/*", @@ -15,9 +15,9 @@ "types": "build/index.d.ts", "dependencies": { "@oclif/command": "^1.6.1", - "@useoptic/cli-client": "8.2.2", - "@useoptic/cli-config": "8.2.2", - "@useoptic/client-utilities": "8.2.2", + "@useoptic/cli-client": "8.2.3", + "@useoptic/cli-config": "8.2.3", + "@useoptic/client-utilities": "8.2.3", "@useoptic/domain": "8.2.3", "@useoptic/domain-types": "8.2.3", "@useoptic/domain-utilities": "8.2.3", diff --git a/workspaces/client-utilities/package.json b/workspaces/client-utilities/package.json index daa7433fab..399b6d1f48 100644 --- a/workspaces/client-utilities/package.json +++ b/workspaces/client-utilities/package.json @@ -1,6 +1,6 @@ { "name": "@useoptic/client-utilities", - "version": "8.2.2", + "version": "8.2.3", "scripts": { "ws:build": "yarn run tsc -b --verbose", "ws:clean": "rm -rf build/*", diff --git a/workspaces/local-cli/package.json b/workspaces/local-cli/package.json index 85821be315..69137ec2b1 100644 --- a/workspaces/local-cli/package.json +++ b/workspaces/local-cli/package.json @@ -1,7 +1,7 @@ { "name": "@useoptic/cli", "description": "The Optic CLI", - "version": "8.2.2", + "version": "8.2.3", "author": "@useoptic", "bin": { "api": "./bin/run" @@ -16,11 +16,11 @@ "@oclif/command": "^1", "@oclif/config": "^1", "@oclif/plugin-help": "^2", - "@useoptic/cli-client": "8.2.2", - "@useoptic/cli-config": "8.2.2", - "@useoptic/cli-scripts": "8.2.2", - "@useoptic/cli-server": "8.2.2", - "@useoptic/cli-shared": "8.2.2", + "@useoptic/cli-client": "8.2.3", + "@useoptic/cli-config": "8.2.3", + "@useoptic/cli-scripts": "8.2.3", + "@useoptic/cli-server": "8.2.3", + "@useoptic/cli-shared": "8.2.3", "@useoptic/domain": "8.2.3", "analytics-node": "^3.4.0-beta.1", "cli-ux": "^5.4.1", diff --git a/workspaces/saas-types/package.json b/workspaces/saas-types/package.json index 615ee4d334..c1544acaa3 100644 --- a/workspaces/saas-types/package.json +++ b/workspaces/saas-types/package.json @@ -1,7 +1,7 @@ { "name": "@useoptic/saas-types", "description": "interfaces and types for Optic SaaS surface area", - "version": "8.2.2", + "version": "8.2.3", "main": "build/index.js", "files": [ "build" diff --git a/workspaces/snapshot-tests/package.json b/workspaces/snapshot-tests/package.json index 88e892fe89..6fc768baf4 100644 --- a/workspaces/snapshot-tests/package.json +++ b/workspaces/snapshot-tests/package.json @@ -1,6 +1,6 @@ { "name": "@useoptic/snapshot-tests", - "version": "8.2.2", + "version": "8.2.3", "scripts": { "ws:build": "yarn run tsc -b --verbose", "ws:clean": "rm -rf build/*", diff --git a/workspaces/ui/package.json b/workspaces/ui/package.json index 38d68cd635..50d38b2b59 100644 --- a/workspaces/ui/package.json +++ b/workspaces/ui/package.json @@ -1,6 +1,6 @@ { "name": "@useoptic/ui", - "version": "8.2.2", + "version": "8.2.3", "files": [ "build", "index.js", @@ -15,7 +15,7 @@ "@material-ui/core": "^4.9.7", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "^4.0.0-alpha.46", - "@useoptic/cli-client": "8.2.2", + "@useoptic/cli-client": "8.2.3", "@useoptic/domain": "8.2.3", "@useoptic/domain-utilities": "8.2.3", "bottleneck": "^2.19.5",