@sap-ux/project-access 1.38.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/command/index.d.ts +1 -1
  2. package/dist/command/index.js +1 -5
  3. package/dist/command/npm-command.js +3 -6
  4. package/dist/constants.js +10 -13
  5. package/dist/file/file-access.d.ts +1 -1
  6. package/dist/file/file-access.js +18 -32
  7. package/dist/file/file-search.js +25 -35
  8. package/dist/file/index.d.ts +2 -2
  9. package/dist/file/index.js +2 -19
  10. package/dist/index.d.ts +10 -10
  11. package/dist/index.js +9 -102
  12. package/dist/library/constants.js +1 -4
  13. package/dist/library/helpers.d.ts +1 -1
  14. package/dist/library/helpers.js +36 -44
  15. package/dist/library/index.d.ts +1 -1
  16. package/dist/library/index.js +1 -6
  17. package/dist/odata/index.d.ts +1 -1
  18. package/dist/odata/index.js +1 -6
  19. package/dist/odata/metadata.js +2 -6
  20. package/dist/path/index.d.ts +1 -1
  21. package/dist/path/index.js +1 -5
  22. package/dist/path/normalize.js +3 -6
  23. package/dist/project/access.d.ts +1 -1
  24. package/dist/project/access.js +30 -34
  25. package/dist/project/cap.d.ts +1 -1
  26. package/dist/project/cap.js +75 -102
  27. package/dist/project/dependencies.d.ts +1 -1
  28. package/dist/project/dependencies.js +16 -22
  29. package/dist/project/flex-changes.js +7 -10
  30. package/dist/project/i18n/i18n.d.ts +1 -1
  31. package/dist/project/i18n/i18n.js +22 -22
  32. package/dist/project/i18n/index.d.ts +3 -3
  33. package/dist/project/i18n/index.js +3 -13
  34. package/dist/project/i18n/read.d.ts +1 -1
  35. package/dist/project/i18n/read.js +11 -15
  36. package/dist/project/i18n/write.d.ts +1 -1
  37. package/dist/project/i18n/write.js +22 -28
  38. package/dist/project/index.d.ts +15 -15
  39. package/dist/project/index.js +14 -79
  40. package/dist/project/info.d.ts +1 -1
  41. package/dist/project/info.js +45 -54
  42. package/dist/project/module-loader.js +27 -64
  43. package/dist/project/mta.d.ts +1 -1
  44. package/dist/project/mta.js +6 -9
  45. package/dist/project/script.js +11 -18
  46. package/dist/project/search.d.ts +1 -1
  47. package/dist/project/search.js +77 -86
  48. package/dist/project/service.d.ts +1 -1
  49. package/dist/project/service.js +10 -16
  50. package/dist/project/specification.js +38 -44
  51. package/dist/project/ui5-config.js +21 -29
  52. package/dist/project/ui5-xml-id-validator.js +3 -6
  53. package/dist/types/access/index.d.ts +4 -4
  54. package/dist/types/access/index.js +1 -2
  55. package/dist/types/cap/index.js +1 -2
  56. package/dist/types/find/index.d.ts +1 -1
  57. package/dist/types/find/index.js +1 -2
  58. package/dist/types/i18n/index.js +1 -2
  59. package/dist/types/index.d.ts +9 -9
  60. package/dist/types/index.js +9 -25
  61. package/dist/types/info/index.d.ts +2 -2
  62. package/dist/types/info/index.js +1 -2
  63. package/dist/types/library/index.js +5 -2
  64. package/dist/types/mta/index.js +1 -2
  65. package/dist/types/package/basic.js +1 -2
  66. package/dist/types/package/index.d.ts +1 -1
  67. package/dist/types/package/index.js +1 -2
  68. package/dist/types/package/literal-union.d.ts +1 -1
  69. package/dist/types/package/literal-union.js +1 -2
  70. package/dist/types/package/package-json.d.ts +2 -2
  71. package/dist/types/package/package-json.js +1 -2
  72. package/dist/types/package/primitive.js +1 -2
  73. package/dist/types/vscode/index.js +1 -2
  74. package/dist/types/webapp/index.d.ts +2 -3
  75. package/dist/types/webapp/index.js +1 -2
  76. package/package.json +7 -5
@@ -1,2 +1,2 @@
1
- export { execNpmCommand } from './npm-command';
1
+ export { execNpmCommand } from './npm-command.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.execNpmCommand = void 0;
4
- var npm_command_1 = require("./npm-command");
5
- Object.defineProperty(exports, "execNpmCommand", { enumerable: true, get: function () { return npm_command_1.execNpmCommand; } });
1
+ export { execNpmCommand } from './npm-command.js';
6
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.execNpmCommand = execNpmCommand;
4
- const node_child_process_1 = require("node:child_process");
1
+ import { spawn } from 'node:child_process';
5
2
  /**
6
3
  * Execute an npm command.
7
4
  *
@@ -12,7 +9,7 @@ const node_child_process_1 = require("node:child_process");
12
9
  * @param [options.throwOnError] - optional flag to throw an error if the command exits with a non-zero code, default is false
13
10
  * @returns - stdout of the command
14
11
  */
15
- async function execNpmCommand(commandArguments, options) {
12
+ export async function execNpmCommand(commandArguments, options) {
16
13
  return new Promise((resolve, reject) => {
17
14
  const isWin = process.platform.startsWith('win');
18
15
  // Command to execute npm is platform specific, 'npm.cmd' on windows, 'npm' otherwise
@@ -22,7 +19,7 @@ async function execNpmCommand(commandArguments, options) {
22
19
  const logger = options?.logger;
23
20
  const cwd = options?.cwd;
24
21
  const spawnOptions = typeof cwd === 'string' ? { ...defaultSpawnOptions, cwd } : defaultSpawnOptions;
25
- const spawnProcess = (0, node_child_process_1.spawn)(npmCommand, commandArguments, spawnOptions);
22
+ const spawnProcess = spawn(npmCommand, commandArguments, spawnOptions);
26
23
  let stdOut = '';
27
24
  let stdErr = '';
28
25
  spawnProcess.stdout.on('data', (data) => {
package/dist/constants.js CHANGED
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MinCdsVersion = exports.MinCdsPluginUi5Version = exports.moduleCacheRoot = exports.fioriToolsDirectory = exports.SchemaName = exports.FioriToolsSettings = exports.DirName = exports.FileName = void 0;
4
- const node_os_1 = require("node:os");
5
- const node_path_1 = require("node:path");
6
- exports.FileName = {
1
+ import { homedir } from 'node:os';
2
+ import { join } from 'node:path';
3
+ export const FileName = {
7
4
  AdaptationConfig: 'config.json',
8
5
  CapJavaApplicationYaml: 'application.yaml',
9
6
  ExtConfigJson: '.extconfig.json',
@@ -27,7 +24,7 @@ exports.FileName = {
27
24
  DotGitIgnore: '.gitignore',
28
25
  MtaExtYaml: 'mta-ext.mtaext'
29
26
  };
30
- exports.DirName = {
27
+ export const DirName = {
31
28
  Changes: 'changes',
32
29
  ModuleCache: 'module-cache',
33
30
  Schemas: '.schemas',
@@ -51,21 +48,21 @@ exports.DirName = {
51
48
  Manifest: 'manifest',
52
49
  Annotations: 'annotations'
53
50
  };
54
- exports.FioriToolsSettings = {
51
+ export const FioriToolsSettings = {
55
52
  dir: '.fioritools',
56
53
  migrationSettingsFile: 'migrationSettings.json'
57
54
  };
58
- exports.SchemaName = {
55
+ export const SchemaName = {
59
56
  Ftfs: 'ftfs'
60
57
  };
61
58
  /**
62
59
  * Directory where fiori tools settings are stored
63
60
  */
64
- exports.fioriToolsDirectory = (0, node_path_1.join)((0, node_os_1.homedir)(), exports.FioriToolsSettings.dir);
61
+ export const fioriToolsDirectory = join(homedir(), FioriToolsSettings.dir);
65
62
  /**
66
63
  * Directory where modules are cached
67
64
  */
68
- exports.moduleCacheRoot = (0, node_path_1.join)(exports.fioriToolsDirectory, exports.DirName.ModuleCache);
69
- exports.MinCdsPluginUi5Version = '0.13.0';
70
- exports.MinCdsVersion = '6.8.2';
65
+ export const moduleCacheRoot = join(fioriToolsDirectory, DirName.ModuleCache);
66
+ export const MinCdsPluginUi5Version = '0.13.0';
67
+ export const MinCdsVersion = '6.8.2';
71
68
  //# sourceMappingURL=constants.js.map
@@ -1,5 +1,5 @@
1
1
  import type { Editor } from 'mem-fs-editor';
2
- import type { Manifest, Package } from '../types';
2
+ import type { Manifest, Package } from '../types/index.js';
3
3
  /**
4
4
  * Read file asynchronously. Throws error if file does not exist.
5
5
  *
@@ -1,19 +1,5 @@
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.readFile = readFile;
7
- exports.readJSON = readJSON;
8
- exports.writeFile = writeFile;
9
- exports.fileExists = fileExists;
10
- exports.updatePackageJSON = updatePackageJSON;
11
- exports.updateManifestJSON = updateManifestJSON;
12
- exports.deleteFile = deleteFile;
13
- exports.readDirectory = readDirectory;
14
- exports.deleteDirectory = deleteDirectory;
15
- const node_fs_1 = require("node:fs");
16
- const json_parse_even_better_errors_1 = __importDefault(require("json-parse-even-better-errors"));
1
+ import { promises as fs } from 'node:fs';
2
+ import parseJsonError from 'json-parse-even-better-errors';
17
3
  /**
18
4
  * Read file asynchronously. Throws error if file does not exist.
19
5
  *
@@ -21,12 +7,12 @@ const json_parse_even_better_errors_1 = __importDefault(require("json-parse-even
21
7
  * @param memFs - optional mem-fs-editor instance
22
8
  * @returns - file content as string
23
9
  */
24
- async function readFile(path, memFs) {
10
+ export async function readFile(path, memFs) {
25
11
  if (memFs) {
26
12
  return memFs.read(path);
27
13
  }
28
14
  else {
29
- return node_fs_1.promises.readFile(path, { encoding: 'utf8' });
15
+ return fs.readFile(path, { encoding: 'utf8' });
30
16
  }
31
17
  }
32
18
  /**
@@ -36,7 +22,7 @@ async function readFile(path, memFs) {
36
22
  * @param memFs - optional mem-fs-editor instance
37
23
  * @returns - file content as object of type T
38
24
  */
39
- async function readJSON(path, memFs) {
25
+ export async function readJSON(path, memFs) {
40
26
  if (memFs) {
41
27
  return memFs.readJSON(path);
42
28
  }
@@ -52,11 +38,11 @@ async function readJSON(path, memFs) {
52
38
  * @param memFs - optional mem-fs-editor instance
53
39
  * @returns - file content as string
54
40
  */
55
- async function writeFile(path, content, memFs) {
41
+ export async function writeFile(path, content, memFs) {
56
42
  if (memFs) {
57
43
  return memFs.write(path, content);
58
44
  }
59
- return node_fs_1.promises.writeFile(path, content, { encoding: 'utf8' });
45
+ return fs.writeFile(path, content, { encoding: 'utf8' });
60
46
  }
61
47
  /**
62
48
  * Checks if the provided file exists in the file system.
@@ -65,13 +51,13 @@ async function writeFile(path, content, memFs) {
65
51
  * @param memFs - optional mem-fs-editor instance
66
52
  * @returns - true if the file exists; false otherwise.
67
53
  */
68
- async function fileExists(path, memFs) {
54
+ export async function fileExists(path, memFs) {
69
55
  try {
70
56
  if (memFs) {
71
57
  return memFs.exists(path);
72
58
  }
73
59
  else {
74
- await node_fs_1.promises.access(path);
60
+ await fs.access(path);
75
61
  return true;
76
62
  }
77
63
  }
@@ -86,7 +72,7 @@ async function fileExists(path, memFs) {
86
72
  * @param packageJson - updated package.json file content
87
73
  * @param memFs - optional mem-fs-editor instance
88
74
  */
89
- async function updatePackageJSON(path, packageJson, memFs) {
75
+ export async function updatePackageJSON(path, packageJson, memFs) {
90
76
  await updateJSON(path, packageJson, memFs);
91
77
  }
92
78
  /**
@@ -96,7 +82,7 @@ async function updatePackageJSON(path, packageJson, memFs) {
96
82
  * @param manifest - updated manifest.json file content
97
83
  * @param memFs - optional mem-fs-editor instance
98
84
  */
99
- async function updateManifestJSON(path, manifest, memFs) {
85
+ export async function updateManifestJSON(path, manifest, memFs) {
100
86
  await updateJSON(path, manifest, memFs);
101
87
  }
102
88
  /**
@@ -109,7 +95,7 @@ async function updateManifestJSON(path, manifest, memFs) {
109
95
  async function updateJSON(path, content, memFs) {
110
96
  // read old contents and indentation of the JSON file
111
97
  const oldContentText = await readFile(path, memFs);
112
- const oldContentJson = (0, json_parse_even_better_errors_1.default)(oldContentText);
98
+ const oldContentJson = parseJsonError(oldContentText);
113
99
  const indent = Symbol.for('indent');
114
100
  // prepare new JSON file content with previous indentation
115
101
  const result = JSON.stringify(content, null, oldContentJson[indent]) + '\n';
@@ -122,11 +108,11 @@ async function updateJSON(path, content, memFs) {
122
108
  * @param memFs - optional mem-fs-editor instance
123
109
  * @returns Promise to void.
124
110
  */
125
- async function deleteFile(path, memFs) {
111
+ export async function deleteFile(path, memFs) {
126
112
  if (memFs) {
127
113
  return memFs.delete(path);
128
114
  }
129
- return node_fs_1.promises.unlink(path);
115
+ return fs.unlink(path);
130
116
  }
131
117
  /**
132
118
  * Read array of files from folder asynchronously.
@@ -134,8 +120,8 @@ async function deleteFile(path, memFs) {
134
120
  * @param path - path to folder
135
121
  * @returns Array of the names of the files in the directory.
136
122
  */
137
- async function readDirectory(path) {
138
- return node_fs_1.promises.readdir(path, { encoding: 'utf8' });
123
+ export async function readDirectory(path) {
124
+ return fs.readdir(path, { encoding: 'utf8' });
139
125
  }
140
126
  /**
141
127
  * Deletes folder asynchronously.
@@ -144,10 +130,10 @@ async function readDirectory(path) {
144
130
  * @param memFs - optional mem-fs-editor instance
145
131
  * @returns Promise to void.
146
132
  */
147
- async function deleteDirectory(path, memFs) {
133
+ export async function deleteDirectory(path, memFs) {
148
134
  if (memFs) {
149
135
  return memFs.delete(path);
150
136
  }
151
- return node_fs_1.promises.rm(path, { recursive: true, force: true });
137
+ return fs.rm(path, { recursive: true, force: true });
152
138
  }
153
139
  //# sourceMappingURL=file-access.js.map
@@ -1,17 +1,7 @@
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.findBy = findBy;
7
- exports.findFiles = findFiles;
8
- exports.findFilesByExtension = findFilesByExtension;
9
- exports.findFileUp = findFileUp;
10
- exports.getFilePaths = getFilePaths;
11
- const node_path_1 = require("node:path");
12
- const findit2_1 = __importDefault(require("findit2"));
13
- const file_access_1 = require("./file-access");
14
- const node_fs_1 = require("node:fs");
1
+ import { basename, dirname, extname, join, sep, posix } from 'node:path';
2
+ import find from 'findit2';
3
+ import { fileExists } from './file-access.js';
4
+ import { promises as fs } from 'node:fs';
15
5
  /**
16
6
  * Get deleted and modified files from mem-fs editor filtered by query and 'by' (name|extension).
17
7
  *
@@ -32,16 +22,16 @@ const node_fs_1 = require("node:fs");
32
22
  function getMemFsChanges(changes, fileNames, extensionNames, root) {
33
23
  const deleted = [];
34
24
  const modified = [];
35
- const filteredChanges = Object.keys(changes).filter((f) => f.startsWith(root.replaceAll(node_path_1.sep, node_path_1.posix.sep)) &&
36
- (fileNames.includes((0, node_path_1.basename)(f)) ||
37
- extensionNames.includes((0, node_path_1.extname)(f)) ||
25
+ const filteredChanges = Object.keys(changes).filter((f) => f.startsWith(root.replaceAll(sep, posix.sep)) &&
26
+ (fileNames.includes(basename(f)) ||
27
+ extensionNames.includes(extname(f)) ||
38
28
  (fileNames.length === 0 && extensionNames.length === 0)));
39
29
  for (const file of filteredChanges) {
40
30
  if (changes[file].state === 'deleted') {
41
- deleted.push((0, node_path_1.join)(file));
31
+ deleted.push(join(file));
42
32
  }
43
33
  if (changes[file].state === 'modified') {
44
- modified.push((0, node_path_1.join)(file));
34
+ modified.push(join(file));
45
35
  }
46
36
  }
47
37
  return { deleted, modified };
@@ -85,7 +75,7 @@ function getFindResultOnEnd(results, fileNames, extensionNames, root, errors, me
85
75
  * @returns - array of paths that contain the file
86
76
  * @throws Error[] - list of errors that occurred during the search
87
77
  */
88
- function findBy(options) {
78
+ export function findBy(options) {
89
79
  return new Promise((resolve, reject) => {
90
80
  const results = [];
91
81
  const fileNames = Array.isArray(options.fileNames) ? options.fileNames : [];
@@ -93,16 +83,16 @@ function findBy(options) {
93
83
  const excludeFolders = Array.isArray(options.excludeFolders) ? options.excludeFolders : [];
94
84
  const noTraversal = options.noTraversal ?? false;
95
85
  const errors = [];
96
- const finder = (0, findit2_1.default)(options.root);
86
+ const finder = find(options.root);
97
87
  finder.on('directory', (dir, _stat, stop) => {
98
- const base = (0, node_path_1.basename)(dir);
88
+ const base = basename(dir);
99
89
  if (excludeFolders.includes(base) || (noTraversal && dir !== options.root)) {
100
90
  stop();
101
91
  }
102
92
  });
103
93
  finder.on('file', (file) => {
104
- if (extensionNames.includes((0, node_path_1.extname)(file)) ||
105
- fileNames.includes((0, node_path_1.basename)(file)) ||
94
+ if (extensionNames.includes(extname(file)) ||
95
+ fileNames.includes(basename(file)) ||
106
96
  (fileNames.length === 0 && extensionNames.length === 0)) {
107
97
  results.push(file);
108
98
  }
@@ -130,9 +120,9 @@ function findBy(options) {
130
120
  * @param [memFs] - optional mem-fs-editor instance
131
121
  * @returns - array of paths that contain the filename
132
122
  */
133
- async function findFiles(filename, root, excludeFolders, memFs) {
123
+ export async function findFiles(filename, root, excludeFolders, memFs) {
134
124
  const results = await findBy({ fileNames: [filename], root, excludeFolders, memFs });
135
- return results.map((f) => (0, node_path_1.dirname)(f));
125
+ return results.map((f) => dirname(f));
136
126
  }
137
127
  /**
138
128
  * Search for 'filename' starting from 'root'. Returns array of paths that contain the file.
@@ -144,7 +134,7 @@ async function findFiles(filename, root, excludeFolders, memFs) {
144
134
  * @param noTraversal - optional flag to disable root path traversal
145
135
  * @returns - array of file paths that have the extension
146
136
  */
147
- function findFilesByExtension(extension, root, excludeFolders, memFs, noTraversal) {
137
+ export function findFilesByExtension(extension, root, excludeFolders, memFs, noTraversal) {
148
138
  return findBy({ extensionNames: [extension], root, excludeFolders, noTraversal, memFs });
149
139
  }
150
140
  /**
@@ -155,13 +145,13 @@ function findFilesByExtension(extension, root, excludeFolders, memFs, noTraversa
155
145
  * @param fs - optional mem-fs-editor instance
156
146
  * @returns - path to file name if found, otherwise undefined
157
147
  */
158
- async function findFileUp(fileName, startPath, fs) {
159
- const filePath = (0, node_path_1.join)(startPath, fileName);
160
- if (await (0, file_access_1.fileExists)(filePath, fs)) {
148
+ export async function findFileUp(fileName, startPath, fs) {
149
+ const filePath = join(startPath, fileName);
150
+ if (await fileExists(filePath, fs)) {
161
151
  return filePath;
162
152
  }
163
153
  else {
164
- return (0, node_path_1.dirname)(startPath) !== startPath ? findFileUp(fileName, (0, node_path_1.dirname)(startPath), fs) : undefined;
154
+ return dirname(startPath) !== startPath ? findFileUp(fileName, dirname(startPath), fs) : undefined;
165
155
  }
166
156
  }
167
157
  /**
@@ -171,11 +161,11 @@ async function findFileUp(fileName, startPath, fs) {
171
161
  * @returns {string[]} - array of file path strings
172
162
  * @throws if an error occurs reading a file path
173
163
  */
174
- async function getFilePaths(dir) {
175
- const entries = await node_fs_1.promises.readdir(dir);
164
+ export async function getFilePaths(dir) {
165
+ const entries = await fs.readdir(dir);
176
166
  const filePathsPromises = entries.map(async (entry) => {
177
- const entryPath = (0, node_path_1.join)(dir, entry);
178
- const isDirectory = (await node_fs_1.promises.stat(entryPath)).isDirectory();
167
+ const entryPath = join(dir, entry);
168
+ const isDirectory = (await fs.stat(entryPath)).isDirectory();
179
169
  return isDirectory ? getFilePaths(entryPath) : entryPath;
180
170
  });
181
171
  const filePaths = await Promise.all(filePathsPromises);
@@ -1,3 +1,3 @@
1
- export { deleteDirectory, deleteFile, fileExists, readDirectory, readFile, readJSON, updatePackageJSON, updateManifestJSON, writeFile } from './file-access';
2
- export { findBy, findFiles, findFilesByExtension, findFileUp, getFilePaths } from './file-search';
1
+ export { deleteDirectory, deleteFile, fileExists, readDirectory, readFile, readJSON, updatePackageJSON, updateManifestJSON, writeFile } from './file-access.js';
2
+ export { findBy, findFiles, findFilesByExtension, findFileUp, getFilePaths } from './file-search.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,20 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFilePaths = exports.findFileUp = exports.findFilesByExtension = exports.findFiles = exports.findBy = exports.writeFile = exports.updateManifestJSON = exports.updatePackageJSON = exports.readJSON = exports.readFile = exports.readDirectory = exports.fileExists = exports.deleteFile = exports.deleteDirectory = void 0;
4
- var file_access_1 = require("./file-access");
5
- Object.defineProperty(exports, "deleteDirectory", { enumerable: true, get: function () { return file_access_1.deleteDirectory; } });
6
- Object.defineProperty(exports, "deleteFile", { enumerable: true, get: function () { return file_access_1.deleteFile; } });
7
- Object.defineProperty(exports, "fileExists", { enumerable: true, get: function () { return file_access_1.fileExists; } });
8
- Object.defineProperty(exports, "readDirectory", { enumerable: true, get: function () { return file_access_1.readDirectory; } });
9
- Object.defineProperty(exports, "readFile", { enumerable: true, get: function () { return file_access_1.readFile; } });
10
- Object.defineProperty(exports, "readJSON", { enumerable: true, get: function () { return file_access_1.readJSON; } });
11
- Object.defineProperty(exports, "updatePackageJSON", { enumerable: true, get: function () { return file_access_1.updatePackageJSON; } });
12
- Object.defineProperty(exports, "updateManifestJSON", { enumerable: true, get: function () { return file_access_1.updateManifestJSON; } });
13
- Object.defineProperty(exports, "writeFile", { enumerable: true, get: function () { return file_access_1.writeFile; } });
14
- var file_search_1 = require("./file-search");
15
- Object.defineProperty(exports, "findBy", { enumerable: true, get: function () { return file_search_1.findBy; } });
16
- Object.defineProperty(exports, "findFiles", { enumerable: true, get: function () { return file_search_1.findFiles; } });
17
- Object.defineProperty(exports, "findFilesByExtension", { enumerable: true, get: function () { return file_search_1.findFilesByExtension; } });
18
- Object.defineProperty(exports, "findFileUp", { enumerable: true, get: function () { return file_search_1.findFileUp; } });
19
- Object.defineProperty(exports, "getFilePaths", { enumerable: true, get: function () { return file_search_1.getFilePaths; } });
1
+ export { deleteDirectory, deleteFile, fileExists, readDirectory, readFile, readJSON, updatePackageJSON, updateManifestJSON, writeFile } from './file-access.js';
2
+ export { findBy, findFiles, findFilesByExtension, findFileUp, getFilePaths } from './file-search.js';
20
3
  //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- export { FileName, DirName, FioriToolsSettings, MinCdsPluginUi5Version, MinCdsVersion, fioriToolsDirectory } from './constants';
2
- export { getFilePaths, findFilesByExtension } from './file';
3
- export { normalizePath } from './path';
4
- export { addPackageDevDependency, clearCdsModuleCache, createApplicationAccess, createProjectAccess, deleteCapApp, filterDataSourcesByType, findAllApps, findCapProjectRoot, findCapProjects, findFioriArtifacts, findProjectRoot, findRootsForPath, getAllUi5YamlFileNames, getAppRootFromWebappPath, getAppProgrammingLanguage, getAppType, getCapCustomPaths, getCapEnvironment, getCapModelAndServices, getCapServiceName, getCapProjectType, getCdsFiles, getCdsRoots, getCdsServices, getCapI18nFolderNames, getSpecification, getSpecificationModuleFromCache, getSpecificationPath, getI18nPropertiesPaths, getI18nBundles, getMinUI5VersionFromManifest, getMinUI5VersionAsArray, getMinimumUI5Version, getMtaPath, getMockServerConfig, getMockDataPath, getNodeModulesPath, getPathMappings, type PathMappings, getProject, getProjectType, getWebappPath, hasUI5CliV3, isCapProject, isCapJavaProject, isCapNodeJsProject, loadModuleFromProject, readCapServiceMetadataEdmx, readUi5Yaml, refreshSpecificationDistTags, toReferenceUri, updatePackageScript, getWorkspaceInfo, hasMinCdsVersion, checkCdsUi5PluginEnabled, readFlexChanges, processServices, getMainService, getGlobalCdsHomePath, isUI5IdUnique, getUsedEntitiesFromManifest } from './project';
5
- export type { UsedEntity } from './project';
6
- export { execNpmCommand } from './command/npm-command';
7
- export * from './types';
8
- export { checkDependencies, getReuseLibs } from './library';
9
- export { findRecursiveHierarchyKey, getTableCapabilitiesByEntitySet } from './odata';
10
- export { hasDependency } from './project';
1
+ export { FileName, DirName, FioriToolsSettings, MinCdsPluginUi5Version, MinCdsVersion, fioriToolsDirectory } from './constants.js';
2
+ export { getFilePaths, findFilesByExtension } from './file/index.js';
3
+ export { normalizePath } from './path/index.js';
4
+ export { addPackageDevDependency, clearCdsModuleCache, createApplicationAccess, createProjectAccess, deleteCapApp, filterDataSourcesByType, findAllApps, findCapProjectRoot, findCapProjects, findFioriArtifacts, findProjectRoot, findRootsForPath, getAllUi5YamlFileNames, getAppRootFromWebappPath, getAppProgrammingLanguage, getAppType, getCapCustomPaths, getCapEnvironment, getCapModelAndServices, getCapServiceName, getCapProjectType, getCdsFiles, getCdsRoots, getCdsServices, getCapI18nFolderNames, getSpecification, getSpecificationModuleFromCache, getSpecificationPath, getI18nPropertiesPaths, getI18nBundles, getMinUI5VersionFromManifest, getMinUI5VersionAsArray, getMinimumUI5Version, getMtaPath, getMockServerConfig, getMockDataPath, getNodeModulesPath, getPathMappings, getProject, getProjectType, getWebappPath, hasUI5CliV3, isCapProject, isCapJavaProject, isCapNodeJsProject, loadModuleFromProject, readCapServiceMetadataEdmx, readUi5Yaml, refreshSpecificationDistTags, toReferenceUri, updatePackageScript, getWorkspaceInfo, hasMinCdsVersion, checkCdsUi5PluginEnabled, readFlexChanges, processServices, getMainService, getGlobalCdsHomePath, isUI5IdUnique, getUsedEntitiesFromManifest } from './project/index.js';
5
+ export type { UsedEntity } from './project/index.js';
6
+ export { execNpmCommand } from './command/npm-command.js';
7
+ export * from './types/index.js';
8
+ export { checkDependencies, getReuseLibs } from './library/index.js';
9
+ export { findRecursiveHierarchyKey, getTableCapabilitiesByEntitySet } from './odata/index.js';
10
+ export { hasDependency } from './project/index.js';
11
11
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,103 +1,10 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.getWebappPath = exports.getProjectType = exports.getProject = exports.getPathMappings = exports.getNodeModulesPath = exports.getMockDataPath = exports.getMockServerConfig = exports.getMtaPath = exports.getMinimumUI5Version = exports.getMinUI5VersionAsArray = exports.getMinUI5VersionFromManifest = exports.getI18nBundles = exports.getI18nPropertiesPaths = exports.getSpecificationPath = exports.getSpecificationModuleFromCache = exports.getSpecification = exports.getCapI18nFolderNames = exports.getCdsServices = exports.getCdsRoots = exports.getCdsFiles = exports.getCapProjectType = exports.getCapServiceName = exports.getCapModelAndServices = exports.getCapEnvironment = exports.getCapCustomPaths = exports.getAppType = exports.getAppProgrammingLanguage = exports.getAppRootFromWebappPath = exports.getAllUi5YamlFileNames = exports.findRootsForPath = exports.findProjectRoot = exports.findFioriArtifacts = exports.findCapProjects = exports.findCapProjectRoot = exports.findAllApps = exports.filterDataSourcesByType = exports.deleteCapApp = exports.createProjectAccess = exports.createApplicationAccess = exports.clearCdsModuleCache = exports.addPackageDevDependency = exports.normalizePath = exports.findFilesByExtension = exports.getFilePaths = exports.fioriToolsDirectory = exports.MinCdsVersion = exports.MinCdsPluginUi5Version = exports.FioriToolsSettings = exports.DirName = exports.FileName = void 0;
18
- exports.hasDependency = exports.getTableCapabilitiesByEntitySet = exports.findRecursiveHierarchyKey = exports.getReuseLibs = exports.checkDependencies = exports.execNpmCommand = exports.getUsedEntitiesFromManifest = exports.isUI5IdUnique = exports.getGlobalCdsHomePath = exports.getMainService = exports.processServices = exports.readFlexChanges = exports.checkCdsUi5PluginEnabled = exports.hasMinCdsVersion = exports.getWorkspaceInfo = exports.updatePackageScript = exports.toReferenceUri = exports.refreshSpecificationDistTags = exports.readUi5Yaml = exports.readCapServiceMetadataEdmx = exports.loadModuleFromProject = exports.isCapNodeJsProject = exports.isCapJavaProject = exports.isCapProject = exports.hasUI5CliV3 = void 0;
19
- var constants_1 = require("./constants");
20
- Object.defineProperty(exports, "FileName", { enumerable: true, get: function () { return constants_1.FileName; } });
21
- Object.defineProperty(exports, "DirName", { enumerable: true, get: function () { return constants_1.DirName; } });
22
- Object.defineProperty(exports, "FioriToolsSettings", { enumerable: true, get: function () { return constants_1.FioriToolsSettings; } });
23
- Object.defineProperty(exports, "MinCdsPluginUi5Version", { enumerable: true, get: function () { return constants_1.MinCdsPluginUi5Version; } });
24
- Object.defineProperty(exports, "MinCdsVersion", { enumerable: true, get: function () { return constants_1.MinCdsVersion; } });
25
- Object.defineProperty(exports, "fioriToolsDirectory", { enumerable: true, get: function () { return constants_1.fioriToolsDirectory; } });
26
- var file_1 = require("./file");
27
- Object.defineProperty(exports, "getFilePaths", { enumerable: true, get: function () { return file_1.getFilePaths; } });
28
- Object.defineProperty(exports, "findFilesByExtension", { enumerable: true, get: function () { return file_1.findFilesByExtension; } });
29
- var path_1 = require("./path");
30
- Object.defineProperty(exports, "normalizePath", { enumerable: true, get: function () { return path_1.normalizePath; } });
31
- var project_1 = require("./project");
32
- Object.defineProperty(exports, "addPackageDevDependency", { enumerable: true, get: function () { return project_1.addPackageDevDependency; } });
33
- Object.defineProperty(exports, "clearCdsModuleCache", { enumerable: true, get: function () { return project_1.clearCdsModuleCache; } });
34
- Object.defineProperty(exports, "createApplicationAccess", { enumerable: true, get: function () { return project_1.createApplicationAccess; } });
35
- Object.defineProperty(exports, "createProjectAccess", { enumerable: true, get: function () { return project_1.createProjectAccess; } });
36
- Object.defineProperty(exports, "deleteCapApp", { enumerable: true, get: function () { return project_1.deleteCapApp; } });
37
- Object.defineProperty(exports, "filterDataSourcesByType", { enumerable: true, get: function () { return project_1.filterDataSourcesByType; } });
38
- Object.defineProperty(exports, "findAllApps", { enumerable: true, get: function () { return project_1.findAllApps; } });
39
- Object.defineProperty(exports, "findCapProjectRoot", { enumerable: true, get: function () { return project_1.findCapProjectRoot; } });
40
- Object.defineProperty(exports, "findCapProjects", { enumerable: true, get: function () { return project_1.findCapProjects; } });
41
- Object.defineProperty(exports, "findFioriArtifacts", { enumerable: true, get: function () { return project_1.findFioriArtifacts; } });
42
- Object.defineProperty(exports, "findProjectRoot", { enumerable: true, get: function () { return project_1.findProjectRoot; } });
43
- Object.defineProperty(exports, "findRootsForPath", { enumerable: true, get: function () { return project_1.findRootsForPath; } });
44
- Object.defineProperty(exports, "getAllUi5YamlFileNames", { enumerable: true, get: function () { return project_1.getAllUi5YamlFileNames; } });
45
- Object.defineProperty(exports, "getAppRootFromWebappPath", { enumerable: true, get: function () { return project_1.getAppRootFromWebappPath; } });
46
- Object.defineProperty(exports, "getAppProgrammingLanguage", { enumerable: true, get: function () { return project_1.getAppProgrammingLanguage; } });
47
- Object.defineProperty(exports, "getAppType", { enumerable: true, get: function () { return project_1.getAppType; } });
48
- Object.defineProperty(exports, "getCapCustomPaths", { enumerable: true, get: function () { return project_1.getCapCustomPaths; } });
49
- Object.defineProperty(exports, "getCapEnvironment", { enumerable: true, get: function () { return project_1.getCapEnvironment; } });
50
- Object.defineProperty(exports, "getCapModelAndServices", { enumerable: true, get: function () { return project_1.getCapModelAndServices; } });
51
- Object.defineProperty(exports, "getCapServiceName", { enumerable: true, get: function () { return project_1.getCapServiceName; } });
52
- Object.defineProperty(exports, "getCapProjectType", { enumerable: true, get: function () { return project_1.getCapProjectType; } });
53
- Object.defineProperty(exports, "getCdsFiles", { enumerable: true, get: function () { return project_1.getCdsFiles; } });
54
- Object.defineProperty(exports, "getCdsRoots", { enumerable: true, get: function () { return project_1.getCdsRoots; } });
55
- Object.defineProperty(exports, "getCdsServices", { enumerable: true, get: function () { return project_1.getCdsServices; } });
56
- Object.defineProperty(exports, "getCapI18nFolderNames", { enumerable: true, get: function () { return project_1.getCapI18nFolderNames; } });
57
- Object.defineProperty(exports, "getSpecification", { enumerable: true, get: function () { return project_1.getSpecification; } });
58
- Object.defineProperty(exports, "getSpecificationModuleFromCache", { enumerable: true, get: function () { return project_1.getSpecificationModuleFromCache; } });
59
- Object.defineProperty(exports, "getSpecificationPath", { enumerable: true, get: function () { return project_1.getSpecificationPath; } });
60
- Object.defineProperty(exports, "getI18nPropertiesPaths", { enumerable: true, get: function () { return project_1.getI18nPropertiesPaths; } });
61
- Object.defineProperty(exports, "getI18nBundles", { enumerable: true, get: function () { return project_1.getI18nBundles; } });
62
- Object.defineProperty(exports, "getMinUI5VersionFromManifest", { enumerable: true, get: function () { return project_1.getMinUI5VersionFromManifest; } });
63
- Object.defineProperty(exports, "getMinUI5VersionAsArray", { enumerable: true, get: function () { return project_1.getMinUI5VersionAsArray; } });
64
- Object.defineProperty(exports, "getMinimumUI5Version", { enumerable: true, get: function () { return project_1.getMinimumUI5Version; } });
65
- Object.defineProperty(exports, "getMtaPath", { enumerable: true, get: function () { return project_1.getMtaPath; } });
66
- Object.defineProperty(exports, "getMockServerConfig", { enumerable: true, get: function () { return project_1.getMockServerConfig; } });
67
- Object.defineProperty(exports, "getMockDataPath", { enumerable: true, get: function () { return project_1.getMockDataPath; } });
68
- Object.defineProperty(exports, "getNodeModulesPath", { enumerable: true, get: function () { return project_1.getNodeModulesPath; } });
69
- Object.defineProperty(exports, "getPathMappings", { enumerable: true, get: function () { return project_1.getPathMappings; } });
70
- Object.defineProperty(exports, "getProject", { enumerable: true, get: function () { return project_1.getProject; } });
71
- Object.defineProperty(exports, "getProjectType", { enumerable: true, get: function () { return project_1.getProjectType; } });
72
- Object.defineProperty(exports, "getWebappPath", { enumerable: true, get: function () { return project_1.getWebappPath; } });
73
- Object.defineProperty(exports, "hasUI5CliV3", { enumerable: true, get: function () { return project_1.hasUI5CliV3; } });
74
- Object.defineProperty(exports, "isCapProject", { enumerable: true, get: function () { return project_1.isCapProject; } });
75
- Object.defineProperty(exports, "isCapJavaProject", { enumerable: true, get: function () { return project_1.isCapJavaProject; } });
76
- Object.defineProperty(exports, "isCapNodeJsProject", { enumerable: true, get: function () { return project_1.isCapNodeJsProject; } });
77
- Object.defineProperty(exports, "loadModuleFromProject", { enumerable: true, get: function () { return project_1.loadModuleFromProject; } });
78
- Object.defineProperty(exports, "readCapServiceMetadataEdmx", { enumerable: true, get: function () { return project_1.readCapServiceMetadataEdmx; } });
79
- Object.defineProperty(exports, "readUi5Yaml", { enumerable: true, get: function () { return project_1.readUi5Yaml; } });
80
- Object.defineProperty(exports, "refreshSpecificationDistTags", { enumerable: true, get: function () { return project_1.refreshSpecificationDistTags; } });
81
- Object.defineProperty(exports, "toReferenceUri", { enumerable: true, get: function () { return project_1.toReferenceUri; } });
82
- Object.defineProperty(exports, "updatePackageScript", { enumerable: true, get: function () { return project_1.updatePackageScript; } });
83
- Object.defineProperty(exports, "getWorkspaceInfo", { enumerable: true, get: function () { return project_1.getWorkspaceInfo; } });
84
- Object.defineProperty(exports, "hasMinCdsVersion", { enumerable: true, get: function () { return project_1.hasMinCdsVersion; } });
85
- Object.defineProperty(exports, "checkCdsUi5PluginEnabled", { enumerable: true, get: function () { return project_1.checkCdsUi5PluginEnabled; } });
86
- Object.defineProperty(exports, "readFlexChanges", { enumerable: true, get: function () { return project_1.readFlexChanges; } });
87
- Object.defineProperty(exports, "processServices", { enumerable: true, get: function () { return project_1.processServices; } });
88
- Object.defineProperty(exports, "getMainService", { enumerable: true, get: function () { return project_1.getMainService; } });
89
- Object.defineProperty(exports, "getGlobalCdsHomePath", { enumerable: true, get: function () { return project_1.getGlobalCdsHomePath; } });
90
- Object.defineProperty(exports, "isUI5IdUnique", { enumerable: true, get: function () { return project_1.isUI5IdUnique; } });
91
- Object.defineProperty(exports, "getUsedEntitiesFromManifest", { enumerable: true, get: function () { return project_1.getUsedEntitiesFromManifest; } });
92
- var npm_command_1 = require("./command/npm-command");
93
- Object.defineProperty(exports, "execNpmCommand", { enumerable: true, get: function () { return npm_command_1.execNpmCommand; } });
94
- __exportStar(require("./types"), exports);
95
- var library_1 = require("./library");
96
- Object.defineProperty(exports, "checkDependencies", { enumerable: true, get: function () { return library_1.checkDependencies; } });
97
- Object.defineProperty(exports, "getReuseLibs", { enumerable: true, get: function () { return library_1.getReuseLibs; } });
98
- var odata_1 = require("./odata");
99
- Object.defineProperty(exports, "findRecursiveHierarchyKey", { enumerable: true, get: function () { return odata_1.findRecursiveHierarchyKey; } });
100
- Object.defineProperty(exports, "getTableCapabilitiesByEntitySet", { enumerable: true, get: function () { return odata_1.getTableCapabilitiesByEntitySet; } });
101
- var project_2 = require("./project");
102
- Object.defineProperty(exports, "hasDependency", { enumerable: true, get: function () { return project_2.hasDependency; } });
1
+ export { FileName, DirName, FioriToolsSettings, MinCdsPluginUi5Version, MinCdsVersion, fioriToolsDirectory } from './constants.js';
2
+ export { getFilePaths, findFilesByExtension } from './file/index.js';
3
+ export { normalizePath } from './path/index.js';
4
+ export { addPackageDevDependency, clearCdsModuleCache, createApplicationAccess, createProjectAccess, deleteCapApp, filterDataSourcesByType, findAllApps, findCapProjectRoot, findCapProjects, findFioriArtifacts, findProjectRoot, findRootsForPath, getAllUi5YamlFileNames, getAppRootFromWebappPath, getAppProgrammingLanguage, getAppType, getCapCustomPaths, getCapEnvironment, getCapModelAndServices, getCapServiceName, getCapProjectType, getCdsFiles, getCdsRoots, getCdsServices, getCapI18nFolderNames, getSpecification, getSpecificationModuleFromCache, getSpecificationPath, getI18nPropertiesPaths, getI18nBundles, getMinUI5VersionFromManifest, getMinUI5VersionAsArray, getMinimumUI5Version, getMtaPath, getMockServerConfig, getMockDataPath, getNodeModulesPath, getPathMappings, getProject, getProjectType, getWebappPath, hasUI5CliV3, isCapProject, isCapJavaProject, isCapNodeJsProject, loadModuleFromProject, readCapServiceMetadataEdmx, readUi5Yaml, refreshSpecificationDistTags, toReferenceUri, updatePackageScript, getWorkspaceInfo, hasMinCdsVersion, checkCdsUi5PluginEnabled, readFlexChanges, processServices, getMainService, getGlobalCdsHomePath, isUI5IdUnique, getUsedEntitiesFromManifest } from './project/index.js';
5
+ export { execNpmCommand } from './command/npm-command.js';
6
+ export * from './types/index.js';
7
+ export { checkDependencies, getReuseLibs } from './library/index.js';
8
+ export { findRecursiveHierarchyKey, getTableCapabilitiesByEntitySet } from './odata/index.js';
9
+ export { hasDependency } from './project/index.js';
103
10
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ui5Libs = void 0;
4
- exports.ui5Libs = [
1
+ export const ui5Libs = [
5
2
  'sap.apf',
6
3
  'sap.base',
7
4
  'sap.chart',
@@ -1,4 +1,4 @@
1
- import { type LibraryResults, type Manifest, type ReuseLib, type LibraryXml } from '../types';
1
+ import { type LibraryResults, type Manifest, type ReuseLib, type LibraryXml } from '../types/index.js';
2
2
  /**
3
3
  * Returns an array of the reuse libraries found in the folders.
4
4
  *