Skip to content

add: automated release flow for widgets/packages, and event dispatch for automated wallet integration trigger - #131

Draft
L03TJ3 wants to merge 1 commit into
mainfrom
widget-release-flow
Draft

add: automated release flow for widgets/packages, and event dispatch for automated wallet integration trigger#131
L03TJ3 wants to merge 1 commit into
mainfrom
widget-release-flow

Conversation

@L03TJ3

@L03TJ3 L03TJ3 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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:

  • PR title matches follow: (Feature|Bug|Chore) Task Name
  • My code follows the style guidelines of this project
  • I have followed all the instructions described in the initial task (check Definitions of Done)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added reference to a related issue in the repository
  • I have added a detailed description of the changes proposed in the pull request. I am as descriptive as possible, assisting reviewers as much as possible.
  • I have added screenshots related to my pull request (for frontend tasks)
  • I have pasted a gif showing the feature.
  • @mentions of the person or team responsible for reviewing proposed changes

Copilot AI review requested due to automatic review settings July 29, 2026 09:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 register entry 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.getWithdrawableUsd no longer accepts the buyer parameter, 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.closeChannel dropped the optional body parameter 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.submitOperatorConsent removed the required body parameter, but AiCreditsBackendClient.submitOperatorConsent requires 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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants