-
Notifications
You must be signed in to change notification settings - Fork 11
feat(export): add chain-agnostic patch export for adapters #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Remove broken badges (codecov, CodeClimate maintainability, PR-only workflows) - Rename "Publish" badge to "Release" to match GitHub display - Fix license text to correctly state AGPL v3 (was incorrectly MIT) - Update hyperlinks to point to openzeppelin-ui repo for extracted packages - Update renderer package description with accurate component list - Remove outdated CI workflow references - Restructure package documentation for clarity Also fixes Vite glob import type definitions to use updated query syntax
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This reverts commit 0c9432b.
…/contracts-ui-builder into docs/readme-cleanup
The builder application is a deployable website, not a publishable npm package. This refactor moves it to apps/builder to properly distinguish it from the adapter packages that are published to npm. Changes: - Move packages/builder to apps/builder - Update pnpm-workspace.yaml to include apps/* - Update root package.json workspaces and export-app script - Update GitHub Actions workflows (export-testing, coverage, check-versions, update-versions) - Update Dockerfile COPY path - Update Storybook config paths - Update pre-push hook version check path - Update eslint config and ignore patterns - Update all documentation references (README, CONTRIBUTING, constitution, ADAPTER_ARCHITECTURE, RELEASE) - Update scripts/update-export-versions.cjs path The adapter packages remain in packages/ and continue to be published via changesets. The builder (private: true) was never published.
# Conflicts: # README.md
The vitest config had relative paths to adapter packages that assumed the builder was in packages/builder. Now that it's in apps/builder, the paths need to go through ../../packages/adapter-* instead of ../adapter-*.
Updates paths in: - vite-plugins/virtual-content-loader.ts - template CSS path - export-app.cjs - CLI builder directory paths - components.json - styles CSS path - Various comments and documentation references
The styles package was moved to openzeppelin-ui repo and is now consumed as @openzeppelin/ui-styles from npm, not packages/styles.
Midnight networks were not loading because the SDK patches defined in packages/adapter-midnight/package.json were not being applied. pnpm only applies patches from the root workspace package.json. Changes: - Add all 7 Midnight SDK patches to root patchedDependencies - Add version overrides to pin @midnight-ntwrk packages to 2.0.2 (the versions that have compatible patches) This fixes the "No networks found for Midnight" regression.
Add support for exporting pnpm patch files from adapter packages to exported applications. This enables adapters like Midnight to specify patches for browser compatibility fixes that get included in exports. Changes: - Add `patchedDependencies` config to Midnight adapter - Add `getPatchedDependencies()` to PackageManager - Add `copyAdapterPatchFiles` assembler for chain-agnostic patch copying - Update `updatePackageJson` to include `pnpm.patchedDependencies` - Integrate patch copying into AppExportSystem export pipeline - Improve `dev:local` script to auto-build openzeppelin-ui packages - Update LOCAL_DEVELOPMENT.md with new workflow documentation - Add comprehensive tests for new functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds support for exporting pnpm patch files from adapter packages to exported applications, enabling chain-specific compatibility patches (like Midnight SDK browser fixes) to be automatically included in exported projects.
Changes:
- Added chain-agnostic patch export functionality to the export system, allowing adapters to specify patches in their config that get copied to exported apps
- Updated Midnight adapter configuration to declare its 7 SDK patches via
patchedDependenciesfield - Enhanced
dev:localscript to automatically build openzeppelin-ui packages before linking, improving developer experience
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
apps/builder/src/export/assemblers/copyAdapterPatchFiles.ts |
New assembler that copies patch files from adapter packages to exported projects using Vite's import.meta.glob |
apps/builder/src/export/assemblers/__tests__/copyAdapterPatchFiles.test.ts |
Comprehensive unit tests for the patch copying functionality (mocked due to Vite-specific features) |
apps/builder/src/export/assemblers/index.ts |
Exports the new copyAdapterPatchFiles function |
apps/builder/src/export/PackageManager.ts |
Added getPatchedDependencies() method and updated updatePackageJson() to include pnpm.patchedDependencies configuration |
apps/builder/src/export/__tests__/PackageManager.test.ts |
Added tests for getPatchedDependencies() and package.json patch configuration |
apps/builder/src/export/AppExportSystem.ts |
Integrated copyAdapterPatchFiles into the export pipeline after package.json updates |
packages/adapter-midnight/src/config.ts |
Added patchedDependencies configuration with 7 Midnight SDK patches and removed obsolete comment about bundled patches |
package.json |
Enhanced dev:local script to auto-build openzeppelin-ui packages and support LOCAL_UI_PATH environment variable |
docs/LOCAL_DEVELOPMENT.md |
Updated documentation to reflect new auto-build behavior and streamlined workflow instructions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
apps/builder/src/export/assemblers/__tests__/copyAdapterPatchFiles.test.ts
Show resolved
Hide resolved
- Add note about sync-patches requirement in copyAdapterPatchFiles.ts - Quote variable expansion in dev:local script for paths with spaces
Summary
dev:localscript to automatically build openzeppelin-ui packagesChanges
Export System
patchedDependenciesconfig toAdapterConfiginterfacegetPatchedDependencies()method toPackageManagercopyAdapterPatchFilesassembler for chain-agnostic patch copyingupdatePackageJsonto includepnpm.patchedDependenciesin exported package.jsonAppExportSystemexport pipelineMidnight Adapter
patchedDependenciesconfig with all 7 SDK patchesDeveloper Experience
dev:localscript to auto-build openzeppelin-ui packages before installingLOCAL_UI_PATHenv var for custom openzeppelin-ui locationsLOCAL_DEVELOPMENT.mddocumentationTest plan
getPatchedDependencies()in PackageManagercopyAdapterPatchFilesassemblerRelated
Requires openzeppelin-ui PR for
AdapterConfig.patchedDependenciestype (separate PR)