Skip to content

Commit b9adc2f

Browse files
Merge pull request #26 from cap-js/updateDefaultNamespace
Default applicationNamespace: update regex ( wrt ORD)
2 parents a2cd748 + 8af7079 commit b9adc2f

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55
The format is based on [Keep a Changelog](http://keepachangelog.com/).
66

7+
## Version 1.0.2 tbd
8+
9+
### Changed
10+
11+
- Changed default namespace regex making it compatible with ORD.
12+
713
## Version 1.0.2
814

915
### Changed

lib/compile/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = function processor(csn, options = {}) {
2020
}
2121
if (!cds.env?.export?.asyncapi?.application_namespace) {
2222
const packageJson = require(join(cds.root,'package.json'));
23-
const appName = packageJson.name.replace(/\s/g, "-");
23+
const appName = packageJson.name.replace(/^[@]/, "").replace(/[@/]/g, "-");
2424
envConf["application_namespace"] = `customer.${appName}`
2525
console.info(messages.APPLICATION_NAMESPACE);
2626
}

test/lib/compile/asyncapiMetadata.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,6 @@ describe('asyncapi export: presets and annotations', () => {
9292
cds.env.export.asyncapi = {};
9393
const csn = cds.compile.to.csn(inputCDS);
9494
const generatedAsyncAPI = toAsyncAPI(csn);
95-
expect(generatedAsyncAPI).toHaveProperty('x-sap-application-namespace','customer.@cap-js/asyncapi')
95+
expect(generatedAsyncAPI).toHaveProperty('x-sap-application-namespace','customer.cap-js-asyncapi')
9696
});
9797
});

0 commit comments

Comments
 (0)