Repository navigation
chore(ci): generate the contract clients before the JS checks - #421
Merged
Merged
Conversation
Drop the vitest alias that swapped every generated client for a stub. `npm run build:clients` now writes all six clients from the local Wasm with no network: `src/` from the SDK's generator, which the app's own build uses, and `dist/` from the CLI's bindings for the harness. The asset's client comes from the SDK's Stellar Asset Contract spec. `npm run test` stops with the command to run when any client is missing. Refs #420
Add a root `npm run typecheck` over the three workspaces. The app's script ran plain `tsc` on a tsconfig that only references other projects, so it checked nothing; it now runs `tsc -b`. app-lib gets its own TypeScript and a global `Buffer` type like the app's, and its multisig tests now match the types they use. Refs #420
A new `contracts` job builds the Wasm, checks it embeds no build path, and generates the TypeScript clients from it. The `js` job waits for it, downloads that output, and adds a type check before the tests. The harness type check moves there from the `network` job, which keeps its own Scaffold build and does not wait. Refs #420
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
TypeScript 6 in app-lib's own folder also became the compiler for the generated client packages, which the network job builds and which TypeScript 6 rejects. The app's `tsc -b` now type-checks app-lib as a referenced project instead, so app-lib needs no TypeScript of its own. The type check generates the addresses module first, as the tests do, and both share the clients guard. Refs #420
Every test that mocked `config/clients` built its own client object by hand. They now mock it with one module whose fakes take their call names, arguments and results from the generated clients, so each test names the calls it uses and a wrong name or result shape fails the type check. The stricter types caught a few fixtures that no longer matched the contracts: enum values, pending changes and holder arguments. Refs #420
The modal's 2,158-line file held the copy and status text for every action. That content now lives in one module per section (investor, cycle, emergency, configuration, governance, compliance) beside the shared failure text, the admin copy helpers, the step tracker and the action types. `TransactionModal.tsx` keeps the component and `ShareLink`, and re-exports what callers already import from it. The code moved unchanged. Refs #420
The 3,300-line test file now follows the component: the modal's own behaviour stays in `TransactionModal.test.tsx`, and each section's describe blocks move to a test file beside its module. The render helpers move to one shared module. Test names and assertions moved unchanged; each file mocks the same app-lib helpers the original did. Refs #420
`build:clients` and the harness deploy now write each client's sources with the SDK's generator, pin its stellar-sdk, and compile them to the `dist/` the harness imports. The stellar CLI's bindings, which typed an empty `Option` differently, are no longer generated. The guard before tests and the type check also requires each contract client's `dist/`. Refs #420
A client compiled by an older TypeScript can declare a reference to the node types, which then clash with app-lib's own `Buffer` type. Refs #420
A faked call now resolves either to a result of the contract's type or to a transaction a write can sign, so an empty object or a missing result no longer type-checks. Three vault roles faked as `undefined` now use the `null` the client returns, and the test title says what it fakes. Refs #420
Nothing downstream reads the Wasm, so the artifact carries the generated clients alone. The harness report upload uses the same upload-artifact release as the clients. Refs #420
hpmaxi
marked this pull request as ready for review
November 2, 2026 18:12
luchobonatti
reviewed
Nov 2, 2026
| [ | ||
| ...crateClients(root).flatMap((name) => [ | ||
| `app-lib/clients/${name}/src/index.ts`, | ||
| `app-lib/clients/${name}/dist/index.js`, |
Member
There was a problem hiding this comment.
npm run test now requires each client's dist/, but generate-clients.mjs writes only src/, so that path fails the guard. Suggest checking dist/ only before typecheck, or naming build:clients in the error.
Contributor
Author
There was a problem hiding this comment.
Fixed in ae1aad6: npm run test now checks only src/; npm run typecheck also needs dist/, and both errors name npm run build:clients.
7 tasks
luchobonatti
approved these changes
Nov 2, 2026
9 of 10 tasks
`npm run test` imports only each client's `src/`, which the app's own client generator also writes, so its guard checks only that. The guard before `npm run typecheck` also requires each contract client's `dist/`, which the harness imports. Both errors name `npm run build:clients`. Refs #420
This branch was successfully deployed
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.
Summary
Closes #420
The JavaScript checks ran before any contract was built, so the console's tests ran against a stub client, and nothing type-checked the app against the contracts. Now CI builds the Wasm and the clients first, and the JavaScript checks use them.
Changes
contractsjob builds the Wasm, checks it embeds no build path, and generates the clients;jsdownloads them, then lints, type-checksapp/,app-lib/and the harness, and tests.npm run build:clientsand the harness deploy write each client'ssrc/from the Wasm and compile itsdist/, with no network. The asset's client comes from the SDK's built-in spec.vitest.clients.tsare gone.npm run testandnpm run typecheckstop and name any missing client source ordist/.Numbers
Every earlier test name still runs.
networkstill sets the run's length and only lost steps; it does not wait forcontracts, since Scaffold rebuilds the clients there anyway. Its time moves withnpm ciand the guards suite.Test plan
npm ci,stellar contract build && npm run build:clients, thennpm run lint,npm run format:check,npm run typecheck,npm run test,npm run build -w appandnpm run test:unit -w scripts/harness. All pass.npm run build --workspaces, thennpm run typecheckagain: it still passes.app-lib/clients/nav_oracle/distand runnpm run typecheck: it stops and names the missingdist/index.js.Breaking changes
None for the app. Developers run
stellar contract build && npm run build:clientsonce beforenpm run test.