diff --git a/.github/api-extractor/post-rollup.js b/.github/api-extractor/post-rollup.js index 38477568..2a50400c 100755 --- a/.github/api-extractor/post-rollup.js +++ b/.github/api-extractor/post-rollup.js @@ -104,10 +104,13 @@ async function post (preResults) { rollup += filterFile } - // put all exports into an augmented module declaration. Remove all "declare" modifiers - // as they will now already be in an ambient context - rollup = rollup.replaceAll('declare ','') + rollup = rollup + // remove all "declare" modifiers as they will now already be in an ambient context + .replaceAll('declare ','') + // put cds-dk into the cds-namespace as well, to be included in the default export + .replaceAll(/^namespace cds {$/gm, 'namespace cds { export * from "@sap/cds-dk";') rollup = 'export * from "@sap/cds-dk";\n' + rollup // add cds-dk back in we had to remove in pre() + // put all exports into an augmented module declaration. rollup = `declare module '@sap/cds' {\n${rollup}\n}` await writeFile(rollupFile, rollup) diff --git a/CHANGELOG.md b/CHANGELOG.md index d198c247..f8097f08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ### Added - Types for compile events: `compile.for.runtime`, `compile.to.dbx`, `compile.to.edmx` ### Changed +- Types for `@sap/cds-dk` are now also available from the default export, if the package is intalled. ### Deprecated ### Removed ### Fixed