@sap-ux/launch-config 0.4.3 → 0.5.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/debug-config/config.d.ts +2 -1
- package/dist/debug-config/config.d.ts.map +1 -1
- package/dist/debug-config/config.js +14 -14
- package/dist/debug-config/config.js.map +1 -1
- package/dist/debug-config/workspaceManager.d.ts +2 -32
- package/dist/debug-config/workspaceManager.d.ts.map +1 -1
- package/dist/debug-config/workspaceManager.js +11 -13
- package/dist/debug-config/workspaceManager.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/launch-config-crud/create.d.ts +3 -35
- package/dist/launch-config-crud/create.d.ts.map +1 -1
- package/dist/launch-config-crud/create.js +108 -100
- package/dist/launch-config-crud/create.js.map +1 -1
- package/dist/types/types.d.ts +12 -5
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js +11 -1
- package/dist/types/types.js.map +1 -1
- package/package.json +3 -5
|
@@ -2,9 +2,10 @@ import type { LaunchJSON, DebugOptions } from '../types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Configures the launch.json file based on provided options.
|
|
4
4
|
*
|
|
5
|
+
* @param rootFolder - The root folder path where the app will be generated.
|
|
5
6
|
* @param {string} cwd - The current working directory.
|
|
6
7
|
* @param {DebugOptions} configOpts - Configuration options for the launch.json file.
|
|
7
8
|
* @returns {LaunchJSON} The configured launch.json object.
|
|
8
9
|
*/
|
|
9
|
-
export declare function configureLaunchJsonFile(cwd: string, configOpts: DebugOptions): LaunchJSON;
|
|
10
|
+
export declare function configureLaunchJsonFile(rootFolder: string, cwd: string, configOpts: DebugOptions): LaunchJSON;
|
|
10
11
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/debug-config/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/debug-config/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,UAAU,EAAE,YAAY,EAAmB,MAAM,UAAU,CAAC;AAoDxF;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,GAAG,UAAU,CA0E7G"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.configureLaunchJsonFile = void 0;
|
|
4
|
-
const odata_service_inquirer_1 = require("@sap-ux/odata-service-inquirer");
|
|
5
4
|
const path_1 = require("path");
|
|
6
5
|
const utils_1 = require("../launch-config-crud/utils");
|
|
7
6
|
const types_1 = require("../types");
|
|
@@ -26,7 +25,7 @@ function getEnvUrlParams(sapClientParam) {
|
|
|
26
25
|
return sapClientParam ? `${sapClientParam}&${disableCacheParam}` : disableCacheParam;
|
|
27
26
|
}
|
|
28
27
|
/**
|
|
29
|
-
*
|
|
28
|
+
* Gets launch configuration.
|
|
30
29
|
*
|
|
31
30
|
* @param {string} name - The name of the configuration.
|
|
32
31
|
* @param {string} cwd - The current working directory.
|
|
@@ -36,7 +35,7 @@ function getEnvUrlParams(sapClientParam) {
|
|
|
36
35
|
* @param {string} [runConfig] - The optional run configuration for AppStudio.
|
|
37
36
|
* @returns {LaunchConfig} The launch configuration object.
|
|
38
37
|
*/
|
|
39
|
-
function
|
|
38
|
+
function configureLaunchConfig(name, cwd, runtimeArgs, cmdArgs, envVars, runConfig) {
|
|
40
39
|
const config = (0, utils_1.getLaunchConfig)(name, cwd, runtimeArgs, cmdArgs, envVars);
|
|
41
40
|
if (runConfig) {
|
|
42
41
|
// runConfig is only used in BAS
|
|
@@ -47,43 +46,44 @@ function createLaunchConfig(name, cwd, runtimeArgs, cmdArgs, envVars, runConfig)
|
|
|
47
46
|
/**
|
|
48
47
|
* Configures the launch.json file based on provided options.
|
|
49
48
|
*
|
|
49
|
+
* @param rootFolder - The root folder path where the app will be generated.
|
|
50
50
|
* @param {string} cwd - The current working directory.
|
|
51
51
|
* @param {DebugOptions} configOpts - Configuration options for the launch.json file.
|
|
52
52
|
* @returns {LaunchJSON} The configured launch.json object.
|
|
53
53
|
*/
|
|
54
|
-
function configureLaunchJsonFile(cwd, configOpts) {
|
|
55
|
-
const {
|
|
56
|
-
const projectName = (0, path_1.basename)(
|
|
54
|
+
function configureLaunchJsonFile(rootFolder, cwd, configOpts) {
|
|
55
|
+
const { isAppStudio, datasourceType, flpAppId, flpSandboxAvailable, sapClientParam, odataVersion, isMigrator, isFioriElement, migratorMockIntent } = configOpts;
|
|
56
|
+
const projectName = (0, path_1.basename)(rootFolder);
|
|
57
57
|
const flpAppIdWithHash = flpAppId && !flpAppId.startsWith('#') ? `#${flpAppId}` : flpAppId;
|
|
58
58
|
const startHtmlFile = flpSandboxAvailable ? testFlpSandboxHtml : indexHtml;
|
|
59
59
|
const runConfig = isAppStudio
|
|
60
60
|
? JSON.stringify({
|
|
61
61
|
handlerId: types_1.FIORI_TOOLS_LAUNCH_CONFIG_HANDLER_ID,
|
|
62
|
-
runnableId:
|
|
62
|
+
runnableId: rootFolder
|
|
63
63
|
})
|
|
64
64
|
: undefined;
|
|
65
65
|
const envUrlParam = getEnvUrlParams(sapClientParam);
|
|
66
66
|
const launchFile = { version: '0.2.0', configurations: [] };
|
|
67
67
|
// Add live configuration if the datasource is not from a metadata file
|
|
68
|
-
if (datasourceType !==
|
|
68
|
+
if (datasourceType !== types_1.ProjectDataSourceType.metadataFile) {
|
|
69
69
|
const startCommand = `${startHtmlFile}${flpAppIdWithHash}`;
|
|
70
|
-
const liveConfig =
|
|
70
|
+
const liveConfig = configureLaunchConfig(`Start ${projectName}`, cwd, ['fiori', 'run'], ['--open', startCommand], { DEBUG: '--inspect', FIORI_TOOLS_URL_PARAMS: envUrlParam }, runConfig);
|
|
71
71
|
launchFile.configurations.push(liveConfig);
|
|
72
72
|
}
|
|
73
73
|
// Add mock configuration for OData V2 or V4
|
|
74
|
-
if (odataVersion && [
|
|
74
|
+
if (odataVersion && ['2.0', '4.0'].includes(odataVersion)) {
|
|
75
75
|
const params = `${flpAppIdWithHash ?? ''}`;
|
|
76
|
-
const mockCmdArgs = isMigrator && odataVersion ===
|
|
76
|
+
const mockCmdArgs = isMigrator && odataVersion === '2.0'
|
|
77
77
|
? ['--open', `${testFlpSandboxMockServerHtml}${params}`]
|
|
78
78
|
: ['--config', './ui5-mock.yaml', '--open', `${testFlpSandboxHtml}${params}`];
|
|
79
|
-
const mockConfig =
|
|
79
|
+
const mockConfig = configureLaunchConfig(`Start ${projectName} Mock`, cwd, ['fiori', 'run'], mockCmdArgs, { FIORI_TOOLS_URL_PARAMS: envUrlParam }, runConfig);
|
|
80
80
|
launchFile.configurations.push(mockConfig);
|
|
81
81
|
}
|
|
82
82
|
// Add local configuration
|
|
83
|
-
const shouldUseMockServer = isFioriElement && odataVersion ===
|
|
83
|
+
const shouldUseMockServer = isFioriElement && odataVersion === '2.0' && isMigrator;
|
|
84
84
|
const localHtmlFile = shouldUseMockServer ? testFlpSandboxMockServerHtml : startHtmlFile;
|
|
85
85
|
const startLocalCommand = `${localHtmlFile}${migratorMockIntent ? `#${migratorMockIntent.replace('#', '')}` : flpAppIdWithHash}`;
|
|
86
|
-
const localConfig =
|
|
86
|
+
const localConfig = configureLaunchConfig(`Start ${projectName} Local`, cwd, ['fiori', 'run'], ['--config', './ui5-local.yaml', '--open', startLocalCommand], { FIORI_TOOLS_URL_PARAMS: envUrlParam }, runConfig);
|
|
87
87
|
launchFile.configurations.push(localConfig);
|
|
88
88
|
return launchFile;
|
|
89
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/debug-config/config.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"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GAAG,kBAAkB,GAAG,MAAM,EAAE,CAAC,CAAC;QACtF,MAAM,UAAU,GAAG,qBAAqB,CACpC,SAAS,WAAW,OAAO,EAC3B,GAAG,EACH,CAAC,OAAO,EAAE,KAAK,CAAC,EAChB,WAAW,EACX,EAAE,sBAAsB,EAAE,WAAW,EAAE,EACvC,SAAS,CACZ,CAAC;QACF,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED,0BAA0B;IAC1B,MAAM,mBAAmB,GAAG,cAAc,IAAI,YAAY,KAAK,KAAK,IAAI,UAAU,CAAC;IACnF,MAAM,aAAa,GAAG,mBAAmB,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,aAAa,CAAC;IACzF,MAAM,iBAAiB,GAAG,GAAG,aAAa,GACtC,kBAAkB,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,gBACrE,EAAE,CAAC;IACH,MAAM,WAAW,GAAG,qBAAqB,CACrC,SAAS,WAAW,QAAQ,EAC5B,GAAG,EACH,CAAC,OAAO,EAAE,KAAK,CAAC,EAChB,CAAC,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAAE,iBAAiB,CAAC,EAC7D,EAAE,sBAAsB,EAAE,WAAW,EAAE,EACvC,SAAS,CACZ,CAAC;IACF,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAE5C,OAAO,UAAU,CAAC;AACtB,CAAC;AA1ED,0DA0EC"}
|
|
@@ -1,40 +1,10 @@
|
|
|
1
1
|
import type { DebugOptions, WorkspaceHandlerInfo } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Handles the case where an unsaved workspace is open and the user creates an app in a folder outside of the workspace.
|
|
4
|
-
* This function updates the paths to reflect where the (possibly nested) target folder is located inside the workspace.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} projectPath - The project's folder path including project name.
|
|
7
|
-
* @param {any} vscode - The VS Code API object.
|
|
8
|
-
* @returns {WorkspaceHandlerInfo} An object containing the path to the `launch.json` configuration file and the cwd for the launch configuration.
|
|
9
|
-
*/
|
|
10
|
-
export declare function handleUnsavedWorkspace(projectPath: string, vscode: any): WorkspaceHandlerInfo;
|
|
11
|
-
/**
|
|
12
|
-
* Handles the case where a previously saved workspace is open, and the user creates an app within or outside the workspace.
|
|
13
|
-
* The function determines whether the project is inside the workspace and updates the launch configurations accordingly.
|
|
14
|
-
*
|
|
15
|
-
* @param {string} projectPath - The project's path including project name.
|
|
16
|
-
* @param {string} projectName - The name of the project.
|
|
17
|
-
* @param {string} targetFolder - The directory in which the project's files are located.
|
|
18
|
-
* @param isAppStudio - A boolean indicating whether the current environment is BAS.
|
|
19
|
-
* @param {any} vscode - The VS Code API object.
|
|
20
|
-
* @returns {WorkspaceHandlerInfo} An object containing the path to the `launch.json` configuration file and the cwd for the launch configuration.
|
|
21
|
-
*/
|
|
22
|
-
export declare function handleSavedWorkspace(projectPath: string, projectName: string, targetFolder: string, isAppStudio: boolean, vscode: any): WorkspaceHandlerInfo;
|
|
23
|
-
/**
|
|
24
|
-
* Handles the case where a folder is open in VS Code, but no workspace file is associated with it.
|
|
25
|
-
*
|
|
26
|
-
* @param {string} projectPath - The project's path including project name.
|
|
27
|
-
* @param {string} targetFolder - The directory in which the project's files are located.
|
|
28
|
-
* @param isAppStudio - A boolean indicating whether the current environment is BAS.
|
|
29
|
-
* @param {any} vscode - The VS Code API object.
|
|
30
|
-
* @returns {WorkspaceHandlerInfo} An object containing the path to the `launch.json` configuration file and the cwd for the launch configuration.
|
|
31
|
-
*/
|
|
32
|
-
export declare function handleOpenFolderButNoWorkspaceFile(projectPath: string, targetFolder: string, isAppStudio: boolean, vscode: any): WorkspaceHandlerInfo;
|
|
33
2
|
/**
|
|
34
3
|
* Manages the configuration of the debug workspace based on the provided options.
|
|
35
4
|
* This function handles different scenarios depending on whether a workspace is open,
|
|
36
5
|
* whether the project is inside or outside of a workspace, and other factors.
|
|
37
6
|
*
|
|
7
|
+
* @param rootFolder - The root folder path where the app will be generated.
|
|
38
8
|
* @param {DebugOptions} options - The options used to determine how to manage the workspace configuration.
|
|
39
9
|
* @param {string} options.projectPath -The project's path including project name.
|
|
40
10
|
* @param {boolean} [options.isAppStudio] - A boolean indicating whether the current environment is BAS.
|
|
@@ -42,5 +12,5 @@ export declare function handleOpenFolderButNoWorkspaceFile(projectPath: string,
|
|
|
42
12
|
* @param {any} options.vscode - The VS Code API object.
|
|
43
13
|
* @returns {WorkspaceHandlerInfo} An object containing the path to the `launch.json` configuration file, the cwd command, workspaceFolderUri if provided will enable reload.
|
|
44
14
|
*/
|
|
45
|
-
export declare function handleWorkspaceConfig(options: DebugOptions): WorkspaceHandlerInfo;
|
|
15
|
+
export declare function handleWorkspaceConfig(rootFolder: string, options: DebugOptions): WorkspaceHandlerInfo;
|
|
46
16
|
//# sourceMappingURL=workspaceManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaceManager.d.ts","sourceRoot":"","sources":["../../src/debug-config/workspaceManager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"workspaceManager.d.ts","sourceRoot":"","sources":["../../src/debug-config/workspaceManager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AA+EnE;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,oBAAoB,CA0BrG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleWorkspaceConfig =
|
|
3
|
+
exports.handleWorkspaceConfig = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const helpers_1 = require("./helpers");
|
|
6
6
|
/**
|
|
@@ -20,7 +20,6 @@ function handleUnsavedWorkspace(projectPath, vscode) {
|
|
|
20
20
|
cwd: (0, helpers_1.formatCwd)(nestedFolder)
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
exports.handleUnsavedWorkspace = handleUnsavedWorkspace;
|
|
24
23
|
/**
|
|
25
24
|
* Handles the case where a previously saved workspace is open, and the user creates an app within or outside the workspace.
|
|
26
25
|
* The function determines whether the project is inside the workspace and updates the launch configurations accordingly.
|
|
@@ -43,7 +42,6 @@ function handleSavedWorkspace(projectPath, projectName, targetFolder, isAppStudi
|
|
|
43
42
|
cwd: (0, helpers_1.formatCwd)(projectName)
|
|
44
43
|
};
|
|
45
44
|
}
|
|
46
|
-
exports.handleSavedWorkspace = handleSavedWorkspace;
|
|
47
45
|
/**
|
|
48
46
|
* Handles the case where a folder is open in VS Code, but no workspace file is associated with it.
|
|
49
47
|
*
|
|
@@ -67,12 +65,12 @@ function handleOpenFolderButNoWorkspaceFile(projectPath, targetFolder, isAppStud
|
|
|
67
65
|
cwd: (0, helpers_1.formatCwd)(nestedFolder)
|
|
68
66
|
};
|
|
69
67
|
}
|
|
70
|
-
exports.handleOpenFolderButNoWorkspaceFile = handleOpenFolderButNoWorkspaceFile;
|
|
71
68
|
/**
|
|
72
69
|
* Manages the configuration of the debug workspace based on the provided options.
|
|
73
70
|
* This function handles different scenarios depending on whether a workspace is open,
|
|
74
71
|
* whether the project is inside or outside of a workspace, and other factors.
|
|
75
72
|
*
|
|
73
|
+
* @param rootFolder - The root folder path where the app will be generated.
|
|
76
74
|
* @param {DebugOptions} options - The options used to determine how to manage the workspace configuration.
|
|
77
75
|
* @param {string} options.projectPath -The project's path including project name.
|
|
78
76
|
* @param {boolean} [options.isAppStudio] - A boolean indicating whether the current environment is BAS.
|
|
@@ -80,30 +78,30 @@ exports.handleOpenFolderButNoWorkspaceFile = handleOpenFolderButNoWorkspaceFile;
|
|
|
80
78
|
* @param {any} options.vscode - The VS Code API object.
|
|
81
79
|
* @returns {WorkspaceHandlerInfo} An object containing the path to the `launch.json` configuration file, the cwd command, workspaceFolderUri if provided will enable reload.
|
|
82
80
|
*/
|
|
83
|
-
function handleWorkspaceConfig(options) {
|
|
84
|
-
const {
|
|
85
|
-
const projectName = (0, path_1.basename)(
|
|
86
|
-
const targetFolder = (0, path_1.dirname)(
|
|
81
|
+
function handleWorkspaceConfig(rootFolder, options) {
|
|
82
|
+
const { isAppStudio = false, writeToAppOnly = false, vscode } = options;
|
|
83
|
+
const projectName = (0, path_1.basename)(rootFolder);
|
|
84
|
+
const targetFolder = (0, path_1.dirname)(rootFolder);
|
|
87
85
|
// Directly handle the case where we ignore workspace settings
|
|
88
86
|
if (writeToAppOnly) {
|
|
89
|
-
return (0, helpers_1.handleAppsNotInWorkspace)(
|
|
87
|
+
return (0, helpers_1.handleAppsNotInWorkspace)(rootFolder, isAppStudio, vscode);
|
|
90
88
|
}
|
|
91
89
|
const workspace = vscode.workspace;
|
|
92
90
|
const workspaceFile = workspace?.workspaceFile;
|
|
93
91
|
// Handles the scenario where no workspace or folder is open in VS Code.
|
|
94
92
|
if (!workspace) {
|
|
95
|
-
return (0, helpers_1.handleAppsNotInWorkspace)(
|
|
93
|
+
return (0, helpers_1.handleAppsNotInWorkspace)(rootFolder, isAppStudio, vscode);
|
|
96
94
|
}
|
|
97
95
|
// Handle case where a folder is open, but not a workspace file
|
|
98
96
|
if (!workspaceFile) {
|
|
99
|
-
return handleOpenFolderButNoWorkspaceFile(
|
|
97
|
+
return handleOpenFolderButNoWorkspaceFile(rootFolder, targetFolder, isAppStudio, vscode);
|
|
100
98
|
}
|
|
101
99
|
// Handles the case where a previously saved workspace is open
|
|
102
100
|
if (workspaceFile.scheme === 'file') {
|
|
103
|
-
return handleSavedWorkspace(
|
|
101
|
+
return handleSavedWorkspace(rootFolder, projectName, targetFolder, isAppStudio, vscode);
|
|
104
102
|
}
|
|
105
103
|
// Handles the case where an unsaved workspace is open
|
|
106
|
-
return handleUnsavedWorkspace(
|
|
104
|
+
return handleUnsavedWorkspace(rootFolder, vscode);
|
|
107
105
|
}
|
|
108
106
|
exports.handleWorkspaceConfig = handleWorkspaceConfig;
|
|
109
107
|
//# sourceMappingURL=workspaceManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaceManager.js","sourceRoot":"","sources":["../../src/debug-config/workspaceManager.ts"],"names":[],"mappings":";;;AAAA,+BAAyD;AAEzD,uCAAwG;AAExG;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"workspaceManager.js","sourceRoot":"","sources":["../../src/debug-config/workspaceManager.ts"],"names":[],"mappings":";;;AAAA,+BAAyD;AAEzD,uCAAwG;AAExG;;;;;;;GAOG;AACH,SAAS,sBAAsB,CAAC,WAAmB,EAAE,MAAW;IAC5D,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IACnC,MAAM,QAAQ,GAAG,SAAS,CAAC,kBAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC;IACzF,MAAM,YAAY,GAAG,IAAA,eAAQ,EAAC,QAAQ,IAAI,WAAW,EAAE,WAAW,CAAC,CAAC;IACpE,OAAO;QACH,cAAc,EAAE,IAAA,WAAI,EAAC,QAAQ,IAAI,WAAW,CAAC;QAC7C,GAAG,EAAE,IAAA,mBAAS,EAAC,YAAY,CAAC;KAC/B,CAAC;AACN,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,oBAAoB,CACzB,WAAmB,EACnB,WAAmB,EACnB,YAAoB,EACpB,WAAoB,EACpB,MAAW;IAEX,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IACnC,IAAI,CAAC,IAAA,6BAAmB,EAAC,WAAW,EAAE,SAAS,CAAC,EAAE,CAAC;QAC/C,OAAO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G,IAAA,cAAO,EAAC,UAAU,CAAC,CAAC;IAEzC,8DAA8D;IAC9D,IAAI,cAAc,EAAE,CAAC;QACjB,OAAO,IAAA,kCAAwB,EAAC,UAAU,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IACnC,MAAM,aAAa,GAAG,SAAS,EAAE,aAAa,CAAC;IAC/C,wEAAwE;IACxE,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,OAAO,IAAA,kCAAwB,EAAC,UAAU,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC;IACD,+DAA+D;IAC/D,IAAI,CAAC,aAAa,EAAE,CAAC;QACjB,OAAO,kCAAkC,CAAC,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC7F,CAAC;IACD,8DAA8D;IAC9D,IAAI,aAAa,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QAClC,OAAO,oBAAoB,CAAC,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC5F,CAAC;IACD,sDAAsD;IACtD,OAAO,sBAAsB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AA1BD,sDA0BC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './types';
|
|
2
|
-
export { createLaunchConfig
|
|
2
|
+
export { createLaunchConfig } from './launch-config-crud/create';
|
|
3
3
|
export { deleteLaunchConfig } from './launch-config-crud/delete';
|
|
4
4
|
export { convertOldLaunchConfigToFioriRun } from './launch-config-crud/modify';
|
|
5
5
|
export { getLaunchConfigs, getLaunchConfigByName } from './launch-config-crud/read';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAC/G,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,uCAAuC,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,11 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.getDefaultLaunchConfigOptionsForProject = exports.updateLaunchJSON = exports.generateNewFioriLaunchConfig = exports.getFioriOptions = exports.getIndexOfArgument = exports.updateLaunchConfig = exports.getLaunchConfigByName = exports.getLaunchConfigs = exports.convertOldLaunchConfigToFioriRun = exports.deleteLaunchConfig = exports.
|
|
17
|
+
exports.getDefaultLaunchConfigOptionsForProject = exports.updateLaunchJSON = exports.generateNewFioriLaunchConfig = exports.getFioriOptions = exports.getIndexOfArgument = exports.updateLaunchConfig = exports.getLaunchConfigByName = exports.getLaunchConfigs = exports.convertOldLaunchConfigToFioriRun = exports.deleteLaunchConfig = exports.createLaunchConfig = void 0;
|
|
18
18
|
__exportStar(require("./types"), exports);
|
|
19
19
|
var create_1 = require("./launch-config-crud/create");
|
|
20
20
|
Object.defineProperty(exports, "createLaunchConfig", { enumerable: true, get: function () { return create_1.createLaunchConfig; } });
|
|
21
|
-
Object.defineProperty(exports, "configureLaunchConfig", { enumerable: true, get: function () { return create_1.configureLaunchConfig; } });
|
|
22
21
|
var delete_1 = require("./launch-config-crud/delete");
|
|
23
22
|
Object.defineProperty(exports, "deleteLaunchConfig", { enumerable: true, get: function () { return delete_1.deleteLaunchConfig; } });
|
|
24
23
|
var modify_1 = require("./launch-config-crud/modify");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,sDAAiE;AAAxD,4GAAA,kBAAkB,OAAA;AAC3B,sDAAiE;AAAxD,4GAAA,kBAAkB,OAAA;AAC3B,sDAA+E;AAAtE,0HAAA,gCAAgC,OAAA;AACzC,kDAAoF;AAA3E,wGAAA,gBAAgB,OAAA;AAAE,6GAAA,qBAAqB,OAAA;AAChD,sDAAiE;AAAxD,4GAAA,kBAAkB,OAAA;AAC3B,oDAA+G;AAAtG,2GAAA,kBAAkB,OAAA;AAAE,wGAAA,eAAe,OAAA;AAAE,qHAAA,4BAA4B,OAAA;AAC1E,sDAA+D;AAAtD,0GAAA,gBAAgB,OAAA;AACzB,uDAAsF;AAA7E,kIAAA,uCAAuC,OAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FioriOptions
|
|
1
|
+
import type { FioriOptions } from '../types';
|
|
2
2
|
import type { Editor } from 'mem-fs-editor';
|
|
3
3
|
import type { Logger } from '@sap-ux/logger';
|
|
4
4
|
/**
|
|
@@ -7,40 +7,8 @@ import type { Logger } from '@sap-ux/logger';
|
|
|
7
7
|
* @param rootFolder - workspace root folder.
|
|
8
8
|
* @param fioriOptions - options for the new launch config.
|
|
9
9
|
* @param fs - optional, the memfs editor instance.
|
|
10
|
+
* @param logger - optional, the logger instance.
|
|
10
11
|
* @returns memfs editor instance.
|
|
11
12
|
*/
|
|
12
|
-
export declare function createLaunchConfig(rootFolder: string, fioriOptions: FioriOptions, fs?: Editor): Promise<Editor>;
|
|
13
|
-
/**
|
|
14
|
-
* Writes the application info settings to the appInfo.json file.
|
|
15
|
-
* Adds the specified path to the latestGeneratedFiles array.
|
|
16
|
-
*
|
|
17
|
-
* @param {string} path - The project file path to add.
|
|
18
|
-
* @param log - The logger instance.
|
|
19
|
-
*/
|
|
20
|
-
export declare function writeApplicationInfoSettings(path: string, log?: Logger): void;
|
|
21
|
-
/**
|
|
22
|
-
* Updates the workspace folders in VSCode if the update options are provided.
|
|
23
|
-
*
|
|
24
|
-
* @param {UpdateWorkspaceFolderOptions} updateWorkspaceFolders - The options for updating workspace folders.
|
|
25
|
-
* @param {string} rootFolderPath - The root folder path of the project.
|
|
26
|
-
* @param log - The logger instance.
|
|
27
|
-
*/
|
|
28
|
-
export declare function updateWorkspaceFoldersIfNeeded(updateWorkspaceFolders: UpdateWorkspaceFolderOptions | undefined, rootFolderPath: string, log?: Logger): void;
|
|
29
|
-
/**
|
|
30
|
-
* Creates or updates the launch.json file with the provided configurations.
|
|
31
|
-
*
|
|
32
|
-
* @param {string} rootFolderPath - The root folder path of the project.
|
|
33
|
-
* @param {LaunchJSON} launchJsonFile - The launch.json configuration to write.
|
|
34
|
-
* @param {UpdateWorkspaceFolderOptions} [updateWorkspaceFolders] - Optional workspace folder update options.
|
|
35
|
-
* @param {boolean} appNotInWorkspace - Indicates if the app is not in the workspace.
|
|
36
|
-
* @param log - The logger instance.
|
|
37
|
-
*/
|
|
38
|
-
export declare function createOrUpdateLaunchConfigJSON(rootFolderPath: string, launchJsonFile?: LaunchJSON, updateWorkspaceFolders?: UpdateWorkspaceFolderOptions, appNotInWorkspace?: boolean, log?: Logger): void;
|
|
39
|
-
/**
|
|
40
|
-
* Generates and creates launch configuration for the project based on debug options.
|
|
41
|
-
*
|
|
42
|
-
* @param {DebugOptions} options - The options for configuring the debug setup.
|
|
43
|
-
* @param log - The logger instance.
|
|
44
|
-
*/
|
|
45
|
-
export declare function configureLaunchConfig(options: DebugOptions, log?: Logger): void;
|
|
13
|
+
export declare function createLaunchConfig(rootFolder: string, fioriOptions: FioriOptions, fs?: Editor, logger?: Logger): Promise<Editor>;
|
|
46
14
|
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/launch-config-crud/create.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/launch-config-crud/create.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAwE,MAAM,UAAU,CAAC;AACnH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAM5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAmK7C;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACpC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,YAAY,EAC1B,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAcjB"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
3
|
+
exports.createLaunchConfig = void 0;
|
|
7
4
|
const mem_fs_1 = require("mem-fs");
|
|
8
5
|
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
9
6
|
const path_1 = require("path");
|
|
@@ -14,73 +11,84 @@ const writer_1 = require("./writer");
|
|
|
14
11
|
const jsonc_parser_1 = require("jsonc-parser");
|
|
15
12
|
const workspaceManager_1 = require("../debug-config/workspaceManager");
|
|
16
13
|
const config_1 = require("../debug-config/config");
|
|
17
|
-
const store_1 = require("@sap-ux/store");
|
|
18
|
-
const odata_service_inquirer_1 = require("@sap-ux/odata-service-inquirer");
|
|
19
14
|
const i18n_1 = require("../i18n");
|
|
20
|
-
const fs_1 = __importDefault(require("fs"));
|
|
21
15
|
/**
|
|
22
|
-
*
|
|
16
|
+
* Writes the `launch.json` file with the specified configurations. If the file already exists, it will be overwritten.
|
|
23
17
|
*
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
27
|
-
* @returns
|
|
18
|
+
* @param {Editor} fs - The file system editor used to write the `launch.json` file.
|
|
19
|
+
* @param {string} launchJSONPath - The full path to the `launch.json` file.
|
|
20
|
+
* @param {LaunchConfig[]} configurations - An array of launch configurations to be included in the `launch.json` file.
|
|
21
|
+
* @returns {void}
|
|
28
22
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
function writeLaunchJsonFile(fs, launchJSONPath, configurations) {
|
|
24
|
+
const newLaunchJSONContent = { version: '0.2.0', configurations };
|
|
25
|
+
fs.write(launchJSONPath, JSON.stringify(newLaunchJSONContent, null, 4));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Handles the case where there are no debug options provided. It either enhances an existing `launch.json`
|
|
29
|
+
* file with a new launch configuration or creates a new `launch.json` file with the initial configuration.
|
|
30
|
+
*
|
|
31
|
+
* @param {string} rootFolder - The root directory where the `launch.json` file is located or will be created.
|
|
32
|
+
* @param {FioriOptions} fioriOptions - The options used to generate the new launch configuration for the `launch.json` file.
|
|
33
|
+
* @param {Editor} fs - The file system editor used to read and write the `launch.json` file.
|
|
34
|
+
* @returns {Promise<Editor>} - A promise that resolves with the file system editor after the `launch.json` file has been
|
|
35
|
+
* updated or created.
|
|
36
|
+
*/
|
|
37
|
+
async function handleNoDebugOptions(rootFolder, fioriOptions, fs) {
|
|
38
|
+
const launchJsonWritePath = (0, path_1.join)(rootFolder, project_access_1.DirName.VSCode, types_1.LAUNCH_JSON_FILE);
|
|
39
|
+
if (fs.exists(launchJsonWritePath)) {
|
|
35
40
|
// launch.json exists, enhance existing file with new config
|
|
36
41
|
const launchConfig = (0, utils_1.generateNewFioriLaunchConfig)(rootFolder, fioriOptions);
|
|
37
|
-
const launchJsonString = fs.read(
|
|
42
|
+
const launchJsonString = fs.read(launchJsonWritePath);
|
|
38
43
|
const launchJson = (0, jsonc_parser_1.parse)(launchJsonString);
|
|
39
|
-
await (0, writer_1.updateLaunchJSON)(launchConfig,
|
|
44
|
+
await (0, writer_1.updateLaunchJSON)(launchConfig, launchJsonWritePath, ['configurations', launchJson.configurations.length + 1], {
|
|
40
45
|
isArrayInsertion: true
|
|
41
46
|
}, fs);
|
|
47
|
+
return fs;
|
|
42
48
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const newLaunchJSONContent = { version: '0.2.0', configurations: [configurations] };
|
|
47
|
-
fs.write(launchJSONPath, JSON.stringify(newLaunchJSONContent, null, 4));
|
|
48
|
-
}
|
|
49
|
+
// launch.json is missing, new file with new config
|
|
50
|
+
const configurations = [(0, utils_1.generateNewFioriLaunchConfig)(rootFolder, fioriOptions)];
|
|
51
|
+
writeLaunchJsonFile(fs, launchJsonWritePath, configurations);
|
|
49
52
|
return fs;
|
|
50
53
|
}
|
|
51
|
-
exports.createLaunchConfig = createLaunchConfig;
|
|
52
54
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
+
* Updates or replaces the `launch.json` file depending on whether the file should be replaced
|
|
56
|
+
* or enhanced with additional configurations. If `replaceWithNew` is true, the entire file
|
|
57
|
+
* content is replaced with the new configurations. Otherwise, the configurations are added
|
|
58
|
+
* to the existing `launch.json`.
|
|
55
59
|
*
|
|
56
|
-
* @param {
|
|
57
|
-
* @param
|
|
60
|
+
* @param {Editor} fs - The file system editor to read and write the `launch.json` file.
|
|
61
|
+
* @param {string} launchJSONPath - The path to the existing `launch.json` file.
|
|
62
|
+
* @param {LaunchConfig[]} configurations - An array of new launch configurations to be added or replaced.
|
|
63
|
+
* @param {boolean} replaceWithNew - A flag indicating whether to replace the existing `launch.json`
|
|
64
|
+
* with new configurations (`true`) or append to the existing ones (`false`).
|
|
65
|
+
* @returns {Promise<void>} - A promise that resolves once the `launch.json` file has been updated or replaced.
|
|
58
66
|
*/
|
|
59
|
-
function
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
async function handleExistingLaunchJson(fs, launchJSONPath, configurations, replaceWithNew = false) {
|
|
68
|
+
const launchJsonString = fs.read(launchJSONPath);
|
|
69
|
+
const launchJson = (0, jsonc_parser_1.parse)(launchJsonString);
|
|
70
|
+
if (replaceWithNew) {
|
|
71
|
+
// replaceWithNew is needed in cases where launch config exists in
|
|
72
|
+
// `.vscode` but isn't added to the workspace. If `replaceWithNew` is `true`, it indicates that the app is not
|
|
73
|
+
// in the workspace, so the entire `launch.json` and replaced since launch config is then generated in app folder.
|
|
74
|
+
writeLaunchJsonFile(fs, launchJSONPath, configurations);
|
|
67
75
|
}
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
else {
|
|
77
|
+
for (const config of configurations) {
|
|
78
|
+
await (0, writer_1.updateLaunchJSON)(config, launchJSONPath, ['configurations', launchJson.configurations.length + 1], {
|
|
79
|
+
isArrayInsertion: true
|
|
80
|
+
}, fs);
|
|
81
|
+
}
|
|
70
82
|
}
|
|
71
83
|
}
|
|
72
|
-
exports.writeApplicationInfoSettings = writeApplicationInfoSettings;
|
|
73
84
|
/**
|
|
74
85
|
* Updates the workspace folders in VSCode if the update options are provided.
|
|
75
86
|
*
|
|
76
87
|
* @param {UpdateWorkspaceFolderOptions} updateWorkspaceFolders - The options for updating workspace folders.
|
|
77
|
-
* @param {string} rootFolderPath - The root folder path of the project.
|
|
78
|
-
* @param log - The logger instance.
|
|
79
88
|
*/
|
|
80
|
-
function updateWorkspaceFoldersIfNeeded(updateWorkspaceFolders
|
|
89
|
+
function updateWorkspaceFoldersIfNeeded(updateWorkspaceFolders) {
|
|
81
90
|
if (updateWorkspaceFolders) {
|
|
82
91
|
const { uri, vscode, projectName } = updateWorkspaceFolders;
|
|
83
|
-
writeApplicationInfoSettings(rootFolderPath, log);
|
|
84
92
|
if (uri && vscode) {
|
|
85
93
|
const currentWorkspaceFolders = vscode.workspace.workspaceFolders || [];
|
|
86
94
|
vscode.workspace.updateWorkspaceFolders(currentWorkspaceFolders.length, undefined, {
|
|
@@ -90,70 +98,70 @@ function updateWorkspaceFoldersIfNeeded(updateWorkspaceFolders, rootFolderPath,
|
|
|
90
98
|
}
|
|
91
99
|
}
|
|
92
100
|
}
|
|
93
|
-
exports.updateWorkspaceFoldersIfNeeded = updateWorkspaceFoldersIfNeeded;
|
|
94
101
|
/**
|
|
95
|
-
*
|
|
102
|
+
* Handles the creation and configuration of the `launch.json` file based on debug options.
|
|
103
|
+
* This function processes workspace configuration, updates the `launch.json` file if it exists,
|
|
104
|
+
* and creates it if it does not. Additionally, it updates workspace folders if applicable.
|
|
96
105
|
*
|
|
97
|
-
* @param
|
|
98
|
-
* @param {
|
|
99
|
-
* @param {
|
|
100
|
-
*
|
|
101
|
-
* @param
|
|
106
|
+
* @param rootFolder - root folder.
|
|
107
|
+
* @param {Editor} fs - The file system editor to read and write the `launch.json` file.
|
|
108
|
+
* @param {DebugOptions} debugOptions - Debug configuration options that dictate how the `launch.json`
|
|
109
|
+
* should be generated and what commands should be logged.
|
|
110
|
+
* @param {Logger} logger - Logger instance for logging information or warnings.
|
|
111
|
+
* @returns {Promise<Editor>} - Returns the file system editor after potentially modifying the workspace
|
|
112
|
+
* and updating or creating the `launch.json` file.
|
|
102
113
|
*/
|
|
103
|
-
function
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const path = (0, path_1.join)(dotVscodePath, 'launch.json');
|
|
115
|
-
fs_1.default.writeFileSync(path, JSON.stringify(launchJsonFile ?? {}, null, 4), 'utf8');
|
|
116
|
-
}
|
|
114
|
+
async function handleDebugOptions(rootFolder, fs, debugOptions, logger) {
|
|
115
|
+
const { launchJsonPath, workspaceFolderUri, cwd, appNotInWorkspace } = (0, workspaceManager_1.handleWorkspaceConfig)(rootFolder, debugOptions);
|
|
116
|
+
const configurations = (0, config_1.configureLaunchJsonFile)(rootFolder, cwd, debugOptions).configurations;
|
|
117
|
+
const npmCommand = debugOptions.datasourceType === types_1.ProjectDataSourceType.metadataFile ? 'run start-mock' : 'start';
|
|
118
|
+
logger?.info((0, i18n_1.t)('startServerMessage', {
|
|
119
|
+
folder: (0, path_1.basename)(rootFolder),
|
|
120
|
+
npmCommand
|
|
121
|
+
}));
|
|
122
|
+
const launchJsonWritePath = (0, path_1.join)(launchJsonPath, project_access_1.DirName.VSCode, types_1.LAUNCH_JSON_FILE);
|
|
123
|
+
if (fs.exists(launchJsonWritePath)) {
|
|
124
|
+
await handleExistingLaunchJson(fs, launchJsonWritePath, configurations, appNotInWorkspace);
|
|
117
125
|
}
|
|
118
|
-
|
|
119
|
-
|
|
126
|
+
else {
|
|
127
|
+
writeLaunchJsonFile(fs, launchJsonWritePath, configurations);
|
|
120
128
|
}
|
|
121
|
-
|
|
129
|
+
// The `workspaceFolderUri` is a URI obtained from VS Code that specifies the path to the workspace folder.
|
|
130
|
+
// This URI is populated when a reload of the workspace is required. It allows us to identify and update
|
|
131
|
+
// the workspace folder correctly within VS Code.
|
|
132
|
+
const updateWorkspaceFolders = workspaceFolderUri
|
|
133
|
+
? {
|
|
134
|
+
uri: workspaceFolderUri,
|
|
135
|
+
projectName: (0, path_1.basename)(rootFolder),
|
|
136
|
+
vscode: debugOptions.vscode
|
|
137
|
+
}
|
|
138
|
+
: undefined;
|
|
139
|
+
updateWorkspaceFoldersIfNeeded(updateWorkspaceFolders);
|
|
140
|
+
return fs;
|
|
122
141
|
}
|
|
123
|
-
exports.createOrUpdateLaunchConfigJSON = createOrUpdateLaunchConfigJSON;
|
|
124
142
|
/**
|
|
125
|
-
*
|
|
143
|
+
* Enhance or create the launch.json file with new launch config.
|
|
126
144
|
*
|
|
127
|
-
* @param
|
|
128
|
-
* @param
|
|
145
|
+
* @param rootFolder - workspace root folder.
|
|
146
|
+
* @param fioriOptions - options for the new launch config.
|
|
147
|
+
* @param fs - optional, the memfs editor instance.
|
|
148
|
+
* @param logger - optional, the logger instance.
|
|
149
|
+
* @returns memfs editor instance.
|
|
129
150
|
*/
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return;
|
|
151
|
+
async function createLaunchConfig(rootFolder, fioriOptions, fs, logger) {
|
|
152
|
+
fs = fs ?? (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
153
|
+
const debugOptions = fioriOptions.debugOptions;
|
|
154
|
+
if (!debugOptions) {
|
|
155
|
+
return await handleNoDebugOptions(rootFolder, fioriOptions, fs);
|
|
135
156
|
}
|
|
136
|
-
if (!vscode) {
|
|
137
|
-
return;
|
|
157
|
+
if (!debugOptions.vscode) {
|
|
158
|
+
return fs;
|
|
138
159
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
? {
|
|
145
|
-
uri: workspaceFolderUri,
|
|
146
|
-
projectName: (0, path_1.basename)(options.projectPath),
|
|
147
|
-
vscode
|
|
148
|
-
}
|
|
149
|
-
: undefined;
|
|
150
|
-
createOrUpdateLaunchConfigJSON(launchJsonPath, launchJsonFile, updateWorkspaceFolders, appNotInWorkspace, log);
|
|
151
|
-
const npmCommand = datasourceType === odata_service_inquirer_1.DatasourceType.metadataFile ? 'run start-mock' : 'start';
|
|
152
|
-
const projectName = (0, path_1.basename)(projectPath);
|
|
153
|
-
log?.info((0, i18n_1.t)('startServerMessage', {
|
|
154
|
-
folder: projectName,
|
|
155
|
-
npmCommand
|
|
156
|
-
}));
|
|
160
|
+
if (debugOptions.datasourceType === types_1.ProjectDataSourceType.capProject) {
|
|
161
|
+
logger?.info((0, i18n_1.t)('startApp', { npmStart: '`npm start`', cdsRun: '`cds run --in-memory`' }));
|
|
162
|
+
return fs;
|
|
163
|
+
}
|
|
164
|
+
return await handleDebugOptions(rootFolder, fs, debugOptions, logger);
|
|
157
165
|
}
|
|
158
|
-
exports.
|
|
166
|
+
exports.createLaunchConfig = createLaunchConfig;
|
|
159
167
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/launch-config-crud/create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/launch-config-crud/create.ts"],"names":[],"mappings":";;;AAAA,mCAAiD;AACjD,iDAAuC;AACvC,+BAAsC;AACtC,2DAAiD;AACjD,oCAAmE;AAGnE,mCAAuD;AACvD,qCAA4C;AAC5C,+CAAqC;AACrC,uEAAyE;AACzE,mDAAiE;AAEjE,kCAA4B;AAE5B;;;;;;;GAOG;AACH,SAAS,mBAAmB,CAAC,EAAU,EAAE,cAAsB,EAAE,cAA8B;IAC3F,MAAM,oBAAoB,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;IAClE,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE,IAAI,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C,MAAM,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC;IACd,CAAC;IACD,IAAI,YAAY,CAAC,cAAc,KAAK,6BAAqB,CAAC,UAAU,EAAE,CAAC;QACnE,MAAM,EAAE,IAAI,CAAC,IAAA,QAAC,EAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC,CAAC,CAAC;QAC1F,OAAO,EAAE,CAAC;IACd,CAAC;IACD,OAAO,MAAM,kBAAkB,CAAC,UAAU,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;AAC1E,CAAC;AAnBD,gDAmBC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ODataVersion } from '@sap-ux/project-access';
|
|
2
2
|
import type { FioriToolsProxyConfigBackend } from '@sap-ux/ui5-config';
|
|
3
|
-
import type { OdataVersion, DatasourceType } from '@sap-ux/odata-service-inquirer';
|
|
4
3
|
export declare enum Arguments {
|
|
5
4
|
FrameworkVersion = "--framework-version",
|
|
6
5
|
Open = "--open",
|
|
@@ -19,6 +18,7 @@ export interface FioriOptions {
|
|
|
19
18
|
backendConfigs?: FioriToolsProxyConfigBackend[];
|
|
20
19
|
urlParameters?: string;
|
|
21
20
|
visible?: boolean;
|
|
21
|
+
debugOptions?: DebugOptions;
|
|
22
22
|
}
|
|
23
23
|
export interface LaunchJSON {
|
|
24
24
|
version: string;
|
|
@@ -53,14 +53,21 @@ export interface LaunchConfigInfo {
|
|
|
53
53
|
launchConfigs: LaunchConfig[];
|
|
54
54
|
filePath: string;
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Enum representing the types of data sources or origins for a project.
|
|
58
|
+
* These types indicate how a project is generated.
|
|
59
|
+
*/
|
|
60
|
+
export declare enum ProjectDataSourceType {
|
|
61
|
+
capProject = "capProject",
|
|
62
|
+
odataServiceUrl = "odataServiceUrl",
|
|
63
|
+
metadataFile = "metadataFile"
|
|
64
|
+
}
|
|
56
65
|
/**
|
|
57
66
|
* Configuration options for debugging launch configurations.
|
|
58
67
|
*/
|
|
59
68
|
export interface DebugOptions {
|
|
60
|
-
/** Path to the project directory. */
|
|
61
|
-
projectPath: string;
|
|
62
69
|
/** Type of the data source used in the project. */
|
|
63
|
-
datasourceType:
|
|
70
|
+
datasourceType: ProjectDataSourceType;
|
|
64
71
|
/** SAP client parameter for the connection. */
|
|
65
72
|
sapClientParam: string;
|
|
66
73
|
/** FLP application ID. */
|
|
@@ -68,7 +75,7 @@ export interface DebugOptions {
|
|
|
68
75
|
/** Indicates if the FLP sandbox environment is available. */
|
|
69
76
|
flpSandboxAvailable: boolean;
|
|
70
77
|
/** Version of the OData service. */
|
|
71
|
-
odataVersion?:
|
|
78
|
+
odataVersion?: ODataVersion;
|
|
72
79
|
/** Indicates if the project is a Fiori Element. */
|
|
73
80
|
isFioriElement?: boolean;
|
|
74
81
|
/** Intent parameter for the migrator mock. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAEvE,oBAAY,SAAS;IACjB,gBAAgB,wBAAwB;IACxC,IAAI,WAAW;IACf,MAAM,aAAa;CACtB;AAED,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,WAA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1,10 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Arguments = void 0;
|
|
3
|
+
exports.ProjectDataSourceType = exports.Arguments = void 0;
|
|
4
4
|
var Arguments;
|
|
5
5
|
(function (Arguments) {
|
|
6
6
|
Arguments["FrameworkVersion"] = "--framework-version";
|
|
7
7
|
Arguments["Open"] = "--open";
|
|
8
8
|
Arguments["Config"] = "--config";
|
|
9
9
|
})(Arguments || (exports.Arguments = Arguments = {}));
|
|
10
|
+
/**
|
|
11
|
+
* Enum representing the types of data sources or origins for a project.
|
|
12
|
+
* These types indicate how a project is generated.
|
|
13
|
+
*/
|
|
14
|
+
var ProjectDataSourceType;
|
|
15
|
+
(function (ProjectDataSourceType) {
|
|
16
|
+
ProjectDataSourceType["capProject"] = "capProject";
|
|
17
|
+
ProjectDataSourceType["odataServiceUrl"] = "odataServiceUrl";
|
|
18
|
+
ProjectDataSourceType["metadataFile"] = "metadataFile";
|
|
19
|
+
})(ProjectDataSourceType || (exports.ProjectDataSourceType = ProjectDataSourceType = {}));
|
|
10
20
|
//# sourceMappingURL=types.js.map
|
package/dist/types/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":";;;AAGA,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,qDAAwC,CAAA;IACxC,4BAAe,CAAA;IACf,gCAAmB,CAAA;AACvB,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB;AAuDD;;;GAGG;AACH,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC7B,kDAAyB,CAAA;IACzB,4DAAmC,CAAA;IACnC,sDAA6B,CAAA;AACjC,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/launch-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "SAP Fiori tools launch config administration",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,11 +27,9 @@
|
|
|
27
27
|
"mem-fs": "2.1.0",
|
|
28
28
|
"mem-fs-editor": "9.4.0",
|
|
29
29
|
"yargs-parser": "21.1.1",
|
|
30
|
-
"@sap-ux/project-access": "1.27.2",
|
|
31
30
|
"@sap-ux/ui5-config": "0.24.1",
|
|
32
|
-
"@sap-ux/
|
|
33
|
-
"@sap-ux/
|
|
34
|
-
"@sap-ux/store": "0.9.1"
|
|
31
|
+
"@sap-ux/project-access": "1.27.3",
|
|
32
|
+
"@sap-ux/ui5-info": "0.8.1"
|
|
35
33
|
},
|
|
36
34
|
"devDependencies": {
|
|
37
35
|
"@types/mem-fs": "1.1.2",
|