@contentstack/cli-cm-export 1.20.2 → 1.21.0

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.20.2 linux-x64 node-v22.19.0
51
+ @contentstack/cli-cm-export/1.21.0 linux-x64 node-v22.21.1
52
52
  $ csdx --help [COMMAND]
53
53
  USAGE
54
54
  $ csdx COMMAND
@@ -113,7 +113,7 @@ class BaseClass {
113
113
  case 'export-taxonomy':
114
114
  return this.stack
115
115
  .taxonomy(uid)
116
- .export()
116
+ .export(queryParam)
117
117
  .then((response) => resolve({ response, uid }))
118
118
  .catch((error) => reject({ error, uid }));
119
119
  default:
@@ -2,26 +2,44 @@ import BaseClass from './base-class';
2
2
  import { ModuleClassParams } from '../../types';
3
3
  export default class ExportTaxonomies extends BaseClass {
4
4
  private taxonomies;
5
+ private taxonomiesByLocale;
5
6
  private taxonomiesConfig;
7
+ private isLocaleBasedExportSupported;
6
8
  private qs;
7
9
  taxonomiesFolderPath: string;
10
+ private localesFilePath;
8
11
  constructor({ exportConfig, stackAPIClient }: ModuleClassParams);
9
12
  start(): Promise<void>;
10
13
  /**
11
- * fetch all taxonomies in the provided stack
12
- * @param {number} skip
13
- * @returns {Promise<any>}
14
+ * Process and export taxonomies for a specific locale
14
15
  */
15
- getAllTaxonomies(skip?: number): Promise<any>;
16
+ processLocaleExport(localeCode: string): Promise<void>;
17
+ /**
18
+ * Write taxonomies metadata file
19
+ */
20
+ writeTaxonomiesMetadata(): Promise<void>;
21
+ /**
22
+ * Fetch taxonomies
23
+ *
24
+ * @async
25
+ * @param {?string} [localeCode]
26
+ * @param {boolean} [checkLocaleSupport=false]
27
+ * @returns {Promise<void>}
28
+ */
29
+ fetchTaxonomies(localeCode?: string, checkLocaleSupport?: boolean): Promise<void>;
16
30
  /**
17
31
  * remove invalid keys and write data into taxonomies
18
32
  * @function sanitizeTaxonomiesAttribs
19
- * @param taxonomies
33
+ * @param {Record<string, string>[]} taxonomies
34
+ * @param {?string} [localeCode]
20
35
  */
21
- sanitizeTaxonomiesAttribs(taxonomies: Record<string, string>[]): void;
36
+ sanitizeTaxonomiesAttribs(taxonomies: Record<string, string>[], localeCode?: string): void;
22
37
  /**
23
- * Export all taxonomies details using metadata(this.taxonomies) and write it into respective <taxonomy-uid>.json file
24
- * @returns {Promise<void>}
38
+ * Export taxonomies - supports both locale-based and legacy export
39
+ */
40
+ exportTaxonomies(localeCode?: string): Promise<void>;
41
+ /**
42
+ * Get all locales to export
25
43
  */
26
- exportTaxonomies(): Promise<void>;
44
+ getLocalesToExport(): string[];
27
45
  }
@@ -11,122 +11,228 @@ const utils_1 = require("../../utils");
11
11
  class ExportTaxonomies extends base_class_1.default {
12
12
  constructor({ exportConfig, stackAPIClient }) {
13
13
  super({ exportConfig, stackAPIClient });
14
+ this.isLocaleBasedExportSupported = true; // Flag to track if locale-based export is supported
14
15
  this.taxonomies = {};
16
+ this.taxonomiesByLocale = {};
15
17
  this.taxonomiesConfig = exportConfig.modules.taxonomies;
16
18
  this.qs = { include_count: true, limit: this.taxonomiesConfig.limit || 100, skip: 0 };
17
19
  this.applyQueryFilters(this.qs, 'taxonomies');
18
20
  this.exportConfig.context.module = 'taxonomies';
21
+ this.localesFilePath = (0, node_path_1.resolve)((0, cli_utilities_1.sanitizePath)(exportConfig.data), (0, cli_utilities_1.sanitizePath)(exportConfig.branchName || ''), (0, cli_utilities_1.sanitizePath)(exportConfig.modules.locales.dirName), (0, cli_utilities_1.sanitizePath)(exportConfig.modules.locales.fileName));
19
22
  }
20
23
  async start() {
24
+ var _a;
21
25
  cli_utilities_1.log.debug('Starting taxonomies export process...', this.exportConfig.context);
22
26
  //create taxonomies folder
23
27
  this.taxonomiesFolderPath = (0, node_path_1.resolve)(this.exportConfig.data, this.exportConfig.branchName || '', this.taxonomiesConfig.dirName);
24
28
  cli_utilities_1.log.debug(`Taxonomies folder path: ${this.taxonomiesFolderPath}`, this.exportConfig.context);
25
29
  await utils_1.fsUtil.makeDirectory(this.taxonomiesFolderPath);
26
30
  cli_utilities_1.log.debug('Created taxonomies directory', this.exportConfig.context);
27
- //fetch all taxonomies and write into taxonomies folder
28
- cli_utilities_1.log.debug('Fetching all taxonomies...', this.exportConfig.context);
29
- await this.getAllTaxonomies();
30
- cli_utilities_1.log.debug(`Retrieved ${Object.keys(this.taxonomies).length} taxonomies`, this.exportConfig.context);
31
- if (this.taxonomies === undefined || (0, isEmpty_1.default)(this.taxonomies)) {
32
- cli_utilities_1.log.info(cli_utilities_1.messageHandler.parse('TAXONOMY_NOT_FOUND'), this.exportConfig.context);
31
+ const localesToExport = this.getLocalesToExport();
32
+ cli_utilities_1.log.debug(`Will attempt to export taxonomies for ${localesToExport.length} locale(s): ${localesToExport.join(', ')}`, this.exportConfig.context);
33
+ if (localesToExport.length === 0) {
34
+ cli_utilities_1.log.warn('No locales found to export', this.exportConfig.context);
33
35
  return;
34
36
  }
35
- else {
36
- const taxonomiesFilePath = (0, node_path_1.resolve)(this.taxonomiesFolderPath, 'taxonomies.json');
37
- cli_utilities_1.log.debug(`Writing taxonomies metadata to: ${taxonomiesFilePath}`, this.exportConfig.context);
38
- utils_1.fsUtil.writeFile(taxonomiesFilePath, this.taxonomies);
39
- cli_utilities_1.log.debug('Starting detailed taxonomy export...', this.exportConfig.context);
37
+ // Test locale-based export support with master locale
38
+ const masterLocale = (_a = this.exportConfig.master_locale) === null || _a === void 0 ? void 0 : _a.code;
39
+ await this.fetchTaxonomies(masterLocale, true);
40
+ if (!this.isLocaleBasedExportSupported) {
41
+ cli_utilities_1.log.debug('Localization disabled, falling back to legacy export method', this.exportConfig.context);
40
42
  await this.exportTaxonomies();
43
+ await this.writeTaxonomiesMetadata();
44
+ }
45
+ else {
46
+ // Process all locales with locale-based export
47
+ cli_utilities_1.log.debug('Localization enabled, proceeding with locale-based export', this.exportConfig.context);
48
+ for (const localeCode of localesToExport) {
49
+ await this.fetchTaxonomies(localeCode);
50
+ await this.processLocaleExport(localeCode);
51
+ }
52
+ await this.writeTaxonomiesMetadata();
41
53
  }
42
- cli_utilities_1.log.success(cli_utilities_1.messageHandler.parse('TAXONOMY_EXPORT_COMPLETE', (0, keys_1.default)(this.taxonomies).length), this.exportConfig.context);
54
+ cli_utilities_1.log.success(cli_utilities_1.messageHandler.parse('TAXONOMY_EXPORT_COMPLETE', (0, keys_1.default)(this.taxonomies || {}).length), this.exportConfig.context);
43
55
  }
44
56
  /**
45
- * fetch all taxonomies in the provided stack
46
- * @param {number} skip
47
- * @returns {Promise<any>}
57
+ * Process and export taxonomies for a specific locale
48
58
  */
49
- async getAllTaxonomies(skip = 0) {
50
- if (skip) {
51
- this.qs.skip = skip;
52
- cli_utilities_1.log.debug(`Fetching taxonomies with skip: ${skip}`, this.exportConfig.context);
59
+ async processLocaleExport(localeCode) {
60
+ const localeTaxonomies = this.taxonomiesByLocale[localeCode];
61
+ if ((localeTaxonomies === null || localeTaxonomies === void 0 ? void 0 : localeTaxonomies.size) > 0) {
62
+ cli_utilities_1.log.info(`Found ${localeTaxonomies.size} taxonomies for locale: ${localeCode}`, this.exportConfig.context);
63
+ await this.exportTaxonomies(localeCode);
53
64
  }
54
65
  else {
55
- cli_utilities_1.log.debug('Fetching taxonomies with initial query', this.exportConfig.context);
66
+ cli_utilities_1.log.debug(`No taxonomies found for locale: ${localeCode}`, this.exportConfig.context);
56
67
  }
57
- cli_utilities_1.log.debug(`Query parameters: ${JSON.stringify(this.qs)}`, this.exportConfig.context);
58
- await this.stack
59
- .taxonomy()
60
- .query(this.qs)
61
- .find()
62
- .then(async (data) => {
63
- const { items, count } = data;
64
- const taxonomiesCount = count !== undefined ? count : items === null || items === void 0 ? void 0 : items.length;
65
- cli_utilities_1.log.debug(`Fetched ${(items === null || items === void 0 ? void 0 : items.length) || 0} taxonomies out of total ${taxonomiesCount}`, this.exportConfig.context);
66
- if (items === null || items === void 0 ? void 0 : items.length) {
67
- cli_utilities_1.log.debug(`Processing ${items.length} taxonomies`, this.exportConfig.context);
68
- this.sanitizeTaxonomiesAttribs(items);
68
+ }
69
+ /**
70
+ * Write taxonomies metadata file
71
+ */
72
+ async writeTaxonomiesMetadata() {
73
+ if (!this.taxonomies || (0, isEmpty_1.default)(this.taxonomies)) {
74
+ cli_utilities_1.log.info(cli_utilities_1.messageHandler.parse('TAXONOMY_NOT_FOUND'), this.exportConfig.context);
75
+ return;
76
+ }
77
+ const taxonomiesFilePath = (0, node_path_1.resolve)(this.taxonomiesFolderPath, 'taxonomies.json');
78
+ cli_utilities_1.log.debug(`Writing taxonomies metadata to: ${taxonomiesFilePath}`, this.exportConfig.context);
79
+ utils_1.fsUtil.writeFile(taxonomiesFilePath, this.taxonomies);
80
+ }
81
+ /**
82
+ * Fetch taxonomies
83
+ *
84
+ * @async
85
+ * @param {?string} [localeCode]
86
+ * @param {boolean} [checkLocaleSupport=false]
87
+ * @returns {Promise<void>}
88
+ */
89
+ async fetchTaxonomies(localeCode, checkLocaleSupport = false) {
90
+ var _a;
91
+ let skip = 0;
92
+ const localeInfo = localeCode ? `for locale: ${localeCode}` : '';
93
+ if (localeCode && !this.taxonomiesByLocale[localeCode]) {
94
+ this.taxonomiesByLocale[localeCode] = new Set();
95
+ }
96
+ do {
97
+ const queryParams = Object.assign(Object.assign({}, this.qs), { skip });
98
+ if (localeCode) {
99
+ queryParams.locale = localeCode;
100
+ }
101
+ cli_utilities_1.log.debug(`Fetching taxonomies ${localeInfo} with skip: ${skip}`, this.exportConfig.context);
102
+ try {
103
+ const data = await this.stack.taxonomy().query(queryParams).find();
104
+ const { items, count } = data;
105
+ const taxonomiesCount = (_a = count !== null && count !== void 0 ? count : items === null || items === void 0 ? void 0 : items.length) !== null && _a !== void 0 ? _a : 0;
106
+ cli_utilities_1.log.debug(`Fetched ${(items === null || items === void 0 ? void 0 : items.length) || 0} taxonomies out of total ${taxonomiesCount} ${localeInfo}`, this.exportConfig.context);
107
+ if (!(items === null || items === void 0 ? void 0 : items.length)) {
108
+ cli_utilities_1.log.debug(`No taxonomies found ${localeInfo}`, this.exportConfig.context);
109
+ break;
110
+ }
111
+ // Check localization support
112
+ if (checkLocaleSupport && localeCode && skip === 0 && !items[0].locale) {
113
+ cli_utilities_1.log.debug('API does not support locale-based taxonomy export', this.exportConfig.context);
114
+ this.isLocaleBasedExportSupported = false;
115
+ }
116
+ this.sanitizeTaxonomiesAttribs(items, localeCode);
69
117
  skip += this.qs.limit || 100;
70
118
  if (skip >= taxonomiesCount) {
71
- cli_utilities_1.log.debug('Completed fetching all taxonomies', this.exportConfig.context);
72
- return;
119
+ cli_utilities_1.log.debug(`Completed fetching all taxonomies ${localeInfo}`, this.exportConfig.context);
120
+ break;
73
121
  }
74
- cli_utilities_1.log.debug(`Continuing to fetch taxonomies with skip: ${skip}`, this.exportConfig.context);
75
- return await this.getAllTaxonomies(skip);
76
122
  }
77
- else {
78
- cli_utilities_1.log.debug('No taxonomies found to process', this.exportConfig.context);
123
+ catch (error) {
124
+ cli_utilities_1.log.debug(`Error fetching taxonomies ${localeInfo}`, this.exportConfig.context);
125
+ (0, cli_utilities_1.handleAndLogError)(error, Object.assign(Object.assign({}, this.exportConfig.context), (localeCode && { locale: localeCode })));
126
+ if (checkLocaleSupport) {
127
+ this.isLocaleBasedExportSupported = false;
128
+ }
129
+ // Break to avoid infinite retry loop on errors
130
+ break;
79
131
  }
80
- })
81
- .catch((error) => {
82
- cli_utilities_1.log.debug('Error occurred while fetching taxonomies', this.exportConfig.context);
83
- (0, cli_utilities_1.handleAndLogError)(error, Object.assign({}, this.exportConfig.context));
84
- });
132
+ } while (true);
85
133
  }
86
134
  /**
87
135
  * remove invalid keys and write data into taxonomies
88
136
  * @function sanitizeTaxonomiesAttribs
89
- * @param taxonomies
137
+ * @param {Record<string, string>[]} taxonomies
138
+ * @param {?string} [localeCode]
90
139
  */
91
- sanitizeTaxonomiesAttribs(taxonomies) {
92
- var _a;
93
- cli_utilities_1.log.debug(`Sanitizing ${taxonomies.length} taxonomies`, this.exportConfig.context);
94
- for (let index = 0; index < (taxonomies === null || taxonomies === void 0 ? void 0 : taxonomies.length); index++) {
95
- const taxonomyUID = taxonomies[index].uid;
96
- const taxonomyName = (_a = taxonomies[index]) === null || _a === void 0 ? void 0 : _a.name;
97
- cli_utilities_1.log.debug(`Processing taxonomy: ${taxonomyName} (${taxonomyUID})`, this.exportConfig.context);
98
- this.taxonomies[taxonomyUID] = (0, omit_1.default)(taxonomies[index], this.taxonomiesConfig.invalidKeys);
140
+ sanitizeTaxonomiesAttribs(taxonomies, localeCode) {
141
+ const localeInfo = localeCode ? ` for locale: ${localeCode}` : '';
142
+ cli_utilities_1.log.debug(`Processing ${taxonomies.length} taxonomies${localeInfo}`, this.exportConfig.context);
143
+ for (const taxonomy of taxonomies) {
144
+ const taxonomyUID = taxonomy.uid;
145
+ const taxonomyName = taxonomy.name;
146
+ cli_utilities_1.log.debug(`Processing taxonomy: ${taxonomyName} (${taxonomyUID})${localeInfo}`, this.exportConfig.context);
147
+ // Store taxonomy metadata (only once per taxonomy)
148
+ if (!this.taxonomies[taxonomyUID]) {
149
+ this.taxonomies[taxonomyUID] = (0, omit_1.default)(taxonomy, this.taxonomiesConfig.invalidKeys);
150
+ }
151
+ // Track taxonomy for this locale
152
+ if (localeCode) {
153
+ this.taxonomiesByLocale[localeCode].add(taxonomyUID);
154
+ }
99
155
  }
100
- cli_utilities_1.log.debug(`Sanitization complete. Total taxonomies processed: ${Object.keys(this.taxonomies).length}`, this.exportConfig.context);
156
+ cli_utilities_1.log.debug(`Processing complete${localeInfo}. Total taxonomies processed: ${(0, keys_1.default)(this.taxonomies).length}`, this.exportConfig.context);
101
157
  }
102
158
  /**
103
- * Export all taxonomies details using metadata(this.taxonomies) and write it into respective <taxonomy-uid>.json file
104
- * @returns {Promise<void>}
159
+ * Export taxonomies - supports both locale-based and legacy export
105
160
  */
106
- async exportTaxonomies() {
107
- const taxonomiesUID = (0, keys_1.default)(this.taxonomies) || [];
108
- cli_utilities_1.log.debug(`Exporting detailed data for ${taxonomiesUID.length} taxonomies`, this.exportConfig.context);
161
+ async exportTaxonomies(localeCode) {
162
+ const taxonomiesUID = localeCode ? Array.from(this.taxonomiesByLocale[localeCode] || []) : (0, keys_1.default)(this.taxonomies);
163
+ const localeInfo = localeCode ? ` for locale: ${localeCode}` : '';
164
+ if (taxonomiesUID.length === 0) {
165
+ cli_utilities_1.log.debug(`No taxonomies to export${localeInfo}`, this.exportConfig.context);
166
+ return;
167
+ }
168
+ cli_utilities_1.log.debug(`Exporting detailed data for ${taxonomiesUID.length} taxonomies${localeInfo}`, this.exportConfig.context);
169
+ const exportFolderPath = localeCode ? (0, node_path_1.resolve)(this.taxonomiesFolderPath, localeCode) : this.taxonomiesFolderPath;
170
+ if (localeCode) {
171
+ await utils_1.fsUtil.makeDirectory(exportFolderPath);
172
+ cli_utilities_1.log.debug(`Created locale folder: ${exportFolderPath}`, this.exportConfig.context);
173
+ }
109
174
  const onSuccess = ({ response, uid }) => {
110
- const filePath = (0, node_path_1.resolve)(this.taxonomiesFolderPath, `${uid}.json`);
175
+ const filePath = (0, node_path_1.resolve)(exportFolderPath, `${uid}.json`);
111
176
  cli_utilities_1.log.debug(`Writing detailed taxonomy data to: ${filePath}`, this.exportConfig.context);
112
177
  utils_1.fsUtil.writeFile(filePath, response);
113
178
  cli_utilities_1.log.success(cli_utilities_1.messageHandler.parse('TAXONOMY_EXPORT_SUCCESS', uid), this.exportConfig.context);
114
179
  };
115
180
  const onReject = ({ error, uid }) => {
116
- cli_utilities_1.log.debug(`Failed to export detailed data for taxonomy: ${uid}`, this.exportConfig.context);
117
- (0, cli_utilities_1.handleAndLogError)(error, Object.assign(Object.assign({}, this.exportConfig.context), { uid }));
181
+ cli_utilities_1.log.debug(`Failed to export detailed data for taxonomy: ${uid}${localeInfo}`, this.exportConfig.context);
182
+ (0, cli_utilities_1.handleAndLogError)(error, Object.assign(Object.assign(Object.assign({}, this.exportConfig.context), { uid }), (localeCode && { locale: localeCode })));
118
183
  };
119
- for (let index = 0; index < (taxonomiesUID === null || taxonomiesUID === void 0 ? void 0 : taxonomiesUID.length); index++) {
120
- const taxonomyUID = taxonomiesUID[index];
121
- cli_utilities_1.log.debug(`Processing detailed export for taxonomy: ${taxonomyUID}`, this.exportConfig.context);
184
+ for (const taxonomyUID of taxonomiesUID) {
185
+ cli_utilities_1.log.debug(`Processing detailed export for taxonomy: ${taxonomyUID}${localeInfo}`, this.exportConfig.context);
186
+ const exportParams = { format: 'json' };
187
+ if (localeCode) {
188
+ exportParams.locale = localeCode;
189
+ if (this.qs.include_fallback !== undefined)
190
+ exportParams.include_fallback = this.qs.include_fallback;
191
+ if (this.qs.fallback_locale)
192
+ exportParams.fallback_locale = this.qs.fallback_locale;
193
+ }
194
+ if (this.qs.branch)
195
+ exportParams.branch = this.qs.branch;
122
196
  await this.makeAPICall({
123
197
  reject: onReject,
124
198
  resolve: onSuccess,
125
199
  uid: taxonomyUID,
126
200
  module: 'export-taxonomy',
201
+ queryParam: exportParams,
127
202
  });
128
203
  }
129
- cli_utilities_1.log.debug('Completed detailed taxonomy export process', this.exportConfig.context);
204
+ cli_utilities_1.log.debug(`Completed detailed taxonomy export process${localeInfo}`, this.exportConfig.context);
205
+ }
206
+ /**
207
+ * Get all locales to export
208
+ */
209
+ getLocalesToExport() {
210
+ var _a;
211
+ cli_utilities_1.log.debug('Determining locales to export...', this.exportConfig.context);
212
+ const masterLocaleCode = ((_a = this.exportConfig.master_locale) === null || _a === void 0 ? void 0 : _a.code) || 'en-us';
213
+ const localeSet = new Set([masterLocaleCode]);
214
+ try {
215
+ const locales = utils_1.fsUtil.readFile(this.localesFilePath);
216
+ if (locales && (0, keys_1.default)(locales || {}).length > 0) {
217
+ cli_utilities_1.log.debug(`Loaded ${(0, keys_1.default)(locales || {}).length} locales from ${this.localesFilePath}`, this.exportConfig.context);
218
+ for (const localeUid of (0, keys_1.default)(locales)) {
219
+ const localeCode = locales[localeUid].code;
220
+ if (localeCode && !localeSet.has(localeCode)) {
221
+ localeSet.add(localeCode);
222
+ cli_utilities_1.log.debug(`Added locale: ${localeCode} (uid: ${localeUid})`, this.exportConfig.context);
223
+ }
224
+ }
225
+ }
226
+ else {
227
+ cli_utilities_1.log.debug(`No locales found in ${this.localesFilePath}`, this.exportConfig.context);
228
+ }
229
+ }
230
+ catch (error) {
231
+ cli_utilities_1.log.warn(`Failed to read locales file: ${this.localesFilePath}`, this.exportConfig.context);
232
+ }
233
+ const localesToExport = Array.from(localeSet);
234
+ cli_utilities_1.log.debug(`Total unique locales to export: ${localesToExport.length}`, this.exportConfig.context);
235
+ return localesToExport;
130
236
  }
131
237
  }
132
238
  exports.default = ExportTaxonomies;
@@ -159,5 +159,5 @@
159
159
  ]
160
160
  }
161
161
  },
162
- "version": "1.20.2"
162
+ "version": "1.21.0"
163
163
  }
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": "1.20.2",
4
+ "version": "1.21.0",
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
- "@contentstack/cli-variants": "~1.3.3",
9
+ "@contentstack/cli-variants": "~1.3.4",
10
10
  "@oclif/core": "^4.3.3",
11
- "@contentstack/cli-utilities": "~1.14.1",
11
+ "@contentstack/cli-utilities": "~1.14.4",
12
12
  "async": "^3.2.6",
13
13
  "big-json": "^3.2.0",
14
14
  "bluebird": "^3.7.2",
@@ -27,8 +27,12 @@
27
27
  "@oclif/plugin-help": "^6.2.28",
28
28
  "@oclif/test": "^4.1.13",
29
29
  "@types/big-json": "^3.2.5",
30
+ "@types/chai": "^4.3.11",
30
31
  "@types/mkdirp": "^1.0.2",
32
+ "@types/mocha": "^10.0.6",
31
33
  "@types/progress-stream": "^2.0.5",
34
+ "@types/sinon": "^17.0.2",
35
+ "chai": "^4.4.1",
32
36
  "dotenv": "^16.5.0",
33
37
  "dotenv-expand": "^9.0.0",
34
38
  "eslint": "^8.57.1",
@@ -36,6 +40,8 @@
36
40
  "mocha": "10.8.2",
37
41
  "nyc": "^15.1.0",
38
42
  "oclif": "^4.17.46",
43
+ "sinon": "^17.0.1",
44
+ "source-map-support": "^0.5.21",
39
45
  "ts-node": "^10.9.2",
40
46
  "typescript": "^4.9.5"
41
47
  },
@@ -54,7 +60,8 @@
54
60
  "format": "eslint src/**/*.ts --fix",
55
61
  "test:integration": "INTEGRATION_TEST=true mocha --config ./test/.mocharc.js --forbid-only \"test/run.test.js\"",
56
62
  "test:integration:report": "INTEGRATION_TEST=true nyc --extension .js mocha --forbid-only \"test/run.test.js\"",
57
- "test:unit": "mocha --forbid-only \"test/unit/*.test.ts\""
63
+ "test:unit": "mocha --forbid-only \"test/unit/**/*.test.ts\"",
64
+ "test:unit:report": "nyc --reporter=text --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
58
65
  },
59
66
  "engines": {
60
67
  "node": ">=14.0.0"