@@ -19,7 +19,7 @@ const config = merge(require("./config.json"), cds.env.requires?.["sap-afc-sdk"]
1919const SERVER_SUFFIX = "srv" ;
2020const APPROUTER_SUFFIX = "approuter" ;
2121
22- process . env . CDS_PLUGIN_PACKAGE ??= "@cap-js-community/sap-afc-sdk" ;
22+ process . env . SAP_AFC_SDK_PLUGIN_PACKAGE ??= "@cap-js-community/sap-afc-sdk" ;
2323
2424cds . on ( "bootstrap" , ( ) => {
2525 secureRoutes ( ) ;
@@ -174,7 +174,7 @@ function serveBroker() {
174174}
175175
176176function serveUIs ( ) {
177- if ( process . env . CDS_PLUGIN_PACKAGE === "." && process . env . NODE_ENV !== "test" ) {
177+ if ( process . env . SAP_AFC_SDK_PLUGIN_PACKAGE === "." && process . env . NODE_ENV !== "test" ) {
178178 return ;
179179 }
180180 if ( ! cds . env . requires ?. [ "sap-afc-sdk" ] ?. ui ) {
@@ -184,11 +184,13 @@ function serveUIs() {
184184 let uiShowLaunchpad = cds . env . requires ?. [ "sap-afc-sdk" ] ?. ui ?. launchpad ;
185185 if ( uiShowLaunchpad ) {
186186 const packageRoot = cds . utils . path . resolve (
187- require . resolve ( path . join ( process . env . CDS_PLUGIN_PACKAGE , "package.json" ) , { paths : [ cds . root ] } ) ,
187+ require . resolve ( path . join ( process . env . SAP_AFC_SDK_PLUGIN_PACKAGE , "package.json" ) , { paths : [ cds . root ] } ) ,
188188 ".." ,
189189 ) ;
190190 if ( ! fs . existsSync ( `${ cds . root } /${ cds . env . folders . app } appconfig/fioriSandboxConfig.json` ) ) {
191- cds . app . serve ( `${ uiPath } /${ config . paths . launchpad } ` ) . from ( process . env . CDS_PLUGIN_PACKAGE , "/app/launchpad.html" ) ;
191+ cds . app
192+ . serve ( `${ uiPath } /${ config . paths . launchpad } ` )
193+ . from ( process . env . SAP_AFC_SDK_PLUGIN_PACKAGE , "/app/launchpad.html" ) ;
192194 cds . app . use ( `/appconfig` , express . static ( `${ packageRoot } /app/appconfig` ) ) ;
193195 } else {
194196 serveMergedAppConfig ( packageRoot , uiPath ) ;
@@ -203,11 +205,11 @@ function serveUIs() {
203205 if ( uiShowLaunchpad ) {
204206 cds . app
205207 . serve ( `${ uiPath } /${ app } /webapp` )
206- . from ( process . env . CDS_PLUGIN_PACKAGE , config . paths [ app ] ?? `${ cds . env . folders . app } ${ app } /webapp` ) ;
208+ . from ( process . env . SAP_AFC_SDK_PLUGIN_PACKAGE , config . paths [ app ] ?? `${ cds . env . folders . app } ${ app } /webapp` ) ;
207209 } else if ( uiShowApp ) {
208210 cds . app
209211 . serve ( `${ uiPath } /${ app } ` )
210- . from ( process . env . CDS_PLUGIN_PACKAGE , config . paths [ app ] ?? `${ cds . env . folders . app } ${ app } /webapp` ) ;
212+ . from ( process . env . SAP_AFC_SDK_PLUGIN_PACKAGE , config . paths [ app ] ?? `${ cds . env . folders . app } ${ app } /webapp` ) ;
211213 }
212214 cds . app . use ( `/${ app } /webapp/odata/v4/*` , ( req , res ) => {
213215 res . redirect (
@@ -442,6 +444,6 @@ function registerAfterReadJobFillLink(db) {
442444}
443445
444446// Plugins
445- module . export = async ( ) => {
446- await Promise . all ( config . plugins . map ( ( plugin ) => require ( `${ plugin } /cds-plugin` ) ) ) ;
447- } ;
447+ module . export = ( async ( ) => {
448+ return await Promise . all ( config . plugins . map ( ( plugin ) => require ( `${ plugin } /cds-plugin` ) ) ) ;
449+ } ) ( ) ;
0 commit comments