@sap-ux/fiori-generator-shared 0.15.6 → 1.0.0
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/app-gen-info.d.ts +1 -1
- package/dist/app-gen-info.js +6 -8
- package/dist/app-helpers/app-helpers.js +3 -8
- package/dist/cap/index.js +6 -9
- package/dist/constants.js +3 -6
- package/dist/environment.d.ts +1 -1
- package/dist/environment.js +6 -10
- package/dist/i18n.js +8 -16
- package/dist/index.d.ts +13 -14
- package/dist/index.js +13 -41
- package/dist/logging/logWrapper.js +14 -18
- package/dist/npm-package-scripts/getPackageScripts.d.ts +1 -1
- package/dist/npm-package-scripts/getPackageScripts.js +9 -12
- package/dist/npm-package-scripts/types.js +1 -2
- package/dist/system-utils.js +4 -8
- package/dist/telemetry/index.d.ts +3 -3
- package/dist/telemetry/index.js +2 -21
- package/dist/telemetry/telemetryHelper.d.ts +1 -1
- package/dist/telemetry/telemetryHelper.js +12 -19
- package/dist/telemetry/types.js +1 -2
- package/dist/telemetry/utils.d.ts +1 -1
- package/dist/telemetry/utils.js +8 -12
- package/dist/types/app-gen.js +4 -7
- package/dist/types/cap.js +1 -2
- package/dist/types/environment.js +1 -4
- package/dist/types/headless.d.ts +2 -2
- package/dist/types/headless.js +2 -5
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +4 -20
- package/dist/ui5/ui5.js +1 -4
- package/dist/vscode-helpers/vscode-helpers.js +13 -22
- package/dist/yeoman.js +1 -4
- package/package.json +11 -9
package/dist/app-gen-info.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Editor } from 'mem-fs-editor';
|
|
2
|
-
import type { AbapCSN, AppGenInfo } from './types';
|
|
2
|
+
import type { AbapCSN, AppGenInfo } from './types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Transforms the external abapCSN object (possible multiple services) to the internal abapCSN (single chosen service).
|
|
5
5
|
* Uses the chosen service to obtain the service uri and name for the .appGenInfo.json.
|
package/dist/app-gen-info.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.generateAppGenInfo = generateAppGenInfo;
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
1
|
+
import { dirname, join } from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
4
|
/**
|
|
7
5
|
* Transforms the external abapCSN object (possible multiple services) to the internal abapCSN (single chosen service).
|
|
8
6
|
* Uses the chosen service to obtain the service uri and name for the .appGenInfo.json.
|
|
@@ -13,7 +11,7 @@ const node_path_1 = require("node:path");
|
|
|
13
11
|
* @param abapCSN - external abapCSN object passed to app gen
|
|
14
12
|
* @returns - internal representation of abapCSN for .appGenInfo.json
|
|
15
13
|
*/
|
|
16
|
-
function transformAbapCSNForAppGenInfo({ serviceId, serviceUrl }, abapCSN) {
|
|
14
|
+
export function transformAbapCSNForAppGenInfo({ serviceId, serviceUrl }, abapCSN) {
|
|
17
15
|
const serviceUrlObj = serviceUrl ? new URL(serviceUrl) : undefined;
|
|
18
16
|
// adds trailing '/' to match to mainService.uri in manifest.json
|
|
19
17
|
const serviceUri = serviceUrlObj?.pathname?.endsWith('/')
|
|
@@ -37,10 +35,10 @@ function transformAbapCSNForAppGenInfo({ serviceId, serviceUrl }, abapCSN) {
|
|
|
37
35
|
* @param {Editor} fs - the file system editor instance used to write the info files.
|
|
38
36
|
* @returns {Editor} the file system editor instance used to write the info files.
|
|
39
37
|
*/
|
|
40
|
-
function generateAppGenInfo(destPath, appGenInfo, fs) {
|
|
38
|
+
export function generateAppGenInfo(destPath, appGenInfo, fs) {
|
|
41
39
|
// N.B. This function must stay at this level in the directory structure, i.e one level below 'templates'
|
|
42
40
|
// Apply the configuration to generate the README file
|
|
43
|
-
const templateSourcePath =
|
|
41
|
+
const templateSourcePath = join(__dirname, '../templates/README.md');
|
|
44
42
|
const templateDestPath = `${destPath}/README.md`;
|
|
45
43
|
const { externalParameters, serviceId, ...appGenInfoCore } = appGenInfo;
|
|
46
44
|
// Write the README file
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFlpId = exports.getSemanticObject = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Creates a value suitable for use as a semantic object for navigation intents.
|
|
6
3
|
* Removes specific characters that would break the navigation.
|
|
@@ -8,13 +5,11 @@ exports.getFlpId = exports.getSemanticObject = void 0;
|
|
|
8
5
|
* @param appId
|
|
9
6
|
* @returns
|
|
10
7
|
*/
|
|
11
|
-
const getSemanticObject = (appId) => {
|
|
8
|
+
export const getSemanticObject = (appId) => {
|
|
12
9
|
const semanticObject = appId.replace(/[-_.#]/g, '');
|
|
13
10
|
return semanticObject.length > 30 ? semanticObject.substring(0, 30) : semanticObject;
|
|
14
11
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return `${(0, exports.getSemanticObject)(appId)}${action ? '-' + action : ''}`;
|
|
12
|
+
export const getFlpId = (appId, action) => {
|
|
13
|
+
return `${getSemanticObject(appId)}${action ? '-' + action : ''}`;
|
|
18
14
|
};
|
|
19
|
-
exports.getFlpId = getFlpId;
|
|
20
15
|
//# sourceMappingURL=app-helpers.js.map
|
package/dist/cap/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getCapFolderPathsSync = getCapFolderPathsSync;
|
|
4
|
-
const node_fs_1 = require("node:fs");
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
6
3
|
/**
|
|
7
4
|
* Lightweight synchronous function to get the CAP project custom paths.
|
|
8
5
|
* A more robust async alternative is `getCapCustomPaths` in `@sap-ux/project-access`.
|
|
@@ -10,18 +7,18 @@ const node_path_1 = require("node:path");
|
|
|
10
7
|
* @param capProjectPath - path to project root
|
|
11
8
|
* @returns cap custom paths
|
|
12
9
|
*/
|
|
13
|
-
function getCapFolderPathsSync(capProjectPath) {
|
|
10
|
+
export function getCapFolderPathsSync(capProjectPath) {
|
|
14
11
|
const capPaths = {
|
|
15
12
|
app: 'app/',
|
|
16
13
|
db: 'db/',
|
|
17
14
|
srv: 'srv/'
|
|
18
15
|
};
|
|
19
|
-
const cdsrcPath =
|
|
20
|
-
const packageJsonPath =
|
|
16
|
+
const cdsrcPath = join(capProjectPath, '.cdsrc.json');
|
|
17
|
+
const packageJsonPath = join(capProjectPath, 'package.json');
|
|
21
18
|
const configFiles = [cdsrcPath, packageJsonPath];
|
|
22
19
|
for (const configFile of configFiles) {
|
|
23
20
|
try {
|
|
24
|
-
const config = JSON.parse(
|
|
21
|
+
const config = JSON.parse(readFileSync(configFile).toString());
|
|
25
22
|
for (const folder of Object.keys(capPaths)) {
|
|
26
23
|
let customPath;
|
|
27
24
|
if (config?.folders?.[folder]) {
|
package/dist/constants.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SCRIPT_FLP_SANDBOX = exports.YUI_MIN_VER_FILES_GENERATED_MSG = exports.YUI_EXTENSION_ID = void 0;
|
|
4
|
-
exports.YUI_EXTENSION_ID = 'sapos.yeoman-ui';
|
|
1
|
+
export const YUI_EXTENSION_ID = 'sapos.yeoman-ui';
|
|
5
2
|
// From YUI version 1.16.6 the message 'The files have been generated.' is not shown unless a top level dir is created
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export const YUI_MIN_VER_FILES_GENERATED_MSG = '1.16.6';
|
|
4
|
+
export const SCRIPT_FLP_SANDBOX = '/test/flpSandbox.html';
|
|
8
5
|
//# sourceMappingURL=constants.js.map
|
package/dist/environment.d.ts
CHANGED
package/dist/environment.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.isCli = isCli;
|
|
4
|
-
exports.getHostEnvironment = getHostEnvironment;
|
|
5
|
-
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
6
|
-
const types_1 = require("./types");
|
|
1
|
+
import { isAppStudio } from '@sap-ux/btp-utils';
|
|
2
|
+
import { hostEnvironment } from './types/index.js';
|
|
7
3
|
/**
|
|
8
4
|
* Determine if the current prompting environment is cli .
|
|
9
5
|
*
|
|
10
6
|
* @returns true if it is a cli environment, false otherwise
|
|
11
7
|
*/
|
|
12
|
-
function isCli() {
|
|
8
|
+
export function isCli() {
|
|
13
9
|
if (process.argv[1]?.includes('yo') || process.stdin.isTTY) {
|
|
14
10
|
return true;
|
|
15
11
|
}
|
|
@@ -22,10 +18,10 @@ function isCli() {
|
|
|
22
18
|
*
|
|
23
19
|
* @returns the platform name and technical name
|
|
24
20
|
*/
|
|
25
|
-
function getHostEnvironment() {
|
|
21
|
+
export function getHostEnvironment() {
|
|
26
22
|
if (isCli()) {
|
|
27
|
-
return
|
|
23
|
+
return hostEnvironment.cli;
|
|
28
24
|
}
|
|
29
|
-
return
|
|
25
|
+
return isAppStudio() ? hostEnvironment.bas : hostEnvironment.vscode;
|
|
30
26
|
}
|
|
31
27
|
//# sourceMappingURL=environment.js.map
|
package/dist/i18n.js
CHANGED
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.i18n = void 0;
|
|
7
|
-
exports.initI18n = initI18n;
|
|
8
|
-
exports.t = t;
|
|
9
|
-
const i18next_1 = __importDefault(require("i18next"));
|
|
10
|
-
const fiori_generator_shared_i18n_json_1 = __importDefault(require("./translations/fiori-generator-shared.i18n.json"));
|
|
1
|
+
import i18next from 'i18next';
|
|
2
|
+
import translations from './translations/fiori-generator-shared.i18n.json' with { type: 'json' };
|
|
11
3
|
const NS = 'fiori-freestyle-writer';
|
|
12
|
-
|
|
4
|
+
export const i18n = i18next.createInstance();
|
|
13
5
|
/**
|
|
14
6
|
* Initialize i18next with the translations for this module.
|
|
15
7
|
*/
|
|
16
|
-
async function initI18n() {
|
|
17
|
-
await
|
|
8
|
+
export async function initI18n() {
|
|
9
|
+
await i18n.init({
|
|
18
10
|
resources: {
|
|
19
11
|
en: {
|
|
20
|
-
[NS]:
|
|
12
|
+
[NS]: translations
|
|
21
13
|
}
|
|
22
14
|
},
|
|
23
15
|
lng: 'en',
|
|
@@ -34,8 +26,8 @@ async function initI18n() {
|
|
|
34
26
|
* @param options additional options
|
|
35
27
|
* @returns {string} localized string stored for the given key
|
|
36
28
|
*/
|
|
37
|
-
function t(key, options) {
|
|
38
|
-
return
|
|
29
|
+
export function t(key, options) {
|
|
30
|
+
return i18n.t(key, options);
|
|
39
31
|
}
|
|
40
32
|
initI18n().catch(() => {
|
|
41
33
|
// Ignore any errors since the write will still work
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
export * from './cap';
|
|
2
|
-
export * from './constants';
|
|
3
|
-
export * from './environment';
|
|
4
|
-
export * from './system-utils';
|
|
5
|
-
export * from './telemetry';
|
|
6
|
-
export * from './logging/logWrapper';
|
|
7
|
-
export * from './types';
|
|
8
|
-
export { getPackageScripts } from './npm-package-scripts/getPackageScripts';
|
|
9
|
-
export { getBootstrapResourceUrls } from './ui5/ui5';
|
|
10
|
-
export { getDefaultTargetFolder, isExtensionInstalled, isCommandRegistered } from './vscode-helpers/vscode-helpers';
|
|
11
|
-
export { generateAppGenInfo } from './app-gen-info';
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export { setYeomanEnvConflicterForce } from './yeoman';
|
|
1
|
+
export * from './cap/index.js';
|
|
2
|
+
export * from './constants.js';
|
|
3
|
+
export * from './environment.js';
|
|
4
|
+
export * from './system-utils.js';
|
|
5
|
+
export * from './telemetry/index.js';
|
|
6
|
+
export * from './logging/logWrapper.js';
|
|
7
|
+
export * from './types/index.js';
|
|
8
|
+
export { getPackageScripts } from './npm-package-scripts/getPackageScripts.js';
|
|
9
|
+
export { getBootstrapResourceUrls } from './ui5/ui5.js';
|
|
10
|
+
export { getDefaultTargetFolder, isExtensionInstalled, isCommandRegistered } from './vscode-helpers/vscode-helpers.js';
|
|
11
|
+
export { generateAppGenInfo } from './app-gen-info.js';
|
|
12
|
+
export { getFlpId, getSemanticObject } from './app-helpers/app-helpers.js';
|
|
13
|
+
export { setYeomanEnvConflicterForce } from './yeoman.js';
|
|
15
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,42 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.setYeomanEnvConflicterForce = exports.getSemanticObject = exports.getFlpId = exports.getHostEnvironment = exports.generateAppGenInfo = exports.isCommandRegistered = exports.isExtensionInstalled = exports.getDefaultTargetFolder = exports.getBootstrapResourceUrls = exports.getPackageScripts = void 0;
|
|
18
|
-
__exportStar(require("./cap"), exports);
|
|
19
|
-
__exportStar(require("./constants"), exports);
|
|
20
|
-
__exportStar(require("./environment"), exports);
|
|
21
|
-
__exportStar(require("./system-utils"), exports);
|
|
22
|
-
__exportStar(require("./telemetry"), exports);
|
|
23
|
-
__exportStar(require("./logging/logWrapper"), exports);
|
|
24
|
-
__exportStar(require("./types"), exports);
|
|
25
|
-
var getPackageScripts_1 = require("./npm-package-scripts/getPackageScripts");
|
|
26
|
-
Object.defineProperty(exports, "getPackageScripts", { enumerable: true, get: function () { return getPackageScripts_1.getPackageScripts; } });
|
|
27
|
-
var ui5_1 = require("./ui5/ui5");
|
|
28
|
-
Object.defineProperty(exports, "getBootstrapResourceUrls", { enumerable: true, get: function () { return ui5_1.getBootstrapResourceUrls; } });
|
|
29
|
-
var vscode_helpers_1 = require("./vscode-helpers/vscode-helpers");
|
|
30
|
-
Object.defineProperty(exports, "getDefaultTargetFolder", { enumerable: true, get: function () { return vscode_helpers_1.getDefaultTargetFolder; } });
|
|
31
|
-
Object.defineProperty(exports, "isExtensionInstalled", { enumerable: true, get: function () { return vscode_helpers_1.isExtensionInstalled; } });
|
|
32
|
-
Object.defineProperty(exports, "isCommandRegistered", { enumerable: true, get: function () { return vscode_helpers_1.isCommandRegistered; } });
|
|
33
|
-
var app_gen_info_1 = require("./app-gen-info");
|
|
34
|
-
Object.defineProperty(exports, "generateAppGenInfo", { enumerable: true, get: function () { return app_gen_info_1.generateAppGenInfo; } });
|
|
35
|
-
var environment_1 = require("./environment");
|
|
36
|
-
Object.defineProperty(exports, "getHostEnvironment", { enumerable: true, get: function () { return environment_1.getHostEnvironment; } });
|
|
37
|
-
var app_helpers_1 = require("./app-helpers/app-helpers");
|
|
38
|
-
Object.defineProperty(exports, "getFlpId", { enumerable: true, get: function () { return app_helpers_1.getFlpId; } });
|
|
39
|
-
Object.defineProperty(exports, "getSemanticObject", { enumerable: true, get: function () { return app_helpers_1.getSemanticObject; } });
|
|
40
|
-
var yeoman_1 = require("./yeoman");
|
|
41
|
-
Object.defineProperty(exports, "setYeomanEnvConflicterForce", { enumerable: true, get: function () { return yeoman_1.setYeomanEnvConflicterForce; } });
|
|
1
|
+
export * from './cap/index.js';
|
|
2
|
+
export * from './constants.js';
|
|
3
|
+
export * from './environment.js';
|
|
4
|
+
export * from './system-utils.js';
|
|
5
|
+
export * from './telemetry/index.js';
|
|
6
|
+
export * from './logging/logWrapper.js';
|
|
7
|
+
export * from './types/index.js';
|
|
8
|
+
export { getPackageScripts } from './npm-package-scripts/getPackageScripts.js';
|
|
9
|
+
export { getBootstrapResourceUrls } from './ui5/ui5.js';
|
|
10
|
+
export { getDefaultTargetFolder, isExtensionInstalled, isCommandRegistered } from './vscode-helpers/vscode-helpers.js';
|
|
11
|
+
export { generateAppGenInfo } from './app-gen-info.js';
|
|
12
|
+
export { getFlpId, getSemanticObject } from './app-helpers/app-helpers.js';
|
|
13
|
+
export { setYeomanEnvConflicterForce } from './yeoman.js';
|
|
42
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const logform_1 = require("logform");
|
|
7
|
-
const i18n_1 = require("../i18n");
|
|
8
|
-
exports.LOGGING_LEVEL_CONFIG_PROP = 'ApplicationWizard.loggingLevel';
|
|
1
|
+
import * as vscodeLogging from '@vscode-logging/logger';
|
|
2
|
+
import { format } from 'logform';
|
|
3
|
+
import { t } from '../i18n.js';
|
|
4
|
+
const { getExtensionLogger } = vscodeLogging;
|
|
5
|
+
export const LOGGING_LEVEL_CONFIG_PROP = 'ApplicationWizard.loggingLevel';
|
|
9
6
|
/**
|
|
10
7
|
* Empty Implementation of the Logger, this is not strictly necessary in app gen but
|
|
11
8
|
* other modules consuming parts of app gen need a dummy implementation (logs to console)
|
|
12
9
|
*/
|
|
13
|
-
|
|
10
|
+
export const DefaultLogger = {
|
|
14
11
|
fatal: (msg) => {
|
|
15
12
|
console.log(msg);
|
|
16
13
|
},
|
|
@@ -29,7 +26,7 @@ exports.DefaultLogger = {
|
|
|
29
26
|
trace: (msg) => {
|
|
30
27
|
console.trace(msg);
|
|
31
28
|
},
|
|
32
|
-
getChildLogger: () =>
|
|
29
|
+
getChildLogger: () => DefaultLogger,
|
|
33
30
|
getLogLevel: () => 'off',
|
|
34
31
|
/**
|
|
35
32
|
* Limited compatibility with `@sap-ux/logger`
|
|
@@ -73,24 +70,24 @@ const LOG_LEVEL_KEYS = {
|
|
|
73
70
|
* @param logLevel - defaults to off on cli
|
|
74
71
|
* @returns {ILogWrapper} - the logger
|
|
75
72
|
*/
|
|
76
|
-
function createCLILogger(logName, logLevel = 'off') {
|
|
73
|
+
export function createCLILogger(logName, logLevel = 'off') {
|
|
77
74
|
const extensionLoggerOpts = {
|
|
78
75
|
extName: logName,
|
|
79
76
|
level: logLevel,
|
|
80
77
|
logConsole: true
|
|
81
78
|
};
|
|
82
|
-
return
|
|
79
|
+
return getExtensionLogger(extensionLoggerOpts);
|
|
83
80
|
}
|
|
84
81
|
/**
|
|
85
82
|
* Log to vscode extension logger and yeoman logger simultaneously.
|
|
86
83
|
* This allows use of Application Wizard log config and log file use but still have a single output channel for
|
|
87
84
|
* generator logging.
|
|
88
85
|
*/
|
|
89
|
-
class LogWrapper {
|
|
86
|
+
export class LogWrapper {
|
|
90
87
|
static _vscodeLogger;
|
|
91
88
|
static _yoLogger;
|
|
92
89
|
static _logLevel;
|
|
93
|
-
static consoleFormat =
|
|
90
|
+
static consoleFormat = format.combine(format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }), format.printf((msgJson) => {
|
|
94
91
|
return `[${msgJson.timestamp}] ${msgJson.level.toUpperCase()}: ${msgJson.message}`;
|
|
95
92
|
}));
|
|
96
93
|
/**
|
|
@@ -106,7 +103,7 @@ class LogWrapper {
|
|
|
106
103
|
LogWrapper._yoLogger = yoLogger;
|
|
107
104
|
if (extLogger) {
|
|
108
105
|
LogWrapper._logLevel = vscode
|
|
109
|
-
? vscode.workspace.getConfiguration().get(
|
|
106
|
+
? vscode.workspace.getConfiguration().get(LOGGING_LEVEL_CONFIG_PROP)
|
|
110
107
|
: (logLevel ?? 'info');
|
|
111
108
|
LogWrapper._vscodeLogger = extLogger.getChildLogger({ label: logName });
|
|
112
109
|
}
|
|
@@ -116,7 +113,7 @@ class LogWrapper {
|
|
|
116
113
|
}
|
|
117
114
|
LogWrapper._logLevel = logLevel === 'off' || !logLevel ? 'info' : logLevel;
|
|
118
115
|
}
|
|
119
|
-
LogWrapper._vscodeLogger?.debug(
|
|
116
|
+
LogWrapper._vscodeLogger?.debug(t('logMessages.debug.loggingConfigured', { logLevel: LogWrapper._logLevel }));
|
|
120
117
|
}
|
|
121
118
|
static logAtLevel = (level, message, ...args) => {
|
|
122
119
|
if (typeof message === 'object') {
|
|
@@ -134,7 +131,7 @@ class LogWrapper {
|
|
|
134
131
|
}
|
|
135
132
|
}
|
|
136
133
|
else {
|
|
137
|
-
|
|
134
|
+
DefaultLogger.error(t('logMessages.error.logWrapperNotInitialised'));
|
|
138
135
|
}
|
|
139
136
|
};
|
|
140
137
|
/**
|
|
@@ -262,5 +259,4 @@ class LogWrapper {
|
|
|
262
259
|
return this;
|
|
263
260
|
}
|
|
264
261
|
}
|
|
265
|
-
exports.LogWrapper = LogWrapper;
|
|
266
262
|
//# sourceMappingURL=logWrapper.js.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getPackageScripts = getPackageScripts;
|
|
4
|
-
const i18n_1 = require("../i18n");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
1
|
+
import { t } from '../i18n.js';
|
|
2
|
+
import { SCRIPT_FLP_SANDBOX } from '../constants.js';
|
|
6
3
|
/**
|
|
7
4
|
* Builds the command for the `start-noflp` script in `package.json`.
|
|
8
5
|
*
|
|
@@ -19,7 +16,7 @@ function buildStartNoFLPCommand(localOnly, searchParams) {
|
|
|
19
16
|
const searchParamString = searchParams?.toString();
|
|
20
17
|
const searchParam = searchParamString ? `?${searchParamString}` : '';
|
|
21
18
|
if (localOnly) {
|
|
22
|
-
return `echo \\"${
|
|
19
|
+
return `echo \\"${t('logMessages.info.mockOnlyWarning')}\\"`;
|
|
23
20
|
}
|
|
24
21
|
return `fiori run --open "/index.html${searchParam}"`;
|
|
25
22
|
}
|
|
@@ -50,9 +47,9 @@ function buildParams(searchParams, flpAppId) {
|
|
|
50
47
|
*/
|
|
51
48
|
function buildStartCommand(localOnly, params, startFile) {
|
|
52
49
|
if (localOnly) {
|
|
53
|
-
return `echo \\"${
|
|
50
|
+
return `echo \\"${t('logMessages.info.mockOnlyWarning')}\\"`;
|
|
54
51
|
}
|
|
55
|
-
return `fiori run --open "${startFile ??
|
|
52
|
+
return `fiori run --open "${startFile ?? SCRIPT_FLP_SANDBOX}${params}"`;
|
|
56
53
|
}
|
|
57
54
|
/**
|
|
58
55
|
* Generates a variant management script in preview mode.
|
|
@@ -94,24 +91,24 @@ function getVariantPreviewAppScript(addSearchParams, flpAppId) {
|
|
|
94
91
|
* @param options.supportVirtualEndpoints whether to support virtual endpoints - search params will not be added as they are injected at runtime
|
|
95
92
|
* @returns package.json scripts
|
|
96
93
|
*/
|
|
97
|
-
function getPackageScripts({ localOnly, addMock = true, addTest = false, flpAppId = '', startFile, localStartFile, generateIndex = true, supportVirtualEndpoints = false }) {
|
|
94
|
+
export function getPackageScripts({ localOnly, addMock = true, addTest = false, flpAppId = '', startFile, localStartFile, generateIndex = true, supportVirtualEndpoints = false }) {
|
|
98
95
|
const viewCacheSearchParams = new URLSearchParams([['sap-ui-xx-viewCache', 'false']]);
|
|
99
96
|
const queryParams = buildParams(supportVirtualEndpoints ? undefined : viewCacheSearchParams, flpAppId);
|
|
100
97
|
const scripts = {
|
|
101
98
|
start: buildStartCommand(localOnly, queryParams, startFile),
|
|
102
|
-
'start-local': `fiori run --config ./ui5-local.yaml --open "${localStartFile ??
|
|
99
|
+
'start-local': `fiori run --config ./ui5-local.yaml --open "${localStartFile ?? SCRIPT_FLP_SANDBOX}${queryParams}"`
|
|
103
100
|
};
|
|
104
101
|
if (generateIndex) {
|
|
105
102
|
scripts['start-noflp'] = buildStartNoFLPCommand(localOnly, viewCacheSearchParams);
|
|
106
103
|
}
|
|
107
104
|
if (addMock) {
|
|
108
|
-
scripts['start-mock'] = `fiori run --config ./ui5-mock.yaml --open "${localStartFile ??
|
|
105
|
+
scripts['start-mock'] = `fiori run --config ./ui5-mock.yaml --open "${localStartFile ?? SCRIPT_FLP_SANDBOX}${queryParams}"`;
|
|
109
106
|
}
|
|
110
107
|
if (addTest) {
|
|
111
108
|
scripts['int-test'] = 'fiori run --config ./ui5-mock.yaml --open "/test/integration/opaTests.qunit.html"';
|
|
112
109
|
}
|
|
113
110
|
scripts['start-variants-management'] = localOnly
|
|
114
|
-
? `echo \\"${
|
|
111
|
+
? `echo \\"${t('logMessages.info.mockOnlyWarning')}\\"`
|
|
115
112
|
: getVariantPreviewAppScript(!supportVirtualEndpoints, flpAppId);
|
|
116
113
|
return scripts;
|
|
117
114
|
}
|
package/dist/system-utils.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBackendSystemDisplayName = getBackendSystemDisplayName;
|
|
4
|
-
exports.getSystemDisplayName = getSystemDisplayName;
|
|
5
|
-
const i18n_1 = require("./i18n");
|
|
1
|
+
import { t } from './i18n.js';
|
|
6
2
|
/**
|
|
7
3
|
* Creates and returns a display name for the system, appending the system type and user display name if available.
|
|
8
4
|
*
|
|
9
5
|
* @param system the backend system to create a display name for
|
|
10
6
|
* @returns the display name for the system
|
|
11
7
|
*/
|
|
12
|
-
function getBackendSystemDisplayName(system) {
|
|
8
|
+
export function getBackendSystemDisplayName(system) {
|
|
13
9
|
const systemTypeName = getSystemDisplayName(system.name, system.userDisplayName, system.systemType);
|
|
14
10
|
return systemTypeName;
|
|
15
11
|
}
|
|
@@ -21,7 +17,7 @@ function getBackendSystemDisplayName(system) {
|
|
|
21
17
|
* @param systemType - Backend system type (as string) or undefined
|
|
22
18
|
* @returns system display name
|
|
23
19
|
*/
|
|
24
|
-
function getSystemDisplayName(systemName, displayUsername, systemType) {
|
|
20
|
+
export function getSystemDisplayName(systemName, displayUsername, systemType) {
|
|
25
21
|
const userDisplayName = displayUsername ? ` [${displayUsername}]` : '';
|
|
26
22
|
return `${systemName}${getSystemTypeLabel(systemType)}${userDisplayName}`;
|
|
27
23
|
}
|
|
@@ -33,7 +29,7 @@ function getSystemDisplayName(systemName, displayUsername, systemType) {
|
|
|
33
29
|
*/
|
|
34
30
|
function getSystemTypeLabel(systemType) {
|
|
35
31
|
let systemTypeName = ''; // for on prem we do not show the system type
|
|
36
|
-
const abapCloudLabel = ` (${
|
|
32
|
+
const abapCloudLabel = ` (${t('texts.systemTypeLabel.abapCloud')})`;
|
|
37
33
|
// Legacy store system types will now display as ABAP Cloud
|
|
38
34
|
if (systemType === 'AbapCloud' || systemType === 'S4HC' || systemType === 'BTP') {
|
|
39
35
|
systemTypeName = abapCloudLabel;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { sendTelemetry, sendTelemetryBlocking } from './utils';
|
|
2
|
-
export { TelemetryData } from './types';
|
|
3
|
-
export * from './telemetryHelper';
|
|
1
|
+
export { sendTelemetry, sendTelemetryBlocking } from './utils.js';
|
|
2
|
+
export type { TelemetryData } from './types.js';
|
|
3
|
+
export * from './telemetryHelper.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/telemetry/index.js
CHANGED
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.sendTelemetryBlocking = exports.sendTelemetry = void 0;
|
|
18
|
-
var utils_1 = require("./utils");
|
|
19
|
-
Object.defineProperty(exports, "sendTelemetry", { enumerable: true, get: function () { return utils_1.sendTelemetry; } });
|
|
20
|
-
Object.defineProperty(exports, "sendTelemetryBlocking", { enumerable: true, get: function () { return utils_1.sendTelemetryBlocking; } });
|
|
21
|
-
__exportStar(require("./telemetryHelper"), exports);
|
|
1
|
+
export { sendTelemetry, sendTelemetryBlocking } from './utils.js';
|
|
2
|
+
export * from './telemetryHelper.js';
|
|
22
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TelemetryProperties, type ToolsSuiteTelemetryInitSettings } from '@sap-ux/telemetry';
|
|
2
|
-
import type { TelemetryData } from './types';
|
|
2
|
+
import type { TelemetryData } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Helper class for intialising and preparing event data for telemetry.
|
|
5
5
|
*/
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TelemetryHelper = void 0;
|
|
7
|
-
const telemetry_1 = require("@sap-ux/telemetry");
|
|
8
|
-
const environment_1 = require("../environment");
|
|
9
|
-
const os_name_1 = __importDefault(require("os-name"));
|
|
10
|
-
const i18n_1 = require("../i18n");
|
|
1
|
+
import { PerformanceMeasurementAPI as Performance, initTelemetrySettings } from '@sap-ux/telemetry';
|
|
2
|
+
import { getHostEnvironment } from '../environment.js';
|
|
3
|
+
import osName from 'os-name';
|
|
4
|
+
import { t } from '../i18n.js';
|
|
11
5
|
/**
|
|
12
6
|
* Helper class for intialising and preparing event data for telemetry.
|
|
13
7
|
*/
|
|
14
|
-
class TelemetryHelper {
|
|
8
|
+
export class TelemetryHelper {
|
|
15
9
|
static _telemetryData;
|
|
16
10
|
static _previousEventTimestamp;
|
|
17
11
|
/**
|
|
@@ -28,7 +22,7 @@ class TelemetryHelper {
|
|
|
28
22
|
* @param options - tools suite telemetry init settings
|
|
29
23
|
*/
|
|
30
24
|
static async initTelemetrySettings(options) {
|
|
31
|
-
await
|
|
25
|
+
await initTelemetrySettings(options);
|
|
32
26
|
}
|
|
33
27
|
/**
|
|
34
28
|
* Creates telemetry data and adds default telemetry props.
|
|
@@ -44,15 +38,15 @@ class TelemetryHelper {
|
|
|
44
38
|
this._previousEventTimestamp = currentTimestamp;
|
|
45
39
|
}
|
|
46
40
|
if (!this._telemetryData) {
|
|
47
|
-
let osVersionName =
|
|
41
|
+
let osVersionName = t('telemetry.unknownOs');
|
|
48
42
|
try {
|
|
49
|
-
osVersionName = (
|
|
43
|
+
osVersionName = osName();
|
|
50
44
|
}
|
|
51
45
|
catch {
|
|
52
46
|
// no matched os name, possible beta or unreleased version
|
|
53
47
|
}
|
|
54
48
|
this._telemetryData = {
|
|
55
|
-
Platform:
|
|
49
|
+
Platform: getHostEnvironment().technical,
|
|
56
50
|
OperatingSystem: osVersionName
|
|
57
51
|
};
|
|
58
52
|
}
|
|
@@ -74,7 +68,7 @@ class TelemetryHelper {
|
|
|
74
68
|
*/
|
|
75
69
|
static markAppGenStartTime() {
|
|
76
70
|
TelemetryHelper.createTelemetryData({
|
|
77
|
-
markName:
|
|
71
|
+
markName: Performance.startMark('LOADING_TIME')
|
|
78
72
|
});
|
|
79
73
|
}
|
|
80
74
|
/**
|
|
@@ -83,10 +77,9 @@ class TelemetryHelper {
|
|
|
83
77
|
*/
|
|
84
78
|
static markAppGenEndTime() {
|
|
85
79
|
if (this._telemetryData?.markName) {
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
Performance.endMark(this._telemetryData.markName);
|
|
81
|
+
Performance.measure(this._telemetryData.markName);
|
|
88
82
|
}
|
|
89
83
|
}
|
|
90
84
|
}
|
|
91
|
-
exports.TelemetryHelper = TelemetryHelper;
|
|
92
85
|
//# sourceMappingURL=telemetryHelper.js.map
|
package/dist/telemetry/types.js
CHANGED
package/dist/telemetry/utils.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.sendTelemetry = sendTelemetry;
|
|
4
|
-
exports.sendTelemetryBlocking = sendTelemetryBlocking;
|
|
5
|
-
const telemetry_1 = require("@sap-ux/telemetry");
|
|
6
|
-
const telemetryHelper_1 = require("./telemetryHelper");
|
|
1
|
+
import { ClientFactory, PerformanceMeasurementAPI as Performance, SampleRate } from '@sap-ux/telemetry';
|
|
2
|
+
import { TelemetryHelper } from './telemetryHelper.js';
|
|
7
3
|
/**
|
|
8
4
|
* Prepares the telemetry event to be sent to the telemetry client.
|
|
9
5
|
*
|
|
@@ -13,9 +9,9 @@ const telemetryHelper_1 = require("./telemetryHelper");
|
|
|
13
9
|
*/
|
|
14
10
|
function prepareTelemetryEvent(telemetryEventName, telemetryData) {
|
|
15
11
|
// Make sure performance measurement end is called
|
|
16
|
-
|
|
12
|
+
TelemetryHelper.markAppGenEndTime();
|
|
17
13
|
const generationTime = telemetryData.markName
|
|
18
|
-
?
|
|
14
|
+
? Performance.getMeasurementDuration(telemetryData.markName)
|
|
19
15
|
: undefined;
|
|
20
16
|
return {
|
|
21
17
|
eventName: telemetryEventName,
|
|
@@ -31,9 +27,9 @@ function prepareTelemetryEvent(telemetryEventName, telemetryData) {
|
|
|
31
27
|
* @param appPath - the path of the application
|
|
32
28
|
* @returns - a promise that resolves when the event is sent
|
|
33
29
|
*/
|
|
34
|
-
async function sendTelemetry(telemetryEventName, telemetryData, appPath) {
|
|
30
|
+
export async function sendTelemetry(telemetryEventName, telemetryData, appPath) {
|
|
35
31
|
const telemetryEvent = prepareTelemetryEvent(telemetryEventName, telemetryData);
|
|
36
|
-
return
|
|
32
|
+
return ClientFactory.getTelemetryClient().reportEvent(telemetryEvent, SampleRate.NoSampling, appPath ? { appPath } : undefined);
|
|
37
33
|
}
|
|
38
34
|
/**
|
|
39
35
|
* Sends the telemetry event to the telemetry client and blocks the execution until the event is sent.
|
|
@@ -43,8 +39,8 @@ async function sendTelemetry(telemetryEventName, telemetryData, appPath) {
|
|
|
43
39
|
* @param appPath - the path of the application
|
|
44
40
|
* @returns - a promise that resolves when the event is sent
|
|
45
41
|
*/
|
|
46
|
-
async function sendTelemetryBlocking(telemetryEventName, telemetryData, appPath) {
|
|
42
|
+
export async function sendTelemetryBlocking(telemetryEventName, telemetryData, appPath) {
|
|
47
43
|
const telemetryEvent = prepareTelemetryEvent(telemetryEventName, telemetryData);
|
|
48
|
-
return
|
|
44
|
+
return ClientFactory.getTelemetryClient().reportEventBlocking(telemetryEvent, SampleRate.NoSampling, appPath ? { appPath } : undefined);
|
|
49
45
|
}
|
|
50
46
|
//# sourceMappingURL=utils.js.map
|
package/dist/types/app-gen.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FloorplanFE = exports.FloorplanFF = void 0;
|
|
4
1
|
// Union types to expose a single interface property for Floorplan
|
|
5
2
|
// This provides a layer of abstraction to isolate internal changes from external headless API consumers
|
|
6
3
|
// Since these keys are used as an external API definiton they need to be meaningful
|
|
@@ -9,10 +6,10 @@ exports.FloorplanFE = exports.FloorplanFF = void 0;
|
|
|
9
6
|
* Due to ts(18033) we cannot use the type values directly here:
|
|
10
7
|
* FF_SIMPLE = FFTemplateType.Basic // Once https://github.com/microsoft/TypeScript/pull/59475 is merged we can remove the hardcoded values and directly use the template values
|
|
11
8
|
*/
|
|
12
|
-
var FloorplanFF;
|
|
9
|
+
export var FloorplanFF;
|
|
13
10
|
(function (FloorplanFF) {
|
|
14
11
|
FloorplanFF["FF_SIMPLE"] = "basic";
|
|
15
|
-
})(FloorplanFF || (
|
|
12
|
+
})(FloorplanFF || (FloorplanFF = {}));
|
|
16
13
|
/**
|
|
17
14
|
* Due to ts(18033) we cannot use the type values directly here:
|
|
18
15
|
* Once https://github.com/microsoft/TypeScript/pull/59475 is merged we can remove hardcoded values and directly use the template values
|
|
@@ -23,7 +20,7 @@ var FloorplanFF;
|
|
|
23
20
|
* FE_FEOP = FETemplateType.FormEntryObjectPage,
|
|
24
21
|
* FE_WORKLIST = FETemplateType.Worklist
|
|
25
22
|
*/
|
|
26
|
-
var FloorplanFE;
|
|
23
|
+
export var FloorplanFE;
|
|
27
24
|
(function (FloorplanFE) {
|
|
28
25
|
FloorplanFE["FE_FPM"] = "fpm";
|
|
29
26
|
FloorplanFE["FE_LROP"] = "lrop";
|
|
@@ -31,5 +28,5 @@ var FloorplanFE;
|
|
|
31
28
|
FloorplanFE["FE_ALP"] = "alp";
|
|
32
29
|
FloorplanFE["FE_FEOP"] = "feop";
|
|
33
30
|
FloorplanFE["FE_WORKLIST"] = "worklist";
|
|
34
|
-
})(FloorplanFE || (
|
|
31
|
+
})(FloorplanFE || (FloorplanFE = {}));
|
|
35
32
|
//# sourceMappingURL=app-gen.js.map
|
package/dist/types/cap.js
CHANGED
package/dist/types/headless.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Annotations, EntitySetData, ExternalService } from '@sap-ux/axios-extension';
|
|
2
|
-
import type { FloorplanKey } from './app-gen';
|
|
3
|
-
import type { CapRuntime } from './cap';
|
|
2
|
+
import type { FloorplanKey } from './app-gen.js';
|
|
3
|
+
import type { CapRuntime } from './cap.js';
|
|
4
4
|
/**
|
|
5
5
|
* Shared types used by headless generation from multiple modules
|
|
6
6
|
*/
|
package/dist/types/headless.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DeployTarget = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Shared types used by headless generation from multiple modules
|
|
6
3
|
*/
|
|
7
|
-
var DeployTarget;
|
|
4
|
+
export var DeployTarget;
|
|
8
5
|
(function (DeployTarget) {
|
|
9
6
|
DeployTarget["CF"] = "CF";
|
|
10
7
|
DeployTarget["ABAP"] = "ABAP";
|
|
11
|
-
})(DeployTarget || (
|
|
8
|
+
})(DeployTarget || (DeployTarget = {}));
|
|
12
9
|
//# sourceMappingURL=headless.js.map
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './app-gen';
|
|
2
|
-
export * from './cap';
|
|
3
|
-
export * from './environment';
|
|
4
|
-
export * from './headless';
|
|
1
|
+
export * from './app-gen.js';
|
|
2
|
+
export * from './cap.js';
|
|
3
|
+
export * from './environment.js';
|
|
4
|
+
export * from './headless.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/types/index.js
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./app-gen"), exports);
|
|
18
|
-
__exportStar(require("./cap"), exports);
|
|
19
|
-
__exportStar(require("./environment"), exports);
|
|
20
|
-
__exportStar(require("./headless"), exports);
|
|
1
|
+
export * from './app-gen.js';
|
|
2
|
+
export * from './cap.js';
|
|
3
|
+
export * from './environment.js';
|
|
4
|
+
export * from './headless.js';
|
|
21
5
|
//# sourceMappingURL=index.js.map
|
package/dist/ui5/ui5.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBootstrapResourceUrls = getBootstrapResourceUrls;
|
|
4
1
|
/**
|
|
5
2
|
* Get the resource URLs for the UShell bootstrap and UI5 bootstrap based on project type and UI5 framework details.
|
|
6
3
|
*
|
|
@@ -9,7 +6,7 @@ exports.getBootstrapResourceUrls = getBootstrapResourceUrls;
|
|
|
9
6
|
* @param {string} [version] - The version of the UI5 framework.
|
|
10
7
|
* @returns {{ uShellBootstrapResourceUrl: string, uiBootstrapResourceUrl: string }} - The resource URLs for UShell bootstrap and UI bootstrap.
|
|
11
8
|
*/
|
|
12
|
-
function getBootstrapResourceUrls(isEdmxProjectType, frameworkUrl, version) {
|
|
9
|
+
export function getBootstrapResourceUrls(isEdmxProjectType, frameworkUrl, version) {
|
|
13
10
|
// Constants for relative paths
|
|
14
11
|
const relativeUshellPath = '/test-resources/sap/ushell/bootstrap/sandbox.js';
|
|
15
12
|
const relativeUiPath = '/resources/sap-ui-core.js';
|
|
@@ -1,30 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.getDefaultTargetFolder = getDefaultTargetFolder;
|
|
8
|
-
exports.isExtensionInstalled = isExtensionInstalled;
|
|
9
|
-
exports.isCommandRegistered = isCommandRegistered;
|
|
10
|
-
const node_fs_1 = require("node:fs");
|
|
11
|
-
const node_os_1 = __importDefault(require("node:os"));
|
|
12
|
-
const node_path_1 = require("node:path");
|
|
13
|
-
const semver_1 = require("semver");
|
|
14
|
-
exports.YEOMANUI_TARGET_FOLDER_CONFIG_PROP = 'ApplicationWizard.TargetFolder';
|
|
15
|
-
const DEFAULT_PROJECTS_FOLDER = (0, node_path_1.join)(node_os_1.default.homedir(), 'projects');
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { coerce, lt } from 'semver';
|
|
5
|
+
export const YEOMANUI_TARGET_FOLDER_CONFIG_PROP = 'ApplicationWizard.TargetFolder';
|
|
6
|
+
const DEFAULT_PROJECTS_FOLDER = join(os.homedir(), 'projects');
|
|
16
7
|
/**
|
|
17
8
|
* Determines the target folder for the project.
|
|
18
9
|
*
|
|
19
10
|
* @param vscode - the vscode instance
|
|
20
11
|
* @returns The default path, if it can be determined otherwise undefined.
|
|
21
12
|
*/
|
|
22
|
-
function getDefaultTargetFolder(vscode) {
|
|
13
|
+
export function getDefaultTargetFolder(vscode) {
|
|
23
14
|
// CLI use will not define vscode
|
|
24
15
|
if (!vscode) {
|
|
25
16
|
return undefined;
|
|
26
17
|
}
|
|
27
|
-
const targetFolder = vscode.workspace?.getConfiguration().get(
|
|
18
|
+
const targetFolder = vscode.workspace?.getConfiguration().get(YEOMANUI_TARGET_FOLDER_CONFIG_PROP);
|
|
28
19
|
if (targetFolder) {
|
|
29
20
|
return targetFolder;
|
|
30
21
|
}
|
|
@@ -38,7 +29,7 @@ function getDefaultTargetFolder(vscode) {
|
|
|
38
29
|
}
|
|
39
30
|
}
|
|
40
31
|
// Otherwise use <home-dir>/projects,
|
|
41
|
-
return
|
|
32
|
+
return existsSync(DEFAULT_PROJECTS_FOLDER) ? DEFAULT_PROJECTS_FOLDER : undefined;
|
|
42
33
|
}
|
|
43
34
|
/**
|
|
44
35
|
* Check for an installed extension, optionally specifying a minimum version and activation state.
|
|
@@ -50,13 +41,13 @@ function getDefaultTargetFolder(vscode) {
|
|
|
50
41
|
* @param isActive - If `true`, the function will only return `true` if the extension is also active. Defaults to `true`.
|
|
51
42
|
* @returns true if the extension is installed, the version is >= minVersion, and is active, false otherwise
|
|
52
43
|
*/
|
|
53
|
-
function isExtensionInstalled(vscode, extensionId, minVersion, isActive = true) {
|
|
44
|
+
export function isExtensionInstalled(vscode, extensionId, minVersion, isActive = true) {
|
|
54
45
|
const foundExt = vscode?.extensions?.getExtension(extensionId);
|
|
55
46
|
if (foundExt) {
|
|
56
|
-
const extVersion =
|
|
47
|
+
const extVersion = coerce(foundExt.packageJSON.version);
|
|
57
48
|
if (extVersion) {
|
|
58
49
|
// If a minimum version is specified and the extension's version is less than it, return false.
|
|
59
|
-
if (minVersion &&
|
|
50
|
+
if (minVersion && lt(extVersion, minVersion)) {
|
|
60
51
|
return false;
|
|
61
52
|
}
|
|
62
53
|
// If the caller explicitly requires the extension to check if active, and it's not then return false.
|
|
@@ -75,7 +66,7 @@ function isExtensionInstalled(vscode, extensionId, minVersion, isActive = true)
|
|
|
75
66
|
* @param commandId - the id of the command to check
|
|
76
67
|
* @returns true if the command is registered, else false
|
|
77
68
|
*/
|
|
78
|
-
async function isCommandRegistered(vscode, commandId) {
|
|
69
|
+
export async function isCommandRegistered(vscode, commandId) {
|
|
79
70
|
const commands = await vscode.commands.getCommands();
|
|
80
71
|
return commands.includes(commandId);
|
|
81
72
|
}
|
package/dist/yeoman.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setYeomanEnvConflicterForce = setYeomanEnvConflicterForce;
|
|
4
1
|
/**
|
|
5
2
|
* Set the Yeoman environment's conflicter force option.
|
|
6
3
|
* Sets both `env.conflicter.force` and `env.conflicterOptions.force` to the provided value.
|
|
@@ -9,7 +6,7 @@ exports.setYeomanEnvConflicterForce = setYeomanEnvConflicterForce;
|
|
|
9
6
|
* @param env - Yeoman environment
|
|
10
7
|
* @param force - whether to force overwriting files
|
|
11
8
|
*/
|
|
12
|
-
function setYeomanEnvConflicterForce(env, force) {
|
|
9
|
+
export function setYeomanEnvConflicterForce(env, force) {
|
|
13
10
|
if (env.conflicter) {
|
|
14
11
|
env.conflicter.force = force ?? true;
|
|
15
12
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/fiori-generator-shared",
|
|
3
3
|
"description": "Commonly used shared functionality and types to support the fiori generator.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
8
8
|
"directory": "packages/fiori-generator-shared"
|
|
9
9
|
},
|
|
10
|
+
"type": "module",
|
|
10
11
|
"license": "Apache-2.0",
|
|
11
12
|
"main": "dist/index.js",
|
|
12
13
|
"files": [
|
|
@@ -24,20 +25,21 @@
|
|
|
24
25
|
"mem-fs-editor": "9.4.0",
|
|
25
26
|
"os-name": "4.0.1",
|
|
26
27
|
"semver": "7.7.4",
|
|
27
|
-
"@sap-ux/
|
|
28
|
-
"@sap-ux/
|
|
29
|
-
"@sap-ux/
|
|
28
|
+
"@sap-ux/btp-utils": "2.0.0",
|
|
29
|
+
"@sap-ux/project-access": "2.0.0",
|
|
30
|
+
"@sap-ux/telemetry": "1.0.0"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
33
|
+
"@jest/globals": "30.3.0",
|
|
32
34
|
"@types/mem-fs-editor": "7.0.1",
|
|
33
35
|
"@types/mem-fs": "1.1.2",
|
|
34
36
|
"@types/semver": "7.7.1",
|
|
35
37
|
"@types/vscode": "1.110.0",
|
|
36
38
|
"@types/yeoman-environment": "2.10.11",
|
|
37
39
|
"@types/yeoman-generator": "5.2.14",
|
|
38
|
-
"@sap-ux/axios-extension": "
|
|
39
|
-
"@sap-ux/logger": "0.
|
|
40
|
-
"@sap-ux/store": "
|
|
40
|
+
"@sap-ux/axios-extension": "2.0.0",
|
|
41
|
+
"@sap-ux/logger": "1.0.0",
|
|
42
|
+
"@sap-ux/store": "2.0.0"
|
|
41
43
|
},
|
|
42
44
|
"engines": {
|
|
43
45
|
"node": ">=22.x"
|
|
@@ -48,8 +50,8 @@
|
|
|
48
50
|
"watch": "tsc --watch",
|
|
49
51
|
"lint": "eslint",
|
|
50
52
|
"lint:fix": "eslint --fix",
|
|
51
|
-
"test": "jest --ci --forceExit --detectOpenHandles --colors",
|
|
52
|
-
"test-u": "jest --ci --forceExit --detectOpenHandles --colors -u",
|
|
53
|
+
"test": "cross-env NODE_OPTIONS='--experimental-vm-modules' jest --ci --forceExit --detectOpenHandles --colors",
|
|
54
|
+
"test-u": "cross-env NODE_OPTIONS='--experimental-vm-modules' jest --ci --forceExit --detectOpenHandles --colors -u",
|
|
53
55
|
"link": "pnpm link --global",
|
|
54
56
|
"unlink": "pnpm unlink --global"
|
|
55
57
|
}
|