Skip to content

Agent/scaffold review fixes#3

Merged
krishna916 merged 15 commits into
mainfrom
agent/scaffold-review-fixes
Jul 25, 2026
Merged

Agent/scaffold review fixes#3
krishna916 merged 15 commits into
mainfrom
agent/scaffold-review-fixes

Conversation

@krishna916

@krishna916 krishna916 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Closes #1

Summary by CodeRabbit

  • New Features
    • Added a Relay health dashboard showing connection status, version information, loading states, errors, and retry support.
    • Added a local HTTP health endpoint and static web serving.
    • Added an MCP interface with a relay_health tool.
    • Added SQLite storage setup with migrations and integrity checks.
  • Documentation
    • Added setup, usage, configuration, architecture, troubleshooting, and implementation documentation.
  • Chores
    • Added automated formatting, validation, testing, and CI verification workflows.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@krishna916, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 18 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e19241f3-5604-4fee-9609-67491fe015e4

📥 Commits

Reviewing files that changed from the base of the PR and between 5f17ba3 and 6cc95bf.

📒 Files selected for processing (21)
  • .github/workflows/ci.yml
  • docs/superpowers/plans/2026-07-25-scaffold-implementation-plan.md
  • eslint.config.js
  • package.json
  • scripts/validate-repository-assets.ts
  • src/database/connection.ts
  • src/database/migrate.ts
  • src/interfaces/http/main.ts
  • src/interfaces/mcp/main.ts
  • tests/integration/database-migrations.test.ts
  • tests/integration/http-health.test.ts
  • tests/integration/mcp-stdio.test.ts
  • tests/unit/database/connection.test.ts
  • tests/unit/interfaces/http/create-http-server.test.ts
  • tests/unit/scripts/validate-repository-assets.test.ts
  • tests/unit/web/health-client.test.ts
  • tsconfig.node.json
  • tsconfig.test.json
  • tsup.config.ts
  • web/src/App.test.tsx
  • web/src/App.tsx
📝 Walkthrough

Walkthrough

Adds a production-shaped Relay scaffold with strict TypeScript tooling, SQLite migrations, health endpoints, MCP stdio support, a React/Vite shell, repository validation, tests, documentation, and CI verification.

Changes

Relay scaffold

Layer / File(s) Summary
Project foundation and toolchain
.editorconfig, .github/workflows/*, package.json, tsconfig*.json, README.md, docs/*, *.config.*
Adds Node/pnpm configuration, build and test tooling, CI verification, repository conventions, and scaffold documentation.
Shared contracts and SQLite migrations
src/shared/*, src/application/health/*, src/database/*, tests/support/*, tests/unit/{application,database,shared}/*, tests/integration/database-migrations.test.ts
Adds health and metadata contracts, package-root resolution, configurable SQLite connections, immutable SQL migrations, and migration tests.
HTTP and MCP interfaces
src/interfaces/http/*, src/interfaces/mcp/*, tests/unit/interfaces/*, tests/integration/{http-health,mcp-stdio}.test.ts
Adds loopback HTTP health/static serving and MCP stdio health tooling with shutdown handling and interface coverage.
React health web shell
web/*, vite.config.ts, tests/unit/web/*, web/src/App.test.tsx
Adds the Vite React entrypoint, validated health client, loading/error/success states, retry behavior, and UI tests.
Repository asset validation
scripts/validate-repository-assets.ts, tests/unit/scripts/*
Adds required-asset, JSON, Markdown-link, placeholder, and forbidden-asset checks with fixture tests.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant HTTPServer
  participant HealthService
  participant WebBuild
  Browser->>HTTPServer: GET /api/health
  HTTPServer->>HealthService: getHealth()
  HealthService-->>HTTPServer: health payload
  HTTPServer-->>Browser: JSON response
  Browser->>HTTPServer: GET /
  HTTPServer->>WebBuild: resolve static asset
  WebBuild-->>HTTPServer: index.html or bundle
  HTTPServer-->>Browser: static response
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the scaffold review fixes theme.
Linked Issues check ✅ Passed The PR covers the requested scaffold, tooling, SQLite, MCP/HTTP, React, docs, and CI gates for issue #1.
Out of Scope Changes check ✅ Passed No clearly unrelated changes stand out; the added docs and config support the scaffold objectives.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/scaffold-review-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

🧹 Nitpick comments (3)
eslint.config.js (1)

19-32: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Enable the React Hooks rules.

Registering react-hooks alone activates no checks, so hook ordering and dependency errors bypass the quality gate. Enable the version-supported recommended flat config (or explicitly enable rules-of-hooks and exhaustive-deps) as errors.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@eslint.config.js` around lines 19 - 32, Enable the React Hooks checks in the
rules configuration by spreading the version-supported recommended flat config
from reactHooks, or explicitly configuring react-hooks/rules-of-hooks and
react-hooks/exhaustive-deps as errors. Keep the existing TypeScript and other
rule settings unchanged.
tests/unit/web/health-client.test.ts (1)

9-32: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover malformed successful responses.

The validated-client failure path is untested: a 200 response with an invalid payload must reject with the schema error. This protects the API contract and coverage threshold.

Proposed test
+  it('throws when a successful response violates the health schema', async () => {
+    vi.stubGlobal(
+      'fetch',
+      vi.fn().mockResolvedValue({
+        ok: true,
+        json: async () => ({ name: 'relay', status: 'ok' }),
+      }),
+    );
+
+    await expect(fetchHealth()).rejects.toThrow('Invalid health check response schema');
+  });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/web/health-client.test.ts` around lines 9 - 32, Add a unit test
alongside the existing fetchHealth tests that stubs a successful 200 response
with a malformed payload, then asserts fetchHealth rejects with the
schema-validation error. Reuse the existing fetch mock setup and verify the
invalid response is not accepted as a valid health object.
tests/unit/interfaces/http/create-http-server.test.ts (1)

47-49: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Remove the Windows-only pnpm.cmd shim from test setup commands. These execSync calls already run through a shell, so pnpm resolves cross-platform; pnpm.cmd exists only on Windows. Change tests/unit/interfaces/http/create-http-server.test.ts to execSync('pnpm build:web', ...) and apply the same portable command only where build commands are actually needed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/interfaces/http/create-http-server.test.ts` around lines 47 - 49,
The test setup commands use the Windows-only pnpm.cmd shim. Update the execSync
build commands in tests/unit/interfaces/http/create-http-server.test.ts (lines
47-49), tests/integration/http-health.test.ts (lines 11-13), and
tests/integration/mcp-stdio.test.ts (lines 10-12) to invoke portable pnpm
commands, changing pnpm.cmd to pnpm only where a build command is actually
required.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 14-15: Update the actions/checkout@v4 step in the workflow to set
persist-credentials to false, while preserving the existing repository checkout
behavior.
- Around line 17-24: Reorder the workflow steps so “Enable Corepack” runs before
“Setup Node.js 24,” ensuring pnpm is available when actions/setup-node@v4
configures its pnpm cache. Keep the existing Node.js version and cache settings
unchanged.

In `@docs/superpowers/plans/2026-07-25-scaffold-implementation-plan.md`:
- Line 146: Remove the two stray four-backtick Markdown fence delimiters at the
referenced plan locations, while preserving the later four-backtick closers that
wrap nested triple-backtick examples so subsequent plan steps render as
Markdown.

In `@package.json`:
- Line 36: Align the `@types/node` dependency with the package.json engines range
of Node >=24 <25 by changing it to a 24.x version, unless the supported runtime
policy is intentionally moved to Node 26. Keep the runtime engine declaration
and Node type definitions consistent.

In `@scripts/validate-repository-assets.ts`:
- Around line 80-85: Expand the textExtensions set in the repository asset
validation loop to include .html, .css, .mjs, and .cjs so placeholder markers in
these committed source-text assets are checked. Add a fixture test covering at
least one previously skipped extension and verify unresolved markers are
reported.

In `@src/database/connection.ts`:
- Line 23: Update the connection initialization around db.pragma('journal_mode =
WAL') to inspect the returned journal mode for writable databases whose mode is
not memory. If the result is not wal, close the database and throw an error;
otherwise proceed with initialization unchanged.

In `@src/database/migrate.ts`:
- Around line 31-32: Update the migration validation around appliedMap and
loadMigrationFiles so every applied database version must have a corresponding
migration file; reject startup with the existing migration validation error when
any applied version is missing, before proceeding with normal checks. Add a
regression test covering deletion of an already-applied migration file and
asserting migration startup fails.

In `@src/interfaces/http/main.ts`:
- Around line 8-14: Update the shutdown handler’s instance.stop() promise chain
to handle rejection explicitly, preventing an unhandled rejection when stopping
fails while preserving the existing successful process.exit(0) behavior.

In `@src/interfaces/mcp/main.ts`:
- Around line 19-27: Update the MCP shutdown flow around server.close to avoid
calling process.exit in the finally block; set process.exitCode for success or
failure, await server.close, and allow Node to terminate naturally so pending
responses and buffered logs can drain.

In `@tsconfig.json`:
- Around line 3-6: Update the referenced configurations tsconfig.node.json and
tsconfig.test.json so they are compatible with tsc --build --noEmit: enable
composite and declaration generation, removing any conflicting
declaration-disabled setting while preserving their existing source behavior.
Keep the pnpm typecheck command unchanged.

In `@tsup.config.ts`:
- Around line 10-11: Update the tsup configuration used by the Node build so its
clean step cannot remove the Vite-generated dist/web bundle. Use disjoint output
directories or disable cleaning for the Node build, and ensure the combined
build performs any necessary one-time cleanup before both builds run.

In `@web/src/App.tsx`:
- Around line 9-30: Update loadHealth and the Retry button flow to retain the
active AbortController in a ref, aborting any previous request before starting a
new one and aborting the current request on component unmount. Ensure stale
requests cannot update health, loading, or error state, and avoid relying on the
discarded cleanup returned by direct Retry invocations.

---

Nitpick comments:
In `@eslint.config.js`:
- Around line 19-32: Enable the React Hooks checks in the rules configuration by
spreading the version-supported recommended flat config from reactHooks, or
explicitly configuring react-hooks/rules-of-hooks and
react-hooks/exhaustive-deps as errors. Keep the existing TypeScript and other
rule settings unchanged.

In `@tests/unit/interfaces/http/create-http-server.test.ts`:
- Around line 47-49: The test setup commands use the Windows-only pnpm.cmd shim.
Update the execSync build commands in
tests/unit/interfaces/http/create-http-server.test.ts (lines 47-49),
tests/integration/http-health.test.ts (lines 11-13), and
tests/integration/mcp-stdio.test.ts (lines 10-12) to invoke portable pnpm
commands, changing pnpm.cmd to pnpm only where a build command is actually
required.

In `@tests/unit/web/health-client.test.ts`:
- Around line 9-32: Add a unit test alongside the existing fetchHealth tests
that stubs a successful 200 response with a malformed payload, then asserts
fetchHealth rejects with the schema-validation error. Reuse the existing fetch
mock setup and verify the invalid response is not accepted as a valid health
object.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3e0f43bb-64c5-4744-aa8b-592943cb298d

📥 Commits

Reviewing files that changed from the base of the PR and between d1f7364 and 5f17ba3.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (58)
  • .editorconfig
  • .github/workflows/ci.yml
  • .gitignore
  • .nvmrc
  • .prettierignore
  • .prettierrc.json
  • README.md
  • docs/decisions/0001-product-and-architecture.md
  • docs/superpowers/plans/2026-07-25-scaffold-implementation-plan.md
  • docs/superpowers/plans/2026-07-25-scaffold-review-fixes.md
  • docs/superpowers/specs/2026-07-25-scaffold-review-fixes-design.md
  • eslint.config.js
  • package.json
  • scripts/validate-repository-assets.ts
  • src/application/health/get-health.ts
  • src/application/health/health.ts
  • src/database/connection.ts
  • src/database/database-config.ts
  • src/database/migrate.ts
  • src/database/migration.ts
  • src/database/migrations/0001_scaffold.sql
  • src/domain/README.md
  • src/env.d.ts
  • src/interfaces/http/create-http-server.ts
  • src/interfaces/http/main.ts
  • src/interfaces/mcp/create-mcp-server.ts
  • src/interfaces/mcp/logger.ts
  • src/interfaces/mcp/main.ts
  • src/shared/errors.ts
  • src/shared/package-metadata.ts
  • src/shared/runtime-paths.ts
  • tests/integration/database-migrations.test.ts
  • tests/integration/http-health.test.ts
  • tests/integration/mcp-stdio.test.ts
  • tests/support/temporary-database.ts
  • tests/unit/application/get-health.test.ts
  • tests/unit/database/database-config.test.ts
  • tests/unit/database/migration.test.ts
  • tests/unit/interfaces/http/create-http-server.test.ts
  • tests/unit/interfaces/mcp/create-mcp-server.test.ts
  • tests/unit/scripts/validate-repository-assets.test.ts
  • tests/unit/shared/package-metadata.test.ts
  • tests/unit/web/health-client.test.ts
  • tsconfig.base.json
  • tsconfig.json
  • tsconfig.node.json
  • tsconfig.test.json
  • tsconfig.web.json
  • tsup.config.ts
  • vite.config.ts
  • vitest.config.ts
  • web/index.html
  • web/src/App.test.tsx
  • web/src/App.tsx
  • web/src/api/health-client.ts
  • web/src/env.d.ts
  • web/src/main.tsx
  • web/src/vite-env.d.ts

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml Outdated
Comment thread docs/superpowers/plans/2026-07-25-scaffold-implementation-plan.md Outdated
Comment thread package.json Outdated
Comment thread scripts/validate-repository-assets.ts Outdated
Comment thread src/interfaces/http/main.ts
Comment thread src/interfaces/mcp/main.ts
Comment thread tsconfig.json
Comment on lines +3 to +6
"references": [
{ "path": "./tsconfig.node.json" },
{ "path": "./tsconfig.web.json" },
{ "path": "./tsconfig.test.json" }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
jq -s 'map({
  file: input_filename,
  composite: .compilerOptions.composite,
  noEmit: .compilerOptions.noEmit,
  declaration: .compilerOptions.declaration
})' tsconfig.node.json tsconfig.test.json tsconfig.web.json

Repository: krishna916/relay

Length of output: 485


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== files =="
for f in tsconfig.json tsconfig.node.json tsconfig.web.json tsconfig.test.json package.json; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    cat -n "$f"
  fi
done

echo "== tsc docs local? =="
fd -a 'project-references|tsconfig-project-reference' . 2>/dev/null | head -20 || true

echo "== package scripts/typecheck =="
if [ -f package.json ]; then jq '.scripts' package.json; fi

echo "== TypeScript availability/version if present =="
if [ -x node_modules/.bin/tsc ]; then
  node_modules/.bin/tsc --version
elif [ -x "$(command -v tsc 2>/dev/null)" ]; then
  tsc --version
fi

Repository: krishna916/relay

Length of output: 5186


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== base config files =="
for f in $(fd 'tsconfig.*base.*' .); do
  echo "--- $f ---"
  cat -n "$f"
done

echo "== all tsconfigs with relevant options/refs =="
python3 - <<'PY'
import json, pathlib
for p in sorted(pathlib.Path('.').glob('tsconfig*.json')):
    if p.name.startswith('.'):
        continue
    data=json.loads(p.read_text())
    co=data.get('compilerOptions', {})
    print(p)
    for k in ['extends','files','references','outDir','rootDir','target','module','moduleResolution','lib','jsx','types','noEmit','declaration','declarationMap','composite','emitDeclarationOnly','allowJs']:
        v=co.get(k) if k in co else None
        if k=='references':
            v=data.get(k)
        if v is not None:
            print(f'  {k}: {v}')
PY

echo "== tsc project mode probe =="
tmp="$(mktemp -d)"
cat > "$tmp/README.md" <<'MD'
# placeholder
MD
cat > "$tmp/tests/a.test.ts" <<'TS'
// placeholder TS test file so the test project include is non-empty
throw new Error('placeholder')
TS
mkdir -p "$tmp/src" "$tmp/web/src" "$tmp/dist" "$tmp/types"
cat > "$tmp/tsconfig.base.json" <<'TS'
{
  "compilerOptions": {
    "strict": true
  }
}
TS
cat > "$tmp/tsconfig.test.json" <<'TS'
{
  "extends": "./tsconfig.base.json",
  "compilerOptions": {
    "declaration": false
  },
  "include": ["tests/a.test.ts"]
}
TS
cat > "$tmp/tsconfig.root.json" <<'TS'
{
  "files": [],
  "references": [
    { "path": "./tsconfig.test.json" }
  ]
}
TS
node_modules/.bin/tsc --showConfig --project "$tmp/tsconfig.root.json" 2>&1 || true
node_modules/.bin/tsc --build --noEmit --project "$tmp/tsconfig.root.json" 2>&1 || true

Repository: krishna916/relay

Length of output: 1821


🌐 Web query:

TypeScript project references composite option declaration forced true non-error TS9005

💡 Result:

The TypeScript error TS9005 (Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit.) is primarily a declaration emit error, not a direct validation error caused by setting "composite": true [1][2]. While you may encounter TS9005 while using "composite": true, the error is not inherently caused by the "composite" setting itself [3]. Instead, it occurs because "composite" projects require declaration file generation ("declaration": true), which forces the compiler to determine how to represent exported types in generated.d.ts files [4][5][6]. Here is the breakdown of why this happens and how to address it: 1. The Cause of TS9005 The compiler is attempting to generate a.d.ts file for a file that exports a type or value that cannot be named publicly [1]. This often happens with: - Anonymous functions or classes being exported [7][8]. - Exports in JavaScript files (when "allowJs": true is used) that TypeScript cannot automatically infer a clear, public type for [7][1][2]. - Internal types that are leaked into the public API surface of a module [1]. 2. Why "composite": true is often involved When you set "composite": true, TypeScript enforces that declaration files must be emitted [4][5]. If your project configuration previously allowed these problematic exports because it wasn't emitting declaration files, enabling "composite": true will suddenly force the compiler to try (and fail) to generate those declarations, triggering TS9005 [3][2]. 3. How to fix it - Add explicit type annotations: The error message itself suggests this [1]. By providing an explicit type for the exported item, you give the compiler a public name or type definition to use in the generated.d.ts file, rather than forcing it to guess how to name an anonymous or internal structure [7][1]. - Refactor exports: If you are exporting an anonymous function or class, give it a name [7][8]. - Review "allowJs": If you are using "allowJs", it is often more difficult for the compiler to generate declarations. You may need to provide explicit JSDoc types [1]. - Check for internal type leakage: Ensure that public exports do not depend on types that are not intended to be public, or explicitly export those dependencies [1]. In summary, "composite": true is simply enforcing the generation of declaration files, which exposes existing issues in your type definitions that were previously ignored [5][9]. TS9005 is the compiler informing you that it cannot safely create a public declaration for a specific part of your code [1].

Citations:


🌐 Web query:

TypeScript --build --noEmit requires composite tsconfig references tsc.build

💡 Result:

When using TypeScript's project references, projects that are referenced by other projects must have "composite": true enabled in their tsconfig.json [1][2][3]. This setting ensures that TypeScript can efficiently track build status and locate declaration files [1][4]. Regarding the use of --build and --noEmit: 1. Requirement for composite: The "composite" setting is required for any project intended to be referenced by another [2][3]. If project A references project B, project B must have "composite": true [3]. Enabling "composite" automatically forces "declaration": true, which is necessary for dependent projects to consume type information [1][5][6]. 2. Support for --noEmit: Historically, "noEmit" could not be used with "composite" [7]. However, as of TypeScript 5.0+, the flag tsc --build --noEmit is supported [8]. This allows users to run type-checking only—useful for CI pipelines or workflows where build artifacts are handled by other tools—without requiring the emission of.js files [8]. 3. Build Artifacts: Even with --noEmit, project references still rely on the availability of declaration files (.d.ts) for referenced projects [6]. If you use --build, TypeScript expects the referenced project to have already produced its declaration files [6]. If you only need type checking, you can set "emitDeclarationOnly": true to skip.js generation, or use appropriate output directories (e.g., in node_modules/.tmp) to manage the.d.ts files without cluttering your project source [6]. In summary, while you can now use --noEmit with --build, the "composite" requirement remains essential for the project reference mechanism to function correctly by enabling the necessary metadata and declaration generation for dependencies [8][4][3].

Citations:


🌐 Web query:

site:typescriptlang.org "compiler option references" "composite project" "tsconfig references"

💡 Result:

In TypeScript, project references allow you to structure a large codebase into smaller, independent projects. This setup is enabled using the references top-level property in a tsconfig.json file [1][2]. Core Components: 1. references: This is an array of objects within your tsconfig.json file. Each object contains a path property pointing to either a directory containing a tsconfig.json file or directly to the configuration file itself [1][3]. 2. composite: Any project referenced must have the composite compiler option set to true [1][4]. This setting enables constraints that allow the TypeScript compiler (tsc) to quickly determine if a project has been built and to properly manage output locations [4][5]. Key constraints enabled by composite: - The rootDir compiler option defaults to the directory containing the tsconfig.json file if not explicitly set [1][4]. - All implementation files must be included via an include pattern or explicitly listed in the files array [1][4]. - declaration must be enabled (it defaults to true when composite is true) [4][5]. Relevant Compiler Options: - --build: When using project references, you typically invoke the compiler with the --build (or -b) flag, which enables incremental builds and ensures referenced projects are built in the correct order [4][5]. - disableSourceOfProjectReferenceRedirect: A compiler option that disables the default behavior of preferring source files over declaration files when referencing composite projects [5]. - disableReferencedProjectLoad: A compiler option that disables the automatic loading of referenced projects [5]. - incremental: Enabling composite also defaults incremental to true, allowing for faster builds by storing information about the project graph in a.tsbuildinfo file [5]. Best Practices: - Use a solution-style tsconfig.json at the root of your repository to reference your sub-projects [1]. - When creating a solution tsconfig, set files to an empty array to avoid double-compilation of files, as it is valid to have an empty files array if the project contains at least one reference [1][3].

Citations:


Make the referenced projects compatible with build mode.

pnpm typecheck runs tsc --build --noEmit, but referenced projects must be composite so TypeScript can build them and consume their generated declaration files. tsconfig.node.json has no composite, and tsconfig.test.json explicitly disables declarations while using project references and allowJs. Either enable composite/declaration-only build output for these projects and keep typecheck as is, or replace this command with a no-emit typecheck config that doesn’t depend on project references.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tsconfig.json` around lines 3 - 6, Update the referenced configurations
tsconfig.node.json and tsconfig.test.json so they are compatible with tsc
--build --noEmit: enable composite and declaration generation, removing any
conflicting declaration-disabled setting while preserving their existing source
behavior. Keep the pnpm typecheck command unchanged.

Comment thread tsup.config.ts Outdated
Comment thread web/src/App.tsx
@krishna916
krishna916 merged commit 879971d into main Jul 25, 2026
1 of 2 checks passed
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.

Scaffold Relay with TypeScript, SQLite, MCP, React, and CI quality gates

1 participant