add: automated release flow for widgets/packages, and event dispatch for automated wallet integration trigger - #131
Draft
L03TJ3 wants to merge 1 commit into
Draft
add: automated release flow for widgets/packages, and event dispatch for automated wallet integration trigger#131L03TJ3 wants to merge 1 commit into
L03TJ3 wants to merge 1 commit into
Conversation
…for automated wallet integration trigger
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a production release pipeline for GoodWidget packages/widgets (versioning → build/pack/publish → tag → optional GoodWallet dispatch), and formalizes a widget integration manifest contract validated in CI. It also updates widget register entry points to be SSR-safe by deferring browser-only imports until a Custom Elements runtime is detected.
Changes:
- Add release tooling (
scripts/release/*) plus GitHub Actions workflows to validate, promote, release, and recover npm publications. - Introduce a v2 widget integration manifest schema + per-widget
integration-manifest.json, and enforce package publication metadata consistency. - Make widget
registerentry points SSR-safe (dynamic element imports + DOM guards) and adjust embed/core/ui packaging details to support safe package inspection.
Reviewed changes
Copilot reviewed 47 out of 48 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/release/validate-register-entries.mjs | Validates that every production widget ./register export is SSR-safe for both ESM and CJS builds. |
| scripts/release/validate-packages.mjs | Enforces consistent npm metadata (license, repo, publishConfig) across production packages and checks repository LICENSE. |
| scripts/release/validate-manifests.test.mjs | Adds unit tests for manifest validation and release-envelope creation logic. |
| scripts/release/validate-manifests.mjs | Implements schema + contract validation for widget integration manifests and release-envelope creation. |
| scripts/release/release.mjs | Adds automated versioning, packing, publishing, tagging, verification, and optional GoodWallet dispatch. |
| scripts/release/packages.test.mjs | Tests release relevance and dependency-cascade selection logic for the production allowlist. |
| scripts/release/packages.mjs | Defines the production allowlist + dependency graph and release-relevance rules. |
| schemas/widget-integration-manifest.schema.json | Adds JSON Schema (draft 2020-12) for integration manifest v2. |
| pnpm-lock.yaml | Locks Ajv version and updates workspace protocol ranges used by packages. |
| packages/ui/src/components-test/Select.tsx | Removes an unused Tamagui type import. |
| packages/ui/src/components-test/Input.tsx | Ensures both onChange and onChangeText are forwarded to the input frame. |
| packages/ui/src/clipboard.ts | Removes an unused type definition. |
| packages/ui/package.json | Adds publish metadata (license/repo/files/publishConfig/sideEffects) for release validation. |
| packages/streaming-widget/src/register.ts | Makes web-component registration SSR-safe via DOM guard + dynamic import; switches to async register. |
| packages/streaming-widget/package.json | Adds publish metadata, integration-manifest export, sideEffects, and updates workspace ranges. |
| packages/streaming-widget/integration-manifest.json | Adds v2 integration manifest for the streaming widget. |
| packages/staking-migration-widget/src/register.ts | Makes registration SSR-safe via DOM guard + dynamic import; switches to async register. |
| packages/staking-migration-widget/package.json | Adds publish metadata, integration-manifest export, sideEffects, and updates workspace ranges. |
| packages/staking-migration-widget/integration-manifest.json | Adds v2 integration manifest for the staking migration widget. |
| packages/governance-widget/package.json | Adds license field. |
| packages/goodreserve-widget/src/register.ts | Makes registration SSR-safe via DOM guard + dynamic import; switches to async register. |
| packages/goodreserve-widget/package.json | Adds publish metadata, integration-manifest export, sideEffects, and updates workspace ranges. |
| packages/goodreserve-widget/integration-manifest.json | Adds v2 integration manifest for the goodreserve widget. |
| packages/embed/src/createMiniAppElement.tsx | Avoids hard-failing on missing DOM globals during SSR/package inspection; minor filter cleanup. |
| packages/embed/package.json | Adds publish metadata and updates workspace ranges. |
| packages/core/src/detect.ts | Removes unused type import. |
| packages/core/package.json | Adds publish metadata and updates workspace ranges. |
| packages/claim-widget-theme-demo/src/register.ts | Adds a customElements guard (but still statically imports element, which undermines SSR safety). |
| packages/claim-widget-theme-demo/package.json | Adds license field. |
| packages/citizen-claim-widget/src/register.ts | Makes registration SSR-safe via DOM guard + dynamic import; switches to async register. |
| packages/citizen-claim-widget/package.json | Adds publish metadata, integration-manifest export, sideEffects, bumps stable version, updates workspace ranges. |
| packages/citizen-claim-widget/integration-manifest.json | Adds v2 integration manifest for the citizen claim widget. |
| packages/ai-credits-widget/src/register.ts | Makes registration SSR-safe via DOM guard + dynamic import; switches to async register. |
| packages/ai-credits-widget/src/chainClient.ts | Adjusts mock method signatures (currently diverges from interface parameter lists). |
| packages/ai-credits-widget/src/backendClient.ts | Adjusts mock method signatures (currently diverges from interface parameter lists). |
| packages/ai-credits-widget/package.json | Adds publish metadata, integration-manifest export, sideEffects, and updates workspace ranges. |
| packages/ai-credits-widget/integration-manifest.json | Adds v2 integration manifest for the AI credits widget. |
| package.json | Adds MIT license, release/validation scripts, and Ajv devDependency. |
| LICENSE | Adds MIT LICENSE text required by release validation. |
| docs/PACKAGING.md | Updates packaging guidance to recommend SSR-safe async register with dynamic element import. |
| .github/workflows/validate-release.yml | Adds CI workflow to validate release contracts (manifests/packages/register entry SSR safety). |
| .github/workflows/release-next.yml | Adds branch-gated npm release workflow (next-only), including optional GoodWallet dispatch. |
| .github/workflows/recover-release.yml | Adds a recovery workflow to republish/verify an already-committed version. |
| .github/workflows/promote-next.yml | Adds a maintainer-gated workflow to promote main → next. |
| .github/workflows/deploy-storybook.yml | Pins actions by SHA and sets minimal permissions. |
| .github/workflows/deploy-ai-credits-web.yml | Pins actions by SHA and sets minimal permissions. |
| .github/workflows/copilot-setup-steps.yml | Pins actions by SHA for deterministic Copilot setup. |
| .github/CODEOWNERS | Adds maintainers as owners for release automation and integration contract files. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Comments suppressed due to low confidence (3)
packages/ai-credits-widget/src/chainClient.ts:313
MockAiCreditsChainClient.getWithdrawableUsdno longer accepts thebuyerparameter, even though the interface requires it. This makes direct calls on the mock type-invalid. Keep the signature consistent and ignore the argument if unused.
async getWithdrawableUsd(): Promise<string> {
return '0'
}
packages/ai-credits-widget/src/backendClient.ts:441
MockAiCreditsBackendClient.closeChanneldropped the optionalbodyparameter even though the interface includes it. This makes it harder to use the mock as a drop-in replacement when code passes request bodies.
async closeChannel(channelId: string): Promise<ChannelOperationResponse> {
await sleep(MOCK_DELAY_MS)
return { channelId, action: 'close', bridge: { enabled: true, txHash: '0xmock' } }
}
packages/ai-credits-widget/src/backendClient.ts:458
MockAiCreditsBackendClient.submitOperatorConsentremoved the requiredbodyparameter, butAiCreditsBackendClient.submitOperatorConsentrequires it (and callers pass it). This prevents using the mock directly without retyping it as the interface. Keep the parameter and ignore it if unused.
async submitOperatorConsent(buyer: string): Promise<OperatorConsentResponse> {
await sleep(MOCK_DELAY_MS)
const normalizedBuyer = normalizeAddress(buyer)
markMockOperatorConsent(normalizedBuyer)
Comment on lines
+12
to
+17
| function exactKeys(value, keys, label) { | ||
| const actual = Object.keys(value).sort() | ||
| const expected = [...keys].sort() | ||
| if (actual.join('\0') !== expected.join('\0')) | ||
| throw new Error(`${label} must contain exactly: ${keys.join(', ')}`) | ||
| } |
Comment on lines
+257
to
259
| async isGoodIdVerified(): Promise<boolean> { | ||
| return this.goodIdVerified | ||
| } |
Comment on lines
+426
to
429
| async waitForSettlement(ref: AccountRef): Promise<SettlementResult> { | ||
| await sleep(MOCK_DELAY_MS) | ||
| const state = this.getState(ref.payer) | ||
| for (const entry of state.transactions) { |
Comment on lines
17
to
21
| export function register(tagName: string = TAG_NAME): string { | ||
| if (typeof customElements === 'undefined') return tagName | ||
| if (!customElements.get(tagName)) { | ||
| customElements.define(tagName, ClaimWidgetElement) | ||
| } |
Comment on lines
+1
to
+5
| name: Release production packages | ||
|
|
||
| # Publication is intentionally branch-gated: pushes to main may deploy demos, but cannot | ||
| # enter this workflow. A maintainer must first promote main to next. | ||
| on: |
This was referenced Jul 29, 2026
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.
Description
description coming shortly
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
About # (link your issue here)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: