locize-cli 8.2.0 → 8.3.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/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ 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
+ ## [8.3.1](https://github.com/locize/locize-cli/compare/v8.3.0...v8.3.1) - 2024-12-23
9
+
10
+ - special check for CVS (does not cleanup local language folders)
11
+
12
+ ## [8.3.0](https://github.com/locize/locize-cli/compare/v8.2.0...v8.3.0) - 2024-11-25
13
+
14
+ - update some deprecated dependencies (#100)
15
+
8
16
  ## [8.2.0](https://github.com/locize/locize-cli/compare/v8.1.1...v8.2.0) - 2024-11-12
9
17
 
10
18
  - introduce `--backup-deleted-path` argument (#98)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "locize-cli",
3
- "version": "8.2.0",
3
+ "version": "8.3.1",
4
4
  "description": "locize cli to import locales",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -9,17 +9,17 @@
9
9
  "dependencies": {
10
10
  "@js.properties/properties": "0.5.4",
11
11
  "android-string-resource": "2.3.10",
12
- "async": "3.2.5",
12
+ "async": "3.2.6",
13
13
  "cacheable-lookup": "6.1.0",
14
14
  "colors": "1.4.0",
15
15
  "commander": "9.5.0",
16
16
  "csvjson": "5.1.0",
17
- "diff": "5.2.0",
17
+ "diff": "7.0.0",
18
18
  "dotenv": "16.4.5",
19
19
  "flat": "5.0.2",
20
20
  "fluent_conv": "3.3.0",
21
21
  "gettext-converter": "1.3.0",
22
- "https-proxy-agent": "5.0.1",
22
+ "https-proxy-agent": "7.0.5",
23
23
  "ini": "4.1.3",
24
24
  "js-yaml": "4.1.0",
25
25
  "laravelphp": "2.0.4",
@@ -27,7 +27,7 @@
27
27
  "mkdirp": "3.0.1",
28
28
  "node-fetch": "2.7.0",
29
29
  "resx": "2.0.4",
30
- "rimraf": "3.0.2",
30
+ "rimraf": "4.4.1",
31
31
  "strings-file": "0.0.5",
32
32
  "tmexchange": "2.0.5",
33
33
  "xliff": "6.2.1",
@@ -36,12 +36,12 @@
36
36
  "devDependencies": {
37
37
  "eslint": "8.56.0",
38
38
  "gh-release": "7.0.2",
39
- "pkg": "5.8.1"
39
+ "@yao-pkg/pkg": "6.1.1"
40
40
  },
41
41
  "scripts": {
42
42
  "lint": "eslint .",
43
43
  "test": "npm run lint",
44
- "pkg": "mkdir -p ./bins && pkg ./bin/locize --out-path ./bins --targets node18-linux-x64,node18-macos-x64,node18-win-x64,node18-alpine-x64",
44
+ "pkg": "mkdir -p ./bins && pkg ./bin/locize --out-path ./bins --targets node20-linux-x64,node20-macos-x64,node20-win-x64,node20-alpine-x64",
45
45
  "release": "gh-release --assets ./bins/locize-linux,./bins/locize-macos,./bins/locize-win.exe,./bins/locize-alpine",
46
46
  "version": "npm run pkg",
47
47
  "postversion": "git push && npm run release"
@@ -52,7 +52,7 @@
52
52
  ],
53
53
  "author": "adrai",
54
54
  "license": "MIT",
55
- "homepage": "http://locize.com",
55
+ "homepage": "https://locize.com",
56
56
  "repository": {
57
57
  "type": "git",
58
58
  "url": "git+https://github.com/locize/locize-cli.git"
package/request.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const package = require('./package.json');
2
2
  const fetch = require('node-fetch');
3
- const HttpsProxyAgent = require('https-proxy-agent');
3
+ const { HttpsProxyAgent } = require('https-proxy-agent');
4
4
  const https = require('https');
5
5
  const CacheableLookup = require('cacheable-lookup');
6
6
  const cacheable = new CacheableLookup();
package/sync.js CHANGED
@@ -318,6 +318,14 @@ const update = (opt, lng, ns, shouldOmit, cb) => {
318
318
  send(data, shouldOmit, cb);
319
319
  };
320
320
 
321
+ const doesDirectoryExist = (p) => {
322
+ var directoryExists = false;
323
+ try {
324
+ directoryExists = fs.statSync(p).isDirectory();
325
+ } catch (e) {}
326
+ return directoryExists;
327
+ };
328
+
321
329
  const cleanupLanguages = (opt, remoteLanguages) => {
322
330
  if (opt.pathMask.lastIndexOf(path.sep) < 0) return;
323
331
  const dirs = getDirectories(opt.path).filter((dir) => dir.indexOf('.') !== 0);
@@ -338,6 +346,7 @@ const cleanupLanguages = (opt, remoteLanguages) => {
338
346
  if (filledLngMask.lastIndexOf(path.sep) > 0) {
339
347
  lngPath = filledLngMask.substring(0, filledLngMask.lastIndexOf(path.sep));
340
348
  }
349
+ if (doesDirectoryExist(path.join(opt.path, lngPath, 'CVS'))) return; // special hack for CVS
341
350
  rimraf.sync(path.join(opt.path, lngPath));
342
351
  });
343
352
  }
@@ -581,11 +590,7 @@ const sync = (opt, cb) => {
581
590
  if (!opt.dry && opt.clean) rimraf.sync(path.join(opt.path, '*'));
582
591
 
583
592
  if (opt.autoCreatePath === false) {
584
- var directoryExists = false;
585
- try {
586
- directoryExists = fs.statSync(opt.path).isDirectory();
587
- } catch (e) {}
588
- if (!directoryExists) {
593
+ if (!doesDirectoryExist(opt.path)) {
589
594
  return handleError(new Error(`${opt.path} does not exist!`), cb);
590
595
  }
591
596
  }