yakuza0 2.22.15-beta.0 → 2.22.15-beta.2

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/cli/index.js CHANGED
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.run = undefined;
7
7
 
8
+ var _stringify = require('babel-runtime/core-js/json/stringify');
9
+
10
+ var _stringify2 = _interopRequireDefault(_stringify);
11
+
8
12
  var _regenerator = require('babel-runtime/regenerator');
9
13
 
10
14
  var _regenerator2 = _interopRequireDefault(_regenerator);
@@ -55,6 +59,12 @@ var _verify = require('../utils/verify');
55
59
 
56
60
  var _server = require('yakuza1/server');
57
61
 
62
+ var _commandExists = require('command-exists');
63
+
64
+ var _connectionTester = require('connection-tester');
65
+
66
+ var _connectionTester2 = _interopRequireDefault(_connectionTester);
67
+
58
68
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
59
69
 
60
70
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -62,8 +72,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
62
72
  process.env.YK_USAGE = 'CLI';
63
73
 
64
74
  var _require = require('child_process'),
65
- spawnSync = _require.spawnSync,
75
+ execSync = _require.execSync,
66
76
  spawn = _require.spawn;
77
+
67
78
  // const util = require('util');
68
79
  // const spawn = util.promisify(require('child_process').spawn);
69
80
 
@@ -193,11 +204,15 @@ var alias = function alias() {
193
204
  _server.global.__cln_appName__ = options.appName;
194
205
  };
195
206
 
207
+ var execCmd = function execCmd(cmd) {
208
+ execSync(cmd, { shell: true, stdio: 'inherit' });
209
+ };
210
+
196
211
  var run = exports.run = function () {
197
- var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14(_argv) {
198
- return _regenerator2.default.wrap(function _callee14$(_context14) {
212
+ var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee15(_argv) {
213
+ return _regenerator2.default.wrap(function _callee15$(_context15) {
199
214
  while (1) {
200
- switch (_context14.prev = _context14.next) {
215
+ switch (_context15.prev = _context15.next) {
201
216
  case 0:
202
217
  _commander2.default.version(_package2.default.version, '-v, --version');
203
218
 
@@ -306,18 +321,104 @@ var run = exports.run = function () {
306
321
  };
307
322
  }());
308
323
 
324
+ _commander2.default.command('image').description('Build image.').option('-nc, --no-cache', 'Do not use cache when building the image').action((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5() {
325
+ var _connectionTester$tes, isInner, CS, CLNENV, noCache, CLNWORKERS, TRY_TIMES, CLNVERSION, pkg, NMCI, projectName, obj, imageReleaseName, imageReleaseNameSave, BI, loop;
326
+
327
+ return _regenerator2.default.wrap(function _callee5$(_context5) {
328
+ while (1) {
329
+ switch (_context5.prev = _context5.next) {
330
+ case 0:
331
+ _connectionTester$tes = _connectionTester2.default.test('fe-repo.inner.px.nfjbill.ren', 5000, 1000), isInner = _connectionTester$tes.success;
332
+ CS = (0, _server.gPwd)();
333
+ CLNENV = process.env.CLN_IMAGE_ENV || 'docker';
334
+ noCache = process.env.NO_CACHE === '1';
335
+ CLNWORKERS = process.env.CLN_IMAGE_WORKERS || '2';
336
+ TRY_TIMES = process.env.TRY_TIMES || '3';
337
+ CLNVERSION = process.env.CLN_IMAGE_VERSION || CS;
338
+ pkg = _paths2.default.read(_paths2.default.appPackageJson);
339
+ NMCI = 'nm_' + (0, _server.md5)(pkg).substring(0, 6);
340
+ projectName = 'cln_img';
341
+
342
+ try {
343
+ obj = JSON.parse(pkg);
344
+
345
+ projectName = obj.name;
346
+ NMCI = 'nm_' + (0, _server.md5)((0, _stringify2.default)(obj.dependencies) + (0, _stringify2.default)(obj.peerDependencies) + (0, _stringify2.default)(obj.devDependencies)).substring(0, 6);
347
+ CLNVERSION = process.env.CLN_IMAGE_VERSION || obj.version;
348
+ } catch (e) {}
349
+ imageReleaseName = projectName + ':' + CLNVERSION;
350
+ imageReleaseNameSave = projectName + '_' + CLNVERSION;
351
+ BI = isInner ? 'fe-repo.inner.px.nfjbill.ren:5000/cln-server:0.5.4' : 'nfjbill/cln-server:0.5.4';
352
+
353
+ if ((0, _commandExists.sync)('docker')) {
354
+ _context5.next = 18;
355
+ break;
356
+ }
357
+
358
+ _consola2.default.error('docker must be installed!');
359
+ process.exit(1);
360
+ return _context5.abrupt('return');
361
+
362
+ case 18:
363
+ if (!(0, _commandExists.sync)('pxnpm')) {
364
+ execCmd(isInner ? 'npm i -g pxnpm --registry=http://fe-repo.inner.px.nfjbill.ren:5507' : 'npm i -g pxnpm');
365
+ }
366
+ if (!(0, _commandExists.sync)('cross-env')) {
367
+ execCmd('pxnpm i -g cross-env');
368
+ }
369
+
370
+ execCmd('cross-env YK_ENV=' + CLNENV + ' YK_SERVER_ENV=' + CLNENV + ' YK_VERSIONSHA=' + CS + ' YK_DOCKERNAME=' + CS + ' YK_MACHINE_TYPE=workstation YK0_env=docker pxnpm run build -workers=' + CLNWORKERS);
371
+
372
+ loop = function loop(i) {
373
+ try {
374
+ if (i < parseInt(TRY_TIMES)) {
375
+ execCmd('cross-env DOCKER_BUILDKIT=1 docker build ' + (noCache ? '--no-cache' : '') + ' -f ' + _paths2.default.ykRootImage + 'Dockerfile --build-arg BASE_IMAGE=' + BI + ' --build-arg YK_VERSIONSHA=' + CS + ' --build-arg YK_ENV=' + CLNENV + ' --build-arg NPM_MODULES_CACHE_ID=' + NMCI + ' -t ' + imageReleaseName + ' .');
376
+ } else {
377
+ _consola2.default.error('Image build failure!');
378
+ process.exit(0);
379
+ }
380
+ } catch (e) {
381
+ loop(i + 1);
382
+ }
383
+ };
384
+
385
+ loop(0);
386
+
387
+ _context5.next = 25;
388
+ return (0, _server.delay)(1000);
389
+
390
+ case 25:
391
+
392
+ if (!(0, _commandExists.sync)('gzip')) {
393
+ execCmd('docker save > ' + imageReleaseNameSave + '.tar ' + imageReleaseName);
394
+ } else {
395
+ execCmd('docker save ' + imageReleaseName + ' | gzip >' + imageReleaseNameSave + '.tar');
396
+ }
397
+
398
+ _consola2.default.info('Image tar: ' + imageReleaseNameSave + '.tar');
399
+ _consola2.default.info('Image name: ' + imageReleaseName);
400
+ _consola2.default.info('Image production completed!');
401
+
402
+ case 29:
403
+ case 'end':
404
+ return _context5.stop();
405
+ }
406
+ }
407
+ }, _callee5, undefined);
408
+ })));
409
+
309
410
  _commander2.default.command('build').description('build a model').option('-y0ba, --yk0-build-app <appName>', 'Building a specified application').option('-e, --env <envName>', 'yk server env')
310
411
  // .action(async ({app}) => {
311
412
  .action(function () {
312
- var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(_ref9) {
313
- var yk0BuildApp = _ref9.yk0BuildApp,
314
- env = _ref9.env;
413
+ var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(_ref10) {
414
+ var yk0BuildApp = _ref10.yk0BuildApp,
415
+ env = _ref10.env;
315
416
 
316
- var _ref11, apps, workers, cpuLen, i, run;
417
+ var _ref12, apps, workers, cpuLen, i, run;
317
418
 
318
- return _regenerator2.default.wrap(function _callee6$(_context6) {
419
+ return _regenerator2.default.wrap(function _callee7$(_context7) {
319
420
  while (1) {
320
- switch (_context6.prev = _context6.next) {
421
+ switch (_context7.prev = _context7.next) {
321
422
  case 0:
322
423
  // process.env.NODE_ENV = 'production';
323
424
  // process.env.NODE_CMD = 'build';
@@ -327,12 +428,12 @@ var run = exports.run = function () {
327
428
  _consola2.default.log('In the preparation...');
328
429
  process.env.NODE_ENV = 'production';
329
430
  process.env.NODE_CMD = 'build';
330
- _context6.next = 5;
431
+ _context7.next = 5;
331
432
  return gi({ app: yk0BuildApp, ykServerEnv: env });
332
433
 
333
434
  case 5:
334
- _ref11 = _context6.sent;
335
- apps = _ref11.apps;
435
+ _ref12 = _context7.sent;
436
+ apps = _ref12.apps;
336
437
  workers = process.env.npm_config_workers;
337
438
  cpuLen = _os2.default.cpus().length;
338
439
 
@@ -355,10 +456,10 @@ var run = exports.run = function () {
355
456
  };
356
457
 
357
458
  _server._.asyncMap(apps, function () {
358
- var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(key, j) {
359
- return _regenerator2.default.wrap(function _callee5$(_context5) {
459
+ var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(key, j) {
460
+ return _regenerator2.default.wrap(function _callee6$(_context6) {
360
461
  while (1) {
361
- switch (_context5.prev = _context5.next) {
462
+ switch (_context6.prev = _context6.next) {
362
463
  case 0:
363
464
  if (j < cpuLen) {
364
465
  i = j;
@@ -367,27 +468,27 @@ var run = exports.run = function () {
367
468
 
368
469
  case 1:
369
470
  case 'end':
370
- return _context5.stop();
471
+ return _context6.stop();
371
472
  }
372
473
  }
373
- }, _callee5, undefined);
474
+ }, _callee6, undefined);
374
475
  }));
375
476
 
376
477
  return function (_x8, _x9) {
377
- return _ref12.apply(this, arguments);
478
+ return _ref13.apply(this, arguments);
378
479
  };
379
480
  }());
380
481
 
381
482
  case 13:
382
483
  case 'end':
383
- return _context6.stop();
484
+ return _context7.stop();
384
485
  }
385
486
  }
386
- }, _callee6, undefined);
487
+ }, _callee7, undefined);
387
488
  }));
388
489
 
389
490
  return function (_x7) {
390
- return _ref10.apply(this, arguments);
491
+ return _ref11.apply(this, arguments);
391
492
  };
392
493
  }());
393
494
 
@@ -395,131 +496,131 @@ var run = exports.run = function () {
395
496
  // .option('-y0ba, --yk0-build-app <appName>', 'Building a specified application')
396
497
  // .action(async ({app}) => {
397
498
  .action(function () {
398
- var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(cmd) {
399
- return _regenerator2.default.wrap(function _callee7$(_context7) {
499
+ var _ref14 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(cmd) {
500
+ return _regenerator2.default.wrap(function _callee8$(_context8) {
400
501
  while (1) {
401
- switch (_context7.prev = _context7.next) {
502
+ switch (_context8.prev = _context8.next) {
402
503
  case 0:
403
504
  process.env.NODE_ENV = 'production';
404
505
  process.env.NODE_CMD = 'build';
405
506
  // console.log(app);
406
507
  // gi({app: yk0BuildApp});
407
508
  alias({ appName: cmd });
408
- _context7.next = 5;
509
+ _context8.next = 5;
409
510
  return require(params.serverPath)('build', cmd);
410
511
 
411
512
  case 5:
412
513
  case 'end':
413
- return _context7.stop();
514
+ return _context8.stop();
414
515
  }
415
516
  }
416
- }, _callee7, undefined);
517
+ }, _callee8, undefined);
417
518
  }));
418
519
 
419
520
  return function (_x10) {
420
- return _ref13.apply(this, arguments);
521
+ return _ref14.apply(this, arguments);
421
522
  };
422
523
  }());
423
524
 
424
- _commander2.default.command('generate').alias('g').description('generate a model').action((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8() {
425
- return _regenerator2.default.wrap(function _callee8$(_context8) {
525
+ _commander2.default.command('generate').alias('g').description('generate a model').action((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9() {
526
+ return _regenerator2.default.wrap(function _callee9$(_context9) {
426
527
  while (1) {
427
- switch (_context8.prev = _context8.next) {
528
+ switch (_context9.prev = _context9.next) {
428
529
  case 0:
429
530
  process.env.NODE_ENV = 'production';
430
- _context8.next = 3;
531
+ _context9.next = 3;
431
532
  return gi();
432
533
 
433
534
  case 3:
434
- _context8.prev = 3;
435
- _context8.next = 6;
535
+ _context9.prev = 3;
536
+ _context9.next = 6;
436
537
  return nuxtCli.run(['generate']);
437
538
 
438
539
  case 6:
439
- _context8.next = 12;
540
+ _context9.next = 12;
440
541
  break;
441
542
 
442
543
  case 8:
443
- _context8.prev = 8;
444
- _context8.t0 = _context8['catch'](3);
544
+ _context9.prev = 8;
545
+ _context9.t0 = _context9['catch'](3);
445
546
 
446
- _consola2.default.fatal(_context8.t0);
547
+ _consola2.default.fatal(_context9.t0);
447
548
  process.exit(2);
448
549
 
449
550
  case 12:
450
551
  case 'end':
451
- return _context8.stop();
552
+ return _context9.stop();
452
553
  }
453
554
  }
454
- }, _callee8, undefined, [[3, 8]]);
555
+ }, _callee9, undefined, [[3, 8]]);
455
556
  })));
456
557
 
457
- _commander2.default.command('clean').description('clean cache').action((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9() {
458
- return _regenerator2.default.wrap(function _callee9$(_context9) {
558
+ _commander2.default.command('clean').description('clean cache').action((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10() {
559
+ return _regenerator2.default.wrap(function _callee10$(_context10) {
459
560
  while (1) {
460
- switch (_context9.prev = _context9.next) {
561
+ switch (_context10.prev = _context10.next) {
461
562
  case 0:
462
563
  _rimraf2.default.sync(_paths2.default.hardSourceCache);
463
564
  _rimraf2.default.sync(_paths2.default.ykRootCacheDir);
464
565
 
465
566
  case 2:
466
567
  case 'end':
467
- return _context9.stop();
568
+ return _context10.stop();
468
569
  }
469
570
  }
470
- }, _callee9, undefined);
571
+ }, _callee10, undefined);
471
572
  })));
472
573
 
473
574
  _commander2.default.command('verify <cmd>').option('-ed, --edit <envName>', 'commit file').option('-m, --msg <msg>', 'commit msg').option('-y0ba, --yk0-build-app <appName>', 'Building a specified application').option('-e, --env <envName>', 'yk server env').description('husky').action(function () {
474
- var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(cmd, _ref16) {
475
- var edit = _ref16.edit,
476
- msg = _ref16.msg,
477
- yk0BuildApp = _ref16.yk0BuildApp,
478
- env = _ref16.env;
479
- return _regenerator2.default.wrap(function _callee10$(_context10) {
575
+ var _ref18 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(cmd, _ref17) {
576
+ var edit = _ref17.edit,
577
+ msg = _ref17.msg,
578
+ yk0BuildApp = _ref17.yk0BuildApp,
579
+ env = _ref17.env;
580
+ return _regenerator2.default.wrap(function _callee11$(_context11) {
480
581
  while (1) {
481
- switch (_context10.prev = _context10.next) {
582
+ switch (_context11.prev = _context11.next) {
482
583
  case 0:
483
584
  alias({ appName: "__common" });
484
585
 
485
586
  if (!(cmd !== "commit-init")) {
486
- _context10.next = 4;
587
+ _context11.next = 4;
487
588
  break;
488
589
  }
489
590
 
490
- _context10.next = 4;
591
+ _context11.next = 4;
491
592
  return gi({ app: yk0BuildApp, ykServerEnv: env, appsNoneExit: false });
492
593
 
493
594
  case 4:
494
- _context10.t0 = cmd;
495
- _context10.next = _context10.t0 === "commit-init" ? 7 : 8;
595
+ _context11.t0 = cmd;
596
+ _context11.next = _context11.t0 === "commit-init" ? 7 : 8;
496
597
  break;
497
598
 
498
599
  case 7:
499
- return _context10.abrupt('break', 14);
600
+ return _context11.abrupt('break', 14);
500
601
 
501
602
  case 8:
502
- _context10.next = 10;
603
+ _context11.next = 10;
503
604
  return (0, _verify.commitEsLint)({ edit: edit });
504
605
 
505
606
  case 10:
506
- _context10.next = 12;
607
+ _context11.next = 12;
507
608
  return (0, _verify.commitStyleLint)({ edit: edit });
508
609
 
509
610
  case 12:
510
- _context10.next = 14;
611
+ _context11.next = 14;
511
612
  return (0, _verify.commitMsg)({ edit: msg });
512
613
 
513
614
  case 14:
514
615
  case 'end':
515
- return _context10.stop();
616
+ return _context11.stop();
516
617
  }
517
618
  }
518
- }, _callee10, undefined);
619
+ }, _callee11, undefined);
519
620
  }));
520
621
 
521
622
  return function (_x11, _x12) {
522
- return _ref17.apply(this, arguments);
623
+ return _ref18.apply(this, arguments);
523
624
  };
524
625
  }()
525
626
  // case "commit-eslint":
@@ -534,78 +635,78 @@ var run = exports.run = function () {
534
635
  );
535
636
 
536
637
  _commander2.default.command('server <cmd>').alias('s').option('-y0ba, --yk0-build-app <appName>', 'Building a specified application').option('-e, --env <envName>', 'yk server env').description('service control').action(function () {
537
- var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(cmd, _ref18) {
538
- var yk0BuildApp = _ref18.yk0BuildApp,
539
- env = _ref18.env;
638
+ var _ref20 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(cmd, _ref19) {
639
+ var yk0BuildApp = _ref19.yk0BuildApp,
640
+ env = _ref19.env;
540
641
 
541
- var _ref20, apps;
642
+ var _ref21, apps;
542
643
 
543
- return _regenerator2.default.wrap(function _callee12$(_context12) {
644
+ return _regenerator2.default.wrap(function _callee13$(_context13) {
544
645
  while (1) {
545
- switch (_context12.prev = _context12.next) {
646
+ switch (_context13.prev = _context13.next) {
546
647
  case 0:
547
648
  if (!(_os2.default.platform() === 'win32')) {
548
- _context12.next = 3;
649
+ _context13.next = 3;
549
650
  break;
550
651
  }
551
652
 
552
653
  _consola2.default.error(_msg.errMsg['os.win32.cmd.server']);
553
- return _context12.abrupt('return');
654
+ return _context13.abrupt('return');
554
655
 
555
656
  case 3:
556
657
  process.env.NODE_ENV = 'production';
557
658
  process.env.NODE_CMD = 'server ' + cmd;
558
- _context12.next = 7;
659
+ _context13.next = 7;
559
660
  return gi({ app: yk0BuildApp, ykServerEnv: env });
560
661
 
561
662
  case 7:
562
- _ref20 = _context12.sent;
563
- apps = _ref20.apps;
663
+ _ref21 = _context13.sent;
664
+ apps = _ref21.apps;
564
665
 
565
666
  if (!['start', 'stop', 'restart', 'lite', 'container'].includes(cmd)) {
566
- _context12.next = 21;
667
+ _context13.next = 21;
567
668
  break;
568
669
  }
569
670
 
570
- _context12.t0 = cmd;
571
- _context12.next = _context12.t0 === 'lite' ? 13 : 17;
671
+ _context13.t0 = cmd;
672
+ _context13.next = _context13.t0 === 'lite' ? 13 : 17;
572
673
  break;
573
674
 
574
675
  case 13:
575
676
  alias({ appName: apps[0] });
576
- _context12.next = 16;
677
+ _context13.next = 16;
577
678
  return require(params.serverLite)(cmd);
578
679
 
579
680
  case 16:
580
- return _context12.abrupt('break', 19);
681
+ return _context13.abrupt('break', 19);
581
682
 
582
683
  case 17:
583
- _context12.next = 19;
684
+ _context13.next = 19;
584
685
  return _server._.asyncMap(apps, function () {
585
- var _ref21 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(key, j) {
586
- return _regenerator2.default.wrap(function _callee11$(_context11) {
686
+ var _ref22 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(key, j) {
687
+ return _regenerator2.default.wrap(function _callee12$(_context12) {
587
688
  while (1) {
588
- switch (_context11.prev = _context11.next) {
689
+ switch (_context12.prev = _context12.next) {
589
690
  case 0:
590
691
  alias({ appName: key });
591
- _context11.next = 3;
692
+ _context12.next = 3;
592
693
  return require(params.serverPath)(cmd, key, j !== apps.length - 1);
593
694
 
594
695
  case 3:
595
696
  case 'end':
596
- return _context11.stop();
697
+ return _context12.stop();
597
698
  }
598
699
  }
599
- }, _callee11, undefined);
700
+ }, _callee12, undefined);
600
701
  }));
601
702
 
602
703
  return function (_x15, _x16) {
603
- return _ref21.apply(this, arguments);
704
+ return _ref22.apply(this, arguments);
604
705
  };
605
706
  }());
606
707
 
607
708
  case 19:
608
- _context12.next = 23;
709
+ _context13.next = 23;
609
710
  break;
610
711
 
611
712
  case 21:
@@ -614,14 +715,14 @@ var run = exports.run = function () {
614
715
 
615
716
  case 23:
616
717
  case 'end':
617
- return _context12.stop();
718
+ return _context13.stop();
618
719
  }
619
720
  }
620
- }, _callee12, undefined);
721
+ }, _callee13, undefined);
621
722
  }));
622
723
 
623
724
  return function (_x13, _x14) {
624
- return _ref19.apply(this, arguments);
725
+ return _ref20.apply(this, arguments);
625
726
  };
626
727
  }()).on('--help', function () {
627
728
  console.log('');
@@ -633,29 +734,29 @@ var run = exports.run = function () {
633
734
  });
634
735
 
635
736
  _commander2.default.command('publish').alias('pub').description('Publish to server').action(function () {
636
- var _ref22 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(env, options) {
637
- return _regenerator2.default.wrap(function _callee13$(_context13) {
737
+ var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14(env, options) {
738
+ return _regenerator2.default.wrap(function _callee14$(_context14) {
638
739
  while (1) {
639
- switch (_context13.prev = _context13.next) {
740
+ switch (_context14.prev = _context14.next) {
640
741
  case 0:
641
742
  process.env.NODE_TYPE = 'publish';
642
- _context13.next = 3;
743
+ _context14.next = 3;
643
744
  return gi();
644
745
 
645
746
  case 3:
646
- _context13.next = 5;
747
+ _context14.next = 5;
647
748
  return require('../utils/deployment')();
648
749
 
649
750
  case 5:
650
751
  case 'end':
651
- return _context13.stop();
752
+ return _context14.stop();
652
753
  }
653
754
  }
654
- }, _callee13, undefined);
755
+ }, _callee14, undefined);
655
756
  }));
656
757
 
657
758
  return function (_x17, _x18) {
658
- return _ref22.apply(this, arguments);
759
+ return _ref23.apply(this, arguments);
659
760
  };
660
761
  }());
661
762
 
@@ -666,12 +767,12 @@ var run = exports.run = function () {
666
767
 
667
768
  _commander2.default.parse(process.argv);
668
769
 
669
- case 12:
770
+ case 13:
670
771
  case 'end':
671
- return _context14.stop();
772
+ return _context15.stop();
672
773
  }
673
774
  }
674
- }, _callee14, undefined);
775
+ }, _callee15, undefined);
675
776
  }));
676
777
 
677
778
  return function run(_x3) {
package/config/paths.js CHANGED
@@ -103,6 +103,7 @@ var ykLite = ykRoot + ('server' + path.sep + 'mode' + path.sep + 'lite.js');
103
103
  var ykTemplate = ykRoot + ('template' + path.sep);
104
104
  var ykNuxtBuild = ykRoot + ('nuxt' + path.sep + 'build' + path.sep);
105
105
  var ykCert = ykRoot + ('cert' + path.sep);
106
+ var ykRootImage = ykRoot + ('image' + path.sep);
106
107
  var cacheDir = appNodeModules + (path.sep + '.cache');
107
108
  var ykCacheDir = cacheDir + (path.sep + 'yakuza0');
108
109
  var ykRootCacheDir = ykRoot + '.cache';
@@ -182,6 +183,7 @@ exports.default = {
182
183
  ykTemplate: ykTemplate,
183
184
  ykNuxtBuild: ykNuxtBuild,
184
185
  ykCert: ykCert,
186
+ ykRootImage: ykRootImage,
185
187
  nuxtConf: appDirectory + (path.sep + 'nuxt.config.js'),
186
188
  appAtSameDir: appDirectory + (path.sep + '..' + path.sep),
187
189
  ykCacheDir: ykCacheDir,
@@ -0,0 +1,63 @@
1
+ # See https://help.github.com/ignore-files/ for more about ignoring files.
2
+
3
+ # compiled output
4
+ /dist
5
+ /tmp
6
+ /out-tsc
7
+ /build
8
+ /.next
9
+ /.yk
10
+ /src
11
+
12
+ # dependencies
13
+ /node_modules
14
+
15
+ # IDEs and editors
16
+ /.idea
17
+ .project
18
+ .classpath
19
+ .c9/
20
+ *.launch
21
+ .settings/
22
+ *.sublime-workspace
23
+
24
+ # IDE - VSCode
25
+ .vscode/*
26
+ !.vscode/settings.json
27
+ !.vscode/tasks.json
28
+ !.vscode/launch.json
29
+ !.vscode/extensions.json
30
+
31
+ # misc
32
+ /.sass-cache
33
+ /connect.lock
34
+ /coverage
35
+ /libpeerconnection.log
36
+ npm-debug.log
37
+ testem.log
38
+ /typings
39
+
40
+ # e2e
41
+ /e2e/*.js
42
+ /e2e/*.map
43
+
44
+ # System Files
45
+ .DS_Store
46
+ .env
47
+ Thumbs.db
48
+ /package-*
49
+ /pkg
50
+ npm-debug.log*
51
+ yarn-debug.log*
52
+ yarn-error.log*
53
+
54
+ # nuxt
55
+ .nuxt
56
+ .svn
57
+ .git
58
+ sw.*
59
+ dist
60
+ /app.admin
61
+ Dockerfile
62
+ docker-compose.yml
63
+
@@ -0,0 +1,18 @@
1
+ ARG BASE_IMAGE
2
+ FROM $BASE_IMAGE
3
+
4
+ ARG YK_DOCKERNAME
5
+ ENV YK_DOCKERNAME $YK_DOCKERNAME
6
+ ARG YK_ENV
7
+ ENV YK_ENV $YK_ENV
8
+ ARG YK_ENV
9
+ ENV YK_SERVER_ENV $YK_ENV
10
+
11
+ ADD ./package.json ./package.json
12
+
13
+ ARG NPM_MODULES_CACHE_ID
14
+ RUN --mount=type=cache,target=./node_modules,id=$NPM_MODULES_CACHE_ID,sharing=locked pxnpm i
15
+
16
+ ADD ./.ykServer ./.ykServer
17
+ ADD ./config ./config
18
+ ADD ./common.static ./common.static
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "yakuza0",
3
- "version": "2.22.15-beta.0",
3
+ "version": "2.22.15-beta.2",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
+ "base": "babel --no-babelrc src -d /Users/ningfujun/work/repo/web/CLN_BASE_TEST/node_modules/yakuza0 -w --presets=env --plugins=transform-runtime,transform-object-rest-spread,add-module-exports",
7
8
  "build": "babel --no-babelrc src -d . --presets=env --plugins=transform-runtime,transform-object-rest-spread,add-module-exports",
8
9
  "pub:beta": "npm run build && npm version prerelease --preid=beta && npm publish --tag beta",
9
10
  "pub:hotfix": "npm run build && npm version prerelease --preid=hotfix && npm publish --tag hotfix",
@@ -46,8 +47,10 @@
46
47
  "cli-progress": "^2.1.1",
47
48
  "clipboardy": "^1.2.3",
48
49
  "colors": "^1.4.0",
50
+ "command-exists": "^1.2.9",
49
51
  "commander": "^2.19.0",
50
52
  "compression": "^1.7.4",
53
+ "connection-tester": "^0.2.1",
51
54
  "consola": "^2.10.1",
52
55
  "core-js": "3.10.1",
53
56
  "css-loader": "^5.2.7",