File tree Expand file tree Collapse file tree 5 files changed +27
-34
lines changed
Expand file tree Collapse file tree 5 files changed +27
-34
lines changed Original file line number Diff line number Diff line change 1- const cds = require ( "@sap/cds" ) ;
21const path = require ( "path" ) ;
3- const OrdBuildPlugin = require ( "../../lib/build" ) ;
42const { BUILD_DEFAULT_PATH } = require ( "../../lib/constants" ) ;
53const index = require ( "../../lib/index" ) ;
64
7- jest . mock ( "@sap/cds-dk" , ( ) => {
8- return {
9- build : {
10- Plugin : class {
11- constructor ( ) {
12- this . task = {
13- dest : undefined ,
14- src : null ,
15- } ;
16- }
17- write ( ) {
18- return {
19- to : ( ) => {
20- return Promise . resolve ( ) ;
21- } ,
22- } ;
23- }
24- async model ( ) {
25- return Promise . resolve ( { } ) ;
26- }
5+ // Setup cds.build.Plugin mock BEFORE requiring build.js
6+ const cds = require ( "@sap/cds" ) ;
7+ cds . build = cds . build || { } ;
8+ cds . build . Plugin = class {
9+ constructor ( ) {
10+ this . task = {
11+ dest : undefined ,
12+ src : null ,
13+ } ;
14+ }
15+ write ( ) {
16+ return {
17+ to : ( ) => {
18+ return Promise . resolve ( ) ;
2719 } ,
28- } ,
29- } ;
30- } ) ;
20+ } ;
21+ }
22+ async model ( ) {
23+ return Promise . resolve ( { } ) ;
24+ }
25+ } ;
26+
27+ // Now require the build plugin after the mock is set up
28+ const OrdBuildPlugin = require ( "../../lib/build" ) ;
3129
3230jest . mock ( "../../lib/index" , ( ) => {
3331 return {
Original file line number Diff line number Diff line change 11const cds = require ( "@sap/cds" ) ;
2- const cds_dk = require ( "@sap/cds-dk" ) ;
32const path = require ( "path" ) ;
43const _ = require ( "lodash" ) ;
54const { ord, getMetadata } = require ( "./index" ) ;
65const cliProgress = require ( "cli-progress" ) ;
76const { BUILD_DEFAULT_PATH , ORD_SERVICE_NAME , ORD_DOCUMENT_FILE_NAME } = require ( "./constants" ) ;
87const { isMCPPluginInPackageJson } = require ( "./mcpAdapter" ) ;
98
10- module . exports = class OrdBuildPlugin extends cds_dk . build . Plugin {
9+ module . exports = class OrdBuildPlugin extends cds . build . Plugin {
1110 static taskDefaults = { src : cds . env . folders . srv } ;
1211
1312 init ( ) {
Original file line number Diff line number Diff line change @@ -101,7 +101,6 @@ cds compile srv/ --to ord -o ./custom-output/
101101### CAP Framework Dependencies
102102
103103- ** Minimum CAP Version** : 8.9.4 (peer dependency)
104- - ** Minimum CDS-DK Version** : 8.9.5 (peer dependency)
105104- ** CSN Compatibility** : Must handle all CAP CSN model structures
106105- ** Interop CSN** : Generate interop-compatible CSN format
107106- ** Plugin Architecture** : Must follow CAP plugin conventions
Original file line number Diff line number Diff line change 3232 "jest" : " ^30.0.0" ,
3333 "prettier" : " 3.7.4" ,
3434 "supertest" : " ^7.0.0" ,
35- "@cap-js/sqlite" : " ^2"
35+ "@cap-js/sqlite" : " ^2" ,
36+ "@sap/cds-dk" : " >=8.9.5"
3637 },
3738 "peerDependencies" : {
38- "@sap/cds" : " >=8.9.4" ,
39- "@sap/cds-dk" : " >=8.9.5"
39+ "@sap/cds" : " >=8.9.4"
4040 },
4141 "dependencies" : {
4242 "@cap-js/asyncapi" : " ^1.0.3" ,
Original file line number Diff line number Diff line change 55 "license" : " ISC" ,
66 "dependencies" : {
77 "@cap-js/ord" : " file:../../ord"
8- },
9- "devDependencies" : {
10- "@sap/cds-dk" : " ^9.1.3"
118 }
129}
You can’t perform that action at this time.
0 commit comments