@shoper/cli 0.8.0 → 0.8.1-3

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.
@@ -8,7 +8,8 @@ export class ThemeActionsUtils {
8
8
  static getFilesGlobsThatMatchesActionName({ filesStructure, actionValue, actionType }) {
9
9
  return Object.entries(filesStructure).reduce((acc, [filePath, fileStructureItem]) => {
10
10
  if (fileStructureItem._links?.[actionType] && this._doesActionValueMatch(fileStructureItem._links[actionType], actionValue)) {
11
- return [...acc, toUnixPath(filePath)];
11
+ const normalizedPath = this._normalizeFileGlob(toUnixPath(filePath));
12
+ return [...acc, normalizedPath];
12
13
  }
13
14
  return acc;
14
15
  }, []);
@@ -62,4 +63,10 @@ export class ThemeActionsUtils {
62
63
  }
63
64
  return false;
64
65
  }
66
+ static _normalizeFileGlob(fileGlob) {
67
+ if (fileGlob.endsWith('/')) {
68
+ return `${fileGlob}${THEME_PUSH_WILDCARD_GLOBS_FOR_FILES}`;
69
+ }
70
+ return fileGlob;
71
+ }
65
72
  }
@@ -3,6 +3,7 @@ import { AppError } from '../../../../cli/utilities/features/logger/logs/app_err
3
3
  import { toUnixPath } from '../../../../utils/path_utils.js';
4
4
  import { ThemeFilesStructureUtils } from '../utils/files_structure/theme_files_structure_utils.js';
5
5
  import { filterFiles } from '../../../utils/shoperignore/shoperignore_utils.js';
6
+ import { THEME_PUSH_WILDCARD_GLOBS_FOR_FILES } from './service/theme_push_service_constants.js';
6
7
  export class ThemePushUtils {
7
8
  static async getAllFilesThatAreSendToRemote(themeDir) {
8
9
  const filesStructure = await ThemeFilesStructureUtils.getThemeFilesStructure(themeDir);
@@ -13,7 +14,7 @@ export class ThemePushUtils {
13
14
  });
14
15
  //need unix styles globs
15
16
  const filesToArchive = Object.keys(filesStructure)
16
- .map((path) => toUnixPath(path))
17
+ .map((path) => ThemePushUtils._normalizeFileGlob(toUnixPath(path)))
17
18
  .filter((path) => path !== '*');
18
19
  //need unix styles globs
19
20
  filesToArchive.push('styles/src/**/*');
@@ -25,4 +26,10 @@ export class ThemePushUtils {
25
26
  const filteredFiles = await filterFiles(allFiles, themeDir);
26
27
  return filteredFiles.sort();
27
28
  }
29
+ static _normalizeFileGlob(fileGlob) {
30
+ if (fileGlob.endsWith('/')) {
31
+ return `${fileGlob}${THEME_PUSH_WILDCARD_GLOBS_FOR_FILES}`;
32
+ }
33
+ return fileGlob;
34
+ }
28
35
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@shoper/cli",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "0.8.0",
5
+ "version": "0.8.1-3",
6
6
  "description": "CLI tool for Shoper",
7
7
  "author": "Joanna Firek",
8
8
  "license": "MIT",