locize-cli 7.13.0 → 7.13.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,10 @@ 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.13.1](https://github.com/locize/locize-cli/compare/v7.13.0...v7.13.1) - 2022-12-08
9
+
10
+ - optimize migrate command
11
+
8
12
  ## [7.13.0](https://github.com/locize/locize-cli/compare/v7.12.12...v7.13.0) - 2022-12-08
9
13
 
10
14
  - migrate command will use missing route if replace param is false or not passed and will also automaticaly create languages (make sure to use an api key with admin permissions)
package/README.md CHANGED
@@ -223,7 +223,7 @@ locize delete-namespace common --api-key my-api-key-d9de-4f55-9855-a9ef0ed44672
223
223
 
224
224
  ## Migration of existing i18next files
225
225
  We suggest to use the sync command instead of the migrate command.
226
- The migrate command is older and only works with json files.
226
+ The migrate command should be used only once and only works with json files.
227
227
 
228
228
  ### Step 1: Go near to your translation files
229
229
 
package/migrate.js CHANGED
@@ -230,18 +230,29 @@ const migrate = (opt, cb) => {
230
230
  require('os').cpus().length,
231
231
  (l, done) => addLanguage(opt, l, done),
232
232
  (err) => {
233
- upload(opt, nss, (err) => {
234
- if (err) {
235
- if (!cb) {
236
- console.error(colors.red(err.stack));
237
- process.exit(1);
238
- }
239
- if (cb) cb(err);
240
- return;
233
+ if (err) {
234
+ if (!cb) {
235
+ console.error(colors.red(err.stack));
236
+ process.exit(1);
241
237
  }
242
- if (!cb) console.log(colors.green('FINISHED'));
243
- if (cb) cb(null);
244
- });
238
+ if (cb) cb(err);
239
+ return;
240
+ }
241
+ setTimeout(() => {
242
+ // wait a bit to make sure project is up-to-date also in cache
243
+ upload(opt, nss, (err) => {
244
+ if (err) {
245
+ if (!cb) {
246
+ console.error(colors.red(err.stack));
247
+ process.exit(1);
248
+ }
249
+ if (cb) cb(err);
250
+ return;
251
+ }
252
+ if (!cb) console.log(colors.green('FINISHED'));
253
+ if (cb) cb(null);
254
+ });
255
+ }, 5000);
245
256
  }
246
257
  );
247
258
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "locize-cli",
3
- "version": "7.13.0",
3
+ "version": "7.13.1",
4
4
  "description": "locize cli to import locales",
5
5
  "main": "index.js",
6
6
  "bin": {