Skip to content

Commit

Permalink
improved checkout technique
Browse files Browse the repository at this point in the history
  • Loading branch information
danjoa committed Nov 7, 2024
1 parent f582259 commit 0639ab9
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/checkout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

const cds = require("@sap/cds")
const { read, write, append=_append } = cds.utils
const { copy, read, write, append=_append } = cds.utils

const checkout = {

Expand All @@ -15,7 +15,13 @@ const checkout = {
},

async messaging () {
await append ('\n'+`using from './incidents/field'; //> adds email fields to UI`+'\n') .to ('app/services.cds')
// copy content from xmpls/messaging to incidents...
for (let each of ['app','srv'])
copy('xmpls/messaging/'+each).to(each)
// add email fields to UI
await append ('\n'+`using from './incidents/field';`+'\n')
.to ('app/services.cds')
// enhance package.json
let xmpls = await read ('xmpls/messaging/package.json')
let base = await read ('package.json')
for (let each of ['API_BUSINESS_PARTNER','messaging'])
Expand Down
6 changes: 3 additions & 3 deletions xmpls/messaging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@
"messaging": {
"kind": "local-messaging",
"[production]": {
"kind": "enterprise-messaging-shared",
"format": "cloudevents"
"kind": "enterprise-messaging-shared",
"format": "cloudevents"
}
}
}
}
}
}
3 changes: 3 additions & 0 deletions xmpls/messaging/services.cds
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Using local service implementation
using { ProcessorService } from '../../app/services';
annotate ProcessorService with @impl: 'srv/services.js';
4 changes: 0 additions & 4 deletions xmpls/messaging/srv/mashup.cds
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
// REVISIT: This file and all in ./external is copy from ../remote-service -> should be refactored

using { ProcessorService } from '../../../app/services';
annotate ProcessorService with @impl: 'srv/services.js';

// REVISIT: This is not in line with our best practices.
using { API_BUSINESS_PARTNER as S4 } from './external/API_BUSINESS_PARTNER';
service RemoteService {
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions xmpls/remote-service/services.cds
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Using local service implementation
using { ProcessorService } from '../../app/services';
annotate ProcessorService with @impl: 'srv/services.js';
3 changes: 0 additions & 3 deletions xmpls/remote-service/srv/mashup.cds
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using { ProcessorService } from '../../../app/services';
annotate ProcessorService with @impl: 'srv/services.js';

// REVISIT: This is not in line with our best practices.
using { API_BUSINESS_PARTNER as S4 } from './external/API_BUSINESS_PARTNER';
service RemoteService {
Expand Down

0 comments on commit 0639ab9

Please sign in to comment.