diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index bebdbb7..bd9edb9 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -72,16 +72,14 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: ./ + working-directory: ./packages/v1 timeout-minutes: 5 steps: - uses: actions/checkout@v4 - uses: ./.github/actions/install-dependencies - name: Compile - run: | - yarn workspace @jpyc/sdk-core run compile - yarn workspace @jpyc/sdk-v1 run compile:sdk + run: yarn run compile - name: Lint - run: yarn workspace @jpyc/sdk-v1 run lint:dry-run + run: yarn run lint:dry-run - name: Format - run: yarn workspace @jpyc/sdk-v1 run format:dry-run + run: yarn run format:dry-run diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7847eff..1e159fe 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -95,15 +95,13 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: ./ + working-directory: ./packages/v1 timeout-minutes: 5 steps: - uses: actions/checkout@v4 - uses: ./.github/actions/install-dependencies - name: Build package - run: | - yarn workspace @jpyc/sdk-core run compile - yarn workspace @jpyc/sdk-v1 run compile:sdk + run: yarn run compile - uses: ./.github/actions/publish-package with: working-directory: ./packages/v1 diff --git a/package.json b/package.json index ae000f7..02ec6b4 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ ], "repository": "https://github.com/jcam1/sdks.git", "license": "MIT", - "version": "1.6.0", + "version": "1.7.0", "engines": { "node": "^20.12.0", "yarn": "^1.22.22" diff --git a/packages/core/README.md b/packages/core/README.md index 379e3f2..9300b07 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -12,7 +12,7 @@ The following commands are available as yarn scripts for local development & tes | Command | Description | | ---------------: | :---------------------------------------------------- | | `docs` | Generate Markdown documents from TSDoc-style comments | -| `compile` | Compile (transpile) TypeScript files | +| `compile` | Compile (transpile) SDK | | `lint` | Run Eslint | | `lint:dry-run` | Run Eslint without fixing | | `format` | Run Prettier | diff --git a/packages/core/package.json b/packages/core/package.json index 6b48284..52e8c41 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -3,7 +3,7 @@ "description": "Core SDK for JPYC protocol", "repository": "https://github.com/jcam1/sdks.git", "license": "MIT", - "version": "1.3.0", + "version": "1.4.0", "publishConfig": { "access": "public" }, diff --git a/packages/v1/README.md b/packages/v1/README.md index 1e4fbf0..73d7747 100644 --- a/packages/v1/README.md +++ b/packages/v1/README.md @@ -91,7 +91,7 @@ The following commands are available as yarn scripts for local development & tes | `lint:dry-run` | Run Eslint without fixing | | `format` | Run Prettier | | `format:dry-run` | Run Prettier without fixing | -| `compile:sdk` | Compile (transpile) TypeScript files | +| `compile` | Compile (transpile) SDK | | `compile:contracts` | Compile contracts | | `clean` | Delete contract artifacts | | `node` | Run hardhat network & node locally | diff --git a/packages/v1/examples/README.md b/packages/v1/examples/README.md index 9c73f1a..c45c4c4 100644 --- a/packages/v1/examples/README.md +++ b/packages/v1/examples/README.md @@ -2,15 +2,26 @@ We provide code examples that use JPYC V1 SDK as an interface to locally-deployed `JPYCv2` contracts. Please read and follow the instructions below to learn how to set up local environment as well as how to run our code examples. -### 1. Run Local Network +> [!NOTE] +> Please run the following commands in `/packages/v1` directory. -Run the following command to start running local Hardhat network and its accompanying node. +### 1. Build Packages + +The first thing to do is to build packages. + +```sh +$ yarn run compile +``` + +### 2. Run Local Network + +Start running local Hardhat network and its accompanying node. ```sh $ yarn run node ``` -### 2. Deploy Contracts +### 3. Deploy Contracts **Open a different window** and run the following command to deploy JPYCv2 contracts to the local network. Once successfully deployed, a new directory will be created, and you can find deployed contract addresses at `/packages/v1/ignition/deployments/chain-31337/deployed_addresses.json`. @@ -18,20 +29,17 @@ $ yarn run node $ yarn run deploy ``` -### 3. Set Environment Variables +### 4. Set Environment Variables -Run the following commands, and edit the generated `.env` file accordingly. Set `LOCAL_PROXY_ADDRESS` to the value of `JPYCV2Module#FiatTokenV1` at [here](../ignition/deployments/chain-31337/deployed_addresses.json). See [here](../README.md/) for more details. +Run the following commands and edit the generated `.env` file accordingly. Set `LOCAL_PROXY_ADDRESS` to the value of `JPYCV2Module#FiatTokenV1` at [here](../ignition/deployments/chain-31337/deployed_addresses.json). See [here](../README.md/) for more details. ```sh -# cd into this directory -$ cd /packages/v1 -# copy `.env.example` to `.env` $ yarn run env ``` -### 4. Run Code Examples +### 5. Run Code Examples -Run the following commands to execute our code examples. +Finally, let's execute our code examples! | Command | Description | | ----------------------------: | :------------------------------------------------------ | diff --git a/packages/v1/package.json b/packages/v1/package.json index 0f7059e..84cdc73 100644 --- a/packages/v1/package.json +++ b/packages/v1/package.json @@ -3,7 +3,7 @@ "description": "SDK v1 for JPYC v2 protocol", "repository": "https://github.com/jcam1/sdks.git", "license": "MIT", - "version": "1.1.0", + "version": "1.2.0", "publishConfig": { "access": "public" }, @@ -23,11 +23,11 @@ "lint:dry-run": "eslint ./src", "format": "prettier --write .", "format:dry-run": "prettier --check .", - "compile:sdk": "tsc", + "compile": "yarn workspace @jpyc/sdk-core run compile && tsc", "compile:contracts": "hardhat compile", "clean": "hardhat clean", "node": "hardhat node", - "deploy": "rm -r ignition/deployments && hardhat run ./scripts/deployments.ts --network localhost", + "deploy": "rm -f -r ignition/deployments && hardhat run ./scripts/deployments.ts --network localhost", "mint": "hardhat run ./examples/mint.ts --network localhost", "total-supply": "hardhat run ./examples/total-supply.ts --network localhost", "transfer": "hardhat run ./examples/transfer.ts --network localhost",