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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
The format is based on [Keep a Changelog](http://keepachangelog.com/).

## Version 0.0.2 - 2025-09-04

### Fixed

- Recompilation after compilation of an empty project

## Version 0.0.1 - 2025-09-03

### Added
Expand Down
10 changes: 9 additions & 1 deletion lib/getModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ export default async function getModel(projectPath) {
return compiled
})()

await cds.model
try {
await cds.model
} catch (e) {
cds.model = undefined
throw e
}
return cds.model
}

Expand All @@ -37,6 +42,9 @@ async function compileModel(projectPath) {
cds.root = projectPath
const startTime = Date.now()
const resolved = cds.resolve(projectPath + '/*', { cache: {} }) // use CAP standard resolution for model compilation
if (!resolved) {
throw new Error(`No CDS files in path: ${projectPath}`)
}
let compiled = await cds.load(resolved, { docs: true, locations: true })
if (!compiled || (Array.isArray(compiled) && compiled.length === 0)) {
throw new Error(`Failed to load CDS model from path: ${projectPath}`)
Expand Down