Skip to content

Commit

Permalink
Upgrade to yarn4+ ditch Lerna (#73)
Browse files Browse the repository at this point in the history
* fix lint command

* lint should exit when successful

* setup to use yarn 4

* Update circleci.yml

* commanded needed for machine to be able to install and use yarn 3 if  the package specifies to do so

* get jest running

* yarn berry requires jest to be listed as dep in each package (seemingly)

* docker changes for yarn3

* maybe this will show the issue?

* revert to mean

* remove lerna -- convert to yarn workspaces

* update build commands,  add examples scripts to ci

* include examples in workspaces.

* add back node types

* no lerna file anymore

* why would you clean the cache after installing?

* will docker build?

* copy yarn3 over

* is this right?

* fix test run on combiner

* try focus feature

* fix package ref

* need typescript to compile

* dont use plugin

* work on docker run

* yarn4 && fix global scripts

* no plugins found

* fix running build command

* toplevel

* add --top-level to call bins from workspaces

* merge issues

* fix odis-id

* its plural

* no postinstall

* try seeing what is in bin

* try just installing everything

* fix the clean commands

* build both containers (TEMP)

* fix? index.d.ts is not a module

* i think this is it

* ok better

* are these indented wrong?

* pretty

* Bump reusable wf version

* platforms: 'linux/amd64'

* Master ref commit

* Update reusable wf commit and inputs

* Test signer Dockerfile

* Fix dockerfiles signer loadtest

* Load tests dockerfile

* prune dev deps

* fix commands

* add info on setup and releasing

try out not requiring cs when only md files changed

* fix quoting

* Update GH Actions workflows

* add peer deps required by example project

---------

Co-authored-by: Aaron <[email protected]>
Co-authored-by: Álvaro Fernández <[email protected]>
Co-authored-by: alvarof2 <[email protected]>
  • Loading branch information
4 people authored Oct 27, 2023
1 parent 9ecc948 commit be529d4
Show file tree
Hide file tree
Showing 40 changed files with 26,431 additions and 22,350 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-lobsters-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'odis-example-scripts': patch
---

Use @tsconfig/recommended
7 changes: 5 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
Thank you for considering making a contribution to the Celo community!
Everyone is encouraged to contribute, even the smallest fixes are welcome.

If you'd like to contribute to Celo, please fork, fix, commit and send a
pull request for the maintainers to review.
If you'd like to contribute to Celo, please fork, fix, [write a changeset](../RELEASE.md), commit, and send a pull request for the maintainers to review.

If you wish to submit more complex changes, please sync with a core developer first.
This will help ensure those changes are in line with the general philosophy of the project
and enable you to get some early feedback.

See the [contributing guide](https://docs.celo.org/community/contributing) for details on how to participate.

## Dev Setup

We use yarn berry. You may need to run `corepack enable`. This doesnt setup yarn itself but is a node.js feature for enabling package managers.
2 changes: 1 addition & 1 deletion .github/actions/sync-workspace/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ runs:
if: ${{ fromJSON(env.REBUILD_PACKAGE) }}
run: |
yarn install
yarn build --ignore docs --include-dependencies
yarn build
4 changes: 2 additions & 2 deletions .github/workflows/odis-combiner-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

jobs:
odis-combiner-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.11.4
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.12.2
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/odis-combiner
if: |
github.ref != 'refs/heads/main'
Expand All @@ -30,7 +30,7 @@ jobs:
trivy: true

odis-combiner-build:
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.11.4
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.12.2
name: Build us-west1-docker.pkg.dev/devopsre/social-connect/odis-combiner
if: |
github.ref == 'refs/heads/main'
Expand Down
86 changes: 43 additions & 43 deletions .github/workflows/odis-loadtest-container.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
---
name: Build ODIS loadtest image
on:
push:
paths:
- 'dockerfiles/phone-number-privacy/Dockerfile-loadtest'
- 'packages/phone-number-privacy/monitor/**'
branches:
- main
pull_request:
paths:
- 'dockerfiles/phone-number-privacy/Dockerfile-loadtest'
- 'packages/phone-number-privacy/monitor/**'
workflow_dispatch:
jobs:
odis-loadtest-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected].0
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/odis-loadtest
if: |
github.ref != 'refs/heads/main'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-social-connect/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/odis-loadtest
tag: ${{ github.sha }}
context: .
file: dockerfiles/phone-number-privacy/Dockerfile-loadtest
trivy: true
odis-loadtest-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected].0
name: Build us-west1-docker.pkg.dev/devopsre/social-connect/odis-loadtest
if: |
github.ref == 'refs/heads/main'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-social-connect-main/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/social-connect/odis-loadtest
tag: ${{ github.sha }}
context: .
file: dockerfiles/phone-number-privacy/Dockerfile-loadtest
trivy: true
name: Build ODIS loadtest image

on:
push:
paths:
- 'dockerfiles/phone-number-privacy/Dockerfile-loadtest'
- 'packages/phone-number-privacy/monitor/**'
branches:
- main
pull_request:
paths:
- 'dockerfiles/phone-number-privacy/Dockerfile-loadtest'
- 'packages/phone-number-privacy/monitor/**'
workflow_dispatch:

jobs:
odis-loadtest-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected].2
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/odis-loadtest
if: |
github.ref != 'refs/heads/main'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-social-connect/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/odis-loadtest
tag: ${{ github.sha }}
context: .
file: dockerfiles/phone-number-privacy/Dockerfile-loadtest
trivy: true

odis-loadtest-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected].2
name: Build us-west1-docker.pkg.dev/devopsre/social-connect/odis-loadtest
if: |
github.ref == 'refs/heads/main'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-social-connect-main/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/social-connect/odis-loadtest
tag: ${{ github.sha }}
context: .
file: dockerfiles/phone-number-privacy/Dockerfile-loadtest
trivy: true
86 changes: 43 additions & 43 deletions .github/workflows/odis-signer-container.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
---
name: Build ODIS signer image
on:
push:
paths:
- 'dockerfiles/phone-number-privacy/Dockerfile-signer'
- 'packages/phone-number-privacy/signer/**'
branches:
- main
pull_request:
paths:
- 'dockerfiles/phone-number-privacy/Dockerfile-signer'
- 'packages/phone-number-privacy/signer/**'
workflow_dispatch:
jobs:
odis-signer-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected].0
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/odis-signer
if: |
github.ref != 'refs/heads/main'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-social-connect/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/odis-signer
tag: ${{ github.sha }}
context: .
file: dockerfiles/phone-number-privacy/Dockerfile-signer
trivy: true
odis-signer-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected].0
name: Build us-west1-docker.pkg.dev/devopsre/social-connect/odis-signer
if: |
github.ref == 'refs/heads/main'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-social-connect-main/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/social-connect/odis-signer
tag: ${{ github.sha }}
context: .
file: dockerfiles/phone-number-privacy/Dockerfile-signer
trivy: true
name: Build ODIS signer image

on:
push:
paths:
- 'dockerfiles/phone-number-privacy/Dockerfile-signer'
- 'packages/phone-number-privacy/signer/**'
branches:
- main
pull_request:
paths:
- 'dockerfiles/phone-number-privacy/Dockerfile-signer'
- 'packages/phone-number-privacy/signer/**'
workflow_dispatch:

jobs:
odis-signer-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected].2
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/odis-signer
if: |
github.ref != 'refs/heads/main'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-social-connect/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/odis-signer
tag: ${{ github.sha }}
context: .
file: dockerfiles/phone-number-privacy/Dockerfile-signer
trivy: true

odis-signer-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected].2
name: Build us-west1-docker.pkg.dev/devopsre/social-connect/odis-signer
if: |
github.ref == 'refs/heads/main'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-social-connect-main/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/social-connect/odis-signer
tag: ${{ github.sha }}
context: .
file: dockerfiles/phone-number-privacy/Dockerfile-signer
trivy: true
24 changes: 16 additions & 8 deletions .github/workflows/social-connect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,10 @@ jobs:
key: code-${{ github.sha }}
restore-keys: |
code-${{ github.sha }}
- name: "enable corepack"
run : sudo corepack enable yarn
- name: Install yarn dependencies
run: git config --global url."https://".insteadOf ssh:// && yarn install
if: steps.cache_node.outputs.cache-hit != 'true'
- name: Run yarn postinstall if cache hitted
run: yarn run postinstall
if: steps.cache_node.outputs.cache-hit == 'true'
- name: Fail if any file changed on git
run: |
Expand All @@ -119,7 +118,7 @@ jobs:
exit 1
fi
- name: Build packages
run: yarn build --ignore docs --include-dependencies
run: yarn build
- name: Check licenses
if: steps.cache_node.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -153,18 +152,27 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"
- name: Filter paths
id: changes
uses: dorny/paths-filter@v2
with:
filters: |
markdown:
- added|deleted|modified: '*.md'
others:
- added|deleted|modified: "!('*.md')"
- name: Find ChangeSet in PR
uses: peter-evans/find-comment@v2
id: fc
# Skip if author is github-bot from celo-org
if: github.event_name == 'pull_request' && github.event.pull_request.user.type != 'Bot'
# Skip if author is github-bot from celo-org or only md files changed
if: github.event_name == 'pull_request' && github.event.pull_request.user.type != 'Bot' && steps.changes.outputs.others == 'true'
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: Changeset detected
comment-author: changeset-bot[bot]
- name: Fail if Changeset commit not found
# Skip if author is github-bot from celo-org
if: github.event_name == 'pull_request' && github.event.pull_request.user.type != 'Bot'
# Skip if author is github-bot from celo-org or only md files changed
if: github.event_name == 'pull_request' && github.event.pull_request.user.type != 'Bot' && steps.changes.outputs.others == 'true'
run: |
if ${{ steps.fc.outputs.comment-id == 0 }}; then
echo "Error: No Changeset Found. You create an empty changeset with 'yarn cs add --empty'" && exit 1
Expand Down
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ dist/
npm-debug.log
yarn-error.log

# yarn3 files https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# BUCK
buck-out/
\.buckd/
Expand All @@ -71,8 +80,6 @@ buck-out/
coverage
coverage.json

lerna-debug.log

# Typechain types
**/types/typechain/
**/types/typechain-*/
Expand Down Expand Up @@ -107,4 +114,5 @@ scripts/failedSDKs.json

packages/protocol/types/typechain-mento/*.d.ts
tmp
docs/examples/lib
packages/odis-identifiers/lib
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ package.json

packages/**/dist
packages/**/lib
docs/examples/**/lib


Loading

0 comments on commit be529d4

Please sign in to comment.