@dainprotocol/cli 1.0.1 → 1.0.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.
@@ -46,6 +46,7 @@ var ora_1 = __importDefault(require("ora"));
46
46
  var chokidar_1 = __importDefault(require("chokidar"));
47
47
  var path_1 = __importDefault(require("path"));
48
48
  var childProcess = null;
49
+ var watcher = null;
49
50
  function startProcess(command) {
50
51
  var _a, _b;
51
52
  if (childProcess) {
@@ -67,9 +68,21 @@ function startProcess(command) {
67
68
  }
68
69
  });
69
70
  }
71
+ function cleanup() {
72
+ if (childProcess) {
73
+ childProcess.kill();
74
+ childProcess = null;
75
+ }
76
+ if (watcher) {
77
+ watcher.close();
78
+ watcher = null;
79
+ }
80
+ (0, utils_1.logInfo)('Development server and file watcher stopped.');
81
+ process.exit(0);
82
+ }
70
83
  function dev(options) {
71
84
  return __awaiter(this, void 0, void 0, function () {
72
- var config, command, watchPaths, watcher;
85
+ var config, command, watchPaths;
73
86
  return __generator(this, function (_a) {
74
87
  switch (_a.label) {
75
88
  case 0:
@@ -96,6 +109,9 @@ function dev(options) {
96
109
  startProcess(command);
97
110
  });
98
111
  (0, utils_1.logInfo)('Watching for file changes...');
112
+ // Add signal handlers for graceful shutdown
113
+ process.on('SIGINT', cleanup);
114
+ process.on('SIGTERM', cleanup);
99
115
  return [2 /*return*/];
100
116
  }
101
117
  });
package/dist/utils.js CHANGED
@@ -64,7 +64,7 @@ function setupProxy(port) {
64
64
  _a.label = 1;
65
65
  case 1:
66
66
  _a.trys.push([1, 3, , 4]);
67
- client = new client_1.DainTunnel('wss://tunnel.dain-local.com');
67
+ client = new client_1.DainTunnel('wss:///devtunnel.dain-local.com');
68
68
  return [4 /*yield*/, client.start(parseInt(port))];
69
69
  case 2:
70
70
  tunnelUrl = _a.sent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dainprotocol/cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "CLI for Dain Protocol",
5
5
  "main": "dist/index.js",
6
6
  "bin": {