locize-cli 7.12.0 → 7.12.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/CHANGELOG.md CHANGED
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
  Project versioning adheres to [Semantic Versioning](http://semver.org/).
6
6
  Change log format is based on [Keep a Changelog](http://keepachangelog.com/).
7
7
 
8
+ ## [7.12.3](https://github.com/locize/locize-cli/compare/v7.12.2...v7.12.3) - 2022-07-20
9
+
10
+ - update dependencies
11
+
12
+ ## [7.12.2](https://github.com/locize/locize-cli/compare/v7.12.1...v7.12.2) - 2022-07-12
13
+
14
+ - limit parallel downloads
15
+
16
+ ## [7.12.1](https://github.com/locize/locize-cli/compare/v7.12.0...v7.12.1) - 2022-07-12
17
+
18
+ - limit parallel downloads
19
+
8
20
  ## [7.12.0](https://github.com/locize/locize-cli/compare/v7.11.0...v7.12.0) - 2022-06-16
9
21
 
10
22
  - sync and download: introduce --unpublished flag
package/download.js CHANGED
@@ -34,7 +34,7 @@ function handleDownload(opt, url, err, res, downloads, cb) {
34
34
  return;
35
35
  }
36
36
 
37
- async.each(downloads, (download, clb) => {
37
+ async.eachLimit(downloads, 20, (download, clb) => {
38
38
  const splitted = download.key.split('/');
39
39
  const version = splitted[download.isPrivate ? 2 : 1];
40
40
  const lng = splitted[download.isPrivate ? 3 : 2];
@@ -95,7 +95,7 @@ function handleDownload(opt, url, err, res, downloads, cb) {
95
95
 
96
96
  function handlePull(opt, toDownload, cb) {
97
97
  const url = opt.apiPath + '/pull/' + opt.projectId + '/' + opt.version;
98
- async.each(toDownload, (download, clb) => {
98
+ async.eachLimit(toDownload, 5, (download, clb) => {
99
99
  const lng = download.language;
100
100
  const namespace = download.namespace;
101
101
 
@@ -203,11 +203,13 @@ const download = (opt, cb) => {
203
203
  'Authorization': opt.apiKey
204
204
  } : undefined
205
205
  }, (err, res, obj) => {
206
+ obj = obj || [];
206
207
  if (res && res.status === 401) {
207
208
  opt.apiKey = null;
208
209
  request(url, {
209
210
  method: 'get',
210
211
  }, (err, res, obj) => {
212
+ obj = obj || [];
211
213
  if (opt.skipEmpty) obj = obj.filter((d) => d.size > 2);
212
214
  handleDownload(opt, url, err, res, obj, cb);
213
215
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "locize-cli",
3
- "version": "7.12.0",
3
+ "version": "7.12.3",
4
4
  "description": "locize cli to import locales",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -12,12 +12,12 @@
12
12
  "async": "3.2.4",
13
13
  "cacheable-lookup": "6.0.4",
14
14
  "colors": "1.4.0",
15
- "commander": "9.3.0",
15
+ "commander": "9.4.0",
16
16
  "csvjson": "5.1.0",
17
17
  "diff": "5.1.0",
18
18
  "flat": "5.0.2",
19
19
  "fluent_conv": "3.1.0",
20
- "gettext-converter": "1.2.2",
20
+ "gettext-converter": "1.2.3",
21
21
  "https-proxy-agent": "5.0.1",
22
22
  "ini": "3.0.0",
23
23
  "js-yaml": "4.1.0",
@@ -29,13 +29,13 @@
29
29
  "rimraf": "3.0.2",
30
30
  "strings-file": "0.0.5",
31
31
  "tmexchange": "2.0.4",
32
- "xliff": "6.0.3",
32
+ "xliff": "6.1.0",
33
33
  "xlsx": "0.18.5"
34
34
  },
35
35
  "devDependencies": {
36
- "eslint": "8.17.0",
36
+ "eslint": "8.20.0",
37
37
  "gh-release": "6.0.4",
38
- "pkg": "5.7.0"
38
+ "pkg": "5.8.0"
39
39
  },
40
40
  "scripts": {
41
41
  "lint": "eslint .",
package/sync.js CHANGED
@@ -205,7 +205,7 @@ const downloadAll = (opt, remoteLanguages, omitRef, manipulate, cb) => {
205
205
  return lng !== opt.referenceLanguage;
206
206
  });
207
207
  }
208
- async.each(downloads, (download, clb) => {
208
+ async.eachLimit(downloads, opt.unpublished ? 5 : 20, (download, clb) => {
209
209
  const splitted = download.key.split('/');
210
210
  const lng = splitted[download.isPrivate ? 3 : 2];
211
211
  const namespace = splitted[download.isPrivate ? 4 : 3];
@@ -509,7 +509,7 @@ const handleSync = (opt, remoteLanguages, localNamespaces, cb) => {
509
509
 
510
510
  if (opt.deleteRemoteNamespace && localMissingNamespaces.length > 0) {
511
511
  wasThereSomethingToUpdate = true;
512
- async.each(localMissingNamespaces, (n, clb) => {
512
+ async.eachLimit(localMissingNamespaces, 20, (n, clb) => {
513
513
  if (opt.dry) {
514
514
  console.log(colors.red(`would delete complete namespace ${n.namespace}...`));
515
515
  return clb();