@sap-ux/fiori-app-sub-generator 0.6.10 → 0.6.12

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.
@@ -108,6 +108,7 @@ class FioriAppGenerator extends yeoman_generator_1.default {
108
108
  const isFioriFreestyleTemplate = this.state.floorplan === types_1.FloorplanFF.FF_SIMPLE;
109
109
  if ((0, utils_1.hasStep)(this.fioriSteps, types_1.STEP_DATASOURCE_AND_SERVICE)) {
110
110
  const cachedService = (0, utils_1.getFromCache)(this.appWizard, 'service', FioriAppGenerator.logger);
111
+ (0, utils_1.restoreServiceProviderLoggers)(FioriAppGenerator.logger, cachedService?.connectedSystem?.serviceProvider);
111
112
  const options = {
112
113
  capService: cachedService?.capService ?? this.state.service?.capService,
113
114
  requiredOdataVersion: (0, utils_1.getRequiredOdataVersion)(this.state.floorplan),
@@ -138,6 +139,7 @@ class FioriAppGenerator extends yeoman_generator_1.default {
138
139
  FioriAppGenerator.logger?.error((0, utils_1.t)('error.fatalError'));
139
140
  }
140
141
  }
142
+ (0, utils_1.restoreServiceProviderLoggers)(FioriAppGenerator.logger, serviceAnswers?.connectedSystem?.serviceProvider);
141
143
  /** END: Back button temp fix */
142
144
  this.state.service = { ...this.state?.service, ...serviceAnswers };
143
145
  }
@@ -1,4 +1,4 @@
1
- import type { Annotations } from '@sap-ux/axios-extension';
1
+ import type { Annotations, ServiceProvider } from '@sap-ux/axios-extension';
2
2
  import type { CapRuntime, CapService } from '@sap-ux/cap-config-writer';
3
3
  import type { Logger } from '@sap-ux/logger';
4
4
  import { DatasourceType, OdataVersion, type ConnectedSystem } from '@sap-ux/odata-service-inquirer';
@@ -135,4 +135,14 @@ export declare function convertCapRuntimeToCapProjectType(capRuntime?: CapRuntim
135
135
  * @returns {Promise<CdsAnnotationsInfo | EdmxAnnotationsInfo>} A promise that resolves to either CDS annotations info or EDMX annotations info.
136
136
  */
137
137
  export declare function getAnnotations(projectName: string, annotations?: Annotations, capService?: CapService): Promise<CdsAnnotationsInfo | EdmxAnnotationsInfo | undefined>;
138
+ /**
139
+ * Restore the loggers for the service provider if they are missing.
140
+ * This is necessary because the service provider may have been serialized and deserialized, which can lead to missing loggers which contain circular refs.
141
+ * Not doing this will result in the loggers being undefined when trying to access them, and calling services will throw.
142
+ *
143
+ * @param logger - The logger instance to be restored.
144
+ * @param serviceProvider - The service provider object that may have missing loggers.
145
+ * @returns The service provider with restored loggers.
146
+ */
147
+ export declare function restoreServiceProviderLoggers(logger: Logger, serviceProvider?: ServiceProvider): ServiceProvider | undefined;
138
148
  //# sourceMappingURL=common.d.ts.map
@@ -14,6 +14,7 @@ exports.getLaunchText = getLaunchText;
14
14
  exports.generateLaunchConfig = generateLaunchConfig;
15
15
  exports.convertCapRuntimeToCapProjectType = convertCapRuntimeToCapProjectType;
16
16
  exports.getAnnotations = getAnnotations;
17
+ exports.restoreServiceProviderLoggers = restoreServiceProviderLoggers;
17
18
  const annotation_converter_1 = require("@sap-ux/annotation-converter");
18
19
  const btp_utils_1 = require("@sap-ux/btp-utils");
19
20
  const cap_config_writer_1 = require("@sap-ux/cap-config-writer");
@@ -267,4 +268,25 @@ async function getAnnotations(projectName, annotations, capService) {
267
268
  };
268
269
  }
269
270
  }
271
+ /**
272
+ * Restore the loggers for the service provider if they are missing.
273
+ * This is necessary because the service provider may have been serialized and deserialized, which can lead to missing loggers which contain circular refs.
274
+ * Not doing this will result in the loggers being undefined when trying to access them, and calling services will throw.
275
+ *
276
+ * @param logger - The logger instance to be restored.
277
+ * @param serviceProvider - The service provider object that may have missing loggers.
278
+ * @returns The service provider with restored loggers.
279
+ */
280
+ function restoreServiceProviderLoggers(logger, serviceProvider) {
281
+ // Restore the loggers if missing.
282
+ for (const service in serviceProvider?.services) {
283
+ if (serviceProvider.services?.[service].log && !serviceProvider.services[service].log.info) {
284
+ serviceProvider.services[service].log = logger;
285
+ }
286
+ }
287
+ if (serviceProvider?.log && !serviceProvider.log.info) {
288
+ serviceProvider.log = logger;
289
+ }
290
+ return serviceProvider;
291
+ }
270
292
  //# sourceMappingURL=common.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/fiori-app-sub-generator",
3
3
  "description": "A yeoman (sub) generator that can generate Fiori applications. Not for standalone use.",
4
- "version": "0.6.10",
4
+ "version": "0.6.12",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -30,16 +30,16 @@
30
30
  "uuid": "11.0.5",
31
31
  "yeoman-generator": "5.10.0",
32
32
  "@sap-ux/annotation-generator": "0.3.50",
33
- "@sap-ux/axios-extension": "1.22.4",
33
+ "@sap-ux/axios-extension": "1.22.5",
34
34
  "@sap-ux/btp-utils": "1.1.0",
35
35
  "@sap-ux/cap-config-writer": "0.10.24",
36
36
  "@sap-ux/feature-toggle": "0.3.0",
37
- "@sap-ux/fiori-elements-writer": "2.5.19",
37
+ "@sap-ux/fiori-elements-writer": "2.5.20",
38
38
  "@sap-ux/fiori-freestyle-writer": "2.4.30",
39
39
  "@sap-ux/fiori-generator-shared": "0.13.6",
40
40
  "@sap-ux/fiori-tools-settings": "0.2.0",
41
41
  "@sap-ux/launch-config": "0.10.17",
42
- "@sap-ux/odata-service-inquirer": "2.5.28",
42
+ "@sap-ux/odata-service-inquirer": "2.5.29",
43
43
  "@sap-ux/odata-service-writer": "0.27.15",
44
44
  "@sap-ux/project-access": "1.30.10",
45
45
  "@sap-ux/store": "1.1.2",
@@ -62,8 +62,8 @@
62
62
  "mock-spawn": "0.2.6",
63
63
  "rimraf": "5.0.5",
64
64
  "yeoman-test": "6.3.0",
65
- "@sap-ux/deploy-config-sub-generator": "0.3.54",
66
- "@sap-ux/flp-config-sub-generator": "0.3.8",
65
+ "@sap-ux/deploy-config-sub-generator": "0.3.55",
66
+ "@sap-ux/flp-config-sub-generator": "0.3.10",
67
67
  "@sap-ux/inquirer-common": "0.7.31",
68
68
  "@sap-ux/jest-file-matchers": "0.2.4",
69
69
  "@sap-ux/logger": "0.7.0"