Skip to content

feat: add @parity/product-sdk-auth — shared QR/mobile sign-in component#159

Open
EnderOfWorlds007 wants to merge 7 commits into
mainfrom
feat/product-sdk-auth
Open

feat: add @parity/product-sdk-auth — shared QR/mobile sign-in component#159
EnderOfWorlds007 wants to merge 7 commits into
mainfrom
feat/product-sdk-auth

Conversation

@EnderOfWorlds007

Copy link
Copy Markdown

What

New @parity/product-sdk-auth package: the QR/mobile sign-in + session-signing glue, lifted from playground-cli's src/utils/{auth,signer,sessionSigner}.ts + the RFC-0010 allocation helper, refactored so all env config (DAPP_ID, product id, metadata URL, People endpoints) is injected via createAuthClient(config) instead of importing playground's config.ts. Goal: one shared sign-in implementation for playground-cli and bulletin-deploy (and future product CLIs).

Public API: createAuthClient / resolveSigner / RFC-0010 requestResourceAllocation + a ./ui subpath (QR render + login/logout status formatters). 18 unit tests pass (session signer incl. the wallet-vs-product-account regression guard, allocations, status formatters, auth-client shape).

⚠️ Build issues we hit (flagging for you — mostly pre-existing, not from this package)

Building this in the monorepo surfaced a few problems:

  1. json-rpc-provider override is stranded (FIXED in this PR). pnpm 11 no longer reads pnpm.overrides from package.json ([WARN] … pnpm.overrides ignored), so the existing ^0.2.0 override was a silent no-op. A stale transitive @polkadot-api/substrate-client@0.1.4 (via old host-api-wrapper@0.7.9) then kept json-rpc-provider@0.0.1 (no isResponse) alongside the 0.2.0 host-papp/terminal need → SyntaxError: … does not provide an export named 'isResponse' loading terminal. Fix here: moved the override to pnpm-workspace.yaml + clean reinstall → collapses to a single 0.2.0.

  2. product-sdk-terminal@0.2.1host-papp@0.7.9 (blocks .d.ts). packages/terminal/src/index.ts imports AttestationStatus from @novasamatech/host-papp, but host-papp@0.7.9's type declarations don't export it → terminal's DTS build fails (TS2305) → cascades to block dependents' types. Needs a terminal/host-papp version reconcile (your call).

  3. packages/tx emits no build (dist/index.js missing) → vite can't resolve @parity/product-sdk-tx for tests.

(1) is fixed in this PR; (2) and (3) are yours to reconcile.

Note

bulletin-deploy currently vendors this code behind a one-file facade so it can ship without waiting on this package being published (paritytech/bulletin-deploy#791). Once you publish @parity/product-sdk-auth, bulletin-deploy swaps the vendored copy for the package in a single file.

…(pnpm 11) + approve esbuild/biome builds

pnpm 11 ignores the pnpm.overrides field in package.json (prints [WARN] pnpm.overrides
ignored), so the existing json-rpc-provider override was a no-op and a stale
substrate-client@0.1.4 kept json-rpc-provider@0.0.1 (no isResponse) alongside the 0.2.0
that host-papp/terminal need. Moving it to pnpm-workspace.yaml + a clean reinstall
collapses it to a single 0.2.0.
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.

1 participant