@contentstack/cli-cm-export 1.9.1 → 1.9.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.
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/1.9.1 linux-x64 node-v18.18.0
51
+ @contentstack/cli-cm-export/1.9.3 linux-x64 node-v18.18.2
52
52
  $ csdx --help [COMMAND]
53
53
  USAGE
54
54
  $ csdx COMMAND
@@ -8,6 +8,7 @@ const export_1 = require("../../../export");
8
8
  const utils_1 = require("../../../utils");
9
9
  class ExportCommand extends cli_command_1.Command {
10
10
  async run() {
11
+ var _a;
11
12
  let exportDir;
12
13
  try {
13
14
  const { flags } = await this.parse(ExportCommand);
@@ -18,7 +19,9 @@ class ExportCommand extends cli_command_1.Command {
18
19
  const managementAPIClient = await (0, cli_utilities_1.managementSDKClient)(exportConfig);
19
20
  const moduleExporter = new export_1.ModuleExporter(managementAPIClient, exportConfig);
20
21
  await moduleExporter.start();
21
- (0, utils_1.writeExportMetaFile)(exportConfig);
22
+ if (!((_a = exportConfig.branches) === null || _a === void 0 ? void 0 : _a.length)) {
23
+ (0, utils_1.writeExportMetaFile)(exportConfig);
24
+ }
22
25
  (0, utils_1.log)(exportConfig, `The content of the stack ${exportConfig.apiKey} has been exported successfully!`, 'success');
23
26
  (0, utils_1.log)(exportConfig, `The log has been stored at '${path_1.default.join(exportDir, 'logs', 'export')}'`, 'success');
24
27
  }
@@ -31,6 +31,8 @@ class ModuleExporter {
31
31
  try {
32
32
  this.exportConfig.branchName = branch.uid;
33
33
  this.exportConfig.branchDir = path.join(this.exportConfig.exportDir, branch.uid);
34
+ (0, utils_1.log)(this.exportConfig, `Exporting content from branch ${branch.uid}`, 'success');
35
+ (0, utils_1.writeExportMetaFile)(this.exportConfig, this.exportConfig.branchDir);
34
36
  await this.export();
35
37
  (0, utils_1.log)(this.exportConfig, `The content of branch ${branch.uid} has been exported successfully!`, 'success');
36
38
  }
@@ -9,4 +9,4 @@ export declare const formatError: (error: any) => any;
9
9
  export declare const executeTask: (tasks: unknown[], handler: (task: unknown) => Promise<unknown>, options: {
10
10
  concurrency: number;
11
11
  }) => Promise<unknown[]>;
12
- export declare const writeExportMetaFile: (exportConfig: ExportConfig) => void;
12
+ export declare const writeExportMetaFile: (exportConfig: ExportConfig, metaFilePath?: string) => void;
@@ -79,11 +79,11 @@ const executeTask = function (tasks = [], handler, options) {
79
79
  };
80
80
  exports.executeTask = executeTask;
81
81
  // Note: we can add more useful details in meta file
82
- const writeExportMetaFile = (exportConfig) => {
82
+ const writeExportMetaFile = (exportConfig, metaFilePath) => {
83
83
  const exportMeta = {
84
84
  contentVersion: exportConfig.contentVersion,
85
85
  logsPath: path.join(exportConfig.exportDir, 'logs', 'export'),
86
86
  };
87
- file_helper_1.fsUtil.writeFile(path.join(exportConfig.exportDir, exportConfig.branchName || '', 'export-info.json'), exportMeta);
87
+ file_helper_1.fsUtil.writeFile(path.join(metaFilePath || exportConfig.exportDir, 'export-info.json'), exportMeta);
88
88
  };
89
89
  exports.writeExportMetaFile = writeExportMetaFile;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.9.1",
2
+ "version": "1.9.3",
3
3
  "commands": {
4
4
  "cm:stacks:export": {
5
5
  "id": "cm:stacks:export",
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-export",
3
3
  "description": "Contentstack CLI plugin to export content from stack",
4
- "version": "1.9.1",
4
+ "version": "1.9.3",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
- "@contentstack/cli-command": "~1.2.13",
9
- "@contentstack/cli-utilities": "~1.5.3",
8
+ "@contentstack/cli-command": "~1.2.15",
9
+ "@contentstack/cli-utilities": "~1.5.5",
10
10
  "@oclif/core": "^2.9.3",
11
11
  "async": "^3.2.4",
12
12
  "big-json": "^3.2.0",
@@ -24,8 +24,8 @@
24
24
  "winston": "^3.7.2"
25
25
  },
26
26
  "devDependencies": {
27
- "@contentstack/cli-auth": "~1.3.14",
28
- "@contentstack/cli-config": "~1.4.11",
27
+ "@contentstack/cli-auth": "~1.3.16",
28
+ "@contentstack/cli-config": "~1.4.14",
29
29
  "@contentstack/cli-dev-dependencies": "~1.2.3",
30
30
  "@oclif/plugin-help": "^5.1.19",
31
31
  "@oclif/test": "^1.2.6",
@@ -94,8 +94,8 @@
94
94
  },
95
95
  "shortCommandName": {
96
96
  "cm:stacks:export": "EXPRT",
97
- "cm:export": "EXPRT"
97
+ "cm:export": "O-EXPRT"
98
98
  }
99
99
  },
100
100
  "repository": "https://github.com/contentstack/cli"
101
- }
101
+ }