@shoper/cli 0.8.1-3 → 0.8.1-5
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/README.md +1 -11
- package/build/cli/class/errors/http/http_errors_factory.js +1 -1
- package/build/cli/core/cli_setup.js +6 -6
- package/build/cli/index.js +1 -0
- package/build/cli/utilities/features/logger/logs/app_logs_constants.js +2 -1
- package/build/index.js +2 -2
- package/build/theme/class/archive/theme_archive.js +1 -47
- package/build/theme/class/browser/browser.js +108 -0
- package/build/theme/class/checksums/theme_checksums.js +51 -11
- package/build/theme/commands/pull/theme_pull_command.js +4 -3
- package/build/theme/commands/push/theme_push_command.js +17 -8
- package/build/theme/commands/theme_commands_constants.js +2 -1
- package/build/theme/commands/theme_verify_command.js +3 -3
- package/build/theme/commands/ui/theme_error.js +6 -6
- package/build/theme/commands/watch/theme_watch_command.js +89 -0
- package/build/theme/commands/watch/theme_watch_constants.js +21 -0
- package/build/theme/commands/watch/theme_watch_utils.js +32 -0
- package/build/theme/commands/watch/theme_watching_info.js +14 -0
- package/build/theme/commands/watch/watch.js +55 -0
- package/build/theme/features/theme/actions/theme_actions_constants.js +2 -1
- package/build/theme/features/theme/actions/theme_actions_utils.js +66 -15
- package/build/theme/features/theme/fetch/service/theme_fetch_service.js +2 -4
- package/build/theme/features/theme/init/service/theme_init_service.js +2 -4
- package/build/theme/features/theme/merge/service/theme_merge_service.js +2 -2
- package/build/theme/features/theme/push/api/theme_push_api.js +2 -2
- package/build/theme/features/theme/push/service/theme_push_service.js +93 -33
- package/build/theme/features/theme/push/service/theme_push_service_types.js +1 -0
- package/build/theme/features/theme/push/theme_push_utils.js +6 -9
- package/build/theme/features/theme/utils/archive/theme_archive_utils.js +26 -0
- package/build/theme/{class/archive/theme_archive_errors_factory.js → features/theme/utils/archive/theme_archive_utils_errors_factory.js} +1 -1
- package/build/theme/features/theme/utils/files/them_files_constants.js +1 -0
- package/build/theme/features/theme/utils/{files_structure/theme_files_structure_utils.js → files/theme_files_utils.js} +36 -28
- package/build/theme/features/theme/utils/files_structure/theme_file_structure_errors_factory.js +1 -9
- package/build/theme/features/theme/utils/meta_data/theme_meta_data_utils.js +0 -28
- package/build/theme/features/theme/verify/verify/theme_verify_service.js +19 -12
- package/build/theme/features/theme/watch/api/theme_watch_api.js +19 -0
- package/build/theme/features/theme/watch/service/theme_watch_service.js +167 -0
- package/build/theme/features/theme/watch/theme_watch_constants.js +4 -0
- package/build/theme/features/theme/watch/theme_watch_initializer.js +22 -0
- package/build/theme/index.js +6 -2
- package/build/theme/utils/directory_validator/directory_validator_utils.js +4 -11
- package/build/ui/command_input/command_input.js +25 -0
- package/build/ui/logs/log_entry.js +12 -0
- package/build/ui/logs/logs_constants.js +20 -0
- package/build/ui/logs/logs_list.js +18 -0
- package/build/ui/logs/use_logs.js +23 -0
- package/build/ui/ui_dump/ui_dump.js +9 -4
- package/build/utils/array_utils.js +3 -0
- package/build/utils/fs/fs_constants.js +6 -0
- package/build/utils/fs/fs_utils.js +1 -1
- package/package.json +11 -6
- package/build/theme/utils/shoperignore/shoperignore_utils.js +0 -36
|
@@ -16,6 +16,7 @@ import { MessageBox } from '../message_box/message_box.js';
|
|
|
16
16
|
import { MESSAGE_BOX_VARIANTS } from '../message_box/message_box_constants.js';
|
|
17
17
|
import { TABLE_COMPONENT_DATA } from './ui_dump_constants.js';
|
|
18
18
|
import { Table } from '../table/table.js';
|
|
19
|
+
import { Text } from '../text.js';
|
|
19
20
|
export const UiDump = () => {
|
|
20
21
|
return (React.createElement(Box, { flexDirection: "column", gap: 1 },
|
|
21
22
|
React.createElement(UiComponentBox, { name: "Icons" },
|
|
@@ -41,13 +42,17 @@ export const UiDump = () => {
|
|
|
41
42
|
React.createElement(Flag, null, "--with-settings"),
|
|
42
43
|
"` flag.")),
|
|
43
44
|
React.createElement(UiComponentBox, { name: "Success Message Box" },
|
|
44
|
-
React.createElement(MessageBox, { header: "Theme created!", type: MESSAGE_BOX_VARIANTS.success },
|
|
45
|
+
React.createElement(MessageBox, { header: "Theme created!", type: MESSAGE_BOX_VARIANTS.success },
|
|
46
|
+
React.createElement(Text, null, "A copy of theme ID: 1 (\"Storefront\") has been created with the name \"Storefront Copy 2\" and ID: 5."))),
|
|
45
47
|
React.createElement(UiComponentBox, { name: "Info Message Box" },
|
|
46
|
-
React.createElement(MessageBox, { header: "Theme created!", type: MESSAGE_BOX_VARIANTS.info },
|
|
48
|
+
React.createElement(MessageBox, { header: "Theme created!", type: MESSAGE_BOX_VARIANTS.info },
|
|
49
|
+
React.createElement(Text, null, "A copy of theme ID: 1 (\"Storefront\") has been created with the name \"Storefront Copy 2\" and ID: 5."))),
|
|
47
50
|
React.createElement(UiComponentBox, { name: "Warnging Message Box" },
|
|
48
|
-
React.createElement(MessageBox, { header: "Theme created!", type: MESSAGE_BOX_VARIANTS.warning },
|
|
51
|
+
React.createElement(MessageBox, { header: "Theme created!", type: MESSAGE_BOX_VARIANTS.warning },
|
|
52
|
+
React.createElement(Text, null, "A copy of theme ID: 1 (\"Storefront\") has been created with the name \"Storefront Copy 2\" and ID: 5."))),
|
|
49
53
|
React.createElement(UiComponentBox, { name: "Error Message Box" },
|
|
50
|
-
React.createElement(MessageBox, { header: "Theme created!", type: MESSAGE_BOX_VARIANTS.error },
|
|
54
|
+
React.createElement(MessageBox, { header: "Theme created!", type: MESSAGE_BOX_VARIANTS.error },
|
|
55
|
+
React.createElement(Text, null, "A copy of theme ID: 1 (\"Storefront\") has been created with the name \"Storefront Copy 2\" and ID: 5."))),
|
|
51
56
|
React.createElement(UiComponentBox, { name: "Table" },
|
|
52
57
|
React.createElement(Table, { data: TABLE_COMPONENT_DATA }))));
|
|
53
58
|
};
|
|
@@ -100,7 +100,7 @@ export const getAllFilesAndDirectoriesInside = async (path, options) => {
|
|
|
100
100
|
withFileTypes
|
|
101
101
|
});
|
|
102
102
|
};
|
|
103
|
-
export const getAllDirectoriesNamesInside = async (path, options) => {
|
|
103
|
+
export const getAllDirectoriesNamesInside = async (path, options = { recursive: false, hidden: false }) => {
|
|
104
104
|
const { recursive = true, hidden = true } = options;
|
|
105
105
|
const files = await fsPromises.readdir(path, {
|
|
106
106
|
recursive,
|
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.1-
|
|
5
|
+
"version": "0.8.1-5",
|
|
6
6
|
"description": "CLI tool for Shoper",
|
|
7
7
|
"author": "Joanna Firek",
|
|
8
8
|
"license": "MIT",
|
|
@@ -48,14 +48,13 @@
|
|
|
48
48
|
"chalk": "5.4.1",
|
|
49
49
|
"conf": "13.1.0",
|
|
50
50
|
"fast-glob": "3.3.3",
|
|
51
|
-
"figlet": "1.9.4",
|
|
52
51
|
"figures": "6.1.0",
|
|
53
52
|
"fs-extra": "11.3.0",
|
|
54
53
|
"fs-tree-diff": "2.0.1",
|
|
55
|
-
"ignore": "7.0.5",
|
|
56
54
|
"ink": "6.0.1",
|
|
57
55
|
"ink-link": "4.1.0",
|
|
58
56
|
"ink-gradient": "3.0.0",
|
|
57
|
+
"ink-text-input": "6.0.0",
|
|
59
58
|
"inquirer": "12.5.2",
|
|
60
59
|
"inquirer-select-line": "1.1.3",
|
|
61
60
|
"is-hidden-file": "1.1.2",
|
|
@@ -69,14 +68,19 @@
|
|
|
69
68
|
"pino-pretty": "13.1.2",
|
|
70
69
|
"react": "19.1.0",
|
|
71
70
|
"reflect-metadata": "0.2.2",
|
|
71
|
+
"chokidar": "4.0.3",
|
|
72
72
|
"rxjs": "7.8.2",
|
|
73
73
|
"semver": "7.7.1",
|
|
74
74
|
"strip-ansi": "7.1.0",
|
|
75
75
|
"tmp-promise": "3.0.3",
|
|
76
76
|
"uuid": "11.1.0",
|
|
77
|
+
"micromatch": "4.0.8",
|
|
77
78
|
"walk-sync": "3.0.0",
|
|
78
79
|
"yauzl": "3.2.0",
|
|
79
|
-
"
|
|
80
|
+
"figlet": "1.9.4",
|
|
81
|
+
"yazl": "3.3.1",
|
|
82
|
+
"puppeteer": "24.31.0",
|
|
83
|
+
"gradient-string": "3.0.0"
|
|
80
84
|
},
|
|
81
85
|
"devDependencies": {
|
|
82
86
|
"@babel/core": "7.27.1",
|
|
@@ -87,14 +91,15 @@
|
|
|
87
91
|
"@types/fs-extra": "11.0.4",
|
|
88
92
|
"@types/jest": "29.5.14",
|
|
89
93
|
"@types/jsonwebtoken": "9.0.9",
|
|
90
|
-
"@types/klaw": "3.0.7",
|
|
91
|
-
"@types/lodash": "4.17.17",
|
|
92
94
|
"@types/node": "18.19.84",
|
|
93
95
|
"@types/react": "19.1.8",
|
|
94
96
|
"@types/semver": "7.7.0",
|
|
95
97
|
"@types/tmp": "0.2.6",
|
|
96
98
|
"@types/yauzl": "2.10.3",
|
|
97
99
|
"@types/yazl": "2.4.6",
|
|
100
|
+
"@types/klaw": "3.0.7",
|
|
101
|
+
"@types/lodash": "4.17.17",
|
|
102
|
+
"@types/micromatch": "4.0.9",
|
|
98
103
|
"@typescript-eslint/eslint-plugin": "8.29.1",
|
|
99
104
|
"babel-jest": "29.7.0",
|
|
100
105
|
"eslint": "9.39.1",
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import { join } from '../../../utils/path_utils.js';
|
|
3
|
-
import { fileExists } from '../../../utils/fs/fs_utils.js';
|
|
4
|
-
import ignore from 'ignore';
|
|
5
|
-
export const SHOPER_IGNORE_FILE_NAME = '.shoperignore';
|
|
6
|
-
export async function loadShoperIgnore(themeRootDir) {
|
|
7
|
-
const shoperIgnorePath = join(themeRootDir, SHOPER_IGNORE_FILE_NAME);
|
|
8
|
-
if (!(await fileExists(shoperIgnorePath))) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
try {
|
|
12
|
-
const content = await readFile(shoperIgnorePath, 'utf-8');
|
|
13
|
-
const ig = ignore();
|
|
14
|
-
ig.add('.shoperignore');
|
|
15
|
-
ig.add('.gitignore');
|
|
16
|
-
ig.add(content);
|
|
17
|
-
return ig;
|
|
18
|
-
}
|
|
19
|
-
catch {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export async function filterFiles(files, themeRootDir, ignoreInstance) {
|
|
24
|
-
const ig = ignoreInstance !== undefined ? ignoreInstance : await loadShoperIgnore(themeRootDir);
|
|
25
|
-
if (!ig) {
|
|
26
|
-
return files;
|
|
27
|
-
}
|
|
28
|
-
return files.filter((file) => !ig.ignores(file));
|
|
29
|
-
}
|
|
30
|
-
export async function isIgnored(filePath, themeRootDir, ignoreInstance) {
|
|
31
|
-
const ig = ignoreInstance !== undefined ? ignoreInstance : await loadShoperIgnore(themeRootDir);
|
|
32
|
-
if (!ig) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
return ig.ignores(filePath);
|
|
36
|
-
}
|