feat(builder): disable mainnet networks on hosted deployments#396
Merged
Conversation
Show mainnets as disabled with a self-host notice, reject deep links and saved configs on blocked networks, and bump to published @OpenZeppelin/ui-* packages.
Sync export adapter versions to latest npm releases and refresh snapshots. Avoid eager sibling openzeppelin-adapters globs that break Vitest when a local adapters checkout is present.
Reconcile main's pnpm-workspace overrides migration and adapter bumps with the hosted mainnet network policy changes and ui package updates.
Contributor
There was a problem hiding this comment.
Pull request overview
Implements a “hosted deployments” policy that prevents selecting mainnet networks while keeping them visible with a self-host notice, and enforces that policy when loading deep links or saved configurations. Also updates UI kit package versions and stabilizes adapter patch loading by only sourcing patches from node_modules.
Changes:
- Add hosted mainnet-disable UX in network selection UI + reject deep links / saved configs targeting disabled mainnets.
- Enable the policy in Docker + staging/production GitHub Actions builds via
VITE_APP_CFG_FEATURE_FLAG_MAINNET_NETWORKS_DISABLED=true. - Bump
@openzeppelin/ui-*andreact-hook-formversions and simplify adapter patch loading to usenode_modulesonly (plus related export template/version updates).
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Pins/overrides updated UI kit packages and react-hook-form. |
| pnpm-lock.yaml | Lockfile updated to reflect new UI kit + dependency resolutions. |
| package.json | Bumps @openzeppelin/ui-dev-cli to ^0.6.1. |
| docs/LOCAL_DEVELOPMENT.md | Documents local testing for hosted mainnet-disable behavior + updated mode switching guidance. |
| Dockerfile | Adds build arg/env for VITE_APP_CFG_FEATURE_FLAG_MAINNET_NETWORKS_DISABLED. |
| apps/builder/tsconfig.typecheck.json | Forces declaration emit off during typecheck config. |
| apps/builder/src/export/versions.ts | Syncs exported package version map to new UI kit versions. |
| apps/builder/src/export/templates/typescript-react-vite/package.json | Updates export template deps to ui-components/ui-utils ^3.0.1. |
| apps/builder/src/export/shared/adapterPackageSources.json | Updates patch-source descriptions (now primarily node_modules-based). |
| apps/builder/src/export/assemblers/copyAdapterPatchFiles.ts | Removes sibling repo patch loading; reads patches from node_modules/@openzeppelin/adapter-* only. |
| apps/builder/src/export/assemblers/tests/generateAndAddAppConfig.test.ts | Adds assertion that hosted-only flags aren’t included in exported example config. |
| apps/builder/src/export/tests/snapshots/ExportSnapshotTests.test.ts.snap | Updates snapshots for new UI kit dependency versions. |
| apps/builder/src/dev/seedMockMainnetContractUI.ts | Adds dev-only helper to seed a saved mainnet config for hosted-disable testing. |
| apps/builder/src/components/UIBuilder/StepChainSelection/components/NetworkSelectionPanel.tsx | Shows availability notice; disables non-selectable networks; blocks clicks on disabled networks. |
| apps/builder/src/components/UIBuilder/StepChainSelection/components/NetworkRow.tsx | Adds disabled state + label rendering for non-selectable networks. |
| apps/builder/src/components/UIBuilder/hooks/builder/useBuilderLifecycle.ts | Rejects deep links and saved configs targeting disabled networks (with toast + URL cleanup). |
| apps/builder/src/components/UIBuilder/hooks/builder/tests/useBuilderLifecycle.deeplink.test.ts | Adds test coverage for rejecting saved-config load on disabled network. |
| apps/builder/src/components/Common/DevToolsDropdown.tsx | Adds dev-tools action to seed a saved mainnet config. |
| apps/builder/package.json | Bumps UI kit packages and react-hook-form in the builder app. |
| .github/workflows/docker-stg.yaml | Enables hosted mainnet-disable flag in staging docker build args; normalizes quoting. |
| .github/workflows/docker-prod.yaml | Enables hosted mainnet-disable flag in production docker build args; normalizes quoting. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Set aria-selected false for disabled network rows, remove stale patch source description, and add deep-link rejection test for disabled networks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
show_dev_tools.VITE_APP_CFG_FEATURE_FLAG_MAINNET_NETWORKS_DISABLED=true.@openzeppelin/ui-*packages to consume the hosted network availability policy (ui-types@3.1.1,ui-components@3.0.1,ui-utils@3.0.1).node_modulesonly (avoids Vitest failures when a siblingopenzeppelin-adapterscheckout is present).Test plan
show_dev_toolscan seed mock mainnet contract UIpnpm testand typecheck pass in CI