@shoper/cli 0.5.2-5 → 0.5.2-6
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/cli/auth/cli_auth_errors_factory.js +1 -1
- package/build/cli/auth/cli_auth_initializer.js +6 -1
- package/build/cli/auth/service/cli_auth_service.js +11 -2
- package/build/cli/auth/tokens/cli_auth_tokens_errors_factory.js +1 -1
- package/build/cli/auth/tokens/cli_auth_tokens_initalizer.js +6 -1
- package/build/cli/auth/tokens/service/cli_auth_tokens_service.js +8 -1
- package/build/cli/class/base_command.js +15 -1
- package/build/cli/class/errors/file_system_errors_factory.js +3 -3
- package/build/cli/class/errors/http/http_errors_factory.js +2 -2
- package/build/cli/commands/auth/cli_auth_add_token_command.js +5 -0
- package/build/cli/commands/auth/cli_auth_list_tokens_command.js +20 -11
- package/build/cli/commands/auth/cli_auth_logout_command.js +5 -0
- package/build/cli/commands/auth/cli_auth_remove_token_command.js +5 -0
- package/build/cli/commands/auth/cli_auth_switch_token_command.js +8 -0
- package/build/cli/commands/cli_update_command.js +5 -0
- package/build/cli/core/cli_setup.js +11 -18
- package/build/cli/features/execution_context/execution_context_service.js +2 -0
- package/build/cli/features/version/service/cli_version_service.js +2 -2
- package/build/cli/hooks/authorization/ensure_authorization_hook.js +9 -2
- package/build/cli/hooks/ensure_cli_initialized_hook.js +1 -6
- package/build/cli/hooks/ensure_logs_flushed_hook.js +7 -0
- package/build/cli/index.js +0 -1
- package/build/cli/{features → utilities/features}/http_requester/http_client.js +2 -2
- package/build/cli/{features → utilities/features}/http_requester/http_requester_initializer.js +1 -1
- package/build/cli/utilities/features/logger/api/logger_api.js +28 -0
- package/build/cli/utilities/features/logger/logger_constants.js +7 -0
- package/build/cli/utilities/features/logger/logger_initializer.js +44 -0
- package/build/cli/utilities/features/logger/logs/app_error.js +14 -0
- package/build/cli/utilities/features/logger/logs/app_log.js +40 -0
- package/build/cli/{class/errors/app/app_error_constants.js → utilities/features/logger/logs/app_logs_constants.js} +1 -1
- package/build/cli/utilities/features/logger/service/logger_service.js +108 -0
- package/build/cli/utilities/features/logger/transports/log_object_map_transport.js +15 -22
- package/build/index.js +13 -2
- package/build/theme/class/archive/theme_archive.js +45 -0
- package/build/theme/{features/theme/utils/archive/theme_archive_utils_errors_factory.js → class/archive/theme_archive_errors_factory.js} +2 -2
- package/build/theme/class/checksums/theme_checksums.js +34 -52
- package/build/theme/class/checksums/theme_checksums_error_factory.js +3 -3
- package/build/theme/class/fetch_resources/fetch_resources.js +34 -4
- package/build/theme/class/fetch_resources/fetch_resources_errors_factory.js +1 -1
- package/build/theme/commands/delete/theme_delete_command.js +3 -2
- package/build/theme/commands/info/theme_info_command.js +3 -0
- package/build/theme/commands/init/theme_init_command.js +10 -1
- package/build/theme/commands/list/theme_list_command.js +22 -8
- package/build/theme/commands/publish/theme_publish_command.js +5 -1
- package/build/theme/commands/pull/theme_pull_command.js +18 -7
- package/build/theme/commands/push/theme_push_command.js +15 -21
- package/build/theme/commands/theme_verify_command.js +9 -4
- package/build/theme/commands/ui/theme_error.js +3 -3
- package/build/theme/features/theme/actions/service/theme_actions_service.js +42 -2
- package/build/theme/features/theme/actions/theme_actions_constants.js +1 -2
- package/build/theme/features/theme/actions/theme_actions_initializer.js +3 -1
- package/build/theme/features/theme/actions/theme_actions_utils.js +5 -31
- package/build/theme/features/theme/delete/service/theme_delete_service.js +12 -1
- package/build/theme/features/theme/delete/theme_delete_initalizer.js +6 -1
- package/build/theme/features/theme/fetch/service/theme_fetch_service.js +37 -8
- package/build/theme/features/theme/fetch/theme_fetch_initializer.js +3 -0
- package/build/theme/features/theme/init/service/theme_init_service.js +34 -8
- package/build/theme/features/theme/init/theme_init_initializer.js +4 -1
- package/build/theme/features/theme/merge/service/theme_merge_service.js +40 -6
- package/build/theme/features/theme/merge/theme_merge_initializer.js +3 -1
- package/build/theme/features/theme/push/api/theme_push_api.js +2 -2
- package/build/theme/features/theme/push/service/theme_push_service.js +59 -90
- package/build/theme/features/theme/push/theme_push_errors_factory.js +2 -2
- package/build/theme/features/theme/push/theme_push_initializer.js +3 -1
- package/build/theme/features/theme/push/theme_push_utils.js +3 -3
- package/build/theme/features/theme/utils/files_structure/theme_file_structure_errors_factory.js +9 -0
- package/build/theme/features/theme/utils/{files/theme_files_utils.js → files_structure/theme_files_structure_utils.js} +23 -34
- package/build/theme/features/theme/utils/hidden_directory/hidden_directory_utils.js +5 -2
- package/build/theme/features/theme/utils/meta_data/theme_meta_data_error_factory.js +1 -1
- package/build/theme/features/theme/utils/resources/theme_resources_with_id_directory_utils.js +5 -2
- package/build/theme/features/theme/verify/theme_verify_initializer.js +4 -3
- package/build/theme/features/theme/verify/verify/theme_verify_service.js +30 -18
- package/build/theme/features/themes/list/services/themes_list_service.js +36 -5
- package/build/theme/features/themes/list/themes_list_initializer.js +3 -1
- package/build/theme/hooks/ensure_theme_meta_data_untouched_hook.js +4 -2
- package/build/theme/hooks/theme_checksums/ensure_theme_current_checksums_up_to_date_hook.js +7 -2
- package/build/theme/hooks/themes_actions/ensure_themes_actions_hook.js +2 -3
- package/build/ui/hooks/stream_hook.js +26 -0
- package/build/utils/array_utils.js +0 -3
- package/build/utils/download_file/download_file_errors_factory.js +1 -1
- package/build/utils/download_file/download_file_utils.js +19 -1
- package/build/utils/fs/errors/stream_read_error.js +7 -5
- package/build/utils/fs/errors/stream_write_error.js +7 -5
- package/build/utils/fs/fs_utils.js +1 -1
- package/build/utils/get_api.js +9 -0
- package/build/utils/use_api.js +5 -0
- package/build/utils/zip/create_zip_utils.js +21 -9
- package/build/utils/zip/errors/create_zip_error.js +7 -5
- package/build/utils/zip/errors/open_zip_error.js +7 -5
- package/build/utils/zip/extract_zip_utils.js +90 -15
- package/oclif.config.js +2 -1
- package/package.json +13 -13
- package/build/cli/class/errors/app/app_error.js +0 -17
- package/build/theme/features/theme/utils/archive/theme_archive_utils.js +0 -24
- package/build/theme/features/theme/utils/files/them_files_constants.js +0 -1
- package/build/utils/fs/fs_constants.js +0 -6
|
@@ -6,10 +6,17 @@ import { StreamReadError } from '../fs/errors/stream_read_error.js';
|
|
|
6
6
|
import { CreateZipError } from './errors/create_zip_error.js';
|
|
7
7
|
import { StreamWriteError } from '../fs/errors/stream_write_error.js';
|
|
8
8
|
import { join } from '../path_utils.js';
|
|
9
|
-
import { AppError } from '../../cli/
|
|
10
|
-
export const createZip = async ({ files, dist, baseDir = process.cwd() }) => {
|
|
9
|
+
import { AppError } from '../../cli/utilities/features/logger/logs/app_error.js';
|
|
10
|
+
export const createZip = async ({ files, dist, baseDir = process.cwd(), logger }) => {
|
|
11
11
|
const zipfile = new yazl.ZipFile();
|
|
12
12
|
let hasError = false;
|
|
13
|
+
logger.debug('Starting creation of zip file', {
|
|
14
|
+
details: {
|
|
15
|
+
filesCount: files.length,
|
|
16
|
+
dist,
|
|
17
|
+
baseDir
|
|
18
|
+
}
|
|
19
|
+
});
|
|
13
20
|
try {
|
|
14
21
|
for (let i = 0; i < files.length; ++i) {
|
|
15
22
|
const file = files[i];
|
|
@@ -23,56 +30,61 @@ export const createZip = async ({ files, dist, baseDir = process.cwd() }) => {
|
|
|
23
30
|
details: { file, baseDir }
|
|
24
31
|
});
|
|
25
32
|
if (await isDirectory(fullPath)) {
|
|
33
|
+
logger.debug('Adding empty directory to zip', { details: { directory: file } });
|
|
26
34
|
zipfile.addEmptyDirectory(file);
|
|
27
35
|
}
|
|
28
36
|
else {
|
|
37
|
+
logger.debug('Adding file to zip', { details: { file, fullPath } });
|
|
29
38
|
zipfile.addFile(fullPath, file, {
|
|
30
39
|
//TODO params
|
|
31
40
|
compress: true
|
|
32
41
|
});
|
|
33
42
|
}
|
|
34
43
|
}
|
|
44
|
+
logger.debug('Finished adding all files to zip object. Finalizing archive.');
|
|
35
45
|
zipfile.end();
|
|
36
46
|
}
|
|
37
|
-
catch (
|
|
47
|
+
catch (error) {
|
|
38
48
|
throw new AppError({
|
|
39
49
|
message: 'Error creating zip file',
|
|
40
50
|
code: 'ZIP_CREATION_ERROR',
|
|
41
51
|
details: { files, dist, baseDir },
|
|
42
|
-
|
|
52
|
+
error
|
|
43
53
|
});
|
|
44
54
|
}
|
|
45
55
|
return new Promise((resolve, reject) => {
|
|
46
56
|
const zipOutput = createWriteStream(dist);
|
|
47
57
|
zipOutput.on('error', (err) => {
|
|
48
58
|
hasError = true;
|
|
59
|
+
logger.debug('Write stream error while creating zip file. Cleaning up.', { details: { dist } });
|
|
49
60
|
removeFiles(files).then(() => {
|
|
50
61
|
reject(new StreamWriteError({
|
|
51
62
|
filePath: dist,
|
|
52
|
-
|
|
53
|
-
stack: err.stack
|
|
63
|
+
error: err
|
|
54
64
|
}));
|
|
55
65
|
});
|
|
56
66
|
});
|
|
57
67
|
zipfile.outputStream.pipe(zipOutput).on('close', () => {
|
|
58
68
|
if (hasError) {
|
|
69
|
+
logger.debug('Zip stream closed with error. Cleaning up.', { details: { dist } });
|
|
59
70
|
removeFiles(files).then(() => {
|
|
60
71
|
reject(new CreateZipError({
|
|
61
72
|
file: dist,
|
|
62
|
-
|
|
73
|
+
error: new Error()
|
|
63
74
|
}));
|
|
64
75
|
});
|
|
65
76
|
return;
|
|
66
77
|
}
|
|
78
|
+
logger.debug('Zip file created successfully.', { details: { dist } });
|
|
67
79
|
resolve();
|
|
68
80
|
});
|
|
69
81
|
zipfile.outputStream.on('error', (err) => {
|
|
70
82
|
hasError = true;
|
|
83
|
+
logger.debug('Read stream error while creating zip file. Cleaning up.', { details: { dist } });
|
|
71
84
|
removeFiles(files).then(() => {
|
|
72
85
|
reject(new StreamReadError({
|
|
73
86
|
filePath: dist,
|
|
74
|
-
|
|
75
|
-
stack: err.stack
|
|
87
|
+
error: err
|
|
76
88
|
}));
|
|
77
89
|
});
|
|
78
90
|
});
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { AppError } from '../../../cli/
|
|
1
|
+
import { AppError } from '../../../cli/utilities/features/logger/logs/app_error.js';
|
|
2
2
|
export class CreateZipError extends AppError {
|
|
3
|
-
constructor({
|
|
3
|
+
constructor({ error, file }) {
|
|
4
4
|
super({
|
|
5
5
|
code: 'ZIP_FILE_CREATE_ERROR',
|
|
6
|
-
message: `Error creating zip file
|
|
7
|
-
details
|
|
8
|
-
|
|
6
|
+
message: `Error creating zip file`,
|
|
7
|
+
details: {
|
|
8
|
+
file
|
|
9
|
+
},
|
|
10
|
+
error
|
|
9
11
|
});
|
|
10
12
|
}
|
|
11
13
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { AppError } from '../../../cli/
|
|
1
|
+
import { AppError } from '../../../cli/utilities/features/logger/logs/app_error.js';
|
|
2
2
|
export class OpenZipError extends AppError {
|
|
3
|
-
constructor({
|
|
3
|
+
constructor({ error, file }) {
|
|
4
4
|
super({
|
|
5
5
|
code: 'ZIP_FILE_OPEN_ERROR',
|
|
6
|
-
message: `Error opening zip file
|
|
7
|
-
details
|
|
8
|
-
|
|
6
|
+
message: `Error opening zip file`,
|
|
7
|
+
details: {
|
|
8
|
+
file
|
|
9
|
+
},
|
|
10
|
+
error
|
|
9
11
|
});
|
|
10
12
|
}
|
|
11
13
|
}
|
|
@@ -6,21 +6,44 @@ import { StreamWriteError } from '../fs/errors/stream_write_error.js';
|
|
|
6
6
|
import { StreamReadError } from '../fs/errors/stream_read_error.js';
|
|
7
7
|
import { OpenZipError } from './errors/open_zip_error.js';
|
|
8
8
|
import { pipeline } from 'node:stream/promises';
|
|
9
|
-
export const extractZip = async ({ source, dist, getTransforms = () => [] }) => {
|
|
9
|
+
export const extractZip = async ({ source, dist, logger, getTransforms = () => [] }) => {
|
|
10
10
|
let createdDirectory = false;
|
|
11
|
+
logger.debug('Starting extraction of zip file', {
|
|
12
|
+
details: {
|
|
13
|
+
source,
|
|
14
|
+
dist
|
|
15
|
+
}
|
|
16
|
+
});
|
|
11
17
|
if (!(await directoryExists(dist))) {
|
|
12
18
|
createdDirectory = true;
|
|
19
|
+
logger.debug('Destination directory does not exist. Creating.', {
|
|
20
|
+
details: {
|
|
21
|
+
directory: dist
|
|
22
|
+
}
|
|
23
|
+
});
|
|
13
24
|
await makeDirectory(dist, { recursive: true });
|
|
14
25
|
}
|
|
15
26
|
return new Promise((resolve, reject) => {
|
|
16
27
|
const processedFilesPath = [];
|
|
17
|
-
yauzl.open(source, { lazyEntries: true }, (
|
|
18
|
-
|
|
19
|
-
|
|
28
|
+
yauzl.open(source, { lazyEntries: true }, (error, zipfile) => {
|
|
29
|
+
logger.debug('Zip file opened for extraction', {
|
|
30
|
+
details: {
|
|
31
|
+
source,
|
|
32
|
+
dist
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
if (error) {
|
|
36
|
+
if (createdDirectory) {
|
|
37
|
+
logger.debug('Removing created directory due to an error.', {
|
|
38
|
+
details: {
|
|
39
|
+
directory: dist
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
removeDirectorySync(dist, { recursive: true });
|
|
43
|
+
}
|
|
20
44
|
return reject(new OpenZipError({
|
|
21
45
|
file: source,
|
|
22
|
-
|
|
23
|
-
stack: err.stack
|
|
46
|
+
error
|
|
24
47
|
}));
|
|
25
48
|
}
|
|
26
49
|
let activeEntries = 0;
|
|
@@ -31,16 +54,26 @@ export const extractZip = async ({ source, dist, getTransforms = () => [] }) =>
|
|
|
31
54
|
const filePath = join(dist, entry.fileName);
|
|
32
55
|
const dirPath = dirname(filePath);
|
|
33
56
|
processedFilesPath.push(filePath);
|
|
57
|
+
logger.debug('Extracting zip entry', {
|
|
58
|
+
details: {
|
|
59
|
+
entryName: entry.fileName,
|
|
60
|
+
filePath: filePath
|
|
61
|
+
}
|
|
62
|
+
});
|
|
34
63
|
if (!filePath.startsWith(dist)) {
|
|
35
64
|
return reject(new Error(`Invalid entry path: ${entry.fileName}`));
|
|
36
65
|
}
|
|
37
66
|
if (looksLikeDirectory(entry.fileName)) {
|
|
67
|
+
logger.debug('Entry looks like a directory, skipping file write.', {
|
|
68
|
+
details: {
|
|
69
|
+
entry: entry.fileName
|
|
70
|
+
}
|
|
71
|
+
});
|
|
38
72
|
zipfile.readEntry();
|
|
39
73
|
return;
|
|
40
74
|
}
|
|
41
|
-
if (extractedPaths.has(filePath))
|
|
75
|
+
if (extractedPaths.has(filePath))
|
|
42
76
|
return reject(new Error(`Duplicate entry path detected: ${filePath}`));
|
|
43
|
-
}
|
|
44
77
|
extractedPaths.add(filePath);
|
|
45
78
|
makeDirectory(dirPath, { recursive: true })
|
|
46
79
|
.then(() => {
|
|
@@ -50,31 +83,58 @@ export const extractZip = async ({ source, dist, getTransforms = () => [] }) =>
|
|
|
50
83
|
const writeStream = createWriteStream(filePath);
|
|
51
84
|
writeStream.on('finish', () => {
|
|
52
85
|
activeEntries--;
|
|
53
|
-
|
|
86
|
+
logger.debug('Finished writing file.', {
|
|
87
|
+
details: {
|
|
88
|
+
file: filePath,
|
|
89
|
+
activeEntries
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
if (activeEntries === 0 && doneReadingEntries) {
|
|
93
|
+
logger.debug('All entries processed and written.');
|
|
54
94
|
resolve();
|
|
95
|
+
}
|
|
55
96
|
zipfile.readEntry();
|
|
56
97
|
});
|
|
57
98
|
writeStream.on('error', async (err) => {
|
|
99
|
+
logger.debug('Write stream error. Removing file.', {
|
|
100
|
+
details: {
|
|
101
|
+
file: filePath
|
|
102
|
+
}
|
|
103
|
+
});
|
|
58
104
|
await removeFile(filePath);
|
|
59
105
|
reject(new StreamWriteError({
|
|
60
106
|
filePath,
|
|
61
|
-
|
|
62
|
-
stack: err.stack
|
|
107
|
+
error: err
|
|
63
108
|
}));
|
|
64
109
|
});
|
|
65
110
|
readStream.on('error', async (err) => {
|
|
111
|
+
logger.debug('Read stream error. Removing file.', {
|
|
112
|
+
details: {
|
|
113
|
+
file: filePath
|
|
114
|
+
}
|
|
115
|
+
});
|
|
66
116
|
await removeFile(filePath, { force: true });
|
|
67
117
|
reject(new StreamReadError({
|
|
68
118
|
filePath,
|
|
69
|
-
|
|
70
|
-
stack: err.stack
|
|
119
|
+
error: err
|
|
71
120
|
}));
|
|
72
121
|
});
|
|
73
122
|
const transforms = getTransforms(entry.fileName);
|
|
74
123
|
if (transforms.length) {
|
|
124
|
+
logger.debug('Applying transform(s) to entry.', {
|
|
125
|
+
details: {
|
|
126
|
+
transformsCount: transforms.length,
|
|
127
|
+
entry: entry.fileName
|
|
128
|
+
}
|
|
129
|
+
});
|
|
75
130
|
await pipeline(readStream, ...transforms, writeStream);
|
|
76
131
|
}
|
|
77
132
|
else {
|
|
133
|
+
logger.debug('No transforms for entry. Piping directly.', {
|
|
134
|
+
details: {
|
|
135
|
+
entry: entry.fileName
|
|
136
|
+
}
|
|
137
|
+
});
|
|
78
138
|
readStream.pipe(writeStream);
|
|
79
139
|
}
|
|
80
140
|
});
|
|
@@ -83,19 +143,34 @@ export const extractZip = async ({ source, dist, getTransforms = () => [] }) =>
|
|
|
83
143
|
});
|
|
84
144
|
zipfile.on('end', () => {
|
|
85
145
|
doneReadingEntries = true;
|
|
86
|
-
|
|
146
|
+
logger.debug('Finished reading all zip entries.');
|
|
147
|
+
if (activeEntries === 0) {
|
|
148
|
+
logger.debug('All entries were processed before zip file "end" event.');
|
|
87
149
|
resolve();
|
|
150
|
+
}
|
|
88
151
|
});
|
|
89
152
|
zipfile.on('error', async (err) => {
|
|
90
153
|
for (const filePath of processedFilesPath) {
|
|
91
154
|
try {
|
|
155
|
+
logger.debug('Cleaning up extracted file due to an error.', {
|
|
156
|
+
details: {
|
|
157
|
+
file: filePath
|
|
158
|
+
}
|
|
159
|
+
});
|
|
92
160
|
await removeFile(filePath, { force: true });
|
|
93
161
|
}
|
|
94
162
|
catch (removeErr) {
|
|
95
163
|
console.error(`Error removing file ${filePath}:`, removeErr);
|
|
96
164
|
}
|
|
97
165
|
}
|
|
98
|
-
|
|
166
|
+
if (createdDirectory) {
|
|
167
|
+
logger.debug('Cleaning up created directory due to an error.', {
|
|
168
|
+
details: {
|
|
169
|
+
directory: dist
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
await removeDirectory(dist, { recursive: true });
|
|
173
|
+
}
|
|
99
174
|
reject(err);
|
|
100
175
|
});
|
|
101
176
|
zipfile.readEntry();
|
package/oclif.config.js
CHANGED
|
@@ -21,7 +21,8 @@ export default {
|
|
|
21
21
|
'./build/theme/hooks/ensure_theme_meta_data_untouched_hook.js',
|
|
22
22
|
'./build/theme/hooks/theme_checksums/ensure_theme_current_checksums_up_to_date_hook.js',
|
|
23
23
|
'./build/theme/hooks/themes_actions/ensure_themes_actions_hook.js'
|
|
24
|
-
]
|
|
24
|
+
],
|
|
25
|
+
finally: ['./build/cli/hooks/ensure_logs_flushed_hook.js']
|
|
25
26
|
},
|
|
26
27
|
topicSeparator: ' ',
|
|
27
28
|
topics: {
|
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.5.2-
|
|
5
|
+
"version": "0.5.2-6",
|
|
6
6
|
"description": "CLI tool for Shoper",
|
|
7
7
|
"author": "Joanna Firek",
|
|
8
8
|
"license": "MIT",
|
|
@@ -39,32 +39,33 @@
|
|
|
39
39
|
"@oclif/plugin-help": "6.2.27",
|
|
40
40
|
"@oclif/plugin-version": "2.2.27",
|
|
41
41
|
"@oclif/plugin-warn-if-update-available": "3.1.38",
|
|
42
|
-
"axios": "1.
|
|
42
|
+
"axios": "1.13.1",
|
|
43
43
|
"chalk": "5.4.1",
|
|
44
44
|
"conf": "13.1.0",
|
|
45
45
|
"fast-glob": "3.3.3",
|
|
46
|
+
"figures": "6.1.0",
|
|
47
|
+
"fs-extra": "11.3.0",
|
|
46
48
|
"fs-tree-diff": "2.0.1",
|
|
47
49
|
"ink": "6.0.1",
|
|
50
|
+
"ink-link": "4.1.0",
|
|
48
51
|
"inquirer": "12.5.2",
|
|
52
|
+
"inquirer-select-line": "1.1.3",
|
|
49
53
|
"is-hidden-file": "1.1.2",
|
|
50
54
|
"jsonwebtoken": "9.0.2",
|
|
51
55
|
"klaw": "4.1.0",
|
|
52
56
|
"lodash": "4.17.21",
|
|
57
|
+
"log-symbols": "7.0.1",
|
|
53
58
|
"memfs": "4.17.0",
|
|
54
59
|
"ora": "8.2.0",
|
|
60
|
+
"pino": "10.1.0",
|
|
61
|
+
"pino-pretty": "13.1.2",
|
|
55
62
|
"react": "19.1.0",
|
|
56
63
|
"reflect-metadata": "0.2.2",
|
|
57
64
|
"rxjs": "7.8.2",
|
|
58
65
|
"semver": "7.7.1",
|
|
66
|
+
"strip-ansi": "7.1.0",
|
|
59
67
|
"tmp-promise": "3.0.3",
|
|
60
68
|
"uuid": "11.1.0",
|
|
61
|
-
"fs-extra": "11.3.0",
|
|
62
|
-
"ink-link": "4.1.0",
|
|
63
|
-
"log-symbols": "7.0.1",
|
|
64
|
-
"figures": "6.1.0",
|
|
65
|
-
"strip-ansi": "7.1.0",
|
|
66
|
-
"inquirer-select-line": "1.1.3",
|
|
67
|
-
"micromatch": "4.0.8",
|
|
68
69
|
"walk-sync": "3.0.0",
|
|
69
70
|
"yauzl": "3.2.0",
|
|
70
71
|
"yazl": "3.3.1"
|
|
@@ -78,18 +79,17 @@
|
|
|
78
79
|
"@types/fs-extra": "11.0.4",
|
|
79
80
|
"@types/jest": "29.5.14",
|
|
80
81
|
"@types/jsonwebtoken": "9.0.9",
|
|
82
|
+
"@types/klaw": "3.0.7",
|
|
83
|
+
"@types/lodash": "4.17.17",
|
|
81
84
|
"@types/node": "18.19.84",
|
|
82
85
|
"@types/react": "19.1.8",
|
|
83
86
|
"@types/semver": "7.7.0",
|
|
84
87
|
"@types/tmp": "0.2.6",
|
|
85
88
|
"@types/yauzl": "2.10.3",
|
|
86
89
|
"@types/yazl": "2.4.6",
|
|
87
|
-
"@types/klaw": "3.0.7",
|
|
88
|
-
"@types/lodash": "4.17.17",
|
|
89
|
-
"@types/micromatch": "4.0.9",
|
|
90
90
|
"@typescript-eslint/eslint-plugin": "8.29.1",
|
|
91
91
|
"babel-jest": "29.7.0",
|
|
92
|
-
"eslint": "9.
|
|
92
|
+
"eslint": "9.39.1",
|
|
93
93
|
"eslint-config-prettier": "10.1.1",
|
|
94
94
|
"eslint-plugin-prettier": "5.2.6",
|
|
95
95
|
"jest": "29.7.0",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { APP_ERRORS_LEVELS } from './app_error_constants.js';
|
|
2
|
-
//TODO errory do zaprojektownia
|
|
3
|
-
export class AppError extends Error {
|
|
4
|
-
code;
|
|
5
|
-
level;
|
|
6
|
-
tags;
|
|
7
|
-
details;
|
|
8
|
-
stack;
|
|
9
|
-
constructor({ code, details, message, level = APP_ERRORS_LEVELS.error, tags, stack }) {
|
|
10
|
-
super(message);
|
|
11
|
-
this.code = code;
|
|
12
|
-
this.details = details;
|
|
13
|
-
this.level = level;
|
|
14
|
-
this.tags = tags;
|
|
15
|
-
this.stack = stack;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createZip } from '../../../../../utils/zip/create_zip_utils.js';
|
|
2
|
-
import { extname, join } from '../../../../../utils/path_utils.js';
|
|
3
|
-
import { formatJSONFile } from '../../../../../utils/fs/fs_utils.js';
|
|
4
|
-
import { ThemeArchiveErrorsFactory } from './theme_archive_utils_errors_factory.js';
|
|
5
|
-
export class ThemeArchiveUtils {
|
|
6
|
-
static async create({ dist, files, rootDir }) {
|
|
7
|
-
try {
|
|
8
|
-
await this._formatJsonFiles(rootDir, files);
|
|
9
|
-
return createZip({
|
|
10
|
-
files,
|
|
11
|
-
baseDir: rootDir,
|
|
12
|
-
dist
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
catch (err) {
|
|
16
|
-
throw ThemeArchiveErrorsFactory.createErrorWhileCreatingThemeArchive(err);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
static async _formatJsonFiles(themeRootDir, filesToUpload) {
|
|
20
|
-
await Promise.all(filesToUpload
|
|
21
|
-
.filter((path) => extname(path).toLowerCase() === '.json')
|
|
22
|
-
.map((jsonFile) => formatJSONFile(join(themeRootDir, jsonFile))));
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const FILES_LIST_CUSTOM_MODULES_TO_KEEP_IDS = 'customModulesIdsToKeep';
|