@blocklet/cli 1.16.23-beta-abdda301 → 1.16.23-beta-a2f9b088

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/cli",
3
- "version": "1.16.23-beta-abdda301",
3
+ "version": "1.16.23-beta-a2f9b088",
4
4
  "description": "Command line tools to manage Blocklet and Blocklet Server",
5
5
  "homepage": "https://github.com/ArcBlock/blocklet-server#readme",
6
6
  "main": "bin/blocklet.js",
@@ -16,6 +16,7 @@
16
16
  "test": "node tools/jest.js",
17
17
  "coverage": "npm run test -- --coverage",
18
18
  "clean": "rm -fr lib",
19
+ "build:blocklet-cli": "npm run build",
19
20
  "build": "npm run clean && tsc && cp src/constant.js lib"
20
21
  },
21
22
  "files": [
@@ -36,7 +37,7 @@
36
37
  "url": "https://github.com/ArcBlock/blocklet-server/issues"
37
38
  },
38
39
  "dependencies": {
39
- "@abtnode/cli": "1.16.23-beta-abdda301",
40
+ "@abtnode/cli": "1.16.23-beta-a2f9b088",
40
41
  "colors": "1.4.0",
41
42
  "cross-spawn": "^7.0.3",
42
43
  "shelljs": "^0.8.5"
@@ -56,5 +57,5 @@
56
57
  "engines": {
57
58
  "node": ">=14"
58
59
  },
59
- "gitHead": "2b064df15b34007f6145170ee691ae9e91ff1528"
60
+ "gitHead": "cc060de5d06e1759112a787dd10b780e628ce0b7"
60
61
  }
package/lib/constant.js DELETED
@@ -1,5 +0,0 @@
1
- const packageJson = require('../package.json');
2
-
3
- module.exports = {
4
- name: packageJson.name,
5
- };
package/lib/run.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const _default: () => void;
2
- export = _default;
package/lib/run.js DELETED
@@ -1,73 +0,0 @@
1
- "use strict";
2
- /* eslint-disable global-require */
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || function (mod) {
20
- if (mod && mod.__esModule) return mod;
21
- var result = {};
22
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
- __setModuleDefault(result, mod);
24
- return result;
25
- };
26
- var __importDefault = (this && this.__importDefault) || function (mod) {
27
- return (mod && mod.__esModule) ? mod : { "default": mod };
28
- };
29
- const constant_1 = require("@abtnode/cli/lib/constant");
30
- // !!! PM_HOME must be set before everything
31
- process.env.PM2_HOME = constant_1.PM2_HOME;
32
- process.env.ABT_NODE_HOME = constant_1.ABT_NODE_HOME;
33
- process.env.ABT_NODE_MAX_CLUSTER_SIZE = constant_1.ABT_NODE_MAX_CLUSTER_SIZE;
34
- const cross_spawn_1 = __importDefault(require("cross-spawn"));
35
- const get_cli_binary_name_1 = __importDefault(require("@abtnode/cli/lib/util/get-cli-binary-name"));
36
- const exit_when_server_stopped_1 = __importDefault(require("@abtnode/cli/lib/util/exit-when-server-stopped"));
37
- const print_error_1 = __importDefault(require("@abtnode/cli/lib/util/print-error"));
38
- const constant_2 = require("./constant");
39
- const keepAliveParams = ['--keep-alive', '-k'];
40
- const parseArgv = () => {
41
- const binaryName = (0, get_cli_binary_name_1.default)();
42
- const isServer = process.argv[2] === 'server';
43
- const isStart = process.argv[3] === 'start';
44
- const keepAlive = keepAliveParams.some((x) => process.argv.includes(x));
45
- return { binaryName, isServer, isStart, keepAlive };
46
- };
47
- module.exports = () => {
48
- process.env.ABT_NODE_PACKAGE_NAME = constant_2.name;
49
- const { binaryName, isServer, isStart, keepAlive } = parseArgv();
50
- if (isServer && isStart && keepAlive) {
51
- const argv = process.argv.slice(4).filter((x) => !keepAliveParams.includes(x));
52
- const { error, status } = cross_spawn_1.default.sync(binaryName, ['server', 'start', ...argv], {
53
- timeout: 3 * 60 * 1000,
54
- detached: false,
55
- windowsHide: true,
56
- shell: false,
57
- stdio: 'inherit',
58
- });
59
- if (error) {
60
- (0, print_error_1.default)(error.message);
61
- process.exit(error.errno || -1);
62
- return; // just for test
63
- }
64
- if (status !== 0) {
65
- process.exit(status);
66
- return; // just for test
67
- }
68
- (0, exit_when_server_stopped_1.default)();
69
- }
70
- else {
71
- Promise.resolve().then(() => __importStar(require('@abtnode/cli/bin/blocklet')));
72
- }
73
- };