Skip to content

Conversation

pasevin
Copy link
Collaborator

@pasevin pasevin commented Oct 14, 2025

Midnight adapter: contract ingestion and chain-agnostic artifacts

  • Introduces contractDefinitionArtifacts across app/storage/utils/ui for chain-agnostic adapter artifacts
  • Builder: replace local gating with shared hasMissingRequiredContractInputs/getMissingRequiredContractInputs
  • Midnight adapter: move loader to packages/adapter-midnight/src/contract/loader.ts; keep adapter thin
  • Storage/App/UI: persist and rehydrate artifacts; auto-save triggers on artifact changes
  • Utils: add contractInputs helpers and tests
  • Cleanup: remove redundant gating and unify naming

Packages affected:

  • @openzeppelin/ui-builder-adapter-midnight (minor)
  • @openzeppelin/ui-builder-app (minor)
  • @openzeppelin/ui-builder-storage (minor)
  • @openzeppelin/ui-builder-utils (minor)
  • @openzeppelin/ui-builder-ui (minor)

Changeset: .changeset/midnight-contract-ingestion.md

Align runtime deps with export manifest for v1.

Keep only @midnight-ntwrk/dapp-connector-api.

Remove placeholder Midnight SDK deps from adapter config.

Ensures FR-017 dependency sync policy.
…ark Phase 1-2

Mark T001, T002, T003, T005 as done for Phase 1-2.
Ignore node_modules, dist, build, coverage, exports, caches, and generated artifacts.
Add standard ignores: node_modules, dist, build, coverage, exports, caches, CI dirs.
@pasevin pasevin requested a review from a team as a code owner October 14, 2025 14:53
@pasevin pasevin changed the title Midnight v1 – 02 Ingestion: contract artifacts + loader parity Midnight v1 – 02 Ingestion: contract artifacts + loader Oct 14, 2025
@pasevin pasevin requested a review from Copilot October 14, 2025 14:54
@pasevin pasevin added do not merge midnight Midnight Ecosystem Related Issues labels Oct 14, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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 PR implements contract ingestion for the Midnight adapter with chain-agnostic artifact support. It introduces the ability to persist and handle additional contract artifacts beyond basic definitions, enabling the Midnight adapter to work with complex contract data structures requiring multiple inputs.

  • Adds shared contractInputs utilities for adapter-agnostic required field validation
  • Implements contractDefinitionArtifacts across storage, app, and UI layers for chain-agnostic adapter artifacts
  • Refactors Midnight adapter contract loading into dedicated loader module with metadata support

Reviewed Changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated no comments.

Show a summary per file
File Description
specs/004-add-midnight-adapter/tasks.md Updates task completion status for contract ingestion milestones
specs/004-add-midnight-adapter/checklists/parity.md Marks parity checklist items as completed
specs/004-add-midnight-adapter/checklists/architecture.md Marks architecture checklist items as completed
packages/utils/src/contractInputs.ts Adds shared utilities for validating required contract inputs
packages/storage/src/types.ts Adds contractDefinitionArtifacts field to storage schema
packages/storage/src/services/ContractUIStorage.ts Updates storage service to handle artifacts persistence
packages/builder/src/services/ContractLoader.ts Integrates shared validation and artifacts support
packages/builder/src/hooks/useContractDefinition.ts Updates hook to pass artifacts in callback
packages/builder/src/components/UIBuilder/hooks/useUIBuilderState.ts Implements missing required fields check and artifacts handling
packages/builder/src/components/UIBuilder/hooks/uiBuilderStore.ts Adds artifacts to state management
packages/builder/src/components/UIBuilder/hooks/builder/useBuilderLifecycle.ts Updates lifecycle to handle artifacts
packages/builder/src/components/UIBuilder/hooks/builder/useAutoSave.ts Includes artifacts in auto-save functionality
packages/builder/src/components/UIBuilder/StepContractDefinition/hooks/useFormSync.ts Adds artifacts sync and form value tracking
packages/builder/src/components/UIBuilder/StepContractDefinition/hooks/useContractLoader.ts Removes unnecessary gating comment
packages/builder/src/components/UIBuilder/StepContractDefinition/hooks/useAutoContractLoad.ts Updates auto-load logic for better form validation
packages/builder/src/components/UIBuilder/StepContractDefinition/StepContractDefinition.tsx Passes adapter and values to form sync
packages/adapter-midnight/src/utils/artifacts.ts Fixes error message to reference correct property name
packages/adapter-midnight/src/types/artifacts.ts Renames contractSchema to contractDefinition for consistency
packages/adapter-midnight/src/contract/loader.ts Adds dedicated contract loading module with metadata support
packages/adapter-midnight/src/adapter.ts Refactors to use new loader and updates field names
packages/adapter-midnight/src/config.ts Simplifies dependency configuration per FR-017

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge midnight Midnight Ecosystem Related Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant