@sap-ux/deploy-config-generator-shared 0.0.3 → 0.0.5
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/base/generator.d.ts +1 -0
- package/dist/base/generator.js +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -2
- package/dist/translations/deploy-config-generator-shared.i18n.json +8 -7
- package/dist/utils/conditions.d.ts +11 -0
- package/dist/utils/conditions.js +19 -0
- package/dist/utils/error-handler.d.ts +1 -0
- package/dist/utils/error-handler.js +1 -0
- package/dist/utils/i18n.d.ts +4 -0
- package/dist/utils/i18n.js +2 -1
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.js +19 -1
- package/dist/utils/types.d.ts +9 -0
- package/dist/utils/types.js +3 -0
- package/package.json +6 -3
package/dist/base/generator.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare abstract class DeploymentGenerator extends Generator {
|
|
|
12
12
|
* @param options - options passed to the generator
|
|
13
13
|
*/
|
|
14
14
|
constructor(args: string | string[], options: Generator.GeneratorOptions);
|
|
15
|
+
initializing(): Promise<void>;
|
|
15
16
|
/**
|
|
16
17
|
* Get the logger instance.
|
|
17
18
|
*
|
package/dist/base/generator.js
CHANGED
|
@@ -25,7 +25,9 @@ class DeploymentGenerator extends yeoman_generator_1.default {
|
|
|
25
25
|
DeploymentGenerator._logger =
|
|
26
26
|
this.options.logWrapper ??
|
|
27
27
|
this._configureLogging(this.options.logLevel, this.options.logger, this.options.vscode);
|
|
28
|
-
|
|
28
|
+
}
|
|
29
|
+
async initializing() {
|
|
30
|
+
await (0, utils_1.initI18n)();
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
31
33
|
* Get the logger instance.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { DeploymentGenerator } from './base/generator';
|
|
2
|
-
export {
|
|
2
|
+
export { initI18n, bail, handleErrorMessage, showOverwriteQuestion, ErrorMessages, ConnectedSystem } from './utils';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleErrorMessage = exports.bail = exports.
|
|
3
|
+
exports.ErrorMessages = exports.showOverwriteQuestion = exports.handleErrorMessage = exports.bail = exports.initI18n = exports.DeploymentGenerator = void 0;
|
|
4
4
|
var generator_1 = require("./base/generator");
|
|
5
5
|
Object.defineProperty(exports, "DeploymentGenerator", { enumerable: true, get: function () { return generator_1.DeploymentGenerator; } });
|
|
6
6
|
var utils_1 = require("./utils");
|
|
7
|
-
Object.defineProperty(exports, "
|
|
7
|
+
Object.defineProperty(exports, "initI18n", { enumerable: true, get: function () { return utils_1.initI18n; } });
|
|
8
8
|
Object.defineProperty(exports, "bail", { enumerable: true, get: function () { return utils_1.bail; } });
|
|
9
9
|
Object.defineProperty(exports, "handleErrorMessage", { enumerable: true, get: function () { return utils_1.handleErrorMessage; } });
|
|
10
|
+
Object.defineProperty(exports, "showOverwriteQuestion", { enumerable: true, get: function () { return utils_1.showOverwriteQuestion; } });
|
|
11
|
+
Object.defineProperty(exports, "ErrorMessages", { enumerable: true, get: function () { return utils_1.ErrorMessages; } });
|
|
10
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"errors": {
|
|
3
3
|
"abortSignal": "ABORT_SIGNAL",
|
|
4
|
-
"cannotReadUi5Config": "Cannot read ui5.yaml: {{reason}}",
|
|
4
|
+
"cannotReadUi5Config": "Cannot read ui5.yaml: {{- reason}}",
|
|
5
5
|
"capDeploymentNoMta": "The SAP Fiori application is within a CAP project and deployment should be configured as part of the CAP project. Please ensure you have a mta.yaml file defined for this project.",
|
|
6
|
-
"fileDoesNotExist": "File does not exist: {{filePath}}",
|
|
7
|
-
"folderDoesNotExist": "Folder path does not exist: {{filePath}}",
|
|
8
|
-
"invalidClient": "[{{client}}] is invalid. Enter blank or a value between 000-999",
|
|
6
|
+
"fileDoesNotExist": "File does not exist: {{- filePath}}",
|
|
7
|
+
"folderDoesNotExist": "Folder path does not exist: {{- filePath}}",
|
|
8
|
+
"invalidClient": "[{{- client}}] is invalid. Enter blank or a value between 000-999",
|
|
9
9
|
"invalidMtaId": "The ID can only contain letters, numbers, dashes, periods and underscores (but no spaces).",
|
|
10
|
-
"invalidURL": "Invalid URL: [{{input}}]",
|
|
11
|
-
"mtaIdAlreadyExists": "A folder with same name already exist at {{destinationRoot}}",
|
|
10
|
+
"invalidURL": "Invalid URL: [{{- input}}]",
|
|
11
|
+
"mtaIdAlreadyExists": "A folder with same name already exist at {{- destinationRoot}}",
|
|
12
12
|
"noAppName": "Could not determine app name from manifest",
|
|
13
|
+
"noUi5Config": "Error: could not read ui5.yaml",
|
|
13
14
|
"noBinary": "Cannot find the \"{{bin}}\" executable. Please add it to the path or use \"npm i -g {{pkg}}\" to install it.",
|
|
14
15
|
"noManifest": "Error: could not read webapp/manifest.json",
|
|
15
16
|
"noMta": "MTA ID cannot be empty",
|
|
16
17
|
"noMtaId": "MTA ID cannot be empty",
|
|
17
|
-
"noMtaInRoot": "Error: no {{mtaFileName}} in {{root}}",
|
|
18
|
+
"noMtaInRoot": "Error: no {{mtaFileName}} in {{- root}}",
|
|
18
19
|
"noPath": "Cannot find \"path\" in backend configuration in ui5.yaml",
|
|
19
20
|
"unrecognizedTarget": "Unrecognized target: {{target}}"
|
|
20
21
|
},
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Show overwrite question if certain conditions are met.
|
|
3
|
+
*
|
|
4
|
+
* @param configExists - if the config file already exists
|
|
5
|
+
* @param launchDeployConfigAsSubGenerator - if the generator is launched as a subgenerator
|
|
6
|
+
* @param launchStandaloneFromYui - if the generator is launched as a standalone generator in YUI
|
|
7
|
+
* @param overwriteOption - if the overwrite option is set
|
|
8
|
+
* @returns - if the overwrite question should be shown
|
|
9
|
+
*/
|
|
10
|
+
export declare function showOverwriteQuestion(configExists: boolean, launchDeployConfigAsSubGenerator?: boolean, launchStandaloneFromYui?: boolean, overwriteOption?: boolean): boolean;
|
|
11
|
+
//# sourceMappingURL=conditions.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.showOverwriteQuestion = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Show overwrite question if certain conditions are met.
|
|
6
|
+
*
|
|
7
|
+
* @param configExists - if the config file already exists
|
|
8
|
+
* @param launchDeployConfigAsSubGenerator - if the generator is launched as a subgenerator
|
|
9
|
+
* @param launchStandaloneFromYui - if the generator is launched as a standalone generator in YUI
|
|
10
|
+
* @param overwriteOption - if the overwrite option is set
|
|
11
|
+
* @returns - if the overwrite question should be shown
|
|
12
|
+
*/
|
|
13
|
+
function showOverwriteQuestion(configExists, launchDeployConfigAsSubGenerator = true, launchStandaloneFromYui, overwriteOption) {
|
|
14
|
+
// Don't show this question in wrapper generator
|
|
15
|
+
const showQuestion = launchDeployConfigAsSubGenerator && !launchStandaloneFromYui ? false : Boolean(!overwriteOption);
|
|
16
|
+
return showQuestion && configExists;
|
|
17
|
+
}
|
|
18
|
+
exports.showOverwriteQuestion = showOverwriteQuestion;
|
|
19
|
+
//# sourceMappingURL=conditions.js.map
|
|
@@ -7,6 +7,7 @@ export declare class ErrorMessages {
|
|
|
7
7
|
static readonly abortSignal: string;
|
|
8
8
|
static readonly noManifest: string;
|
|
9
9
|
static readonly noAppName: string;
|
|
10
|
+
static readonly noUI5Config: string;
|
|
10
11
|
static readonly noCdsBin: string;
|
|
11
12
|
static readonly noMtaBin: string;
|
|
12
13
|
static readonly noMta: string;
|
|
@@ -14,6 +14,7 @@ class ErrorMessages {
|
|
|
14
14
|
static abortSignal = (0, i18n_1.t)('errors.abortSignal'); // check this one, is ABORT_SIGNAL signifcant? or can we just throw an error?
|
|
15
15
|
static noManifest = (0, i18n_1.t)('errors.noManifest');
|
|
16
16
|
static noAppName = (0, i18n_1.t)('errors.noAppName');
|
|
17
|
+
static noUI5Config = (0, i18n_1.t)('errors.noUi5Config');
|
|
17
18
|
static noCdsBin = this.cannotFindBinary(constants_1.cdsExecutable, constants_1.cdsPkg);
|
|
18
19
|
static noMtaBin = this.cannotFindBinary(constants_1.mtaExecutable, constants_1.mtaPkg);
|
|
19
20
|
static noMta = (0, i18n_1.t)('errors.noMta');
|
package/dist/utils/i18n.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { TOptions } from 'i18next';
|
|
2
|
+
/**
|
|
3
|
+
* Initialize i18next with the translations for this module.
|
|
4
|
+
*/
|
|
5
|
+
export declare function initI18n(): Promise<void>;
|
|
2
6
|
/**
|
|
3
7
|
* Helper function facading the call to i18next. Unless a namespace option is provided the local namespace will be used.
|
|
4
8
|
*
|
package/dist/utils/i18n.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.t = void 0;
|
|
6
|
+
exports.t = exports.initI18n = void 0;
|
|
7
7
|
const i18next_1 = __importDefault(require("i18next"));
|
|
8
8
|
const deploy_config_generator_shared_i18n_json_1 = __importDefault(require("../translations/deploy-config-generator-shared.i18n.json"));
|
|
9
9
|
const deployConfigGenShared = 'deploy-config-generator-shared';
|
|
@@ -13,6 +13,7 @@ const deployConfigGenShared = 'deploy-config-generator-shared';
|
|
|
13
13
|
async function initI18n() {
|
|
14
14
|
await i18next_1.default.init({ lng: 'en', fallbackLng: 'en' }, () => i18next_1.default.addResourceBundle('en', deployConfigGenShared, deploy_config_generator_shared_i18n_json_1.default));
|
|
15
15
|
}
|
|
16
|
+
exports.initI18n = initI18n;
|
|
16
17
|
/**
|
|
17
18
|
* Helper function facading the call to i18next. Unless a namespace option is provided the local namespace will be used.
|
|
18
19
|
*
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
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
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleErrorMessage = exports.bail = exports.ErrorMessages = exports.t = void 0;
|
|
17
|
+
exports.handleErrorMessage = exports.bail = exports.ErrorMessages = exports.showOverwriteQuestion = exports.initI18n = exports.t = void 0;
|
|
4
18
|
var i18n_1 = require("./i18n");
|
|
5
19
|
Object.defineProperty(exports, "t", { enumerable: true, get: function () { return i18n_1.t; } });
|
|
20
|
+
Object.defineProperty(exports, "initI18n", { enumerable: true, get: function () { return i18n_1.initI18n; } });
|
|
21
|
+
var conditions_1 = require("./conditions");
|
|
22
|
+
Object.defineProperty(exports, "showOverwriteQuestion", { enumerable: true, get: function () { return conditions_1.showOverwriteQuestion; } });
|
|
6
23
|
var error_handler_1 = require("./error-handler");
|
|
7
24
|
Object.defineProperty(exports, "ErrorMessages", { enumerable: true, get: function () { return error_handler_1.ErrorMessages; } });
|
|
8
25
|
Object.defineProperty(exports, "bail", { enumerable: true, get: function () { return error_handler_1.bail; } });
|
|
9
26
|
Object.defineProperty(exports, "handleErrorMessage", { enumerable: true, get: function () { return error_handler_1.handleErrorMessage; } });
|
|
27
|
+
__exportStar(require("./types"), exports);
|
|
10
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ServiceProvider } from '@sap-ux/axios-extension';
|
|
2
|
+
import type { Destination } from '@sap-ux/btp-utils';
|
|
3
|
+
import type { BackendSystem } from '@sap-ux/store';
|
|
4
|
+
export interface ConnectedSystem {
|
|
5
|
+
serviceProvider?: ServiceProvider;
|
|
6
|
+
backendSystem?: BackendSystem;
|
|
7
|
+
destination?: Destination;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/deploy-config-generator-shared",
|
|
3
3
|
"description": "Commonly used shared functionality and types to support the deploy config generator.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -20,11 +20,14 @@
|
|
|
20
20
|
"@vscode-logging/logger": "2.0.0",
|
|
21
21
|
"i18next": "20.6.1",
|
|
22
22
|
"yeoman-generator": "5.10.0",
|
|
23
|
-
"@sap-ux/fiori-generator-shared": "0.7.
|
|
23
|
+
"@sap-ux/fiori-generator-shared": "0.7.14"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/yeoman-generator": "5.2.11",
|
|
27
|
-
"typescript": "5.3.3"
|
|
27
|
+
"typescript": "5.3.3",
|
|
28
|
+
"@sap-ux/axios-extension": "1.17.7",
|
|
29
|
+
"@sap-ux/btp-utils": "0.17.1",
|
|
30
|
+
"@sap-ux/store": "0.9.3"
|
|
28
31
|
},
|
|
29
32
|
"engines": {
|
|
30
33
|
"node": ">=18.x"
|