From 99bbca0b89035841974ab7ad8c49e70553a731e9 Mon Sep 17 00:00:00 2001 From: "Alan, Provable" Date: Fri, 26 Jun 2026 16:38:25 -0700 Subject: [PATCH 1/4] Update test script and add tslib dependency --- apps/s03-indexer/package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/s03-indexer/package.json b/apps/s03-indexer/package.json index 7e7ae3b..d9d9421 100644 --- a/apps/s03-indexer/package.json +++ b/apps/s03-indexer/package.json @@ -14,7 +14,7 @@ "start:docker": "bun run start", "dev": "bun run codegen && bun run build && bun run start", "prepack": "rm -rf dist && bun run build", - "test": "subql build && bun test tests" + "test": "subql codegen && subql build && bun test tests" }, "homepage": "https://github.com/subquery/stellar-subql-starter", "repository": "github:subquery/stellar-subql-starter", @@ -31,7 +31,8 @@ "@subql/common": "latest", "@subql/types-core": "^2.2.0", "@subql/types-stellar": "latest", - "text-encoding": "^0.7.0" + "text-encoding": "^0.7.0", + "tslib": "^2.8.1" }, "devDependencies": { "@subql/cli": "latest", From 10db7e48a94a4da3d39a64c374ce5abe89b0b6e3 Mon Sep 17 00:00:00 2001 From: "Alan, Provable" Date: Fri, 26 Jun 2026 16:52:16 -0700 Subject: [PATCH 2/4] Enhance README with test runner details and service info Added test runner conventions and updated service table. --- apps/s03-indexer/README.md | 43 ++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/apps/s03-indexer/README.md b/apps/s03-indexer/README.md index 7318872..c5a4634 100644 --- a/apps/s03-indexer/README.md +++ b/apps/s03-indexer/README.md @@ -36,15 +36,40 @@ bun run --cwd apps/s03-indexer start builds the mappings, pulls the required Docker images, and starts the local stack. +## Test Runner Conventions + +Use the indexer package test script before opening a PR: + +```bash +bun run --cwd apps/s03-indexer test +``` + +That command runs `subql codegen`, `subql build`, and then `bun test tests`. +The codegen step is required in a clean checkout because the mapping sources +import generated `src/types` models, and those generated files stay ignored. + +Use `bun test tests` only for a faster local loop after generated types already +exist. Keep indexer pure-logic tests on Bun's built-in `bun:test` runner. Use +Vitest for Vite, DOM, or React/browser harnesses such as `apps/web`; do not move +indexer mapping tests to Vitest unless they start needing that style of harness. + +Current pure-logic test inventory: + +- `tests/mappingHandlers.test.ts` stubs SubQuery `store` and `logger`, then + covers ScVal decoding, map/vector payload decoding, raw Soroban event + decoding, deterministic entity IDs, lifecycle dispatch for market, deposit, + withdrawal, order, position, liquidation, ADL, fee, referral, token/faucet + events, and unknown-event logging. + ## Local Services The Docker stack in `docker-compose.yml` starts three services: -| Service | Image/build | Port | Purpose | -| --- | --- | --- | --- | -| `postgres` | local `docker/pg-Dockerfile` | `localhost:5432` | SubQuery metadata and indexed entities | -| `subquery-node` | `subquerynetwork/subql-node-stellar:latest` | internal `3000` | Stellar/SubQuery indexing node | -| `graphql-engine` | `subquerynetwork/subql-query:latest` | `localhost:3000` | GraphQL API and playground | +| Service | Image/build | Port | Purpose | +| ---------------- | ------------------------------------------- | ---------------- | -------------------------------------- | +| `postgres` | local `docker/pg-Dockerfile` | `localhost:5432` | SubQuery metadata and indexed entities | +| `subquery-node` | `subquerynetwork/subql-node-stellar:latest` | internal `3000` | Stellar/SubQuery indexing node | +| `graphql-engine` | `subquerynetwork/subql-query:latest` | `localhost:3000` | GraphQL API and playground | Requirements: @@ -172,11 +197,11 @@ The runner executes layered, timed steps and records each one in a JSON report: ### Run modes -| Mode | Behavior | -| --- | --- | +| Mode | Behavior | +| ----------------------- | --------------------------------------------------------------------------- | | `--mode auto` (default) | Reuse a complete local deployment if present, otherwise deploy + bootstrap. | -| `--mode fresh` | Always deploy test tokens, contracts, and bootstrap a market. | -| `--mode existing` | Require a complete `.deployed/local.env`; fail fast if missing. | +| `--mode fresh` | Always deploy test tokens, contracts, and bootstrap a market. | +| `--mode existing` | Require a complete `.deployed/local.env`; fail fast if missing. | ### Common options From 64e58b415fa11ddf65a7178f06639445c020c071 Mon Sep 17 00:00:00 2001 From: "Alan, Provable" Date: Fri, 26 Jun 2026 16:58:31 -0700 Subject: [PATCH 3/4] Update tslib version in bun.lock --- bun.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/bun.lock b/bun.lock index 62b74ae..327262f 100644 --- a/bun.lock +++ b/bun.lock @@ -11,6 +11,7 @@ "turbo": "^2.8.17", "typescript": "5.9.3", }, + "tslib": "^2.8.1", }, "apps/s03-indexer": { "name": "s03-indexer", From 7bdd6494af0a72d99c89c70b5328440c56524e74 Mon Sep 17 00:00:00 2001 From: "Alan, Provable" Date: Fri, 26 Jun 2026 17:24:42 -0700 Subject: [PATCH 4/4] Restore tslib dependency in bun.lock Re-add tslib dependency to the project. --- bun.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bun.lock b/bun.lock index 327262f..05b33b0 100644 --- a/bun.lock +++ b/bun.lock @@ -11,7 +11,6 @@ "turbo": "^2.8.17", "typescript": "5.9.3", }, - "tslib": "^2.8.1", }, "apps/s03-indexer": { "name": "s03-indexer", @@ -23,6 +22,7 @@ "@subql/types-core": "^2.2.0", "@subql/types-stellar": "latest", "text-encoding": "^0.7.0", + "tslib": "^2.8.1", }, "devDependencies": { "@subql/cli": "latest",