@sap-ux/launch-config 0.2.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/LICENSE +201 -0
- package/README.md +22 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/launch-config-crud/create.d.ts +12 -0
- package/dist/launch-config-crud/create.d.ts.map +1 -0
- package/dist/launch-config-crud/create.js +43 -0
- package/dist/launch-config-crud/create.js.map +1 -0
- package/dist/launch-config-crud/delete.d.ts +11 -0
- package/dist/launch-config-crud/delete.d.ts.map +1 -0
- package/dist/launch-config-crud/delete.js +30 -0
- package/dist/launch-config-crud/delete.js.map +1 -0
- package/dist/launch-config-crud/modify.d.ts +12 -0
- package/dist/launch-config-crud/modify.d.ts.map +1 -0
- package/dist/launch-config-crud/modify.js +152 -0
- package/dist/launch-config-crud/modify.js.map +1 -0
- package/dist/launch-config-crud/read.d.ts +50 -0
- package/dist/launch-config-crud/read.d.ts.map +1 -0
- package/dist/launch-config-crud/read.js +149 -0
- package/dist/launch-config-crud/read.js.map +1 -0
- package/dist/launch-config-crud/update.d.ts +14 -0
- package/dist/launch-config-crud/update.d.ts.map +1 -0
- package/dist/launch-config-crud/update.js +131 -0
- package/dist/launch-config-crud/update.js.map +1 -0
- package/dist/launch-config-crud/utils.d.ts +44 -0
- package/dist/launch-config-crud/utils.d.ts.map +1 -0
- package/dist/launch-config-crud/utils.js +235 -0
- package/dist/launch-config-crud/utils.js.map +1 -0
- package/dist/launch-config-crud/writer.d.ts +14 -0
- package/dist/launch-config-crud/writer.d.ts.map +1 -0
- package/dist/launch-config-crud/writer.js +35 -0
- package/dist/launch-config-crud/writer.js.map +1 -0
- package/dist/project-discovery/project.d.ts +14 -0
- package/dist/project-discovery/project.d.ts.map +1 -0
- package/dist/project-discovery/project.js +82 -0
- package/dist/project-discovery/project.js.map +1 -0
- package/dist/types/constants.d.ts +4 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/constants.js +7 -0
- package/dist/types/constants.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/types.d.ts +54 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/types.js +10 -0
- package/dist/types/types.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLaunchConfigByName = exports.getAllLaunchConfigs = exports.getLaunchConfigs = exports.getLaunchJSONFilePaths = exports.getLaunchJSONFilePath = void 0;
|
|
4
|
+
const project_access_1 = require("@sap-ux/project-access");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
const jsonc_parser_1 = require("jsonc-parser");
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
/**
|
|
10
|
+
* Returns path to the launch.json file (if exists) for a given root folder.
|
|
11
|
+
*
|
|
12
|
+
* @param rootFolder - workspace root folder.
|
|
13
|
+
* @param memFs - optional, the memfs editor instance.
|
|
14
|
+
* @returns {string | undefined} path to the launch config file.
|
|
15
|
+
*/
|
|
16
|
+
async function getLaunchJSONFilePath(rootFolder, memFs) {
|
|
17
|
+
const launchConfigPath = (0, path_1.join)(rootFolder, project_access_1.DirName.VSCode, types_1.LAUNCH_JSON_FILE);
|
|
18
|
+
if (memFs) {
|
|
19
|
+
return memFs.exists(launchConfigPath) ? launchConfigPath : undefined;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
try {
|
|
23
|
+
await fs_1.promises.access(launchConfigPath);
|
|
24
|
+
return launchConfigPath;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.getLaunchJSONFilePath = getLaunchJSONFilePath;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the list of launch.json paths for a given root folders.
|
|
34
|
+
*
|
|
35
|
+
* @param rootFolders - list of root folders in workspace.
|
|
36
|
+
* @param memFs - optional, the memfs editor instance.
|
|
37
|
+
* @returns {string[]} list of launch.json files.
|
|
38
|
+
*/
|
|
39
|
+
async function getLaunchJSONFilePaths(rootFolders, memFs) {
|
|
40
|
+
const roots = Array.isArray(rootFolders) ? rootFolders : [rootFolders];
|
|
41
|
+
const launchConfigFiles = [];
|
|
42
|
+
for (const rootFolder of roots) {
|
|
43
|
+
const launchConfigPath = await getLaunchJSONFilePath(rootFolder, memFs);
|
|
44
|
+
if (typeof launchConfigPath === 'string') {
|
|
45
|
+
launchConfigFiles.push(launchConfigPath);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return launchConfigFiles;
|
|
49
|
+
}
|
|
50
|
+
exports.getLaunchJSONFilePaths = getLaunchJSONFilePaths;
|
|
51
|
+
/**
|
|
52
|
+
* Returns launch configurations from a given root folder.
|
|
53
|
+
*
|
|
54
|
+
* @param rootFolder - Single path to the root.
|
|
55
|
+
* @param memFs - optional, the memfs editor instance.
|
|
56
|
+
* @returns {LaunchConfig[] | undefined} list of launch configs.
|
|
57
|
+
*/
|
|
58
|
+
async function getLaunchConfigs(rootFolder, memFs) {
|
|
59
|
+
const launchJsonPath = await getLaunchJSONFilePath(rootFolder, memFs);
|
|
60
|
+
let launchJsonString;
|
|
61
|
+
let launchJson;
|
|
62
|
+
try {
|
|
63
|
+
if (launchJsonPath) {
|
|
64
|
+
if (memFs) {
|
|
65
|
+
launchJsonString = memFs.read(launchJsonPath);
|
|
66
|
+
launchJson = (0, jsonc_parser_1.parse)(launchJsonString);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
launchJsonString = await fs_1.promises.readFile(launchJsonPath, { encoding: 'utf8' });
|
|
70
|
+
launchJson = (0, jsonc_parser_1.parse)(launchJsonString);
|
|
71
|
+
}
|
|
72
|
+
return launchJson.configurations;
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
throw new Error(err);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.getLaunchConfigs = getLaunchConfigs;
|
|
81
|
+
/**
|
|
82
|
+
* Returns all launch configurations by file from a given root folders.
|
|
83
|
+
*
|
|
84
|
+
* @param rootFolder - Single path to root or list of root folders.
|
|
85
|
+
* @param memFs - optional, the memfs editor instance.
|
|
86
|
+
* @returns {LaunchConfigInfo[]} list of launch configs.
|
|
87
|
+
*/
|
|
88
|
+
async function getAllLaunchConfigs(rootFolder, memFs) {
|
|
89
|
+
const launchConfigList = [];
|
|
90
|
+
const roots = Array.isArray(rootFolder) ? rootFolder : [rootFolder];
|
|
91
|
+
const configFiles = await getLaunchJSONFilePaths(roots, memFs);
|
|
92
|
+
if (memFs) {
|
|
93
|
+
for (const filePath of configFiles) {
|
|
94
|
+
const launchJsonString = memFs.read(filePath);
|
|
95
|
+
const config = (0, jsonc_parser_1.parse)(launchJsonString);
|
|
96
|
+
if (Array.isArray(config.configurations)) {
|
|
97
|
+
launchConfigList.push({ filePath, launchConfigs: config.configurations });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
for (const filePath of configFiles) {
|
|
103
|
+
const launchJsonString = await fs_1.promises.readFile(filePath, { encoding: 'utf8' });
|
|
104
|
+
const config = (0, jsonc_parser_1.parse)(launchJsonString);
|
|
105
|
+
if (Array.isArray(config.configurations)) {
|
|
106
|
+
launchConfigList.push({ filePath, launchConfigs: config.configurations });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return launchConfigList;
|
|
111
|
+
}
|
|
112
|
+
exports.getAllLaunchConfigs = getAllLaunchConfigs;
|
|
113
|
+
/**
|
|
114
|
+
* Returns the launch configuration from a given launch configurations path by name.
|
|
115
|
+
*
|
|
116
|
+
* @param launchConfigPath - path to the launch.json file.
|
|
117
|
+
* @param name - name of the launch config.
|
|
118
|
+
* @param options - optional options.
|
|
119
|
+
* @param options.memFs - optional, the memfs editor instance.
|
|
120
|
+
* @param options.logger - optional, the logger instance.
|
|
121
|
+
* @returns {LaunchConfig} launch config.
|
|
122
|
+
*/
|
|
123
|
+
async function getLaunchConfigByName(launchConfigPath, name, options) {
|
|
124
|
+
let launchJsonString;
|
|
125
|
+
let launchJson;
|
|
126
|
+
const memFs = options?.memFs;
|
|
127
|
+
const logger = options?.logger;
|
|
128
|
+
try {
|
|
129
|
+
if (memFs) {
|
|
130
|
+
launchJsonString = memFs.read(launchConfigPath);
|
|
131
|
+
launchJson = (0, jsonc_parser_1.parse)(launchJsonString);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
launchJsonString = await fs_1.promises.readFile(launchConfigPath, { encoding: 'utf8' });
|
|
135
|
+
launchJson = (0, jsonc_parser_1.parse)(launchJsonString);
|
|
136
|
+
}
|
|
137
|
+
const launchConfig = launchJson.configurations.find((c) => c.name === name);
|
|
138
|
+
if (!launchConfig) {
|
|
139
|
+
throw Error(`No config '${name}'`);
|
|
140
|
+
}
|
|
141
|
+
return launchConfig;
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
logger?.error(`Could not find launch config '${name}' in '${launchConfigPath}'`);
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
exports.getLaunchConfigByName = getLaunchConfigByName;
|
|
149
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../src/launch-config-crud/read.ts"],"names":[],"mappings":";;;AAAA,2DAAiD;AACjD,+BAA4B;AAE5B,oCAA4C;AAC5C,+CAAqC;AAErC,2BAAoC;AAGpC;;;;;;GAMG;AACI,KAAK,UAAU,qBAAqB,C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,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QAC1F,IAAI,CAAC,YAAY,EAAE,CAAC;YAChB,MAAM,KAAK,CAAC,cAAc,IAAI,GAAG,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,YAAY,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,EAAE,KAAK,CAAC,iCAAiC,IAAI,SAAS,gBAAgB,GAAG,CAAC,CAAC;QACjF,MAAM,KAAK,CAAC;IAChB,CAAC;AACL,CAAC;AA1BD,sDA0BC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FioriOptions } from '../types';
|
|
2
|
+
import type { Editor } from 'mem-fs-editor';
|
|
3
|
+
export type configType = object | string | number | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Update existing launch config in launch.json file.
|
|
6
|
+
*
|
|
7
|
+
* @param rootFolder - workspace root folder.
|
|
8
|
+
* @param fioriOptions - options for the new launch config.
|
|
9
|
+
* @param index - index of the launch config to edit.
|
|
10
|
+
* @param fs - optional, the memfs editor instance.
|
|
11
|
+
* @returns memfs editor instance.
|
|
12
|
+
*/
|
|
13
|
+
export declare function updateLaunchConfig(rootFolder: string, fioriOptions: FioriOptions, index: number, fs?: Editor): Promise<Editor>;
|
|
14
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/launch-config-crud/update.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,UAAU,CAAC;AAIzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAM5C,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAkI9D;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACpC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,MAAM,EACb,EAAE,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC,CAmBjB"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateLaunchConfig = void 0;
|
|
4
|
+
const mem_fs_1 = require("mem-fs");
|
|
5
|
+
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
const jsonc_parser_1 = require("jsonc-parser");
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const project_access_1 = require("@sap-ux/project-access");
|
|
11
|
+
const writer_1 = require("./writer");
|
|
12
|
+
/**
|
|
13
|
+
* Traverses each property in launch config object and executes callback function on it.
|
|
14
|
+
*
|
|
15
|
+
* @param obj - the new JSON object to replace original JSON.
|
|
16
|
+
* @param filePath - path to the JSON file.
|
|
17
|
+
* @param originalJSON - the original JSON {@linkcode Node} before modification.
|
|
18
|
+
* @param callback - function to be executed on the object property.
|
|
19
|
+
* @param fs - the memfs editor instance.
|
|
20
|
+
* @param initialPath - intial {@linkcode JSONPath} of the object to be traversed.
|
|
21
|
+
* @returns void.
|
|
22
|
+
*/
|
|
23
|
+
async function traverseAndModifyLaunchConfig(obj, filePath, originalJSON, callback, fs, initialPath = []) {
|
|
24
|
+
for (const key in obj) {
|
|
25
|
+
// Build the current JSONPath by appending the current key
|
|
26
|
+
const currentPath = [...initialPath, key];
|
|
27
|
+
const node = originalJSON && (0, jsonc_parser_1.findNodeAtLocation)(originalJSON, currentPath);
|
|
28
|
+
const originalLength = node?.children?.length;
|
|
29
|
+
if (Array.isArray(obj[key])) {
|
|
30
|
+
await processArrayProperty(obj[key], filePath, originalJSON, callback, currentPath, originalLength, fs);
|
|
31
|
+
}
|
|
32
|
+
else if (typeof obj[key] === 'object') {
|
|
33
|
+
await processObjectProperty({
|
|
34
|
+
obj: obj[key],
|
|
35
|
+
filePath,
|
|
36
|
+
originalJSON,
|
|
37
|
+
currentPath,
|
|
38
|
+
originalLength,
|
|
39
|
+
node
|
|
40
|
+
}, callback, fs);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
await callback(obj[key], filePath, [...currentPath], undefined, fs);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Processes each element of launch config array property and executes callback function on it.
|
|
49
|
+
*
|
|
50
|
+
* @param arr - array of objects.
|
|
51
|
+
* @param filePath - path to the JSON file.
|
|
52
|
+
* @param originalJSON - the original JSON {@linkcode Node} before modification.
|
|
53
|
+
* @param callback - function to be executed on the object property.
|
|
54
|
+
* @param currentPath - intial {@linkcode JSONPath} of the object to be traversed.
|
|
55
|
+
* @param originalLength - original lench of the array.
|
|
56
|
+
* @param fs - the memfs editor instance.
|
|
57
|
+
* @returns void.
|
|
58
|
+
*/
|
|
59
|
+
async function processArrayProperty(arr, filePath, originalJSON, callback, currentPath, originalLength, fs) {
|
|
60
|
+
if (!fs) {
|
|
61
|
+
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
62
|
+
}
|
|
63
|
+
const maxLength = Math.max(arr.length, originalLength);
|
|
64
|
+
for (let i = 0, j = maxLength; i < maxLength; i++) {
|
|
65
|
+
if (typeof arr[i] === 'object') {
|
|
66
|
+
await traverseAndModifyLaunchConfig(arr[i], filePath, originalJSON, callback, fs, [...currentPath, i]);
|
|
67
|
+
}
|
|
68
|
+
else if (arr.length >= originalLength || arr[i]) {
|
|
69
|
+
await callback(arr[i], filePath, [...currentPath, i], undefined, fs);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
// deletion of a property
|
|
73
|
+
await callback(undefined, filePath, [...currentPath, --j], undefined, fs);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Processes each element of launch config object and executes callback function on it.
|
|
79
|
+
*
|
|
80
|
+
* @param launchConfigObject - launch config object properties.
|
|
81
|
+
* @param callback - function to be executed on the object property.
|
|
82
|
+
* @param fs - the memfs editor instance.
|
|
83
|
+
* @returns void.
|
|
84
|
+
*/
|
|
85
|
+
async function processObjectProperty(launchConfigObject, callback, fs) {
|
|
86
|
+
const { obj, originalLength, filePath, originalJSON, currentPath, node } = launchConfigObject;
|
|
87
|
+
const length = Object.keys(obj).length;
|
|
88
|
+
if (length >= originalLength) {
|
|
89
|
+
await traverseAndModifyLaunchConfig(obj, filePath, originalJSON, callback, fs, currentPath);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
for (let i = 0; i < originalLength; i++) {
|
|
93
|
+
const value = node?.children[i].children[0].value;
|
|
94
|
+
if (!obj[value]) {
|
|
95
|
+
// delete property
|
|
96
|
+
await callback(undefined, filePath, [...currentPath, value], undefined, fs);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Update existing launch config in launch.json file.
|
|
103
|
+
*
|
|
104
|
+
* @param rootFolder - workspace root folder.
|
|
105
|
+
* @param fioriOptions - options for the new launch config.
|
|
106
|
+
* @param index - index of the launch config to edit.
|
|
107
|
+
* @param fs - optional, the memfs editor instance.
|
|
108
|
+
* @returns memfs editor instance.
|
|
109
|
+
*/
|
|
110
|
+
async function updateLaunchConfig(rootFolder, fioriOptions, index, fs) {
|
|
111
|
+
if (!fs) {
|
|
112
|
+
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
113
|
+
}
|
|
114
|
+
const launchJSONPath = (0, path_1.join)(rootFolder, project_access_1.DirName.VSCode, types_1.LAUNCH_JSON_FILE);
|
|
115
|
+
if (fs.exists(launchJSONPath)) {
|
|
116
|
+
// edit existing launch config
|
|
117
|
+
const launchJSONString = fs.read(launchJSONPath);
|
|
118
|
+
const launchJSON = (0, jsonc_parser_1.parse)(launchJSONString);
|
|
119
|
+
const launchJSONTree = (0, jsonc_parser_1.parseTree)(launchJSONString);
|
|
120
|
+
const launchConfig = (0, utils_1.generateNewFioriLaunchConfig)(rootFolder, fioriOptions);
|
|
121
|
+
const oldArgs = launchJSON.configurations[index].args;
|
|
122
|
+
launchConfig.args = (0, utils_1.mergeArgs)(launchConfig.args, oldArgs);
|
|
123
|
+
await traverseAndModifyLaunchConfig(launchConfig, launchJSONPath, launchJSONTree, writer_1.updateLaunchJSON, fs, [
|
|
124
|
+
'configurations',
|
|
125
|
+
index
|
|
126
|
+
]);
|
|
127
|
+
}
|
|
128
|
+
return fs;
|
|
129
|
+
}
|
|
130
|
+
exports.updateLaunchConfig = updateLaunchConfig;
|
|
131
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/launch-config-crud/update.ts"],"names":[],"mappings":";;;AAAA,mCAAiD;AACjD,iDAAuC;AAEvC,oCAA4C;AAE5C,+CAAoE;AAEpE,mCAAkE;AAClE,+BAA4B;AAC5B,2DAAiD;AACjD,qCAA4C;AAqB5C;;;;;;;;;;GAUG;AACH,KAAK,UAAU,6BAA6B,CACxC,GAAQ,EACR,QAAgB,EAChB,YAA8B,EAC9B,QAAwB,EACxB,EAAU,EACV,cAAwB,EAAE;IAE1B,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACpB,0DAA0D;QAC1D,MAAM,WAAW,GAAG,CAAC,GAAG,WAAW,EAAE,GAAG,CAAC,CAAC;QAC1C,MAAM,IAAI,GAAG,YAAY,IAAI,IAAA,iCAAkB,EAAC,YAAY,EAAE,WAAW,CAAC,CAAC;QAC3E,MAAM,cAAc,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAgB,CAAC;QAExD,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC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2
|
+
import type { FioriOptions, LaunchConfig } from '../types';
|
|
3
|
+
import { default as yargsParser } from 'yargs-parser';
|
|
4
|
+
/**
|
|
5
|
+
* Returns index number from argument in array of arguments.
|
|
6
|
+
*
|
|
7
|
+
* @param args - array of argument strings.
|
|
8
|
+
* @param arg - argument to find.
|
|
9
|
+
* @returns launch config options.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getIndexOfArgument(args: Array<string>, arg: string): number;
|
|
12
|
+
/**
|
|
13
|
+
* Merges the new and the existing cli arguments of a run configuration.
|
|
14
|
+
*
|
|
15
|
+
* @param newArgs new cli arguments specified in the run config wizard.
|
|
16
|
+
* @param oldArgs existing cli arguments of a run configuration.
|
|
17
|
+
* @returns merged launch config arguments.
|
|
18
|
+
*/
|
|
19
|
+
export declare function mergeArgs(newArgs: string[] | undefined, oldArgs: string[] | undefined): string[];
|
|
20
|
+
/**
|
|
21
|
+
* Returns Fiori Options from Launch Configuration object.
|
|
22
|
+
*
|
|
23
|
+
* @param launchConfig - Launch Configuration.
|
|
24
|
+
* @param launchJSONRootPath - workspace root folder for Launch Configuration where .vscode/launch.json is.
|
|
25
|
+
* @param oDataVersion - OData version of the application V2/V4.
|
|
26
|
+
* @returns Fiori Options of the launch config.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getFioriOptions(launchConfig: LaunchConfig, launchJSONRootPath: string, oDataVersion: ODataVersion): FioriOptions;
|
|
29
|
+
/**
|
|
30
|
+
* Generates a new launch config from passed Fiori options.
|
|
31
|
+
*
|
|
32
|
+
* @param rootFolder - workspace root folder.
|
|
33
|
+
* @param options - the variable part of the launch config.
|
|
34
|
+
* @returns launch config.
|
|
35
|
+
*/
|
|
36
|
+
export declare function generateNewFioriLaunchConfig(rootFolder: string, options: FioriOptions): LaunchConfig;
|
|
37
|
+
/**
|
|
38
|
+
* Parses the list of cli arguments.
|
|
39
|
+
*
|
|
40
|
+
* @param args list of cli arguments in array.
|
|
41
|
+
* @returns parsed arguments.
|
|
42
|
+
*/
|
|
43
|
+
export declare function parseArguments(args: string[]): yargsParser.Arguments;
|
|
44
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/launch-config-crud/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAmB,MAAM,UAAU,CAAC;AAE5E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAgCtD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAI3E;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAYhG;AA0DD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC3B,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,MAAM,EAC1B,YAAY,EAAE,YAAY,GAC3B,YAAY,CAsDd;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,CAyBpG;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC,SAAS,CAcpE"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.parseArguments = exports.generateNewFioriLaunchConfig = exports.getFioriOptions = exports.mergeArgs = exports.getIndexOfArgument = void 0;
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const project_access_1 = require("@sap-ux/project-access");
|
|
9
|
+
const types_1 = require("../types");
|
|
10
|
+
const yargs_parser_1 = __importDefault(require("yargs-parser"));
|
|
11
|
+
/**
|
|
12
|
+
* Returns the string array of 'args' required in the launch config.
|
|
13
|
+
*
|
|
14
|
+
* @param options - the externally exposed launch config options.
|
|
15
|
+
* @returns launch config options.
|
|
16
|
+
*/
|
|
17
|
+
function getArgs(options) {
|
|
18
|
+
const args = [];
|
|
19
|
+
if (options.startFile) {
|
|
20
|
+
const open = types_1.Arguments.Open;
|
|
21
|
+
args.push(open, options.startFile);
|
|
22
|
+
}
|
|
23
|
+
if (options.useMockData && !options.ui5Local) {
|
|
24
|
+
const config = types_1.Arguments.Config;
|
|
25
|
+
args.push(config, project_access_1.FileName.Ui5MockYaml);
|
|
26
|
+
}
|
|
27
|
+
if (options.ui5Local) {
|
|
28
|
+
const config = types_1.Arguments.Config;
|
|
29
|
+
args.push(config, project_access_1.FileName.Ui5LocalYaml);
|
|
30
|
+
if (options.ui5LocalVersion) {
|
|
31
|
+
args.push(types_1.Arguments.FrameworkVersion, options.ui5LocalVersion);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return args.length > 0 ? args : undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Returns index number from argument in array of arguments.
|
|
38
|
+
*
|
|
39
|
+
* @param args - array of argument strings.
|
|
40
|
+
* @param arg - argument to find.
|
|
41
|
+
* @returns launch config options.
|
|
42
|
+
*/
|
|
43
|
+
function getIndexOfArgument(args, arg) {
|
|
44
|
+
const index = (element) => element.includes(arg);
|
|
45
|
+
// return -1 if argument is not in arguments array
|
|
46
|
+
return args.findIndex(index);
|
|
47
|
+
}
|
|
48
|
+
exports.getIndexOfArgument = getIndexOfArgument;
|
|
49
|
+
/**
|
|
50
|
+
* Merges the new and the existing cli arguments of a run configuration.
|
|
51
|
+
*
|
|
52
|
+
* @param newArgs new cli arguments specified in the run config wizard.
|
|
53
|
+
* @param oldArgs existing cli arguments of a run configuration.
|
|
54
|
+
* @returns merged launch config arguments.
|
|
55
|
+
*/
|
|
56
|
+
function mergeArgs(newArgs, oldArgs) {
|
|
57
|
+
let mergedArgs = [];
|
|
58
|
+
if (newArgs && oldArgs) {
|
|
59
|
+
mergedArgs = mergedArgs.concat(newArgs);
|
|
60
|
+
const parsedOldArgs = parseArguments(oldArgs);
|
|
61
|
+
mergedArgs = mergedArgs.concat(parsedOldArgs['_']);
|
|
62
|
+
return mergedArgs;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
return mergedArgs;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.mergeArgs = mergeArgs;
|
|
69
|
+
/**
|
|
70
|
+
* Returns the launch config object.
|
|
71
|
+
*
|
|
72
|
+
* @param name - name of the launch config.
|
|
73
|
+
* @param cwd - working directory of the application to run with launch config.
|
|
74
|
+
* @param runtimeArgs - arguments passed to the runtime executable.
|
|
75
|
+
* @param args - JSON array of command-line arguments to pass to the application.
|
|
76
|
+
* @param env - environment variables for the application.
|
|
77
|
+
* @returns launch config object.
|
|
78
|
+
*/
|
|
79
|
+
function getLaunchConfig(name, cwd, runtimeArgs, args, env) {
|
|
80
|
+
return {
|
|
81
|
+
name,
|
|
82
|
+
cwd,
|
|
83
|
+
runtimeArgs,
|
|
84
|
+
type: 'node',
|
|
85
|
+
request: 'launch',
|
|
86
|
+
runtimeExecutable: 'npx',
|
|
87
|
+
args, // default arguments
|
|
88
|
+
windows: {
|
|
89
|
+
runtimeExecutable: `npx.cmd`
|
|
90
|
+
},
|
|
91
|
+
console: 'internalConsole',
|
|
92
|
+
internalConsoleOptions: 'openOnSessionStart',
|
|
93
|
+
outputCapture: 'std',
|
|
94
|
+
env
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Returns project root from Launch Configuration.
|
|
99
|
+
*
|
|
100
|
+
* @param workspaceRoot - workspace root folder.
|
|
101
|
+
* @param cwd - Launch Configuration working directory folder.
|
|
102
|
+
* @param env - Launch Configuration environment variable where runnableId is.
|
|
103
|
+
* @returns project root.
|
|
104
|
+
*/
|
|
105
|
+
function getProjectRootFromLaunchConfig(workspaceRoot, cwd, env) {
|
|
106
|
+
// firstly check if there is env variable for project root
|
|
107
|
+
if (env?.['run.config']) {
|
|
108
|
+
return JSON.parse(env['run.config']).runnableId;
|
|
109
|
+
}
|
|
110
|
+
// case when workspaceRoot is in opened project
|
|
111
|
+
if (!cwd || (0, path_1.basename)(workspaceRoot) === (0, path_1.basename)(cwd)) {
|
|
112
|
+
return workspaceRoot;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
return (0, path_1.join)(workspaceRoot, (0, path_1.basename)(cwd));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Returns Fiori Options from Launch Configuration object.
|
|
120
|
+
*
|
|
121
|
+
* @param launchConfig - Launch Configuration.
|
|
122
|
+
* @param launchJSONRootPath - workspace root folder for Launch Configuration where .vscode/launch.json is.
|
|
123
|
+
* @param oDataVersion - OData version of the application V2/V4.
|
|
124
|
+
* @returns Fiori Options of the launch config.
|
|
125
|
+
*/
|
|
126
|
+
function getFioriOptions(launchConfig, launchJSONRootPath, oDataVersion) {
|
|
127
|
+
const projectRoot = getProjectRootFromLaunchConfig(launchJSONRootPath, launchConfig.cwd, launchConfig.env);
|
|
128
|
+
let startFile;
|
|
129
|
+
let isMockDataEnabled = false;
|
|
130
|
+
let ui5Version;
|
|
131
|
+
let ui5VersionUri;
|
|
132
|
+
let ui5Local = false;
|
|
133
|
+
let ui5LocalVersion;
|
|
134
|
+
let backendConfigs;
|
|
135
|
+
let urlParameters;
|
|
136
|
+
// Do not display configurations which have different type than node
|
|
137
|
+
let visible = launchConfig.type === 'node';
|
|
138
|
+
if (launchConfig.env) {
|
|
139
|
+
ui5Version = launchConfig.env.FIORI_TOOLS_UI5_VERSION;
|
|
140
|
+
ui5VersionUri = launchConfig.env.FIORI_TOOLS_UI5_URI;
|
|
141
|
+
urlParameters = launchConfig.env.FIORI_TOOLS_URL_PARAMS;
|
|
142
|
+
if (launchConfig.env.FIORI_TOOLS_BACKEND_CONFIG) {
|
|
143
|
+
backendConfigs = JSON.parse(launchConfig.env.FIORI_TOOLS_BACKEND_CONFIG);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (launchConfig.args && launchConfig.args.length > 0) {
|
|
147
|
+
const parsedArguments = parseArguments(launchConfig.args);
|
|
148
|
+
if (parsedArguments.open) {
|
|
149
|
+
startFile = parsedArguments.open;
|
|
150
|
+
}
|
|
151
|
+
if (parsedArguments.config === project_access_1.FileName.Ui5MockYaml) {
|
|
152
|
+
isMockDataEnabled = true;
|
|
153
|
+
}
|
|
154
|
+
if (parsedArguments.config === project_access_1.FileName.Ui5LocalYaml) {
|
|
155
|
+
isMockDataEnabled = true;
|
|
156
|
+
ui5Local = true;
|
|
157
|
+
if (parsedArguments['framework-version']) {
|
|
158
|
+
ui5LocalVersion = parsedArguments['framework-version'];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const stringArguments = launchConfig.args.toString().toLowerCase();
|
|
162
|
+
// filter configurations containing input:UI5MinVersion, this will be supported later
|
|
163
|
+
visible = visible || stringArguments.indexOf('${input:') === -1;
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
name: launchConfig.name,
|
|
167
|
+
projectRoot,
|
|
168
|
+
oDataVersion,
|
|
169
|
+
useMockData: isMockDataEnabled,
|
|
170
|
+
ui5Version,
|
|
171
|
+
ui5VersionUri,
|
|
172
|
+
ui5Local,
|
|
173
|
+
ui5LocalVersion,
|
|
174
|
+
startFile,
|
|
175
|
+
backendConfigs,
|
|
176
|
+
urlParameters,
|
|
177
|
+
visible
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
exports.getFioriOptions = getFioriOptions;
|
|
181
|
+
/**
|
|
182
|
+
* Generates a new launch config from passed Fiori options.
|
|
183
|
+
*
|
|
184
|
+
* @param rootFolder - workspace root folder.
|
|
185
|
+
* @param options - the variable part of the launch config.
|
|
186
|
+
* @returns launch config.
|
|
187
|
+
*/
|
|
188
|
+
function generateNewFioriLaunchConfig(rootFolder, options) {
|
|
189
|
+
const name = options.name;
|
|
190
|
+
const projectRoot = options.projectRoot;
|
|
191
|
+
let env = {
|
|
192
|
+
'run.config': JSON.stringify({
|
|
193
|
+
handlerId: types_1.FIORI_TOOLS_LAUNCH_CONFIG_HANDLER_ID,
|
|
194
|
+
runnableId: projectRoot
|
|
195
|
+
}),
|
|
196
|
+
...(options.backendConfigs && { FIORI_TOOLS_BACKEND_CONFIG: JSON.stringify(options.backendConfigs) }),
|
|
197
|
+
...(options.urlParameters && { FIORI_TOOLS_URL_PARAMS: options.urlParameters })
|
|
198
|
+
};
|
|
199
|
+
if (!options.ui5Local) {
|
|
200
|
+
env = Object.assign(env, {
|
|
201
|
+
FIORI_TOOLS_UI5_VERSION: options.ui5Version,
|
|
202
|
+
FIORI_TOOLS_UI5_URI: options.ui5VersionUri
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
// replace common path of the workspace and application path with "${workspaceFolder}"
|
|
206
|
+
const cwd = projectRoot.replace(rootFolder, '${workspaceFolder}');
|
|
207
|
+
// runtimeArgs for applications that supports fiori cli
|
|
208
|
+
const runtimeArgs = ['fiori', 'run'];
|
|
209
|
+
const args = getArgs(options);
|
|
210
|
+
return getLaunchConfig(name, cwd, runtimeArgs, args, env);
|
|
211
|
+
}
|
|
212
|
+
exports.generateNewFioriLaunchConfig = generateNewFioriLaunchConfig;
|
|
213
|
+
/**
|
|
214
|
+
* Parses the list of cli arguments.
|
|
215
|
+
*
|
|
216
|
+
* @param args list of cli arguments in array.
|
|
217
|
+
* @returns parsed arguments.
|
|
218
|
+
*/
|
|
219
|
+
function parseArguments(args) {
|
|
220
|
+
return (0, yargs_parser_1.default)(args, {
|
|
221
|
+
alias: {
|
|
222
|
+
open: ['o'],
|
|
223
|
+
config: ['c']
|
|
224
|
+
},
|
|
225
|
+
string: ['config', 'open', 'framework-version'],
|
|
226
|
+
configuration: {
|
|
227
|
+
'strip-aliased': true,
|
|
228
|
+
'camel-case-expansion': false,
|
|
229
|
+
'unknown-options-as-args': true,
|
|
230
|
+
'parse-numbers': false
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
exports.parseArguments = parseArguments;
|
|
235
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/launch-config-crud/utils.ts"],"names":[],"mappings":";;;;;;AAAA,+BAAsC;AAEtC,2DAAkD;AAElD,oCAA2E;AAC3E,gEAAsD;AAEtD;;;;;GAKG;AACH,SAAS,OAAO,CAAC,OAAqB;IAClC,MAAM,IAAI,GAAG,EAAE,CAAC;IAChB,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACpB,MAAM,IAAI,GAAG,iBAAS,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,OAAO,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QAC3C,MAAM,MAAM,GAAG,iBAAS,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,yBAAQ,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACnB,MAAM,MAAM,GAAG,iBAAS,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,yBAAQ,CAAC,YAAY,CAAC,CAAC;QAEzC,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;YAC1B,IAAI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AK,EAAE;YACH,IAAI,EAAE,CAAC,GAAG,CAAC;YACX,MAAM,EAAE,CAAC,GAAG,CAAC;SAChB;QACD,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,mBAAmB,CAAC;QAC/C,aAAa,EAAE;YACX,eAAe,EAAE,IAAI;YACrB,sBAAsB,EAAE,KAAK;YAC7B,yBAAyB,EAAE,IAAI;YAC/B,eAAe,EAAE,KAAK;SACzB;KACJ,CAAC,CAAC;AACP,CAAC;AAdD,wCAcC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { JSONPath, ModificationOptions } from 'jsonc-parser';
|
|
2
|
+
import type { Editor } from 'mem-fs-editor';
|
|
3
|
+
/**
|
|
4
|
+
* Writes changes for 'launch.json'.
|
|
5
|
+
*
|
|
6
|
+
* @param content content to be added to the JSON file at location specified by JSONPath.
|
|
7
|
+
* @param filePath path to the json file.
|
|
8
|
+
* @param jsonPath The {@linkcode JSONPath} of the value to change. The path represents either to the document root, a property or an array item.
|
|
9
|
+
* @param options Options {@linkcode ModificationOptions} used by {@linkcode modify} when computing the modification edit operations. Default formattingOptions are used if not provided.
|
|
10
|
+
* @param fs - optional, the memfs editor instance.
|
|
11
|
+
* @returns void.
|
|
12
|
+
*/
|
|
13
|
+
export declare function updateLaunchJSON(content: object | string | number | undefined, filePath: string, jsonPath: JSONPath, options?: ModificationOptions, fs?: Editor): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=writer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../src/launch-config-crud/writer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAElE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CAClC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,EAC7C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,EAClB,OAAO,GAAE,mBAAwB,EACjC,EAAE,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAgBf"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateLaunchJSON = void 0;
|
|
4
|
+
const mem_fs_1 = require("mem-fs");
|
|
5
|
+
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
6
|
+
const jsonc_parser_1 = require("jsonc-parser");
|
|
7
|
+
/**
|
|
8
|
+
* Writes changes for 'launch.json'.
|
|
9
|
+
*
|
|
10
|
+
* @param content content to be added to the JSON file at location specified by JSONPath.
|
|
11
|
+
* @param filePath path to the json file.
|
|
12
|
+
* @param jsonPath The {@linkcode JSONPath} of the value to change. The path represents either to the document root, a property or an array item.
|
|
13
|
+
* @param options Options {@linkcode ModificationOptions} used by {@linkcode modify} when computing the modification edit operations. Default formattingOptions are used if not provided.
|
|
14
|
+
* @param fs - optional, the memfs editor instance.
|
|
15
|
+
* @returns void.
|
|
16
|
+
*/
|
|
17
|
+
async function updateLaunchJSON(content, filePath, jsonPath, options = {}, fs) {
|
|
18
|
+
if (!fs) {
|
|
19
|
+
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
20
|
+
}
|
|
21
|
+
const jsonString = fs.read(filePath);
|
|
22
|
+
if (!options.formattingOptions) {
|
|
23
|
+
options.formattingOptions = {
|
|
24
|
+
tabSize: 4,
|
|
25
|
+
insertSpaces: true
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
// make edits and apply them
|
|
29
|
+
const edits = (0, jsonc_parser_1.modify)(jsonString, jsonPath, content, options);
|
|
30
|
+
const updated = (0, jsonc_parser_1.applyEdits)(jsonString, edits);
|
|
31
|
+
// write changes to file
|
|
32
|
+
fs.write(filePath, updated);
|
|
33
|
+
}
|
|
34
|
+
exports.updateLaunchJSON = updateLaunchJSON;
|
|
35
|
+
//# sourceMappingURL=writer.js.map
|