@contentstack/cli-cm-export 2.0.0-beta → 2.0.0-beta.1
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 -1
- package/lib/utils/progress-strategy-registry.js +88 -82
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ $ npm install -g @contentstack/cli-cm-export
|
|
|
48
48
|
$ csdx COMMAND
|
|
49
49
|
running command...
|
|
50
50
|
$ csdx (--version)
|
|
51
|
-
@contentstack/cli-cm-export/2.0.0-beta linux-x64 node-v22.20.0
|
|
51
|
+
@contentstack/cli-cm-export/2.0.0-beta.1 linux-x64 node-v22.20.0
|
|
52
52
|
$ csdx --help [COMMAND]
|
|
53
53
|
USAGE
|
|
54
54
|
$ csdx COMMAND
|
|
@@ -7,86 +7,92 @@ const constants_1 = require("./constants");
|
|
|
7
7
|
* to ensure correct item counts in the final summary.
|
|
8
8
|
*/
|
|
9
9
|
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.
|
|
38
|
-
|
|
39
|
-
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.
|
|
40
|
-
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.
|
|
41
|
-
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.
|
|
42
|
-
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.
|
|
43
|
-
|
|
44
|
-
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.
|
|
45
|
-
// Register strategy for
|
|
46
|
-
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
// Register strategy for
|
|
69
|
-
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.
|
|
70
|
-
//
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
10
|
+
// Wrap all registrations in try-catch to prevent module loading errors
|
|
11
|
+
try {
|
|
12
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.CONTENT_TYPES], new cli_utilities_1.DefaultProgressStrategy());
|
|
13
|
+
// Register strategy for Assets - custom strategy to avoid double counting
|
|
14
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.ASSETS], new cli_utilities_1.CustomProgressStrategy((processes) => {
|
|
15
|
+
// Both ASSET_METADATA and ASSET_DOWNLOADS represent the same assets
|
|
16
|
+
// Count only the downloads process to avoid double counting in summary
|
|
17
|
+
const downloadsProcess = processes.get(constants_1.PROCESS_NAMES.ASSET_DOWNLOADS);
|
|
18
|
+
if (downloadsProcess) {
|
|
19
|
+
return {
|
|
20
|
+
total: downloadsProcess.total,
|
|
21
|
+
success: downloadsProcess.successCount,
|
|
22
|
+
failures: downloadsProcess.failureCount,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
// Fallback to metadata process if downloads don't exist
|
|
26
|
+
const metadataProcess = processes.get(constants_1.PROCESS_NAMES.ASSET_METADATA);
|
|
27
|
+
if (metadataProcess) {
|
|
28
|
+
return {
|
|
29
|
+
total: metadataProcess.total,
|
|
30
|
+
success: metadataProcess.successCount,
|
|
31
|
+
failures: metadataProcess.failureCount,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return null; // Fall back to default aggregation
|
|
35
|
+
}));
|
|
36
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.GLOBAL_FIELDS], new cli_utilities_1.DefaultProgressStrategy());
|
|
37
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.EXTENSIONS], new cli_utilities_1.DefaultProgressStrategy());
|
|
38
|
+
// Register strategy for Environments - simple module
|
|
39
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.ENVIRONMENTS], new cli_utilities_1.DefaultProgressStrategy());
|
|
40
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.LOCALES], new cli_utilities_1.DefaultProgressStrategy());
|
|
41
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.LABELS], new cli_utilities_1.DefaultProgressStrategy());
|
|
42
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.WEBHOOKS], new cli_utilities_1.DefaultProgressStrategy());
|
|
43
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.WORKFLOWS], new cli_utilities_1.DefaultProgressStrategy());
|
|
44
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.CUSTOM_ROLES], new cli_utilities_1.DefaultProgressStrategy());
|
|
45
|
+
// Register strategy for Taxonomies - use Taxonomies & Terms as primary process
|
|
46
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.TAXONOMIES], new cli_utilities_1.PrimaryProcessStrategy(constants_1.PROCESS_NAMES.EXPORT_TAXONOMIES_TERMS));
|
|
47
|
+
// Register strategy for Marketplace Apps - complex module with app installations
|
|
48
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.MARKETPLACE_APPS], new cli_utilities_1.CustomProgressStrategy((processes) => {
|
|
49
|
+
// For marketplace apps, count the actual apps exported
|
|
50
|
+
const appsExport = processes.get(constants_1.PROCESS_NAMES.FETCH_APPS);
|
|
51
|
+
if (appsExport) {
|
|
52
|
+
return {
|
|
53
|
+
total: appsExport.total,
|
|
54
|
+
success: appsExport.successCount,
|
|
55
|
+
failures: appsExport.failureCount,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const setup = processes.get(constants_1.PROCESS_NAMES.FETCH_CONFIG_MANIFEST);
|
|
59
|
+
if (setup) {
|
|
60
|
+
return {
|
|
61
|
+
total: setup.total,
|
|
62
|
+
success: setup.successCount,
|
|
63
|
+
failures: setup.failureCount,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}));
|
|
68
|
+
// Register strategy for Stack Settings - use Settings as primary process
|
|
69
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.STACK], new cli_utilities_1.PrimaryProcessStrategy(constants_1.PROCESS_NAMES.STACK_SETTINGS));
|
|
70
|
+
// Register strategy for Personalize - complex module with projects/experiences
|
|
71
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.PERSONALIZE], new cli_utilities_1.CustomProgressStrategy((processes) => {
|
|
72
|
+
// For personalize, we want to count projects as the main metric
|
|
73
|
+
const projectExport = processes.get(constants_1.PROCESS_NAMES.PERSONALIZE_PROJECTS);
|
|
74
|
+
if (projectExport) {
|
|
75
|
+
return {
|
|
76
|
+
total: projectExport.total,
|
|
77
|
+
success: projectExport.successCount,
|
|
78
|
+
failures: projectExport.failureCount,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
// Fallback to any other main process
|
|
82
|
+
const mainProcess = Array.from(processes.values())[0];
|
|
83
|
+
if (mainProcess) {
|
|
84
|
+
return {
|
|
85
|
+
total: mainProcess.total,
|
|
86
|
+
success: mainProcess.successCount,
|
|
87
|
+
failures: mainProcess.failureCount,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}));
|
|
92
|
+
// Register strategy for Entries - use Entries as primary process
|
|
93
|
+
cli_utilities_1.ProgressStrategyRegistry.register(constants_1.MODULE_NAMES[constants_1.MODULE_CONTEXTS.ENTRIES], new cli_utilities_1.PrimaryProcessStrategy(constants_1.PROCESS_NAMES.ENTRIES));
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
// Silently ignore registration errors during module loading
|
|
97
|
+
}
|
|
92
98
|
exports.default = cli_utilities_1.ProgressStrategyRegistry;
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-cm-export",
|
|
3
3
|
"description": "Contentstack CLI plugin to export content from stack",
|
|
4
|
-
"version": "2.0.0-beta",
|
|
4
|
+
"version": "2.0.0-beta.1",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@contentstack/cli-command": "~1.6.1",
|
|
9
9
|
"@contentstack/cli-variants": "~2.0.0-beta",
|
|
10
10
|
"@oclif/core": "^4.3.3",
|
|
11
|
-
"@contentstack/cli-utilities": "~1.
|
|
11
|
+
"@contentstack/cli-utilities": "~1.15.0",
|
|
12
12
|
"async": "^3.2.6",
|
|
13
13
|
"big-json": "^3.2.0",
|
|
14
14
|
"bluebird": "^3.7.2",
|