Skip to content

Comments

Add best-effort CDS extractor support for @sap/cds-indexer#303

Open
data-douser wants to merge 3 commits intomainfrom
dd/cds-extractor-update/1
Open

Add best-effort CDS extractor support for @sap/cds-indexer#303
data-douser wants to merge 3 commits intomainfrom
dd/cds-extractor-update/1

Conversation

@data-douser
Copy link
Collaborator

What This PR Contributes

Summary of Changes

  • Integrate indexer orchestration into cds-extractor.ts between dependency installation and compilation phases
  • New src/cds/indexer.ts: detect projects using @sap/cds-indexer and run npx --yes @sap/cds-indexer before compilation, with graceful error handling and diagnostic warnings on failure
  • Include @sap/cds-indexer in dependency cache when declared in project package.json (dependencies or devDependencies)
  • Add addCdsIndexerDiagnostic() to diagnostics.ts
  • Add unit tests to cover new indexer and diagnostic functions
  • Fix Jest localstorage-file warnings on Node.js v25+

Outline of Changes

CDS Extraction Pipeline Enhancements

  • Added orchestration of the CDS indexer (orchestrateCdsIndexer) to run before compilation in cds-extractor.ts, with performance tracking and summary logging. This ensures that projects requiring indexing are processed appropriately. [1] [2]

Testing Environment Improvements

  • Updated jest.config.js to suppress Node.js v25+ localStorage warnings by setting the --localstorage-file option for all Jest worker processes. This prevents noisy warnings during test runs on newer Node versions.

Dependency Updates

  • Upgraded the @typescript-eslint suite (including eslint-plugin, parser, scope-manager, type-utils, utils, visitor-keys, etc.) from version 8.55.0 to 8.56.0, and updated peer dependencies to support ESLint v10. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • Upgraded eslint-plugin-jest from 29.14.0 to 29.15.0.
  • Updated eslint-visitor-keys from 4.2.1 to 5.0.0, which also updates its required Node.js engine version.

Miscellaneous Package Lock Cleanups

  • Removed "peer": true fields from several dependencies in package-lock.json, reflecting changes in how peer dependencies are tracked or resolved. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Future Works

TBD

- Integrate indexer orchestration into cds-extractor.ts between
  dependency installation and compilation phases
- New src/cds/indexer.ts: detect projects using @sap/cds-indexer and
  run `npx --yes @sap/cds-indexer` before compilation, with graceful
  error handling and diagnostic warnings on failure
- Include @sap/cds-indexer in dependency cache when declared in
  project package.json (dependencies or devDependencies)
- Add addCdsIndexerDiagnostic() to diagnostics.ts
- Add unit tests to cover new indexer and diagnostic functions
- Fix Jest localstorage-file warnings on Node.js v25+
@data-douser data-douser self-assigned this Feb 17, 2026
@data-douser data-douser added the enhancement New feature or request label Feb 17, 2026
@data-douser data-douser changed the title Add best-effort @sap/cds-indexer support to CDS extractor Add best-effort CDS extractor support for @sap/cds-indexer Feb 17, 2026
@data-douser data-douser requested a review from Copilot February 17, 2026 22:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds best-effort support for running @sap/cds-indexer in the CDS extraction pipeline. The indexer is run automatically for projects that declare @sap/cds-indexer as a dependency or devDependency, with graceful error handling that allows compilation to proceed even if indexing fails.

Changes:

  • New indexer module (src/cds/indexer.ts) that detects and runs @sap/cds-indexer via npx before CDS compilation
  • Integration of indexer orchestration into the main extraction pipeline between dependency installation and compilation phases
  • Cache installer enhancements to include @sap/cds-indexer in dependency hash calculation and installation
  • Jest configuration update to suppress Node.js v25+ localStorage warnings during test execution
  • Dependency updates for TypeScript ESLint tooling (8.55.0 → 8.56.0) and eslint-plugin-jest (29.14.0 → 29.15.0)

Reviewed changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/cds/indexer.ts New module implementing CDS indexer detection, execution, and orchestration with timeout handling and diagnostic reporting
src/diagnostics.ts Added addCdsIndexerDiagnostic function for warning-level diagnostics on indexer failures
src/packageManager/types.ts Added optional cdsIndexerVersion field to CdsDependencyCombination interface
src/packageManager/cacheInstaller.ts Updated to detect, include, and match @sap/cds-indexer in dependency cache logic
cds-extractor.ts Integrated indexer orchestration between dependency installation and compilation with performance tracking
test/src/diagnostics.test.ts Added comprehensive tests for addCdsIndexerDiagnostic function
test/src/cds/indexer.test.ts New test suite with comprehensive coverage of indexer functionality including success, failure, timeout, and cache scenarios
jest.config.js Added Node.js v25+ localStorage file configuration to suppress warnings
package-lock.json Updated TypeScript ESLint packages and eslint-plugin-jest with peer dependency adjustments
dist/cds-extractor.bundle.js Compiled bundle reflecting all source changes
Files not reviewed (1)
  • extractors/cds/tools/package-lock.json: Language not supported

data-douser and others added 2 commits February 17, 2026 15:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@data-douser data-douser marked this pull request as ready for review February 18, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant