From e5afcc0c070827b23ceaba7d2ca79d712ca00ef8 Mon Sep 17 00:00:00 2001 From: Jordan Gensler Date: Tue, 27 Sep 2022 15:28:33 -0700 Subject: [PATCH] [fe] Add top-level command alias for easier monorepo management (#4804) * Add top-level command alias for easier monorepo management * Revert index guard --- .github/workflows/explorer-client-prs.yml | 10 +++++----- .github/workflows/ts-sdk.yml | 6 +++--- .github/workflows/wallet-adapter.yml | 2 +- .github/workflows/wallet-ext-prs.yml | 14 ++++---------- package.json | 7 +++++++ sdk/typescript/README.md | 4 ++-- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/workflows/explorer-client-prs.yml b/.github/workflows/explorer-client-prs.yml index 53388ba3397b7..f66fe924ce6ec 100644 --- a/.github/workflows/explorer-client-prs.yml +++ b/.github/workflows/explorer-client-prs.yml @@ -29,11 +29,11 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - name: Lint - run: pnpm --filter sui-explorer lint + run: pnpm explorer lint - name: Unit Tests - run: pnpm --filter sui-explorer test:unit + run: pnpm explorer test:unit - name: Build - run: pnpm --filter sui-explorer build + run: pnpm explorer build end_to_end_static: name: End-to-end tests (Static) needs: diff @@ -53,7 +53,7 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - name: Install Cypress - run: pnpm --filter sui-explorer exec cypress install + run: pnpm explorer exec cypress install - name: Run e2e tests uses: cypress-io/github-action@v4 with: @@ -81,7 +81,7 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - name: Install Cypress - run: pnpm --filter sui-explorer exec cypress install + run: pnpm explorer exec cypress install - name: Run e2e tests uses: cypress-io/github-action@v4 with: diff --git a/.github/workflows/ts-sdk.yml b/.github/workflows/ts-sdk.yml index c59e84573da72..ba83cd7226349 100644 --- a/.github/workflows/ts-sdk.yml +++ b/.github/workflows/ts-sdk.yml @@ -29,9 +29,9 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - name: Test - run: pnpm --filter @mysten/sui.js test:unit + run: pnpm sdk test:unit - name: Build - run: pnpm --filter @mysten/sui.js build + run: pnpm sdk build end_to_end: name: End-to-end tests needs: diff @@ -52,4 +52,4 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - name: Run e2e tests - run: pnpm dlx concurrently --kill-others --success command-1 'cargo run --bin sui-test-validator' 'pnpm --filter @mysten/sui.js test:e2e' + run: pnpm dlx concurrently --kill-others --success command-1 'cargo run --bin sui-test-validator' 'pnpm sdk test:e2e' diff --git a/.github/workflows/wallet-adapter.yml b/.github/workflows/wallet-adapter.yml index 498f755bfc201..b83de7bcb9eda 100644 --- a/.github/workflows/wallet-adapter.yml +++ b/.github/workflows/wallet-adapter.yml @@ -29,4 +29,4 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - name: Build - run: pnpm --filter sui-wallet-adapter build + run: pnpm wallet-adapter build diff --git a/.github/workflows/wallet-ext-prs.yml b/.github/workflows/wallet-ext-prs.yml index 1aee33a0ab169..fc95e0c0f0f9d 100644 --- a/.github/workflows/wallet-ext-prs.yml +++ b/.github/workflows/wallet-ext-prs.yml @@ -16,8 +16,6 @@ jobs: needs: diff if: needs.diff.outputs.isWalletExt == 'true' runs-on: ubuntu-latest - env: - working-directory: ./apps/wallet steps: - name: Checkout uses: actions/checkout@v3 @@ -32,17 +30,13 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - name: Lint - working-directory: ${{env.working-directory}} - run: pnpm lint + run: pnpm wallet lint - name: Test - working-directory: ${{env.working-directory}} - run: pnpm test + run: pnpm wallet test - name: Build - working-directory: ${{env.working-directory}} - run: pnpm build:prod + run: pnpm wallet build:prod - name: Package - working-directory: ${{env.working-directory}} - run: pnpm pack:zip + run: pnpm wallet pack:zip - uses: actions/upload-artifact@v3 with: name: wallet-extension diff --git a/package.json b/package.json index 7b96a2e77e1e0..84e48be9dd449 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,13 @@ "name": "sui-monorepo", "private": true, "license": "Apache-2.0", + "scripts": { + "explorer": "pnpm --filter ./apps/explorer", + "wallet": "pnpm --filter ./apps/wallet", + "wallet-adapter": "pnpm --filter ./sdk/wallet-adapter", + "sdk": "pnpm --filter ./sdk/typescript", + "bcs": "pnpm --filter ./sdk/bcs" + }, "pnpm": { "overrides": { "node-notifier": "10.0.0", diff --git a/sdk/typescript/README.md b/sdk/typescript/README.md index d1a51adfe846e..dc1f0f26c9ef0 100644 --- a/sdk/typescript/README.md +++ b/sdk/typescript/README.md @@ -31,8 +31,8 @@ To get started you need to install [pnpm](https://pnpm.io/), then run the follow ```bash # Install all dependencies $ pnpm install -# Run the build for the TypeScript SDK and all of its dependencies. -$ pnpm --filter @mysten/sui.js... build +# Run the build for the TypeScript SDK +$ pnpm sdk build ``` ## Type Doc