Skip to content

fix(riviere-extract-ts): preserve customTypes during module resolution - #152

Merged
NTCoding merged 4 commits into
mainfrom
issue-151-fix-extract-ts-resolvemodule-d
Jan 13, 2026
Merged

NTCoding merged 4 commits into
mainfrom
issue-151-fix-extract-ts-resolvemodule-d

Conversation

@NTCoding

@NTCoding NTCoding commented Jan 13, 2026 •

Copy link
Copy Markdown
Owner

User description

Closes #151

Fixes #151

Summary

resolveModule and resolveModuleWithExtends were dropping customTypes from module config during resolution, making them unavailable for extraction.

Changes

  • resolveModule: Include customTypes from moduleConfig if defined
  • resolveModuleWithExtends: Merge customTypes from base and local configs (local overrides base for same type name)
  • Tests: Added 4 comprehensive tests covering all customTypes resolution scenarios

Verification

  • All acceptance criteria met
  • End-to-end tested with ecommerce-demo-app
  • 100% test coverage maintained

PR Type

Bug fix


Description

  • Preserve customTypes in resolveModule function

  • Merge customTypes from base and local configs

  • Local customTypes override base for same names

  • Add comprehensive test coverage for customTypes resolution


Diagram Walkthrough

flowchart LR
  ModuleConfig["ModuleConfig with customTypes"]
  resolveModule["resolveModule function"]
  resolveModuleWithExtends["resolveModuleWithExtends function"]
  mergeCustomTypes["mergeCustomTypes helper"]
  ResolvedModule["Resolved Module with customTypes"]
  
  ModuleConfig -- "includes customTypes" --> resolveModule
  resolveModule -- "delegates to" --> resolveModuleWithExtends
  resolveModuleWithExtends -- "calls" --> mergeCustomTypes
  mergeCustomTypes -- "merges base + local" --> ResolvedModule
  resolveModule -- "direct pass-through" --> ResolvedModule
Loading

File Walkthrough

Relevant files
Bug fix
resolve-config.ts
Preserve and merge customTypes in module resolution           

packages/riviere-extract-ts/src/resolve-config.ts

  • Added customTypes preservation in resolveModule function
  • Added customTypes merging in resolveModuleWithExtends function
  • Implemented mergeCustomTypes helper function to merge base and local
    customTypes
  • Local customTypes override base customTypes with same name
+16/-0   
Tests
resolve-config.spec.ts
Add customTypes resolution test coverage                                 

packages/riviere-extract-ts/src/resolve-config.spec.ts

  • Added test for customTypes inclusion in resolved module
  • Added test for customTypes in extended module
  • Added test for merging customTypes from local and base
  • Added test for local customType override behavior
+143/-0 

Summary by CodeRabbit

  • New Features
    • Resolved modules now include custom type configurations when present; extended modules inherit and merge custom types from their bases, with local definitions overriding inherited ones.
  • Tests
    • Added tests verifying preservation, inheritance, merging, and overriding of custom types across standalone and extended module scenarios.
  • Documentation
    • Streamlined the PR submission guide into a compact workflow with updated examples and formatting.

✏️ Tip: You can customize this high-level summary in your review settings.

resolveModule and resolveModuleWithExtends were dropping customTypes from
module config during resolution, making them unavailable for extraction.

Changes:
- resolveModule: Include customTypes from moduleConfig if defined
- resolveModuleWithExtends: Merge customTypes from base and local configs
  (local overrides base for same type name)
- Added 4 tests covering customTypes resolution scenarios

Fixes #151

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jan 13, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Resolve logic now preserves and propagates module-level customTypes. resolveModule includes local customTypes; resolveModuleWithExtends shallow-merges base and local customTypes via a new internal mergeCustomTypes helper and exposes the merged result.

Changes

Cohort / File(s) Summary
Test coverage: customTypes
packages/riviere-extract-ts/src/resolve-config.spec.ts
Adds tests verifying preservation, inheritance, merging, and local override behavior for customTypes across standalone and extended module scenarios.
Runtime: resolve and merge customTypes
packages/riviere-extract-ts/src/resolve-config.ts
Adds mergeCustomTypes(base, local) helper; updates resolveModule to include customTypes when present; updates resolveModuleWithExtends to compute and include merged customTypes in returned Module.
Docs/automation: submit PR guidance
.claude/agents/submit-pr.md
Reworks submit-pr guidance: metadata, workflow block, and condensed instructions; updates front-matter (model/tools/color) and output/critical rules sections.

Sequence Diagram(s)

(omitted — changes are internal merging/resolution without multi-component runtime interaction)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

Review effort 3/5

Poem

🐰 I hopped through configs, sniffed each key,

Found custom types once missing from me,
I stitched base and local, neat and spry,
Now types march out and never hide,
Hooray — the resolver lets them fly!

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Changes to .claude/agents/submit-pr.md are unrelated to issue #151 and the customTypes fix; this documentation update appears to be out-of-scope. Remove or separate the submit-pr.md documentation changes into a distinct PR focused on documentation updates, keeping this PR focused solely on the customTypes fix.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: preserving customTypes during module resolution, which directly matches the PR's primary objective.
Linked Issues check ✅ Passed All acceptance criteria from issue #151 are met: resolveModule and resolveModuleWithExtends now include customTypes; merging logic with local override is implemented; 4 tests added covering inclusion, inheritance, merging, and override scenarios.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 34cf04f and 27f079c.

📒 Files selected for processing (1)
  • .claude/agents/submit-pr.md

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

@qodo-code-review

qodo-code-review Bot commented Jan 13, 2026 •

Copy link
Copy Markdown
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🟡
🎫 #151
🟢 `resolveModule` includes `customTypes` in the returned module object.
resolveModuleWithExtends includes customTypes in the returned module object for modules
using extends.
Tests are added for `customTypes` resolution.
⚪ Extraction with `customTypes` works end-to-end in `ecommerce-demo-app`.
Codebase Duplication Compliance
⚪
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jan 13, 2026 •

Copy link
Copy Markdown

Deploying living-architecture with  Cloudflare Pages  Cloudflare Pages

Latest commit: 27f079c
Status: ✅  Deploy successful!
Preview URL: https://64d09abb.living-architecture.pages.dev
Branch Preview URL: https://issue-151-fix-extract-ts-res.living-architecture.pages.dev

View logs

@qodo-code-review

qodo-code-review Bot commented Jan 13, 2026 •

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Prevent undefined spreads in mergeCustomTypes

Refactor mergeCustomTypes to explicitly handle undefined inputs, returning the
defined object or merging them if both exist, thus avoiding spreading undefined.

packages/riviere-extract-ts/src/resolve-config.ts [74-85]

 function mergeCustomTypes(
   base: Module['customTypes'],
   local: ModuleConfig['customTypes'],
 ): Module['customTypes'] {
-  if (base === undefined && local === undefined) {
-    return undefined
+  if (base === undefined) {
+    return local
+  }
+  if (local === undefined) {
+    return base
   }
   return {
     ...base,
     ...local,
   }
 }

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 5

__

Why: This suggestion improves code clarity and robustness by explicitly handling cases where one of the inputs is undefined, making the mergeCustomTypes function's logic more readable.

Low
  • Update

@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: 1

🤖 Fix all issues with AI agents
In @packages/riviere-extract-ts/src/resolve-config.spec.ts:
- Around line 198-225: Add a unit test named something like "inherits
customTypes from base module when local has none" that uses a mocked
ConfigLoader (vi.fn() -> baseWithCustomTypes) where baseWithCustomTypes sets
Module.customTypes (e.g., service -> { find: 'classes', where: { nameEndsWith: {
suffix: 'Service' } } }) and the local module in the ExtractionConfig omits
customTypes; call resolveConfig(config, loader) and assert
result.modules[0]?.customTypes strictly equals the base customTypes to verify
mergeCustomTypes(base, undefined) returns the base.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aed2276 and b627d22.

📒 Files selected for processing (2)
  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
🧰 Additional context used
📓 Path-based instructions (4)
packages/riviere-extract-ts/**/*.{ts,tsx}

📄 CodeRabbit inference engine (packages/riviere-extract-ts/CLAUDE.md)

packages/riviere-extract-ts/**/*.{ts,tsx}: Use ts-morph for TypeScript AST parsing instead of other parsers
Implement extraction logic as pure functions with no side effects
Compose detection rules via and/or logic for predicates
Reject invalid extraction configs at load time, not during extraction phase
Use glob pattern matching for module-based organization of extraction rules

Files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
**/*.{js,mjs,ts,tsx,json}

📄 CodeRabbit inference engine (CLAUDE.md)

Always use nx commands for build, test, lint operations. Do not run npm/pnpm directly in project folders

Files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Use cross-project imports with package names (e.g., import { X } from '@living-architecture/[pkg-name]'), not relative paths
When adding dependencies between projects, add "@living-architecture/[pkg-name]": "workspace:*" to the consuming project's package.json
Follow docs/conventions/software-design.md when writing, editing, refactoring, or reviewing code
Look for and follow standard implementation patterns defined in docs/conventions/standard-patterns.md
Avoid anti-patterns documented in @docs/conventions/anti-patterns.md
Follow docs/conventions/testing.md when writing tests. 100% test coverage is mandatory and enforced

Files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,js,jsx}: Never commit secrets, API keys, or credentials. Use environment variables for sensitive configuration
Do not log sensitive data (passwords, tokens, PII). Validate and sanitize all external input

Files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
🧠 Learnings (23)
📓 Common learnings
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/architecture/overview.md:0-0
Timestamp: 2026-01-08T22:20:13.250Z
Learning: Applies to docs/architecture/**/*extract*.ts : Use `living-architecture/riviere-extract-ts` TypeScript extractor with ts-morph for AST parsing when implementing TypeScript extraction for architecture schema components
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-conventions/CLAUDE.md:0-0
Timestamp: 2026-01-08T07:05:01.766Z
Learning: Applies to packages/riviere-extract-conventions/**/*.ts : Use `Custom(type)` decorator to annotate components with custom types not covered by standard decorators
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.test.{ts,tsx} : Implement integration tests for end-to-end extraction from TypeScript code to JSON output
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.{ts,tsx} : Implement extraction logic as pure functions with no side effects
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.{ts,tsx} : Use glob pattern matching for module-based organization of extraction rules
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-config/CLAUDE.md:0-0
Timestamp: 2026-01-06T23:01:34.751Z
Learning: Applies to packages/riviere-extract-config/**/*.ts : Extraction config schema is the source of truth for valid structures. TypeScript types must mirror the schema definition to maintain consistency
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.test.{ts,tsx} : Implement unit tests for each predicate type in isolation with positive and negative cases
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.{ts,tsx} : Use ts-morph for TypeScript AST parsing instead of other parsers
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.{ts,tsx} : Reject invalid extraction configs at load time, not during extraction phase
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/architecture/overview.md:0-0
Timestamp: 2026-01-08T22:20:13.250Z
Learning: Applies to docs/architecture/**/*.{ts,tsx} : Apply decorators from `living-architecture/riviere-extract-conventions` to mark all classes as architectural components
📚 Learning: 2026-01-08T12:57:19.167Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 67
File: packages/riviere-extract-ts/tsconfig.spec.json:5-22
Timestamp: 2026-01-08T12:57:19.167Z
Learning: In tsconfig.spec.json files, use expanded types array ["vitest/globals", "vitest/importMeta", "vite/client", "node", "vitest"] for complete test type coverage. Include patterns should cover .test and .spec files, config files (vitest.config.ts/mts, vite.config.ts/mts), multiple extensions (.ts, .tsx, .js, .jsx), and .d.ts files to ensure proper TypeScript coverage across the testing environment.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
📚 Learning: 2026-01-08T17:19:17.148Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.test.{ts,tsx} : Implement integration tests for end-to-end extraction from TypeScript code to JSON output

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
📚 Learning: 2026-01-08T17:19:17.148Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.test.{ts,tsx} : Implement unit tests for each predicate type in isolation with positive and negative cases

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T07:05:01.766Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-conventions/CLAUDE.md:0-0
Timestamp: 2026-01-08T07:05:01.766Z
Learning: Applies to packages/riviere-extract-conventions/**/*.ts : Use `Custom(type)` decorator to annotate components with custom types not covered by standard decorators

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
📚 Learning: 2026-01-06T23:01:34.751Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-config/CLAUDE.md:0-0
Timestamp: 2026-01-06T23:01:34.751Z
Learning: Applies to packages/riviere-extract-config/**/*.ts : Extraction config schema is the source of truth for valid structures. TypeScript types must mirror the schema definition to maintain consistency

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
📚 Learning: 2026-01-08T17:19:17.148Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.test.{ts,tsx} : Use ts-morph's in-memory file system (`useInMemoryFileSystem: true`) for fast isolated tests

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T17:19:17.148Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.{ts,tsx} : Use glob pattern matching for module-based organization of extraction rules

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
📚 Learning: 2026-01-08T17:19:17.148Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.{ts,tsx} : Use ts-morph for TypeScript AST parsing instead of other parsers

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
📚 Learning: 2026-01-08T17:19:17.148Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.{ts,tsx} : Reject invalid extraction configs at load time, not during extraction phase

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
📚 Learning: 2026-01-13T11:37:59.334Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-13T11:37:59.334Z
Learning: Applies to vitest.config.ts : Add vitest.config.ts if tests are needed with 100% coverage as the default

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-06T23:01:34.751Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-config/CLAUDE.md:0-0
Timestamp: 2026-01-06T23:01:34.751Z
Learning: Extraction config schemas must define all six required component types per module: api, useCase, domainOp, event, eventHandler, and ui. Unused component types must be explicitly marked with `notUsed: true` rather than omitted

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
📚 Learning: 2026-01-08T06:46:00.609Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 66
File: packages/riviere-extract-conventions/src/eslint/require-component-decorator.spec.ts:19-21
Timestamp: 2026-01-08T06:46:00.609Z
Learning: In test files using typescript-eslint/rule-tester's RuleTester.run(), ensure there is an explicit it() block with at least one expect() assertion (e.g., expect(rule).toBeDefined()) to satisfy sonarjs/no-empty-test-file and sonarjs/assertions-in-tests lint rules, which don’t recognize RuleTester's internal test blocks. Apply this pattern to all spec.ts test files to maintain consistency and pass lint checks.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-11T14:38:35.637Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 129
File: packages/riviere-cli/src/commands/extract/config-loader.ts:31-39
Timestamp: 2026-01-11T14:38:35.637Z
Learning: In packages/riviere-cli/src/commands/extract/config-loader.ts, the isExtendedConfig type guard intentionally performs minimal validation (checks for non-null object and validates modules is an array if present) because comprehensive validation is handled downstream by the schema validator. The type guard's purpose is basic type narrowing to support both module-array and top-level-rules formats, not comprehensive validation. This follows the layered validation pattern where type guards are minimal and schema validation occurs at system boundaries.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
📚 Learning: 2026-01-08T22:20:13.250Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/architecture/overview.md:0-0
Timestamp: 2026-01-08T22:20:13.250Z
Learning: Applies to docs/architecture/**/*extract*.ts : Use `living-architecture/riviere-extract-ts` TypeScript extractor with ts-morph for AST parsing when implementing TypeScript extraction for architecture schema components

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
📚 Learning: 2026-01-09T20:08:30.350Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 88
File: packages/riviere-cli/src/commands/extract/extract.spec.ts:33-38
Timestamp: 2026-01-09T20:08:30.350Z
Learning: In test files, keep type guard implementations like isExtractionOutput(value: unknown): value is ExtractionOutput focused on narrowing types for TypeScript. Do not perform comprehensive runtime shape validation in type guards; rely on explicit test assertions (e.g., expect(result).toMatchObject(...)) for shape checks. This keeps type guards simple and rely on assertion-based tests for thorough validation.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T22:20:13.250Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/architecture/overview.md:0-0
Timestamp: 2026-01-08T22:20:13.250Z
Learning: Applies to docs/architecture/**/*extract*.{json,ts} : Define extraction configuration using the JSON Schema from `living-architecture/riviere-extract-config` DSL

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T07:05:01.766Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-conventions/CLAUDE.md:0-0
Timestamp: 2026-01-08T07:05:01.766Z
Learning: Import and use the default extraction config from `living-architecture/riviere-extract-conventions/default-config` in extraction tooling to detect all 6 component types

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-10T08:54:09.466Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 96
File: apps/docs/.vitepress/theme/eclairLinkHandler.spec.ts:229-249
Timestamp: 2026-01-10T08:54:09.466Z
Learning: In jsdom test environments, window.location.assign cannot be spied on due to TypeError: Cannot redefine property. Use Object.defineProperty to mock the entire window.location object, replacing it with a controlled mock, and restore the original in afterEach. Ensure to clean up the mock after each test to avoid side effects.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T22:39:00.431Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 84
File: packages/riviere-extract-ts/src/extractor.ts:168-187
Timestamp: 2026-01-08T22:39:00.431Z
Learning: In ts-morph usage within the riviere-extract-ts package, MethodDeclaration.getName() always returns a string (never undefined) because methods cannot be anonymous in TypeScript. Only ClassDeclaration.getName() and FunctionDeclaration.getName() can return undefined. Therefore, remove undefined guards for MethodDeclaration when implementing createMethodComponent, and only keep guards for components that can actually be undefined (class/function components). Apply this guidance to all .ts files under packages/riviere-extract-ts/ (i.e., **/packages/riviere-extract-ts/**/*.ts).

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
📚 Learning: 2026-01-11T18:47:09.232Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 129
File: apps/eclair/src/components/SchemaModal/SchemaModal.cssModule.spec.ts:13-19
Timestamp: 2026-01-11T18:47:09.232Z
Learning: In test files matching *.spec.ts or *.test.ts, avoid using try/catch blocks for testing error conditions. Prefer assertion library matchers like expect(...).toThrow() or expect(...).rejects.toThrow() to assert errors.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-11T18:47:09.232Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 129
File: apps/eclair/src/components/SchemaModal/SchemaModal.cssModule.spec.ts:13-19
Timestamp: 2026-01-11T18:47:09.232Z
Learning: Encourage using const for declarations by default in TypeScript/JavaScript files and only use let when a variable must be reassigned. Do not rely on var. This improves immutability and clarity. If a variable needs mutation (e.g., counters in loops, reassigned values), use let, but prefer const whenever possible and refactor reassigned logic to avoid mutations where feasible.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
  • packages/riviere-extract-ts/src/resolve-config.ts
📚 Learning: 2026-01-08T17:19:17.148Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.{ts,tsx} : Implement extraction logic as pure functions with no side effects

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.ts
🧬 Code graph analysis (1)
packages/riviere-extract-ts/src/resolve-config.ts (1)
packages/riviere-extract-config/src/types.ts (2)
  • Module (93-103)
  • ModuleConfig (76-87)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: main
🔇 Additional comments (6)
packages/riviere-extract-ts/src/resolve-config.ts (3)

74-84: LGTM! Clean pure function for merging customTypes.

The mergeCustomTypes helper correctly handles all edge cases:

  • Both undefined → returns undefined
  • One undefined → spreading undefined yields {}, so the defined value propagates
  • Both defined → shallow merge with local overriding base

This is a well-structured pure function consistent with the coding guidelines. Based on learnings, extraction logic should be pure functions with no side effects, which this follows.


46-46: LGTM!

Correct use of conditional spreading to include customTypes only when defined, avoiding pollution of the returned object with undefined values.


60-71: LGTM!

The extends resolution correctly computes merged customTypes and conditionally includes them in the result. The merge is performed before constructing the return object, keeping the logic clear.

packages/riviere-extract-ts/src/resolve-config.spec.ts (3)

66-96: LGTM!

Good test coverage for the non-extends scenario with customTypes. The assertion correctly verifies that customTypes are preserved in the resolved module.


227-268: LGTM!

Excellent test for the merge behavior with distinct keys from base and local customTypes.


270-307: LGTM!

Good coverage of the override scenario where local customType with the same name takes precedence over the inherited one.

Comment thread packages/riviere-extract-ts/src/resolve-config.spec.ts
Add test case for inheriting base module customTypes when local module
omits them, verifying mergeCustomTypes(base, undefined) returns base.

Addresses CodeRabbit feedback.

Co-Authored-By: Claude Opus 4.5 <[email protected]>

@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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/riviere-extract-ts/src/resolve-config.spec.ts (1)

65-340: Consider adding edge case tests for empty customTypes objects.

The current test suite covers the main scenarios well. Per testing conventions, you might want to add tests for edge cases like:

  • Empty customTypes: {} in local module
  • Empty customTypes: {} in base module when merging
  • Nested edge cases (e.g., merge of empty base with populated local)

These would ensure the merging logic handles degenerate cases gracefully.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b627d22 and b1cad78.

📒 Files selected for processing (1)
  • packages/riviere-extract-ts/src/resolve-config.spec.ts
🧰 Additional context used
📓 Path-based instructions (4)
packages/riviere-extract-ts/**/*.{ts,tsx}

📄 CodeRabbit inference engine (packages/riviere-extract-ts/CLAUDE.md)

packages/riviere-extract-ts/**/*.{ts,tsx}: Use ts-morph for TypeScript AST parsing instead of other parsers
Implement extraction logic as pure functions with no side effects
Compose detection rules via and/or logic for predicates
Reject invalid extraction configs at load time, not during extraction phase
Use glob pattern matching for module-based organization of extraction rules

Files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
**/*.{js,mjs,ts,tsx,json}

📄 CodeRabbit inference engine (CLAUDE.md)

Always use nx commands for build, test, lint operations. Do not run npm/pnpm directly in project folders

Files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Use cross-project imports with package names (e.g., import { X } from '@living-architecture/[pkg-name]'), not relative paths
When adding dependencies between projects, add "@living-architecture/[pkg-name]": "workspace:*" to the consuming project's package.json
Follow docs/conventions/software-design.md when writing, editing, refactoring, or reviewing code
Look for and follow standard implementation patterns defined in docs/conventions/standard-patterns.md
Avoid anti-patterns documented in @docs/conventions/anti-patterns.md
Follow docs/conventions/testing.md when writing tests. 100% test coverage is mandatory and enforced

Files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,js,jsx}: Never commit secrets, API keys, or credentials. Use environment variables for sensitive configuration
Do not log sensitive data (passwords, tokens, PII). Validate and sanitize all external input

Files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
🧠 Learnings (26)
📓 Common learnings
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-conventions/CLAUDE.md:0-0
Timestamp: 2026-01-08T07:05:01.766Z
Learning: Applies to packages/riviere-extract-conventions/**/*.ts : Use `Custom(type)` decorator to annotate components with custom types not covered by standard decorators
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/architecture/overview.md:0-0
Timestamp: 2026-01-08T22:20:13.250Z
Learning: Applies to docs/architecture/**/*extract*.ts : Use `living-architecture/riviere-extract-ts` TypeScript extractor with ts-morph for AST parsing when implementing TypeScript extraction for architecture schema components
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.test.{ts,tsx} : Implement integration tests for end-to-end extraction from TypeScript code to JSON output
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.{ts,tsx} : Use glob pattern matching for module-based organization of extraction rules
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.test.{ts,tsx} : Implement unit tests for each predicate type in isolation with positive and negative cases
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.{ts,tsx} : Implement extraction logic as pure functions with no side effects
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-config/CLAUDE.md:0-0
Timestamp: 2026-01-06T23:01:34.751Z
Learning: Applies to packages/riviere-extract-config/**/*.ts : Extraction config schema is the source of truth for valid structures. TypeScript types must mirror the schema definition to maintain consistency
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.{ts,tsx} : Use ts-morph for TypeScript AST parsing instead of other parsers
📚 Learning: 2026-01-08T17:19:17.148Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.test.{ts,tsx} : Implement integration tests for end-to-end extraction from TypeScript code to JSON output

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T12:57:19.167Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 67
File: packages/riviere-extract-ts/tsconfig.spec.json:5-22
Timestamp: 2026-01-08T12:57:19.167Z
Learning: In tsconfig.spec.json files, use expanded types array ["vitest/globals", "vitest/importMeta", "vite/client", "node", "vitest"] for complete test type coverage. Include patterns should cover .test and .spec files, config files (vitest.config.ts/mts, vite.config.ts/mts), multiple extensions (.ts, .tsx, .js, .jsx), and .d.ts files to ensure proper TypeScript coverage across the testing environment.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T17:19:17.148Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.test.{ts,tsx} : Implement unit tests for each predicate type in isolation with positive and negative cases

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T07:05:01.766Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-conventions/CLAUDE.md:0-0
Timestamp: 2026-01-08T07:05:01.766Z
Learning: Applies to packages/riviere-extract-conventions/**/*.ts : Use `Custom(type)` decorator to annotate components with custom types not covered by standard decorators

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-06T23:01:34.751Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-config/CLAUDE.md:0-0
Timestamp: 2026-01-06T23:01:34.751Z
Learning: Applies to packages/riviere-extract-config/**/*.ts : Extraction config schema is the source of truth for valid structures. TypeScript types must mirror the schema definition to maintain consistency

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-11T14:38:35.637Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 129
File: packages/riviere-cli/src/commands/extract/config-loader.ts:31-39
Timestamp: 2026-01-11T14:38:35.637Z
Learning: In packages/riviere-cli/src/commands/extract/config-loader.ts, the isExtendedConfig type guard intentionally performs minimal validation (checks for non-null object and validates modules is an array if present) because comprehensive validation is handled downstream by the schema validator. The type guard's purpose is basic type narrowing to support both module-array and top-level-rules formats, not comprehensive validation. This follows the layered validation pattern where type guards are minimal and schema validation occurs at system boundaries.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T17:19:17.148Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.test.{ts,tsx} : Use ts-morph's in-memory file system (`useInMemoryFileSystem: true`) for fast isolated tests

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T17:19:17.148Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.{ts,tsx} : Reject invalid extraction configs at load time, not during extraction phase

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-13T11:37:59.334Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-13T11:37:59.334Z
Learning: Applies to vitest.config.ts : Add vitest.config.ts if tests are needed with 100% coverage as the default

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-11T22:42:36.650Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/conventions/testing.md:0-0
Timestamp: 2026-01-11T22:42:36.650Z
Learning: Applies to docs/conventions/**/*.spec.{ts,tsx,js,jsx} : Systematically test edge cases for collections: empty collections, single element, duplicates, nested structures, circular references, large collections, sparse arrays, and mixed types.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-11T22:42:12.408Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/conventions/anti-patterns.md:0-0
Timestamp: 2026-01-11T22:42:12.408Z
Learning: Applies to docs/conventions/**/packages/*/src/index.{ts,tsx} : Never export test fixtures from a package's public API for use by other packages. Each package should create its own local test fixtures to avoid fragile cross-package coupling.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-11T22:42:36.650Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/conventions/testing.md:0-0
Timestamp: 2026-01-11T22:42:36.650Z
Learning: Applies to docs/conventions/**/*.spec.{ts,tsx,js,jsx} : Systematically test null and undefined cases: null input, undefined input, missing optional properties, and explicit undefined vs missing key distinction.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-11T22:42:36.650Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/conventions/testing.md:0-0
Timestamp: 2026-01-11T22:42:36.650Z
Learning: Applies to docs/conventions/**/*.spec.{ts,tsx,js,jsx} : Avoid implementation coupling in tests. Test behavior outcomes, not internal implementation details. For example, assert on result values rather than mock method call signatures.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-11T22:42:36.650Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/conventions/testing.md:0-0
Timestamp: 2026-01-11T22:42:36.650Z
Learning: Applies to docs/conventions/**/*-fixtures.ts : Create fixture files with pattern '<module>-fixtures.ts' alongside '<module>.spec.ts' to reduce test duplication. Use a buildArgs helper to define defaults and override specific values in tests.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-06T23:01:34.751Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-config/CLAUDE.md:0-0
Timestamp: 2026-01-06T23:01:34.751Z
Learning: Extraction config schemas must define all six required component types per module: api, useCase, domainOp, event, eventHandler, and ui. Unused component types must be explicitly marked with `notUsed: true` rather than omitted

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T17:19:17.148Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-ts/CLAUDE.md:0-0
Timestamp: 2026-01-08T17:19:17.148Z
Learning: Applies to packages/riviere-extract-ts/**/*.{ts,tsx} : Use glob pattern matching for module-based organization of extraction rules

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T06:46:00.609Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 66
File: packages/riviere-extract-conventions/src/eslint/require-component-decorator.spec.ts:19-21
Timestamp: 2026-01-08T06:46:00.609Z
Learning: In test files using typescript-eslint/rule-tester's RuleTester.run(), ensure there is an explicit it() block with at least one expect() assertion (e.g., expect(rule).toBeDefined()) to satisfy sonarjs/no-empty-test-file and sonarjs/assertions-in-tests lint rules, which don’t recognize RuleTester's internal test blocks. Apply this pattern to all spec.ts test files to maintain consistency and pass lint checks.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T22:20:13.250Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/architecture/overview.md:0-0
Timestamp: 2026-01-08T22:20:13.250Z
Learning: Applies to docs/architecture/**/*extract*.ts : Use `living-architecture/riviere-extract-ts` TypeScript extractor with ts-morph for AST parsing when implementing TypeScript extraction for architecture schema components

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-09T20:08:30.350Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 88
File: packages/riviere-cli/src/commands/extract/extract.spec.ts:33-38
Timestamp: 2026-01-09T20:08:30.350Z
Learning: In test files, keep type guard implementations like isExtractionOutput(value: unknown): value is ExtractionOutput focused on narrowing types for TypeScript. Do not perform comprehensive runtime shape validation in type guards; rely on explicit test assertions (e.g., expect(result).toMatchObject(...)) for shape checks. This keeps type guards simple and rely on assertion-based tests for thorough validation.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T22:20:13.250Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: docs/architecture/overview.md:0-0
Timestamp: 2026-01-08T22:20:13.250Z
Learning: Applies to docs/architecture/**/*extract*.{json,ts} : Define extraction configuration using the JSON Schema from `living-architecture/riviere-extract-config` DSL

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T07:05:01.766Z
Learnt from: CR
Repo: NTCoding/living-architecture PR: 0
File: packages/riviere-extract-conventions/CLAUDE.md:0-0
Timestamp: 2026-01-08T07:05:01.766Z
Learning: Import and use the default extraction config from `living-architecture/riviere-extract-conventions/default-config` in extraction tooling to detect all 6 component types

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-10T08:54:09.466Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 96
File: apps/docs/.vitepress/theme/eclairLinkHandler.spec.ts:229-249
Timestamp: 2026-01-10T08:54:09.466Z
Learning: In jsdom test environments, window.location.assign cannot be spied on due to TypeError: Cannot redefine property. Use Object.defineProperty to mock the entire window.location object, replacing it with a controlled mock, and restore the original in afterEach. Ensure to clean up the mock after each test to avoid side effects.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-08T22:39:00.431Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 84
File: packages/riviere-extract-ts/src/extractor.ts:168-187
Timestamp: 2026-01-08T22:39:00.431Z
Learning: In ts-morph usage within the riviere-extract-ts package, MethodDeclaration.getName() always returns a string (never undefined) because methods cannot be anonymous in TypeScript. Only ClassDeclaration.getName() and FunctionDeclaration.getName() can return undefined. Therefore, remove undefined guards for MethodDeclaration when implementing createMethodComponent, and only keep guards for components that can actually be undefined (class/function components). Apply this guidance to all .ts files under packages/riviere-extract-ts/ (i.e., **/packages/riviere-extract-ts/**/*.ts).

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-11T18:47:09.232Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 129
File: apps/eclair/src/components/SchemaModal/SchemaModal.cssModule.spec.ts:13-19
Timestamp: 2026-01-11T18:47:09.232Z
Learning: In test files matching *.spec.ts or *.test.ts, avoid using try/catch blocks for testing error conditions. Prefer assertion library matchers like expect(...).toThrow() or expect(...).rejects.toThrow() to assert errors.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
📚 Learning: 2026-01-11T18:47:09.232Z
Learnt from: NTCoding
Repo: NTCoding/living-architecture PR: 129
File: apps/eclair/src/components/SchemaModal/SchemaModal.cssModule.spec.ts:13-19
Timestamp: 2026-01-11T18:47:09.232Z
Learning: Encourage using const for declarations by default in TypeScript/JavaScript files and only use let when a variable must be reassigned. Do not rely on var. This improves immutability and clarity. If a variable needs mutation (e.g., counters in loops, reassigned values), use let, but prefer const whenever possible and refactor reassigned logic to avoid mutations where feasible.

Applied to files:

  • packages/riviere-extract-ts/src/resolve-config.spec.ts
🧬 Code graph analysis (1)
packages/riviere-extract-ts/src/resolve-config.spec.ts (3)
packages/riviere-extract-config/src/types.ts (2)
  • ExtractionConfig (109-112)
  • Module (93-103)
packages/riviere-extract-ts/src/resolve-config.ts (2)
  • resolveConfig (21-29)
  • ConfigLoader (13-13)
packages/riviere-extract-ts/src/index.ts (2)
  • resolveConfig (6-6)
  • ConfigLoader (6-6)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: main
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (5)
packages/riviere-extract-ts/src/resolve-config.spec.ts (5)

66-96: LGTM!

This test correctly verifies that customTypes defined in a non-extends module are preserved through resolution. The assertion properly validates the complete structure of the custom type definition.


198-225: LGTM!

Test properly validates that local customTypes are included when extending a base module that lacks its own custom types.


227-258: LGTM!

This test validates the inheritance scenario where the local module omits customTypes and inherits them entirely from the base module.


260-301: LGTM!

Test correctly validates the merge behavior when both base and local modules define different customTypes. The assertion confirms both entries are present in the merged result.


303-340: LGTM!

Test validates the override semantics correctly: when a local customType shares a key with an inherited one, the local definition takes precedence.

@sonarqubecloud

Copy link
Copy Markdown

@NTCoding
NTCoding merged commit a47ca68 into main Jan 13, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(extract-ts): resolveModule drops customTypes from module config

1 participant