From d2095d837c60e68d2d60095cda0444582f39a13e Mon Sep 17 00:00:00 2001 From: Jordan Gensler Date: Thu, 16 Nov 2023 14:48:00 -0800 Subject: [PATCH] Remove explorer source conditions (#14618) ## Description Describe the changes or additions included in this PR. ## Test Plan How did you test the new or updated feature? --- If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process. ### Type of Change (Check all that apply) - [ ] protocol change - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes --- .github/workflows/e2e.yml | 4 ++++ apps/explorer/package.json | 6 ++++-- apps/explorer/tsconfig.json | 6 +----- apps/explorer/vite.config.ts | 1 - apps/ui/package.json | 4 ++-- package.json | 1 + pnpm-lock.yaml | 3 +++ 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 4da062ad5953f..434a9f4deba56 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -53,6 +53,10 @@ jobs: if: ${{ needs.diff.outputs.isTypescriptSDK == 'true' || needs.diff.outputs.isRust == 'true'}} run: pnpm dlx concurrently --kill-others --success command-1 "$E2E_RUN_LOCAL_NET_CMD" 'pnpm sdk test:e2e' + - name: Build explorer + if: ${{ needs.diff.outputs.isTypescriptSDK == 'true' || needs.diff.outputs.isExplorer == 'true' || needs.diff.outputs.isRust == 'true'}} + run: pnpm turbo --filter=sui-explorer build + - name: Run Explorer e2e tests # need to run Explorer e2e when its upstream(TS SDK and Rust) or itself is changed if: ${{ needs.diff.outputs.isTypescriptSDK == 'true' || needs.diff.outputs.isExplorer == 'true' || needs.diff.outputs.isRust == 'true'}} diff --git a/apps/explorer/package.json b/apps/explorer/package.json index 3f85ede816c1d..eaec9f41a314e 100644 --- a/apps/explorer/package.json +++ b/apps/explorer/package.json @@ -2,11 +2,13 @@ "name": "sui-explorer", "private": true, "scripts": { - "dev": "vite --port 3000", + "dev": "concurrently 'pnpm:dev-deps' 'pnpm:dev-local'", + "dev-deps": "turbo run dev --filter sui-explorer^... --concurrency 100", + "dev-local": "vite --port 3000", "test": "pnpm test:unit", "test:unit": "vitest run", "typecheck": "tsc -b", - "playwright": "NODE_OPTIONS='--conditions=source' playwright", + "playwright": "playwright", "build": "pnpm typecheck && vite build", "eslint:check": "eslint --max-warnings=0 \"./src/**/*.{js,jsx,ts,tsx}\"", "eslint:fix": "pnpm eslint:check --fix", diff --git a/apps/explorer/tsconfig.json b/apps/explorer/tsconfig.json index 828f0bf7fc454..d9d8a402c770c 100644 --- a/apps/explorer/tsconfig.json +++ b/apps/explorer/tsconfig.json @@ -17,11 +17,7 @@ "jsx": "react-jsx", "baseUrl": ".", "paths": { - "~/*": ["./src/*"], - "@mysten/sui.js/transactions": ["../../sdk/typescript/src/builder/export.ts"], - "@mysten/sui.js/*": ["../../sdk/typescript/src/*"], - "@mysten/sui.js": ["../../sdk/typescript/src/"], - "@mysten/dapp-kit": ["../../sdk/dapp-kit/src/"] + "~/*": ["./src/*"] } }, "include": ["src", "tests"], diff --git a/apps/explorer/vite.config.ts b/apps/explorer/vite.config.ts index 8c94a544792d9..687732a9cc9b3 100644 --- a/apps/explorer/vite.config.ts +++ b/apps/explorer/vite.config.ts @@ -27,7 +27,6 @@ export default defineConfig({ sourcemap: true, }, resolve: { - conditions: ['source'], alias: { '~': new URL('./src', import.meta.url).pathname, }, diff --git a/apps/ui/package.json b/apps/ui/package.json index d7d59fae7f7b3..2281d13c62079 100644 --- a/apps/ui/package.json +++ b/apps/ui/package.json @@ -25,8 +25,8 @@ "eslint:fix": "pnpm run eslint:check --fix", "lint": "pnpm run eslint:check && pnpm run prettier:check", "lint:fix": "pnpm run eslint:fix && pnpm run prettier:fix", - "dev": "storybook dev -p 6006", - "build": "tsc -b && storybook build" + "storybook": "storybook dev -p 6006", + "build-storybook": "tsc -b && storybook build" }, "dependencies": { "@mysten/core": "workspace:*", diff --git a/package.json b/package.json index 5e99b1c33c203..a508a593fa46e 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "@tanstack/eslint-plugin-query": "^5.0.0", "@typescript-eslint/eslint-plugin": "^6.1.0", "@typescript-eslint/parser": "^6.1.0", + "concurrently": "^8.2.0", "eslint": "^8.45.0", "eslint-config-prettier": "^8.8.0", "eslint-config-react-app": "^7.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 05b7fdd3303d0..c32e02bad8961 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,6 +34,9 @@ importers: '@typescript-eslint/parser': specifier: ^6.1.0 version: 6.1.0(eslint@8.45.0)(typescript@5.1.6) + concurrently: + specifier: ^8.2.0 + version: 8.2.0 eslint: specifier: ^8.45.0 version: 8.45.0