@shoper/cli 0.5.2-1 → 0.5.2-2
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/build/theme/commands/push/theme_push_command.js +2 -2
- package/build/theme/commands/ui/theme_error.js +2 -2
- package/build/theme/features/theme/push/service/theme_push_service.js +11 -5
- package/build/theme/features/theme/utils/files/theme_files_utils.js +0 -2
- package/package.json +1 -1
- package/build/cli/utilities/features/logger/logger_initializer.js +0 -6
|
@@ -112,12 +112,12 @@ export class ThemePushCommand extends BaseThemeCommand {
|
|
|
112
112
|
themeFilesUploadApi
|
|
113
113
|
});
|
|
114
114
|
spinner.stop();
|
|
115
|
-
await promptConfirmation('
|
|
115
|
+
await promptConfirmation('Confirm');
|
|
116
116
|
renderOnce(React.createElement(ThemePushedSuccess, { themeName: await ThemeInfoUtils.getThemeName(executionContext.themeRootDir) }));
|
|
117
117
|
}
|
|
118
118
|
catch (err) {
|
|
119
119
|
spinner?.stop();
|
|
120
|
-
await promptConfirmation('
|
|
120
|
+
await promptConfirmation('Confirm');
|
|
121
121
|
renderOnce(React.createElement(ThemeError, { err: err, executionContext: executionContext }));
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -19,8 +19,8 @@ export const ThemeError = ({ err, executionContext }) => {
|
|
|
19
19
|
return React.createElement(ThemeWorkUrlMismatch, { command: "verify" });
|
|
20
20
|
}
|
|
21
21
|
if (err?.code === THEME_FILES_UPLOAD_ERROR) {
|
|
22
|
-
return (React.createElement(Error, { header: "Uploading theme files to the shop failed
|
|
23
|
-
React.createElement(Text, null, "
|
|
22
|
+
return (React.createElement(Error, { header: "Uploading theme files to the shop failed." },
|
|
23
|
+
React.createElement(Text, null, "Please ensure that the files are not corrupted and that the file extensions are supported.")));
|
|
24
24
|
}
|
|
25
25
|
if (err?.message) {
|
|
26
26
|
return React.createElement(ValidationErrors, { errors: err.message });
|
|
@@ -43,7 +43,9 @@ export class ThemePushService {
|
|
|
43
43
|
themeRootDir,
|
|
44
44
|
themeFilesUploadApi
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
if (!uploadData.isSuccess)
|
|
47
|
+
throw ThemePushErrorsFactory.createErrorWhileUploadingThemeFiles(credentials.shopUrl);
|
|
48
|
+
localFileNameToUploaded = uploadData.localFileNameToUploadedMap;
|
|
47
49
|
}
|
|
48
50
|
const themeArchivePath = join(tmpDir, `${uuid()}.zip`);
|
|
49
51
|
const filesInArchive = await ThemeActionsUtils.getFilesThatMatchesAction({
|
|
@@ -91,18 +93,19 @@ export class ThemePushService {
|
|
|
91
93
|
await themeChecksums.updateAllChecksums();
|
|
92
94
|
}
|
|
93
95
|
catch (err) {
|
|
94
|
-
console.log('err', err);
|
|
95
96
|
await ThemeFilesUtils.removeAFilesListFile(themeRootDir);
|
|
96
97
|
throw err;
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
async _uploadThemeFiles({ filesToUpload, themeRootDir, credentials, themeFilesUploadApi }) {
|
|
100
101
|
try {
|
|
101
|
-
const { uploadedImageData } = await themeFilesUploadApi.uploadFiles(filesToUpload);
|
|
102
|
+
const { uploadedImageData, rejectedImageData } = await themeFilesUploadApi.uploadFiles(filesToUpload);
|
|
102
103
|
if (uploadedImageData.length)
|
|
103
104
|
await ThemeImagesUtils.removeUploadedOriginalFiles(themeRootDir, uploadedImageData);
|
|
104
105
|
return {
|
|
105
|
-
|
|
106
|
+
isSuccess: rejectedImageData.length === 0,
|
|
107
|
+
rejectedImageData,
|
|
108
|
+
localFileNameToUploadedMap: uploadedImageData.reduce((acc, { originalFilename, uploadedFilename }) => {
|
|
106
109
|
return {
|
|
107
110
|
...acc,
|
|
108
111
|
[originalFilename]: uploadedFilename ?? originalFilename
|
|
@@ -137,7 +140,10 @@ export class ThemePushService {
|
|
|
137
140
|
return uniq(withSettingsFiles);
|
|
138
141
|
}
|
|
139
142
|
async _getAllModulesIds(themeRootDir) {
|
|
140
|
-
const
|
|
143
|
+
const modulesPath = join(themeRootDir, MODULES_DIRECTORY_NAME);
|
|
144
|
+
if (!(await fileExists(modulesPath)))
|
|
145
|
+
return [];
|
|
146
|
+
const moduleDirs = await getAllDirectoriesNamesInside(modulesPath);
|
|
141
147
|
const modulesIds = [];
|
|
142
148
|
for (const moduleDir of moduleDirs) {
|
|
143
149
|
const moduleSettingsPath = join(themeRootDir, MODULES_DIRECTORY_NAME, moduleDir, THEME_MODULE_SETTINGS_FILE_NAME);
|
package/package.json
CHANGED