feat: add @parity/product-sdk-auth — shared QR/mobile sign-in component#159
Open
EnderOfWorlds007 wants to merge 7 commits into
Open
feat: add @parity/product-sdk-auth — shared QR/mobile sign-in component#159EnderOfWorlds007 wants to merge 7 commits into
EnderOfWorlds007 wants to merge 7 commits into
Conversation
…(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.
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.
What
New
@parity/product-sdk-authpackage: the QR/mobile sign-in + session-signing glue, lifted from playground-cli'ssrc/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 viacreateAuthClient(config)instead of importing playground'sconfig.ts. Goal: one shared sign-in implementation for playground-cli and bulletin-deploy (and future product CLIs).Public API:
createAuthClient/resolveSigner/ RFC-0010requestResourceAllocation+ a./uisubpath (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).Building this in the monorepo surfaced a few problems:
json-rpc-provideroverride is stranded (FIXED in this PR). pnpm 11 no longer readspnpm.overridesfrompackage.json([WARN] … pnpm.overrides ignored), so the existing^0.2.0override was a silent no-op. A stale transitive@polkadot-api/substrate-client@0.1.4(via oldhost-api-wrapper@0.7.9) then keptjson-rpc-provider@0.0.1(noisResponse) alongside the0.2.0host-papp/terminalneed →SyntaxError: … does not provide an export named 'isResponse'loading terminal. Fix here: moved the override topnpm-workspace.yaml+ clean reinstall → collapses to a single0.2.0.product-sdk-terminal@0.2.1↔host-papp@0.7.9(blocks.d.ts).packages/terminal/src/index.tsimportsAttestationStatusfrom@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).packages/txemits no build (dist/index.jsmissing) → vite can't resolve@parity/product-sdk-txfor 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.