@sap-ux/telemetry 0.6.0 → 0.6.2

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.
@@ -118,14 +118,22 @@ async function getAppProperties(appPath) {
118
118
  return output;
119
119
  }
120
120
  /**
121
- * Read template type from README.md of an Fiori app. This will be improved once we have the floor
122
- * plan information added to e.g. manifest.json of generated app.
121
+ * Read template type from the .appGenInfo.json file or README.md of an Fiori app.
123
122
  *
124
123
  * @param appPath Root folder path of Fiori app
125
124
  * @returns Template type used in the Fiori app
126
125
  */
127
126
  async function getTemplateType(appPath) {
128
127
  const readmeFilePath = path_1.default.join(appPath, 'README.md');
128
+ const appGenInfoPath = path_1.default.join(appPath, '.appGenInfo.json');
129
+ // N.B.: Keep this order i.e .appGenInfo.json file is read first, then README.md.
130
+ if (fs_1.default.existsSync(appGenInfoPath)) {
131
+ const appGenInfo = await fs_1.default.promises.readFile(appGenInfoPath, 'utf-8');
132
+ const appGenInfoParsed = JSON.parse(appGenInfo);
133
+ if (appGenInfoParsed?.generationParameters?.template) {
134
+ return appGenInfoParsed.generationParameters.template.trim();
135
+ }
136
+ }
129
137
  if (fs_1.default.existsSync(readmeFilePath)) {
130
138
  const readmeContent = await fs_1.default.promises.readFile(readmeFilePath, 'utf-8');
131
139
  if (readmeContent) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/telemetry",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Library for sending usage telemetry data",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,10 +19,10 @@
19
19
  "performance-now": "2.1.0",
20
20
  "yaml": "2.3.3",
21
21
  "@sap-ux/store": "1.1.0",
22
- "@sap-ux/project-access": "1.30.0",
23
- "@sap-ux/btp-utils": "1.1.0",
24
- "@sap-ux/ui5-config": "0.28.0",
25
- "@sap-ux/logger": "0.7.0"
22
+ "@sap-ux/project-access": "1.30.1",
23
+ "@sap-ux/ui5-config": "0.28.1",
24
+ "@sap-ux/logger": "0.7.0",
25
+ "@sap-ux/btp-utils": "1.1.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "jest-extended": "4.0.2",