@sap-ux/deploy-tooling 0.9.5 → 0.9.7

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.
@@ -54,6 +54,7 @@ export interface AbapDeployConfig extends CommonOptions {
54
54
  target: AbapTarget;
55
55
  app: BspConfig;
56
56
  credentials?: AxiosRequestConfig['auth'];
57
+ exclude?: string[];
57
58
  }
58
59
  export interface CliOptions extends Partial<BspConfig>, Partial<DestinationAbapTarget>, Pick<Partial<UrlAbapTarget>, Exclude<keyof UrlAbapTarget, 'serviceKey' | 'scp'>>, Partial<CommonOptions> {
59
60
  config?: string;
@@ -8,7 +8,8 @@ import type { DuplexCollection } from '@ui5/fs';
8
8
  * @param logger - reference to the logger instance
9
9
  * @param workspace - reference to the UI5 tooling workspace object
10
10
  * @param projectName - project properties and configuration
11
+ * @param exclude - array of regex patterns used to exclude folders from archive
11
12
  * @returns {*} {Promise<Buffer>} - archive
12
13
  */
13
- export declare function createUi5Archive(logger: ToolsLogger, workspace: DuplexCollection, projectName: string): Promise<Buffer>;
14
+ export declare function createUi5Archive(logger: ToolsLogger, workspace: DuplexCollection, projectName: string, exclude?: string[]): Promise<Buffer>;
14
15
  //# sourceMappingURL=archive.d.ts.map
@@ -18,19 +18,22 @@ const base_1 = require("../base");
18
18
  * @param logger - reference to the logger instance
19
19
  * @param workspace - reference to the UI5 tooling workspace object
20
20
  * @param projectName - project properties and configuration
21
+ * @param exclude - array of regex patterns used to exclude folders from archive
21
22
  * @returns {*} {Promise<Buffer>} - archive
22
23
  */
23
- function createUi5Archive(logger, workspace, projectName) {
24
+ function createUi5Archive(logger, workspace, projectName, exclude = []) {
24
25
  return __awaiter(this, void 0, void 0, function* () {
25
26
  logger.info('Creating archive with UI5 build result.');
26
27
  const prefix = `/resources/${projectName}/`;
27
28
  const zip = new yazl_1.ZipFile();
28
29
  const resources = yield workspace.byGlob(`${prefix}**/*`);
29
30
  for (const resource of resources) {
30
- const path = resource.getPath().replace(prefix, '');
31
- logger.debug(`Adding ${path}`);
32
- const buffer = yield resource.getBuffer();
33
- zip.addBuffer(buffer, path);
31
+ if (!exclude.some((regex) => RegExp(regex, 'g').exec(resource.getPath()))) {
32
+ const path = resource.getPath().replace(prefix, '');
33
+ logger.debug(`Adding ${path}`);
34
+ const buffer = yield resource.getBuffer();
35
+ zip.addBuffer(buffer, path);
36
+ }
34
37
  }
35
38
  logger.info('Archive created.');
36
39
  return (0, base_1.createBuffer)(zip);
package/dist/ui5/index.js CHANGED
@@ -35,7 +35,7 @@ function task({ workspace, options }) {
35
35
  const config = (0, base_1.validateConfig)(options.configuration);
36
36
  (0, base_1.replaceEnvVariables)(config);
37
37
  // The calling client can use either the projectNamespace or projectName when creating the workspace, needs to match when creating the archive.
38
- const archive = yield (0, archive_1.createUi5Archive)(logger, workspace, (_e = options.projectNamespace) !== null && _e !== void 0 ? _e : options.projectName);
38
+ const archive = yield (0, archive_1.createUi5Archive)(logger, workspace, (_e = options.projectNamespace) !== null && _e !== void 0 ? _e : options.projectName, config.exclude);
39
39
  yield (0, base_1.deploy)(archive, config, logger);
40
40
  });
41
41
  }
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Adeploy-tooling"
11
11
  },
12
- "version": "0.9.5",
12
+ "version": "0.9.7",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -31,10 +31,10 @@
31
31
  "dotenv": "16.0.0",
32
32
  "prompts": "2.4.2",
33
33
  "yazl": "2.5.1",
34
- "@sap-ux/axios-extension": "1.4.1",
34
+ "@sap-ux/axios-extension": "1.4.2",
35
35
  "@sap-ux/btp-utils": "0.11.8",
36
36
  "@sap-ux/logger": "0.3.7",
37
- "@sap-ux/system-access": "0.2.0",
37
+ "@sap-ux/system-access": "0.2.1",
38
38
  "@sap-ux/ui5-config": "0.19.0"
39
39
  },
40
40
  "devDependencies": {