Skip to content

Commit 06885f3

Browse files
committed
Merge branch 'main' into mde/sam-contract
2 parents 58463a8 + 59154f7 commit 06885f3

File tree

461 files changed

+50219
-11389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

461 files changed

+50219
-11389
lines changed

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ runs:
1717
run: yarn --immutable
1818
- name: Build
1919
shell: bash
20-
run: yarn build
20+
run: yarn build || yarn build

.github/workflows/ci.yml renamed to .github/workflows/ci-contracts.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: CI - packages/contracts
22

33
env:
44
CI: true
@@ -23,7 +23,9 @@ jobs:
2323
- name: Set up environment
2424
uses: ./.github/actions/setup
2525
- name: Run tests
26-
run: yarn test:coverage
26+
run: |
27+
pushd packages/contracts
28+
yarn test:coverage
2729
- name: Upload coverage report
2830
uses: codecov/codecov-action@v3
2931
with:

.github/workflows/ci-token-dist.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI - packages/token-distribution
2+
3+
env:
4+
CI: true
5+
6+
on:
7+
push:
8+
branches: "*"
9+
paths:
10+
- packages/token-distribution/**
11+
pull_request:
12+
branches: "*"
13+
paths:
14+
- packages/token-distribution/**
15+
workflow_dispatch:
16+
17+
jobs:
18+
test-ci:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- name: Set up environment
24+
uses: ./.github/actions/setup
25+
- name: Run tests
26+
run: yarn test

.github/workflows/e2e.yml renamed to .github/workflows/e2e-contracts.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: E2E
1+
name: E2E - packages/contracts
22

33
env:
44
CI: true
@@ -9,7 +9,7 @@ on:
99
paths:
1010
- packages/contracts/contracts/**
1111
- packages/contracts/config/**
12-
- packages/contracts/e2e/**
12+
- packages/contracts/test/e2e/**
1313
- packages/contracts/tasks/**
1414
- packages/contracts/scripts/**
1515
- packages/contracts/hardhat.config.ts
@@ -18,7 +18,7 @@ on:
1818
paths:
1919
- packages/contracts/contracts/**
2020
- packages/contracts/config/**
21-
- packages/contracts/e2e/**
21+
- packages/contracts/test/e2e/**
2222
- packages/contracts/tasks/**
2323
- packages/contracts/scripts/**
2424
- packages/contracts/hardhat.config.ts
@@ -41,4 +41,5 @@ jobs:
4141
sed -i'' -e 's/^\(.*dev.period.*\)/# \1/' docker-compose.yaml
4242
./test-node.bash --init --batchposters 0 --redundantsequencers 0 --detach
4343
popd
44+
pushd packages/contracts
4445
L1_NETWORK=localnitrol1 L2_NETWORK=localnitrol2 yarn test:e2e

.github/workflows/verifydeployed.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
with:
3737
name: contract-artifacts
3838
path: |
39-
build
40-
cache/*.json
39+
packages/contracts/build
40+
packages/contracts/cache/*.json
4141
4242
verify:
4343
name: Verify deployments
@@ -54,7 +54,7 @@ jobs:
5454
name: contract-artifacts
5555

5656
- name: Verify contracts on Defender
57-
run: yarn hardhat --network ${{ inputs.network }} verify-defender ${{ inputs.contracts }}
57+
run: cd packages/contracts && yarn hardhat --network ${{ inputs.network }} verify-defender ${{ inputs.contracts }}
5858
env:
5959
DEFENDER_API_KEY: "${{ secrets.DEFENDER_API_KEY }}"
6060
DEFENDER_API_SECRET: "${{ secrets.DEFENDER_API_SECRET }}"

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ cached/
2121
# Build artifacts
2222
dist/
2323
build/
24+
deployments/hardhat/
2425

2526
# Ignore solc bin output
2627
bin/
@@ -43,3 +44,9 @@ addresses-fork.json
4344

4445
# Keys
4546
.keystore
47+
48+
# Graph client
49+
.graphclient
50+
51+
tx-builder-*.json
52+
!tx-builder-template.json

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
nodeLinker: node-modules
2+
nmHoistingLimits: workspaces

README.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ This repository is a Yarn workspaces monorepo containing the following packages:
3737
| Package | Latest version | Description |
3838
| --- | --- | --- |
3939
| [contracts](./packages/contracts) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fcontracts.svg)](https://badge.fury.io/js/@graphprotocol%2Fcontracts) | Contracts enabling the open and permissionless decentralized network known as The Graph protocol. |
40+
| [eslint-graph-config](./packages/eslint-graph-config) | [![npm version]()]() | Shared linting and formatting rules for TypeScript projects. |
41+
| [token-distribution](./packages/token-distribution) | - | Contracts managing token locks for network participants |
4042
| [sdk](./packages/sdk) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fsdk.svg)](https://badge.fury.io/js/@graphprotocol%2Fsdk) | TypeScript based SDK to interact with the protocol contracts |
43+
| [solhint-graph-config](./packages/eslint-graph-config) | [![npm version]()]() | Shared linting and formatting rules for Solidity projects. |
4144

4245

4346
## Development
@@ -65,21 +68,42 @@ $ yarn
6568
$ yarn build
6669
```
6770

68-
### Versioning a package
71+
### Versioning and publishing packages
6972

70-
To version a package, run the following command from the root of the repository:
73+
We use [changesets](https://github.com/changesets/changesets) to manage package versioning, this ensures that all packages are versioned together in a consistent manner and helps with generating changelogs.
74+
75+
#### Step 1: Creating a changeset
76+
77+
A changeset is a file that describes the changes that have been made to the packages in the repository. To create a changeset, run the following command from the root of the repository:
7178

7279
```bash
73-
# Change directory to the package you want to version
74-
$ cd packages/<package-name>
80+
$ yarn changeset
81+
```
82+
83+
Changeset files are stored in the `.changeset` directory until they are packaged into a release. You can commit these files and even merge them into your main branch without publishing a release.
7584

76-
# Bump the version
77-
$ yarn version <major|minor|patch>
85+
#### Step 2: Creating a package release
86+
87+
When you are ready to create a new package release, run the following command to package all changesets, this will also bump package versions and dependencies:
88+
89+
```bash
90+
$ yarn changeset version
91+
```
92+
93+
### Step 3: Tagging the release
94+
95+
__Note__: this step is meant to be run on the main branch.
96+
97+
After creating a package release, you will need to tag the release commit with the version number. To do this, run the following command from the root of the repository:
98+
99+
```bash
100+
$ yarn changeset tag
101+
$ git push --follow-tags
78102
```
79103

80-
__Note on cross referenced packages__: Bumping the version of a package that is cross referenced by another package will automatically bump the dependency version in the other package. For example, if you bump the version of `sdk` from `0.0.1` to `0.0.2`, the required version of `sdk` in the `contracts` package will automatically be bumped to `0.0.2`. Depending on the nature of the change you might need to bump (and publish) a new version of the `contracts` package as well.
104+
#### Step 4: Publishing a package release
81105

82-
### Publishing a package
106+
__Note__: this step is meant to be run on the main branch.
83107

84108
Packages are published and distributed via NPM. To publish a package, run the following command from the root of the repository:
85109

0 commit comments

Comments
 (0)