Add best-effort CDS extractor support for @sap/cds-indexer#303
Open
data-douser wants to merge 3 commits intomainfrom
Open
Add best-effort CDS extractor support for @sap/cds-indexer#303data-douser wants to merge 3 commits intomainfrom
@sap/cds-indexer#303data-douser wants to merge 3 commits intomainfrom
Conversation
- 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+
@sap/cds-indexer
Contributor
There was a problem hiding this comment.
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-indexervia 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-indexerin 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
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What This PR Contributes
Summary of Changes
npx --yes @sap/cds-indexerbefore compilation, with graceful error handling and diagnostic warnings on failureOutline of Changes
CDS Extraction Pipeline Enhancements
orchestrateCdsIndexer) to run before compilation incds-extractor.ts, with performance tracking and summary logging. This ensures that projects requiring indexing are processed appropriately. [1] [2]Testing Environment Improvements
jest.config.jsto suppress Node.js v25+localStoragewarnings by setting the--localstorage-fileoption for all Jest worker processes. This prevents noisy warnings during test runs on newer Node versions.Dependency Updates
@typescript-eslintsuite (includingeslint-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]eslint-plugin-jestfrom 29.14.0 to 29.15.0.eslint-visitor-keysfrom 4.2.1 to 5.0.0, which also updates its required Node.js engine version.Miscellaneous Package Lock Cleanups
"peer": truefields from several dependencies inpackage-lock.json, reflecting changes in how peer dependencies are tracked or resolved. [1] [2] [3] [4] [5] [6] [7] [8] [9]Future Works
TBD