@sap-ux/generator-adp 0.3.30 → 0.3.32
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/generators/app/index.d.ts +2 -1
- package/generators/app/index.js +27 -22
- package/generators/app/layer.d.ts +2 -8
- package/generators/app/layer.js +4 -17
- package/generators/translations/generator-adp.i18n.json +2 -1
- package/generators/utils/appWizardCache.d.ts +5 -5
- package/generators/utils/opts.d.ts +2 -2
- package/generators/utils/subgenHelpers.d.ts +7 -8
- package/generators/utils/subgenHelpers.js +3 -4
- package/generators/utils/workspace.d.ts +30 -0
- package/generators/utils/workspace.js +67 -0
- package/package.json +9 -9
|
@@ -10,6 +10,7 @@ export default class extends Generator {
|
|
|
10
10
|
private readonly appWizard;
|
|
11
11
|
private readonly vscode;
|
|
12
12
|
private readonly toolsLogger;
|
|
13
|
+
private isCli;
|
|
13
14
|
/**
|
|
14
15
|
* A boolean flag indicating whether node_modules should be installed after project generation.
|
|
15
16
|
*/
|
|
@@ -82,7 +83,7 @@ export default class extends Generator {
|
|
|
82
83
|
prompting(): Promise<void>;
|
|
83
84
|
writing(): Promise<void>;
|
|
84
85
|
install(): Promise<void>;
|
|
85
|
-
end(): void
|
|
86
|
+
end(): Promise<void>;
|
|
86
87
|
/**
|
|
87
88
|
* Retrieves the ConfigPrompter instance from cache if it exists, otherwise creates a new instance.
|
|
88
89
|
*
|
package/generators/app/index.js
CHANGED
|
@@ -7,23 +7,24 @@ const path_1 = require("path");
|
|
|
7
7
|
const yeoman_generator_1 = __importDefault(require("yeoman-generator"));
|
|
8
8
|
const yeoman_ui_types_1 = require("@sap-devx/yeoman-ui-types");
|
|
9
9
|
const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
10
|
-
const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
|
|
11
10
|
const logger_1 = require("@sap-ux/logger");
|
|
12
11
|
const feature_toggle_1 = require("@sap-ux/feature-toggle");
|
|
12
|
+
const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
|
|
13
13
|
const layer_1 = require("./layer");
|
|
14
14
|
const i18n_1 = require("../utils/i18n");
|
|
15
15
|
const telemetryEvents_1 = require("../telemetryEvents");
|
|
16
16
|
const opts_1 = require("../utils/opts");
|
|
17
|
-
const steps_1 = require("../utils/steps");
|
|
18
17
|
const logger_2 = __importDefault(require("../utils/logger"));
|
|
19
18
|
const attributes_1 = require("./questions/attributes");
|
|
20
19
|
const configuration_1 = require("./questions/configuration");
|
|
21
20
|
const validators_1 = require("./questions/helper/validators");
|
|
22
21
|
const deps_1 = require("../utils/deps");
|
|
23
|
-
const subgenHelpers_1 = require("../utils/subgenHelpers");
|
|
24
22
|
const parse_json_input_1 = require("../utils/parse-json-input");
|
|
23
|
+
const subgenHelpers_1 = require("../utils/subgenHelpers");
|
|
25
24
|
const appWizardCache_1 = require("../utils/appWizardCache");
|
|
26
25
|
const default_values_1 = require("./questions/helper/default-values");
|
|
26
|
+
const steps_1 = require("../utils/steps");
|
|
27
|
+
const workspace_1 = require("../utils/workspace");
|
|
27
28
|
/**
|
|
28
29
|
* Generator for creating an Adaptation Project.
|
|
29
30
|
*
|
|
@@ -34,6 +35,7 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
34
35
|
appWizard;
|
|
35
36
|
vscode;
|
|
36
37
|
toolsLogger;
|
|
38
|
+
isCli;
|
|
37
39
|
/**
|
|
38
40
|
* A boolean flag indicating whether node_modules should be installed after project generation.
|
|
39
41
|
*/
|
|
@@ -110,7 +112,7 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
110
112
|
this.options = opts;
|
|
111
113
|
this._setupLogging();
|
|
112
114
|
const jsonInputString = (0, parse_json_input_1.getFirstArgAsString)(args);
|
|
113
|
-
this.jsonInput = (0, parse_json_input_1.parseJsonInput)(jsonInputString, this.
|
|
115
|
+
this.jsonInput = (0, parse_json_input_1.parseJsonInput)(jsonInputString, this.logger);
|
|
114
116
|
if (!this.jsonInput) {
|
|
115
117
|
this.env.lookup({
|
|
116
118
|
packagePatterns: ['@sap/generator-fiori', '@sap-ux/adp-flp-config-sub-generator']
|
|
@@ -127,9 +129,10 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
127
129
|
}
|
|
128
130
|
async initializing() {
|
|
129
131
|
await (0, i18n_1.initI18n)();
|
|
130
|
-
this.
|
|
132
|
+
this.isCli = (0, fiori_generator_shared_1.isCli)();
|
|
133
|
+
this.layer = (0, layer_1.getFlexLayer)();
|
|
131
134
|
this.isCustomerBase = this.layer === "CUSTOMER_BASE" /* FlexLayer.CUSTOMER_BASE */;
|
|
132
|
-
this.systemLookup = new adp_tooling_1.SystemLookup(this.
|
|
135
|
+
this.systemLookup = new adp_tooling_1.SystemLookup(this.logger);
|
|
133
136
|
if (!this.jsonInput) {
|
|
134
137
|
this.prompts.splice(0, 0, (0, steps_1.getWizardPages)());
|
|
135
138
|
this.prompter = this._getOrCreatePrompter();
|
|
@@ -147,10 +150,9 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
147
150
|
if (this.jsonInput) {
|
|
148
151
|
return;
|
|
149
152
|
}
|
|
150
|
-
const isCLI = (0, fiori_generator_shared_1.getHostEnvironment)() === fiori_generator_shared_1.hostEnvironment.cli;
|
|
151
153
|
const configQuestions = this.prompter.getPrompts({
|
|
152
|
-
appValidationCli: { hide: !
|
|
153
|
-
systemValidationCli: { hide: !
|
|
154
|
+
appValidationCli: { hide: !this.isCli },
|
|
155
|
+
systemValidationCli: { hide: !this.isCli }
|
|
154
156
|
});
|
|
155
157
|
this.configAnswers = await this.prompt(configQuestions);
|
|
156
158
|
this.shouldCreateExtProject = !!this.configAnswers.shouldCreateExtProject;
|
|
@@ -170,7 +172,7 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
170
172
|
}
|
|
171
173
|
const options = {
|
|
172
174
|
targetFolder: { default: defaultFolder },
|
|
173
|
-
ui5ValidationCli: { hide: !
|
|
175
|
+
ui5ValidationCli: { hide: !this.isCli },
|
|
174
176
|
enableTypeScript: { hide: this.shouldCreateExtProject },
|
|
175
177
|
addFlpConfig: { hasBaseAppInbounds: !!this.baseAppInbounds }
|
|
176
178
|
};
|
|
@@ -244,11 +246,8 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
244
246
|
catch (e) {
|
|
245
247
|
this.logger.error(`Installation of dependencies failed: ${e.message}`);
|
|
246
248
|
}
|
|
247
|
-
finally {
|
|
248
|
-
(0, appWizardCache_1.cacheClear)(this.appWizard, this.logger);
|
|
249
|
-
}
|
|
250
249
|
}
|
|
251
|
-
end() {
|
|
250
|
+
async end() {
|
|
252
251
|
const telemetryData = fiori_generator_shared_1.TelemetryHelper.createTelemetryData({
|
|
253
252
|
appType: 'generator-adp',
|
|
254
253
|
...this.options.telemetryData
|
|
@@ -259,17 +258,23 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
259
258
|
this.logger.error((0, i18n_1.t)('error.telemetry', { error }));
|
|
260
259
|
});
|
|
261
260
|
}
|
|
261
|
+
if ((0, adp_tooling_1.isCFEnvironment)(projectPath) || this.isCli) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
262
264
|
try {
|
|
263
|
-
if (!(0,
|
|
264
|
-
this.vscode
|
|
265
|
+
if (!(0, workspace_1.existsInWorkspace)(this.vscode, projectPath)) {
|
|
266
|
+
const userChoice = await (0, workspace_1.showWorkspaceFolderWarning)(this.vscode, projectPath);
|
|
267
|
+
if (!userChoice) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
await (0, workspace_1.handleWorkspaceFolderChoice)(this.vscode, projectPath, userChoice);
|
|
271
|
+
return;
|
|
265
272
|
}
|
|
273
|
+
await this.vscode?.commands?.executeCommand?.('sap.ux.application.info', { fsPath: projectPath });
|
|
266
274
|
}
|
|
267
275
|
catch (e) {
|
|
268
276
|
this.appWizard.showError(e.message, yeoman_ui_types_1.MessageType.notification);
|
|
269
277
|
}
|
|
270
|
-
finally {
|
|
271
|
-
(0, appWizardCache_1.cacheClear)(this.appWizard, this.logger);
|
|
272
|
-
}
|
|
273
278
|
}
|
|
274
279
|
/**
|
|
275
280
|
* Retrieves the ConfigPrompter instance from cache if it exists, otherwise creates a new instance.
|
|
@@ -281,7 +286,7 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
281
286
|
if (cached) {
|
|
282
287
|
return cached;
|
|
283
288
|
}
|
|
284
|
-
const prompter = new configuration_1.ConfigPrompter(this.systemLookup, this.layer, this.
|
|
289
|
+
const prompter = new configuration_1.ConfigPrompter(this.systemLookup, this.layer, this.logger);
|
|
285
290
|
(0, appWizardCache_1.cachePut)(this.appWizard, { prompter }, this.logger);
|
|
286
291
|
return prompter;
|
|
287
292
|
}
|
|
@@ -314,14 +319,14 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
314
319
|
namespace,
|
|
315
320
|
system
|
|
316
321
|
});
|
|
317
|
-
this.publicVersions = await (0, adp_tooling_1.fetchPublicVersions)(this.
|
|
322
|
+
this.publicVersions = await (0, adp_tooling_1.fetchPublicVersions)(this.logger);
|
|
318
323
|
const providerOptions = {
|
|
319
324
|
system,
|
|
320
325
|
client,
|
|
321
326
|
username,
|
|
322
327
|
password
|
|
323
328
|
};
|
|
324
|
-
this.abapProvider = await (0, adp_tooling_1.getConfiguredProvider)(providerOptions, this.
|
|
329
|
+
this.abapProvider = await (0, adp_tooling_1.getConfiguredProvider)(providerOptions, this.logger);
|
|
325
330
|
const applications = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase);
|
|
326
331
|
const application = applications.find((application) => application.id === baseApplicationName);
|
|
327
332
|
if (!application) {
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { FlexLayer } from '@sap-ux/adp-tooling';
|
|
2
|
-
/**
|
|
3
|
-
* Determines whether the generator is being run in an internal context.
|
|
4
|
-
*
|
|
5
|
-
* @returns {Promise<boolean>} True if internal usage; otherwise, false.
|
|
6
|
-
*/
|
|
7
|
-
export declare function isInternalUsage(): Promise<boolean>;
|
|
8
2
|
/**
|
|
9
3
|
* Determines and returns the appropriate FlexLayer based on internal usage.
|
|
10
4
|
*
|
|
11
|
-
* @returns {
|
|
5
|
+
* @returns {FlexLayer} True if internal usage; otherwise, false.
|
|
12
6
|
*/
|
|
13
|
-
export declare function getFlexLayer():
|
|
7
|
+
export declare function getFlexLayer(): FlexLayer;
|
|
14
8
|
//# sourceMappingURL=layer.d.ts.map
|
package/generators/app/layer.js
CHANGED
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isInternalUsage = isInternalUsage;
|
|
4
3
|
exports.getFlexLayer = getFlexLayer;
|
|
5
|
-
const
|
|
6
|
-
const feature_toggle_node_1 = require("@sap-devx/feature-toggle-node");
|
|
7
|
-
/**
|
|
8
|
-
* Determines whether the generator is being run in an internal context.
|
|
9
|
-
*
|
|
10
|
-
* @returns {Promise<boolean>} True if internal usage; otherwise, false.
|
|
11
|
-
*/
|
|
12
|
-
async function isInternalUsage() {
|
|
13
|
-
if ((0, btp_utils_1.isAppStudio)()) {
|
|
14
|
-
return (0, feature_toggle_node_1.isFeatureEnabled)('adaptation-project', 'internal');
|
|
15
|
-
}
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
4
|
+
const feature_toggle_1 = require("@sap-ux/feature-toggle");
|
|
18
5
|
/**
|
|
19
6
|
* Determines and returns the appropriate FlexLayer based on internal usage.
|
|
20
7
|
*
|
|
21
|
-
* @returns {
|
|
8
|
+
* @returns {FlexLayer} True if internal usage; otherwise, false.
|
|
22
9
|
*/
|
|
23
|
-
|
|
24
|
-
const internal =
|
|
10
|
+
function getFlexLayer() {
|
|
11
|
+
const internal = (0, feature_toggle_1.isInternalFeaturesSettingEnabled)();
|
|
25
12
|
return internal ? "VENDOR" /* FlexLayer.VENDOR */ : "CUSTOMER_BASE" /* FlexLayer.CUSTOMER_BASE */;
|
|
26
13
|
}
|
|
27
14
|
//# sourceMappingURL=layer.js.map
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
"projectNameLengthErrorExt": "The name cannot contain more than 61 characters or end with the word 'component'.",
|
|
47
47
|
"projectNameValidationErrorExt": "The name must contain only latin alphanumeric characters. Different parts can be separated by a period and every part must start with a letter.",
|
|
48
48
|
"projectNameLengthErrorInt": "The name cannot start with the word 'customer', or contain more than 61 characters, or end with the word 'component'.",
|
|
49
|
-
"projectNameValidationErrorInt": "The name must contain only latin alphanumeric characters and it must have at least two parts. The different parts must be separated by a period and every part must start with a letter."
|
|
49
|
+
"projectNameValidationErrorInt": "The name must contain only latin alphanumeric characters and it must have at least two parts. The different parts must be separated by a period and every part must start with a letter.",
|
|
50
|
+
"projectNotInWorkspace": "The project: '{{- path}}' is not in the workspace. Some adaptation project tools may not work. What do you want to do?"
|
|
50
51
|
},
|
|
51
52
|
"error": {
|
|
52
53
|
"selectCannotBeEmptyError": "{{value}} has to be selected.",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AppWizard } from '@sap-devx/yeoman-ui-types';
|
|
2
|
-
import {
|
|
2
|
+
import type { ToolsLogger } from '@sap-ux/logger';
|
|
3
3
|
import type { ConfigPrompter } from '../app/questions/configuration';
|
|
4
4
|
/**
|
|
5
5
|
* Values that are stashed in the App-Wizard cache.
|
|
@@ -23,7 +23,7 @@ export type AppWizardWithCache = AppWizard & {
|
|
|
23
23
|
* @param {AppWizardWithCache} [wizard] - The AppWizard instance to augment with cache storage.
|
|
24
24
|
* @returns {void}
|
|
25
25
|
*/
|
|
26
|
-
export declare function initCache(logger:
|
|
26
|
+
export declare function initCache(logger: ToolsLogger, wizard?: AppWizardWithCache): void;
|
|
27
27
|
/**
|
|
28
28
|
* Stores or merges partial generator state in the AppWizard’s cache.
|
|
29
29
|
*
|
|
@@ -32,7 +32,7 @@ export declare function initCache(logger: ILogWrapper, wizard?: AppWizardWithCac
|
|
|
32
32
|
* @param {ILogWrapper} logger - Logger instance for diagnostics.
|
|
33
33
|
* @returns {void}
|
|
34
34
|
*/
|
|
35
|
-
export declare function cachePut(wizard: AppWizardWithCache | undefined, state: Partial<State>, logger:
|
|
35
|
+
export declare function cachePut(wizard: AppWizardWithCache | undefined, state: Partial<State>, logger: ToolsLogger): void;
|
|
36
36
|
/**
|
|
37
37
|
* Retrieves a cached value from the AppWizard instance by key.
|
|
38
38
|
*
|
|
@@ -42,7 +42,7 @@ export declare function cachePut(wizard: AppWizardWithCache | undefined, state:
|
|
|
42
42
|
* @param {ILogWrapper} logger - Logger instance used for diagnostics.
|
|
43
43
|
* @returns {T | undefined} - The cached value if present, otherwise `undefined`.
|
|
44
44
|
*/
|
|
45
|
-
export declare function cacheGet<T>(wizard: AppWizardWithCache | undefined, key: keyof State, logger:
|
|
45
|
+
export declare function cacheGet<T>(wizard: AppWizardWithCache | undefined, key: keyof State, logger: ToolsLogger): T | undefined;
|
|
46
46
|
/**
|
|
47
47
|
* Clears the entire generator state cache from the AppWizard instance.
|
|
48
48
|
*
|
|
@@ -50,6 +50,6 @@ export declare function cacheGet<T>(wizard: AppWizardWithCache | undefined, key:
|
|
|
50
50
|
* @param {ILogWrapper} logger - Logger instance for diagnostics.
|
|
51
51
|
* @returns {void}
|
|
52
52
|
*/
|
|
53
|
-
export declare function cacheClear(wizard: AppWizardWithCache | undefined, logger:
|
|
53
|
+
export declare function cacheClear(wizard: AppWizardWithCache | undefined, logger: ToolsLogger): void;
|
|
54
54
|
export {};
|
|
55
55
|
//# sourceMappingURL=appWizardCache.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ToolsLogger } from '@sap-ux/logger';
|
|
2
2
|
import type { AdpGeneratorOptions } from '../app/types';
|
|
3
3
|
/**
|
|
4
4
|
* Sets the header title in the AppWizard UI, if the `setHeaderTitle` method is available.
|
|
@@ -7,5 +7,5 @@ import type { AdpGeneratorOptions } from '../app/types';
|
|
|
7
7
|
* @param {AdpGeneratorOptions} opts - The generator options, potentially including the AppWizard instance.
|
|
8
8
|
* @param {IChildLogger} logger - Logger instance used for logging any errors that occur during execution.
|
|
9
9
|
*/
|
|
10
|
-
export declare function setHeaderTitle(opts: AdpGeneratorOptions, logger:
|
|
10
|
+
export declare function setHeaderTitle(opts: AdpGeneratorOptions, logger: ToolsLogger): void;
|
|
11
11
|
//# sourceMappingURL=opts.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type Generator from 'yeoman-generator';
|
|
2
2
|
import type { AppWizard } from '@sap-devx/yeoman-ui-types';
|
|
3
|
+
import type { ToolsLogger } from '@sap-ux/logger';
|
|
3
4
|
import type { ManifestNamespace } from '@sap-ux/project-access';
|
|
4
|
-
import type { ILogWrapper } from '@sap-ux/fiori-generator-shared';
|
|
5
5
|
import type { ConfigAnswers, AttributesAnswers, SystemLookup } from '@sap-ux/adp-tooling';
|
|
6
6
|
/**
|
|
7
7
|
* Parameters required for composing the extension project generator.
|
|
@@ -36,12 +36,11 @@ interface DeployGenOptions {
|
|
|
36
36
|
* @param {FlpGenProps} options - Configuration object for the FLP generator.
|
|
37
37
|
* @param {string} options.projectRootPath - Full path to the root of the project.
|
|
38
38
|
* @param {string} options.system - System identifier string.
|
|
39
|
-
* @param {Manifest} options.manifest - The manifest object to pass to the FLP generator.
|
|
40
39
|
* @param {Generator['composeWith']} composeWith - `composeWith` method provided by Yeoman Generator instance.
|
|
41
|
-
* @param {
|
|
40
|
+
* @param {ToolsLogger} logger - Logger instance for tracking operations and errors.
|
|
42
41
|
* @param {AppWizard} appWizard - AppWizard instance for interacting with the UI (optional).
|
|
43
42
|
*/
|
|
44
|
-
export declare function addFlpGen({ projectRootPath, vscode, inbounds }: FlpGenProps, composeWith: Generator['composeWith'], logger:
|
|
43
|
+
export declare function addFlpGen({ projectRootPath, vscode, inbounds }: FlpGenProps, composeWith: Generator['composeWith'], logger: ToolsLogger, appWizard: AppWizard): void;
|
|
45
44
|
/**
|
|
46
45
|
* Composes the Fiori deploy-config sub-generator using `composeWith`. This sub-generator configures
|
|
47
46
|
* deployment for Fiori applications, such as to ABAP or Cloud Foundry environments.
|
|
@@ -54,10 +53,10 @@ export declare function addFlpGen({ projectRootPath, vscode, inbounds }: FlpGenP
|
|
|
54
53
|
* @param {string} options.connectedSystem - (Optional) Connected system data
|
|
55
54
|
* @param {string} options.destinationName - (Optional) Destination name for deployment
|
|
56
55
|
* @param {Generator['composeWith']} composeWith - Yeoman composeWith method from generator context
|
|
57
|
-
* @param {
|
|
56
|
+
* @param {ToolsLogger} logger - Logger for info and error output
|
|
58
57
|
* @param {AppWizard} appWizard - Optional AppWizard instance for displaying UI messages
|
|
59
58
|
*/
|
|
60
|
-
export declare function addDeployGen({ projectName, targetFolder, client, connectedSystem, destinationName }: DeployGenOptions, composeWith: Generator['composeWith'], logger:
|
|
59
|
+
export declare function addDeployGen({ projectName, targetFolder, client, connectedSystem, destinationName }: DeployGenOptions, composeWith: Generator['composeWith'], logger: ToolsLogger, appWizard: AppWizard): void;
|
|
61
60
|
/**
|
|
62
61
|
* Composes the extension project sub-generator if the base app is unsupported.
|
|
63
62
|
*
|
|
@@ -66,9 +65,9 @@ export declare function addDeployGen({ projectName, targetFolder, client, connec
|
|
|
66
65
|
* @param {AttributesAnswers} options.attributeAnswers - The collected attribute prompt answers.
|
|
67
66
|
* @param {SystemLookup} options.systemLookup - Instance of the system lookup.
|
|
68
67
|
* @param {Generator['composeWith']} composeWith - `composeWith` method provided by Yeoman Generator instance.
|
|
69
|
-
* @param {
|
|
68
|
+
* @param {ToolsLogger} logger - Logger instance for tracking operations and errors.
|
|
70
69
|
* @param {AppWizard} appWizard - AppWizard instance for interacting with the UI (optional).
|
|
71
70
|
*/
|
|
72
|
-
export declare function addExtProjectGen({ configAnswers, attributeAnswers, systemLookup }: ExtProjectGenProps, composeWith: Generator['composeWith'], logger:
|
|
71
|
+
export declare function addExtProjectGen({ configAnswers, attributeAnswers, systemLookup }: ExtProjectGenProps, composeWith: Generator['composeWith'], logger: ToolsLogger, appWizard?: AppWizard): Promise<void>;
|
|
73
72
|
export {};
|
|
74
73
|
//# sourceMappingURL=subgenHelpers.d.ts.map
|
|
@@ -12,9 +12,8 @@ const extension_project_1 = require("../app/extension-project");
|
|
|
12
12
|
* @param {FlpGenProps} options - Configuration object for the FLP generator.
|
|
13
13
|
* @param {string} options.projectRootPath - Full path to the root of the project.
|
|
14
14
|
* @param {string} options.system - System identifier string.
|
|
15
|
-
* @param {Manifest} options.manifest - The manifest object to pass to the FLP generator.
|
|
16
15
|
* @param {Generator['composeWith']} composeWith - `composeWith` method provided by Yeoman Generator instance.
|
|
17
|
-
* @param {
|
|
16
|
+
* @param {ToolsLogger} logger - Logger instance for tracking operations and errors.
|
|
18
17
|
* @param {AppWizard} appWizard - AppWizard instance for interacting with the UI (optional).
|
|
19
18
|
*/
|
|
20
19
|
function addFlpGen({ projectRootPath, vscode, inbounds }, composeWith, logger, appWizard) {
|
|
@@ -48,7 +47,7 @@ function addFlpGen({ projectRootPath, vscode, inbounds }, composeWith, logger, a
|
|
|
48
47
|
* @param {string} options.connectedSystem - (Optional) Connected system data
|
|
49
48
|
* @param {string} options.destinationName - (Optional) Destination name for deployment
|
|
50
49
|
* @param {Generator['composeWith']} composeWith - Yeoman composeWith method from generator context
|
|
51
|
-
* @param {
|
|
50
|
+
* @param {ToolsLogger} logger - Logger for info and error output
|
|
52
51
|
* @param {AppWizard} appWizard - Optional AppWizard instance for displaying UI messages
|
|
53
52
|
*/
|
|
54
53
|
function addDeployGen({ projectName, targetFolder, client, connectedSystem, destinationName }, composeWith, logger, appWizard) {
|
|
@@ -81,7 +80,7 @@ function addDeployGen({ projectName, targetFolder, client, connectedSystem, dest
|
|
|
81
80
|
* @param {AttributesAnswers} options.attributeAnswers - The collected attribute prompt answers.
|
|
82
81
|
* @param {SystemLookup} options.systemLookup - Instance of the system lookup.
|
|
83
82
|
* @param {Generator['composeWith']} composeWith - `composeWith` method provided by Yeoman Generator instance.
|
|
84
|
-
* @param {
|
|
83
|
+
* @param {ToolsLogger} logger - Logger instance for tracking operations and errors.
|
|
85
84
|
* @param {AppWizard} appWizard - AppWizard instance for interacting with the UI (optional).
|
|
86
85
|
*/
|
|
87
86
|
async function addExtProjectGen({ configAnswers, attributeAnswers, systemLookup }, composeWith, logger, appWizard) {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const workspaceChoices: {
|
|
2
|
+
readonly OPEN_FOLDER: "Open Folder";
|
|
3
|
+
readonly ADD_TO_WORKSPACE: "Add Project to Workspace";
|
|
4
|
+
};
|
|
5
|
+
export type WorkspaceChoice = (typeof workspaceChoices)[keyof typeof workspaceChoices];
|
|
6
|
+
/**
|
|
7
|
+
* Checks if a given path exists in the VS Code workspace.
|
|
8
|
+
*
|
|
9
|
+
* @param vscode - The VS Code API instance
|
|
10
|
+
* @param {string} path - The path to check
|
|
11
|
+
* @returns {boolean} True if the path exists in the workspace, false otherwise
|
|
12
|
+
*/
|
|
13
|
+
export declare function existsInWorkspace(vscode: any, path: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Shows a warning message when a project is not in the workspace.
|
|
16
|
+
*
|
|
17
|
+
* @param vscode - The VS Code API instance
|
|
18
|
+
* @param {string} path - The path of the project
|
|
19
|
+
* @returns {Promise<WorkspaceChoice | undefined>} The user's choice or undefined if dismissed
|
|
20
|
+
*/
|
|
21
|
+
export declare function showWorkspaceFolderWarning(vscode: any, path: string): Promise<WorkspaceChoice | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* Handles the user's choice for workspace folder operations.
|
|
24
|
+
*
|
|
25
|
+
* @param vscode - The VS Code API instance
|
|
26
|
+
* @param {string} path - The path of the project
|
|
27
|
+
* @param {WorkspaceChoice} userChoice - The user's choice from the warning dialog
|
|
28
|
+
*/
|
|
29
|
+
export declare function handleWorkspaceFolderChoice(vscode: any, path: string, userChoice: WorkspaceChoice): Promise<void>;
|
|
30
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.workspaceChoices = void 0;
|
|
4
|
+
exports.existsInWorkspace = existsInWorkspace;
|
|
5
|
+
exports.showWorkspaceFolderWarning = showWorkspaceFolderWarning;
|
|
6
|
+
exports.handleWorkspaceFolderChoice = handleWorkspaceFolderChoice;
|
|
7
|
+
const i18n_1 = require("./i18n");
|
|
8
|
+
exports.workspaceChoices = {
|
|
9
|
+
OPEN_FOLDER: 'Open Folder',
|
|
10
|
+
ADD_TO_WORKSPACE: 'Add Project to Workspace'
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Checks if a given path exists in the VS Code workspace.
|
|
14
|
+
*
|
|
15
|
+
* @param vscode - The VS Code API instance
|
|
16
|
+
* @param {string} path - The path to check
|
|
17
|
+
* @returns {boolean} True if the path exists in the workspace, false otherwise
|
|
18
|
+
*/
|
|
19
|
+
function existsInWorkspace(vscode, path) {
|
|
20
|
+
const uri = vscode?.Uri?.file(path);
|
|
21
|
+
return !!vscode.workspace.getWorkspaceFolder(uri);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Shows a warning message when a project is not in the workspace.
|
|
25
|
+
*
|
|
26
|
+
* @param vscode - The VS Code API instance
|
|
27
|
+
* @param {string} path - The path of the project
|
|
28
|
+
* @returns {Promise<WorkspaceChoice | undefined>} The user's choice or undefined if dismissed
|
|
29
|
+
*/
|
|
30
|
+
async function showWorkspaceFolderWarning(vscode, path) {
|
|
31
|
+
return vscode.window.showWarningMessage((0, i18n_1.t)('prompts.projectNotInWorkspace', { path }), { modal: true }, exports.workspaceChoices.OPEN_FOLDER, exports.workspaceChoices.ADD_TO_WORKSPACE);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Handles the user's choice for workspace folder operations.
|
|
35
|
+
*
|
|
36
|
+
* @param vscode - The VS Code API instance
|
|
37
|
+
* @param {string} path - The path of the project
|
|
38
|
+
* @param {WorkspaceChoice} userChoice - The user's choice from the warning dialog
|
|
39
|
+
*/
|
|
40
|
+
async function handleWorkspaceFolderChoice(vscode, path, userChoice) {
|
|
41
|
+
const { workspace, commands } = vscode;
|
|
42
|
+
const uri = vscode?.Uri?.file(path);
|
|
43
|
+
if (userChoice === exports.workspaceChoices.OPEN_FOLDER) {
|
|
44
|
+
await commands.executeCommand('vscode.openFolder', uri);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
const foldersCount = workspace?.workspaceFolders?.length ?? 0;
|
|
48
|
+
/**
|
|
49
|
+
* If you add project to a plane VS Code instance, VS Code creates a new window with workspace
|
|
50
|
+
* containing the project and the onDidChangeWorkspaceFolders event is not fired.
|
|
51
|
+
* In that case foldersCount is 0.
|
|
52
|
+
*/
|
|
53
|
+
if (foldersCount) {
|
|
54
|
+
/**
|
|
55
|
+
* Waits for the folder to be added to the workspace.
|
|
56
|
+
*/
|
|
57
|
+
const didChangeWorkspaceFoldersOnce = workspace?.onDidChangeWorkspaceFolders(() => {
|
|
58
|
+
didChangeWorkspaceFoldersOnce.dispose();
|
|
59
|
+
commands.executeCommand('sap.ux.application.info', { fsPath: path });
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
workspace.updateWorkspaceFolders(foldersCount, null, {
|
|
63
|
+
uri
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=workspace.js.map
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@sap-ux/generator-adp",
|
|
3
3
|
"displayName": "SAPUI5 Adaptation Project",
|
|
4
4
|
"description": "Adaptation project allows you to create an app variant for an existing SAP Fiori elements-based or SAPUI5 freestyle application, without changing the original application.",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.32",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
"i18next": "23.5.1",
|
|
30
30
|
"yeoman-generator": "5.10.0",
|
|
31
31
|
"uuid": "10.0.0",
|
|
32
|
-
"@sap-ux/adp-tooling": "0.14.
|
|
32
|
+
"@sap-ux/adp-tooling": "0.14.32",
|
|
33
33
|
"@sap-ux/axios-extension": "1.22.3",
|
|
34
34
|
"@sap-ux/btp-utils": "1.1.0",
|
|
35
35
|
"@sap-ux/feature-toggle": "0.3.0",
|
|
36
|
-
"@sap-ux/inquirer-common": "0.7.
|
|
36
|
+
"@sap-ux/inquirer-common": "0.7.16",
|
|
37
37
|
"@sap-ux/logger": "0.7.0",
|
|
38
38
|
"@sap-ux/project-access": "1.30.3",
|
|
39
|
-
"@sap-ux/store": "1.1.
|
|
40
|
-
"@sap-ux/system-access": "0.6.
|
|
41
|
-
"@sap-ux/project-input-validator": "0.6.
|
|
42
|
-
"@sap-ux/fiori-generator-shared": "0.12.
|
|
43
|
-
"@sap-ux/adp-flp-config-sub-generator": "0.1.
|
|
39
|
+
"@sap-ux/store": "1.1.1",
|
|
40
|
+
"@sap-ux/system-access": "0.6.9",
|
|
41
|
+
"@sap-ux/project-input-validator": "0.6.5",
|
|
42
|
+
"@sap-ux/fiori-generator-shared": "0.12.11",
|
|
43
|
+
"@sap-ux/adp-flp-config-sub-generator": "0.1.32"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@jest/types": "29.6.3",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"fs-extra": "10.0.0",
|
|
56
56
|
"rimraf": "5.0.5",
|
|
57
57
|
"yeoman-test": "6.3.0",
|
|
58
|
-
"@sap-ux/deploy-config-sub-generator": "0.3.
|
|
58
|
+
"@sap-ux/deploy-config-sub-generator": "0.3.27"
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=20.x"
|