@intuned/runtime-dev 1.2.0-cli.6 → 1.2.0-cli.7
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.
|
@@ -156,19 +156,29 @@ async function runDeployProject(projectName, auth) {
|
|
|
156
156
|
(0, _terminal.terminal)("\n");
|
|
157
157
|
const startTime = Date.now();
|
|
158
158
|
let lastCheckTime = startTime;
|
|
159
|
-
|
|
160
|
-
(
|
|
159
|
+
let spinner = null;
|
|
160
|
+
if (_terminal.terminalStdout.isTTY) {
|
|
161
|
+
spinner = await _terminal.terminal.spinner("dotSpinner");
|
|
162
|
+
(0, _terminal.terminal)("\n");
|
|
163
|
+
} else {
|
|
164
|
+
(0, _terminal.terminal)(`^cDeploying ^:\n`);
|
|
165
|
+
}
|
|
161
166
|
try {
|
|
162
167
|
while (true) {
|
|
163
168
|
await (0, _promises.setTimeout)(50);
|
|
164
|
-
_terminal.terminal.previousLine(1);
|
|
165
|
-
_terminal.terminal.column(3);
|
|
166
|
-
_terminal.terminal.eraseLineAfter();
|
|
167
169
|
const timeElapsedText = ((Date.now() - startTime) / (0, _ms.default)("1 second")).toFixed(1);
|
|
168
|
-
(
|
|
170
|
+
if (_terminal.terminalStdout.isTTY) {
|
|
171
|
+
_terminal.terminal.previousLine(1);
|
|
172
|
+
_terminal.terminal.column(3);
|
|
173
|
+
_terminal.terminal.eraseLineAfter();
|
|
174
|
+
(0, _terminal.terminal)(`^cDeploying ^:^K(${timeElapsedText}s)^ \n`);
|
|
175
|
+
}
|
|
169
176
|
if (Date.now() - lastCheckTime < _constants.PROJECT_DEPLOY_CHECK_PERIOD) {
|
|
170
177
|
continue;
|
|
171
178
|
}
|
|
179
|
+
if (!_terminal.terminalStdout.isTTY) {
|
|
180
|
+
(0, _terminal.terminal)(`^cDeploying ^:^K(${timeElapsedText}s)^ \n`);
|
|
181
|
+
}
|
|
172
182
|
lastCheckTime = Date.now();
|
|
173
183
|
const {
|
|
174
184
|
status,
|
|
@@ -184,7 +194,7 @@ async function runDeployProject(projectName, auth) {
|
|
|
184
194
|
}
|
|
185
195
|
_terminal.terminal.previousLine(1);
|
|
186
196
|
_terminal.terminal.eraseLine();
|
|
187
|
-
spinner
|
|
197
|
+
spinner?.animate(false);
|
|
188
198
|
if (status === "completed") {
|
|
189
199
|
const url = (0, _helpers.getBaseUrl)();
|
|
190
200
|
(0, _terminal.terminal)(`\n^g^+Project deployed successfully!^:\n`);
|
|
@@ -194,7 +204,7 @@ async function runDeployProject(projectName, auth) {
|
|
|
194
204
|
throw new _helpers.CLIError(`^r^+An error occurred while deploying project:^:\n^R${message}^:\n^r^+Project deployment failed^:\n`);
|
|
195
205
|
}
|
|
196
206
|
} catch (e) {
|
|
197
|
-
spinner
|
|
207
|
+
spinner?.animate(false);
|
|
198
208
|
}
|
|
199
209
|
}
|
|
200
210
|
const projectNameSchema = exports.projectNameSchema = _zod.z.string().min(1, "Project Name is required").max(50, "Name must be 50 characters or less").regex(/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/, "Name can only contain lowercase letters, numbers, hyphens, and underscores in between").refine(value => !_zod.z.string().uuid().safeParse(value).success, {
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.terminal = void 0;
|
|
6
|
+
exports.terminalStdout = exports.terminal = void 0;
|
|
7
7
|
var _terminalKit = require("terminal-kit");
|
|
8
|
+
const terminalStdout = exports.terminalStdout = process.stderr;
|
|
8
9
|
const terminal = exports.terminal = (0, _terminalKit.createTerminal)({
|
|
9
10
|
appId: "Intuned CLI",
|
|
10
11
|
appName: "Intuned CLI",
|
|
11
|
-
stdout:
|
|
12
|
+
stdout: terminalStdout
|
|
12
13
|
});
|