@sap-ux/fiori-freestyle-writer 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ const ui5_config_1 = require("@sap-ux/ui5-config");
16
16
  const i18n_1 = require("./i18n");
17
17
  const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
18
18
  const utils_1 = require("./utils");
19
+ const cap_config_writer_1 = require("@sap-ux/cap-config-writer");
19
20
  /**
20
21
  * Generate a UI5 application based on the specified Fiori Freestyle floorplan template.
21
22
  *
@@ -114,6 +115,26 @@ async function generate(basePath, data, fs) {
114
115
  ui5LocalConfig.addFioriToolsProxydMiddleware({});
115
116
  fs.write(ui5LocalConfigPath, ui5LocalConfig.toString());
116
117
  }
118
+ if (ffApp.service?.capService) {
119
+ const hasCdsUi5PluginInfo = !!ffApp.service.capService.cdsUi5PluginInfo;
120
+ const settings = {
121
+ appRoot: basePath,
122
+ packageName: ffApp.package.name ?? '',
123
+ appId: ffApp.app.id,
124
+ sapux: ffApp.appOptions?.sapux,
125
+ enableTypescript: ffApp.appOptions?.typescript,
126
+ // Enable CDS UI5 plugin and NPM workspaces if the CDS UI5 plugin info is present
127
+ enableCdsUi5Plugin: hasCdsUi5PluginInfo,
128
+ enableNPMWorkspaces: hasCdsUi5PluginInfo
129
+ };
130
+ // Enable CDS UI5 plugin and NPM workspaces if the CDS UI5 plugin info is present
131
+ if (ffApp.service?.capService.cdsUi5PluginInfo) {
132
+ settings.enableCdsUi5Plugin = true;
133
+ settings.enableNPMWorkspaces = true;
134
+ }
135
+ // apply cap updates when service is cap
136
+ await (0, cap_config_writer_1.applyCAPUpdates)(fs, ffApp.service.capService, settings);
137
+ }
117
138
  return fs;
118
139
  }
119
140
  var types_2 = require("./types");
package/dist/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { Ui5App, App } from '@sap-ux/ui5-application-writer';
2
2
  import type { OdataService } from '@sap-ux/odata-service-writer';
3
+ import type { CapServiceCdsInfo } from '@sap-ux/cap-config-writer';
3
4
  export declare const TemplateType: {
4
5
  readonly Basic: "basic";
5
6
  readonly Worklist: "worklist";
@@ -32,7 +33,9 @@ export interface FioriApp extends App {
32
33
  }
33
34
  export interface FreestyleApp<T> extends Ui5App {
34
35
  template: Template<T>;
35
- service?: OdataService;
36
+ service?: OdataService & {
37
+ capService?: CapServiceCdsInfo;
38
+ };
36
39
  app: FioriApp;
37
40
  }
38
41
  export { OdataVersion } from '@sap-ux/odata-service-writer';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/fiori-freestyle-writer",
3
3
  "description": "SAP Fiori freestyle application writer",
4
- "version": "2.0.2",
4
+ "version": "2.0.3",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -30,7 +30,8 @@
30
30
  "@sap-ux/odata-service-writer": "0.25.4",
31
31
  "@sap-ux/ui5-application-writer": "1.2.9",
32
32
  "@sap-ux/ui5-config": "0.26.1",
33
- "@sap-ux/fiori-generator-shared": "0.7.21"
33
+ "@sap-ux/fiori-generator-shared": "0.7.21",
34
+ "@sap-ux/cap-config-writer": "0.9.0"
34
35
  },
35
36
  "devDependencies": {
36
37
  "@types/ejs": "3.1.2",