@dainprotocol/cli 1.0.9 → 1.0.10
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/dist/commands/dev.js +21 -7
- package/dist/utils.js +1 -1
- package/package.json +1 -1
package/dist/commands/dev.js
CHANGED
|
@@ -139,11 +139,15 @@ function dev(options) {
|
|
|
139
139
|
if (proxyServer) {
|
|
140
140
|
proxyServer.close(function () {
|
|
141
141
|
(0, utils_1.logInfo)('Proxy server closed.');
|
|
142
|
-
|
|
142
|
+
setTimeout(function () {
|
|
143
|
+
process.exit(0);
|
|
144
|
+
}, 500);
|
|
143
145
|
});
|
|
144
146
|
}
|
|
145
147
|
else {
|
|
146
|
-
|
|
148
|
+
setTimeout(function () {
|
|
149
|
+
process.exit(0);
|
|
150
|
+
}, 500);
|
|
147
151
|
}
|
|
148
152
|
});
|
|
149
153
|
process.on('SIGTERM', function () {
|
|
@@ -151,11 +155,15 @@ function dev(options) {
|
|
|
151
155
|
if (proxyServer) {
|
|
152
156
|
proxyServer.close(function () {
|
|
153
157
|
(0, utils_1.logInfo)('Proxy server closed.');
|
|
154
|
-
|
|
158
|
+
setTimeout(function () {
|
|
159
|
+
process.exit(0);
|
|
160
|
+
}, 500);
|
|
155
161
|
});
|
|
156
162
|
}
|
|
157
163
|
else {
|
|
158
|
-
|
|
164
|
+
setTimeout(function () {
|
|
165
|
+
process.exit(0);
|
|
166
|
+
}, 500);
|
|
159
167
|
}
|
|
160
168
|
});
|
|
161
169
|
// Handle uncaught exceptions and unhandled rejections
|
|
@@ -164,14 +172,18 @@ function dev(options) {
|
|
|
164
172
|
cleanup();
|
|
165
173
|
if (proxyServer)
|
|
166
174
|
proxyServer.close();
|
|
167
|
-
|
|
175
|
+
setTimeout(function () {
|
|
176
|
+
process.exit(1);
|
|
177
|
+
}, 500);
|
|
168
178
|
});
|
|
169
179
|
process.on('unhandledRejection', function (reason, promise) {
|
|
170
180
|
(0, utils_1.logError)('Unhandled Rejection at:', promise + '\n\nreason:' + reason);
|
|
171
181
|
cleanup();
|
|
172
182
|
if (proxyServer)
|
|
173
183
|
proxyServer.close();
|
|
174
|
-
|
|
184
|
+
setTimeout(function () {
|
|
185
|
+
process.exit(1);
|
|
186
|
+
}, 500);
|
|
175
187
|
});
|
|
176
188
|
return [3 /*break*/, 5];
|
|
177
189
|
case 4:
|
|
@@ -180,7 +192,9 @@ function dev(options) {
|
|
|
180
192
|
cleanup();
|
|
181
193
|
if (proxyServer)
|
|
182
194
|
proxyServer.close();
|
|
183
|
-
|
|
195
|
+
setTimeout(function () {
|
|
196
|
+
process.exit(1);
|
|
197
|
+
}, 500);
|
|
184
198
|
return [3 /*break*/, 5];
|
|
185
199
|
case 5: return [2 /*return*/];
|
|
186
200
|
}
|
package/dist/utils.js
CHANGED
|
@@ -87,7 +87,7 @@ function getDainConfig(configFile) {
|
|
|
87
87
|
config["version"] = config["version"] || "1.0.0";
|
|
88
88
|
config["out-dir"] = config["out-dir"] || "dist"; // Default to 'dist' if not specified
|
|
89
89
|
config["tunnel-base-url"] =
|
|
90
|
-
config["tunnel-base-url"] || "wss:///
|
|
90
|
+
config["tunnel-base-url"] || "wss:///tunnel.dain-local.com"; // Default value if not specified
|
|
91
91
|
// Handle API key
|
|
92
92
|
if (!config["api-key"] || config["api-key"] === "env" || config["api-key"] === "MUST PUT IN .env.development as DAIN_API_KEY=YOUR_API_KEY") {
|
|
93
93
|
config["api-key"] = process.env.DAIN_API_KEY;
|