Skip to content

chore(assets-data): scaffold the DDD target packages (LIVE-35225) - #20285

Open
LucasWerey wants to merge 2 commits into
test/dada-client-LIVE-35224-characterization-testsfrom
chore/assets-data-LIVE-35225-scaffold-packages
Open

chore(assets-data): scaffold the DDD target packages (LIVE-35225)#20285
LucasWerey wants to merge 2 commits into
test/dada-client-LIVE-35224-characterization-testsfrom
chore/assets-data-LIVE-35225-scaffold-packages

Conversation

@LucasWerey

@LucasWerey LucasWerey commented Jul 31, 2026

Copy link
Copy Markdown
Member

Note

Stacked PR — base is #20276, not develop. Review that one first; merge it first too.

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests. Nothing to test — the four packages are empty shells. Each one's typecheck and jest targets are verified to run, which is all there is to assert at this stage. Code and its tests arrive in LIVE-35226 / LIVE-35227.
  • Impact of the changes:
    - No runtime impact. Four new private workspace packages, all empty (export {};). No existing file was modified except knip.json (+12) and pnpm-lock.yaml.
    - Nothing imports these packages yet, so no app behaviour can change.
    - No QA pass needed.

📝 Description

Problem. libs/ledger-live-common/src/dada-client is being migrated into the DDD layers under LIVE-35223. The relocation itself (LIVE-35226 / LIVE-35227) is a large diff, so the destination packages are created first, empty, in their own reviewable step.

Solution. Scaffold four packages per the docs/new-library.md checklist. No code moved.

Path Package Will own
domain/entity/asset @domain/entity-asset CryptoAssetMeta, NetworkInfo, CurrenciesOrder
domain/entity/interest-rate @domain/entity-interest-rate InterestRate, ApyType
domain/api/assets-data @domain/api-assets-data wire contract, RTK Query, transforms, chunk/merge, errors, mocks
features/platform/assets-data @features/platform-assets-data hooks, cache selectors, discovery, currency selection

Each gets package.json, tsconfig.json, jest.config.js, project.json, README.md with a status marker, and a placeholder src/index.ts. The jsdom package additionally gets jest.setup.js loading @testing-library/jest-dom, matching features/platform/{style,currencies,feature-flags}.

Decisions worth reviewing

  • Named for the domain concept, not the vendor service. assets-data, not dada, per the naming table in docs/new-library.md.
  • The React layer is features/platform, not features/flow. Market, Portfolio, Global Search and the asset/network selectors all consume it, so it is a capability shared across flows rather than one journey's internals.
  • Wire types will live in the api package, not an entity. ApiAsset / RawApiResponse describe DADA's transport format; entities own only canonical shapes. Mirrors domain/api/market-sentiment + domain/entity/market-sentiment.
  • markets stays loosely typed — no domain/entity/market. It would roughly double the migration and pull in another team's surface, and since PartialMarketItemResponse is Partial<MarketItemResponse> there is nothing meaningful to validate. Documented as an explicit scope boundary.
  • READMEs carry the decisions rather than a docs/ page, because this repo has no ADR convention (nothing in docs/about-docs, docs/contributing, AGENTS.md, or the docs-update-or-create skill). A reader of the package finds the rationale without needing the Jira epic. The @domain/api-assets-data README records the accepted dadaIdToMarketId copy debt and the two leniency invariants; the @features/platform-assets-data README records the hooks-only API, the frozen reducerPath string, and the cross-query cache-scan quirk.
  • Registered in knip.json (+12 lines, one workspaces entry each) per the knip-migration skill's "new package = born migrated" rule. Exports are explicit with no ./* wildcard. Verified: pnpm run unimported in domain/api/assets-data runs clean.

Notes for reviewers

  • Version 0.1.0 on all four, matching the market-sentiment precedent where the creating PR carried a minor changeset (0.1.00.2.0).
  • test scripts use --passWithNoTests so the empty packages don't fail their targets. Remove when real tests land in LIVE-35226 / LIVE-35227.
  • No runtime dependencies declared yet. zod, @reduxjs/toolkit, @shared/env and the currency entities are added in the PR that moves the code in, so this PR doesn't declare deps nothing imports. @features/platform-assets-data does carry react / react-redux peers, matching features/platform/currencies.
  • pnpm-lock.yaml has 5 deleted lines beyond the new importers, and they are explainable rather than avoidable. Regenerated from the base commit, which cut the diff from 56 deletions to 5. Two experiments: --lockfile-only on the base branch (which adds no packages) produces zero churn in 693ms, so the committed lockfile is internally consistent; resetting this branch's lockfile to the base and regenerating reproduces the same churn in 34.7s. So it is pnpm re-resolving more broadly when the workspace set changes (203 → 207 projects), which re-keys @storybook/addon-react-native-web and materialises the @babel/* snapshots it pulls in. Two of the five deletions aren't dependency changes at all — npm changed its own deprecation text upstream for @apollo/server and conventional-changelog. No version changed for any existing package. packageManager pins pnpm@10.24.0 and that is the version used.
  • Verified locally: all four packages typecheck, all four jest targets run, nx show projects lists all four, commitlint --from develop passes across the stack.

❓ Context


🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

Copilot AI review requested due to automatic review settings July 31, 2026 12:04
@LucasWerey LucasWerey changed the title chore(assets-data): scaffold DDD packages for the DADA migration chore(assets-data): scaffold the DDD target packages (LIVE-35225) Jul 31, 2026
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Web Tools Build Status

Build Status Deployment
Web Tools Build ✅ Deployed https://web-tools-3ars8e7uk-ledger-hq-prd.vercel.app
Native Storybook Build ✅ Deployed https://native-ui-storybook-5uazuamwv-ledger-hq-prd.vercel.app
React Storybook Build ✅ Deployed https://react-ui-storybook-g0kqlsb0b-ledger-hq-prd.vercel.app

Create the four empty packages that libs/ledger-live-common/src/dada-client will
move into (LIVE-35223). Scaffolding only: no code moved, no behaviour change.

  @domain/entity-asset            crypto-asset meta, network info, currency order
  @domain/entity-interest-rate    interest rate shape and its APY type
  @domain/api-assets-data         DADA wire contract, RTK Query, transforms
  @features/platform-assets-data  hooks, cache selectors, discovery, selection

The React layer sits in features/platform rather than features/flow because
Market, Portfolio, Global Search and the asset selectors all consume it.

READMEs carry the decisions instead of a docs/ page, since the repo has no ADR
convention: why wire types belong to the api package, why markets stays loosely
typed with no domain/entity/market, the copied dadaIdToMarketId debt, and the
invariants that break with no type error.

Registered in knip.json per the born-migrated rule for new packages.

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.

🟡 Not ready to approve

The new platform package’s Jest setup is incomplete for jest-dom usage, and the lockfile diff includes non-scaffold-related metadata churn that should be minimized or explained.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR scaffolds new DDD workspaces to host the upcoming DADA (Dynamic Assets Data Aggregator) migration out of live-common, creating placeholder domain/entity, domain/api, and features/platform packages with initial tooling/config.

Changes:

  • Add new empty DDD packages: @domain/entity-asset, @domain/entity-interest-rate, and @domain/api-assets-data.
  • Add a new app-facing platform layer package @features/platform-assets-data (currently scaffolded/empty).
  • Register the new workspaces in knip.json, add a changeset, and update the lockfile for the new importers.
File summaries
File Description
pnpm-lock.yaml Adds new workspace importers for the scaffolded packages; also updates some existing package snapshot/peer metadata.
knip.json Registers the new workspaces for knip entrypoints.
features/platform/assets-data/tsconfig.json TypeScript config for the new platform package.
features/platform/assets-data/src/index.ts Placeholder entrypoint.
features/platform/assets-data/README.md Documents intended responsibilities and constraints of the platform layer.
features/platform/assets-data/project.json Nx project scaffold (noop build).
features/platform/assets-data/package.json Workspace manifest, scripts, and dependencies for the platform package.
features/platform/assets-data/jest.config.js Jest config scaffold for the platform package.
domain/entity/interest-rate/tsconfig.json TypeScript config for the new entity package.
domain/entity/interest-rate/src/index.ts Placeholder entrypoint.
domain/entity/interest-rate/README.md Documents intended scope and future migration source.
domain/entity/interest-rate/project.json Nx project scaffold (noop build).
domain/entity/interest-rate/package.json Workspace manifest and scripts for the interest-rate entity package.
domain/entity/interest-rate/jest.config.js Jest config scaffold for the interest-rate entity package.
domain/entity/asset/tsconfig.json TypeScript config for the new entity package.
domain/entity/asset/src/index.ts Placeholder entrypoint.
domain/entity/asset/README.md Documents intended scope and future migration source.
domain/entity/asset/project.json Nx project scaffold (noop build).
domain/entity/asset/package.json Workspace manifest and scripts for the asset entity package.
domain/entity/asset/jest.config.js Jest config scaffold for the asset entity package.
domain/api/assets-data/tsconfig.json TypeScript config for the new API package.
domain/api/assets-data/src/index.ts Placeholder entrypoint.
domain/api/assets-data/README.md Documents the planned cross-entity contract and invariants for DADA integration.
domain/api/assets-data/project.json Nx project scaffold (noop build).
domain/api/assets-data/package.json Workspace manifest and scripts for the assets-data API package.
domain/api/assets-data/jest.config.js Jest config scaffold for the assets-data API package.
.changeset/tidy-pandas-gather.md Changeset documenting the introduction of the new scaffolded packages.
Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 26/27 changed files
  • Comments generated: 2
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread features/platform/assets-data/jest.config.js
Comment thread pnpm-lock.yaml
Copilot AI review requested due to automatic review settings July 31, 2026 12:10
@LucasWerey
LucasWerey force-pushed the chore/assets-data-LIVE-35225-scaffold-packages branch from fcc77ff to 64a63a9 Compare July 31, 2026 12:10

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.

🟡 Not ready to approve

The new React package Jest scaffold includes jest-dom types/deps but doesn’t load jest-dom in setup, and the lockfile includes unrelated churn that should be minimized or split.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file

Suppressed comments (2)

features/platform/assets-data/jest.config.js:5

  • @testing-library/jest-dom is included (devDependency + TS types), but the Jest config doesn't load it via setupFilesAfterEnv, unlike other features/platform/* packages (e.g. features/platform/currencies/jest.config.js). Without this, common matchers like toBeInTheDocument() won't be registered at runtime when tests are added.
module.exports = {
  testEnvironment: "jsdom",
  roots: ["<rootDir>/src"],
  testMatch: ["**/*.test.ts?(x)"],
  transform: {

pnpm-lock.yaml:2206

  • This lockfile hunk changes @react-native/babel-preset resolution to include an explicit (@babel/core@...) peer param even though this PR only scaffolds new DDD workspace packages (Jest/SWC/TS) and does not touch any React Native deps. Per repo review guidance, consider splitting unrelated lockfile churn into a separate PR (or regenerate the lockfile in a way that only reflects the new workspaces) to keep the diff reviewable and reduce merge conflicts.
  • Files reviewed: 26/27 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@github-actions

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 7 projects in monorepo, 7 projects with changes.

📊 Quick Summary
Project Total Size Change
desktop-main 2.3 MB -
desktop-preloader 7.1 KB -
desktop-renderer 80.6 MB -
desktop-webviewDappPreloader 36.9 KB -
desktop-webviewPreloader 200.0 B -
desktop-workers 36.8 KB -
mobile 261.3 MB -
📋 Detailed Reports (Click to expand)

📁 desktop-main

Path: rsdoctor/desktop-main/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.3 MB - -
📄 JavaScript 2.2 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 135.3 KB - -

📁 desktop-preloader

Path: rsdoctor/desktop-preloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 7.1 KB - -
📄 JavaScript 5.3 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 1.8 KB - -

📁 desktop-renderer

Path: rsdoctor/desktop-renderer/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 80.6 MB - -
📄 JavaScript 29.3 MB - -
🎨 CSS 183.1 KB - -
🌐 HTML 1.8 KB - -
📁 Other Assets 51.2 MB - -

📁 desktop-webviewDappPreloader

Path: rsdoctor/desktop-webviewDappPreloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 36.9 KB - -
📄 JavaScript 36.9 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 desktop-webviewPreloader

Path: rsdoctor/desktop-webviewPreloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 200.0 B - -
📄 JavaScript 200.0 B - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 desktop-workers

Path: rsdoctor/desktop-workers/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 36.8 KB - -
📄 JavaScript 36.8 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 mobile

Path: rsdoctor/mobile/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 261.3 MB - -
📄 JavaScript 110.4 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 150.9 MB - -

Generated by Rsdoctor GitHub Action

The package is jsdom and its tsconfig declares @testing-library/jest-dom types,
but nothing loaded the matchers at runtime, so a test using toBeInTheDocument
would have compiled and then failed. Adds jest.setup.js + setupFilesAfterEnv,
matching features/platform/{style,currencies,feature-flags}.

Also regenerates pnpm-lock.yaml from the base commit rather than from the state
left by an interrupted install.
Copilot AI review requested due to automatic review settings July 31, 2026 12:24

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.

🟢 Ready to approve

The changes are isolated scaffolding consistent with existing DDD package patterns and introduce no runtime behavior changes.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 27/28 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

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.

🟢 Ready to approve

The changes are limited to consistent scaffolding of new private workspaces plus expected knip/lockfile wiring, with no runtime code movement or behavior changes.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 27/28 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@LucasWerey
LucasWerey marked this pull request as ready for review July 31, 2026 12:47
@LucasWerey
LucasWerey requested a review from a team as a code owner July 31, 2026 12:47
@sonarqubecloud

Copy link
Copy Markdown

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