Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions extractors/cds/tools/cds-extractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { join } from 'path';
import { sync as globSync } from 'glob';

import { orchestrateCompilation } from './src/cds/compiler';
import { orchestrateCdsIndexer } from './src/cds/indexer';
import { buildCdsProjectDependencyGraph, type CdsDependencyGraph } from './src/cds/parser';
import { handleEarlyExit, runJavaScriptExtractionWithMarker } from './src/codeql';
import {
Expand Down Expand Up @@ -206,6 +207,23 @@ if (projectCacheDirMap.size === 0) {
);
}

// Run cds-indexer for projects that use it (before compilation)
logPerformanceTrackingStart('CDS Indexer');
const cdsIndexerSummary = orchestrateCdsIndexer(
dependencyGraph,
sourceRoot,
projectCacheDirMap,
codeqlExePath,
);
logPerformanceTrackingStop('CDS Indexer');

if (cdsIndexerSummary.projectsRequiringIndexer > 0) {
logPerformanceMilestone(
'CDS indexer completed',
`${cdsIndexerSummary.successfulRuns} succeeded, ${cdsIndexerSummary.failedRuns} failed`,
);
}

// Collect all CDS files to process
const cdsFilePathsToProcess: string[] = [];
for (const project of dependencyGraph.projects.values()) {
Expand Down
304 changes: 229 additions & 75 deletions extractors/cds/tools/dist/cds-extractor.bundle.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions extractors/cds/tools/dist/cds-extractor.bundle.js.map

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions extractors/cds/tools/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Suppress Node.js v25+ localStorage warning triggered by jest-environment-node
// teardown accessing globalThis.localStorage before --localstorage-file is set.
// Setting the env var here ensures it propagates to all Jest worker processes.
const nodeVersion = parseInt(process.versions.node, 10);
if (nodeVersion >= 25 && !process.env.NODE_OPTIONS?.includes('--localstorage-file')) {
const localStoragePath = require('path').join(
require('os').tmpdir(),
'.jest-cds-extractor-localstorage',
);
process.env.NODE_OPTIONS = [
process.env.NODE_OPTIONS,
`--localstorage-file=${localStoragePath}`,
]
.filter(Boolean)
.join(' ');
}

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
Expand Down
132 changes: 66 additions & 66 deletions extractors/cds/tools/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading