embedlabs 0.1.0-alpha.110 → 0.1.0-alpha.112
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/README.md +1 -1
- package/bin/install-progress.js +23 -22
- package/package.json +2 -2
package/README.md
CHANGED
package/bin/install-progress.js
CHANGED
|
@@ -14,21 +14,11 @@ if (phase === "preinstall") {
|
|
|
14
14
|
const steps = phase === "preinstall"
|
|
15
15
|
? [
|
|
16
16
|
[5, `install: initializing (${target})`],
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[35, "install: extracting packages"],
|
|
23
|
-
[40, "install: extracting packages"],
|
|
24
|
-
[45, "install: preparing CLI"],
|
|
25
|
-
[50, "install: preparing CLI"],
|
|
26
|
-
[55, "install: preparing native bridge"],
|
|
27
|
-
[60, "install: preparing native bridge"],
|
|
28
|
-
[65, "install: preparing command links"],
|
|
29
|
-
[70, "install: preparing command links"],
|
|
30
|
-
[75, "install: waiting for npm"],
|
|
31
|
-
[80, "install: waiting for npm"],
|
|
17
|
+
[18, "install: checking platform"],
|
|
18
|
+
[30, "install: resolving packages"],
|
|
19
|
+
[45, "install: downloading dependencies"],
|
|
20
|
+
[60, "install: extracting files"],
|
|
21
|
+
[75, "install: preparing commands"],
|
|
32
22
|
[84, "install: waiting for npm"]
|
|
33
23
|
]
|
|
34
24
|
: [
|
|
@@ -37,13 +27,26 @@ const steps = phase === "preinstall"
|
|
|
37
27
|
[100, "install: complete"]
|
|
38
28
|
];
|
|
39
29
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
if (shouldShowProgress()) {
|
|
31
|
+
for (let index = 0; index < steps.length; index += 1) {
|
|
32
|
+
const [percent, message] = steps[index];
|
|
33
|
+
writeProgress(percent, message, index === steps.length - 1);
|
|
34
|
+
await sleep(1000);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function shouldShowProgress() {
|
|
39
|
+
return (
|
|
40
|
+
process.stdout.isTTY ||
|
|
41
|
+
process.env.npm_config_foreground_scripts === "true" ||
|
|
42
|
+
process.env.EMBEDLABS_INSTALL_FORCE_PROGRESS === "1" ||
|
|
43
|
+
process.env.EMBEDLABS_INSTALL_NO_TTY === "1"
|
|
44
|
+
);
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
function writeProgress(percent, message) {
|
|
46
|
-
const
|
|
47
|
+
function writeProgress(percent, message, final = false) {
|
|
48
|
+
const text = `[EmbedLabs] ${String(percent).padStart(3, " ")}% ${message}`;
|
|
49
|
+
const line = `\r\x1b[2K${text}${final ? "\n" : ""}`;
|
|
47
50
|
if (process.stdout.isTTY || process.env.EMBEDLABS_INSTALL_NO_TTY === "1") {
|
|
48
51
|
process.stdout.write(line);
|
|
49
52
|
return;
|
|
@@ -129,14 +132,12 @@ function installCommandShim() {
|
|
|
129
132
|
if (platform() === "win32") {
|
|
130
133
|
const target = join(prefix, "embedlabs.cmd");
|
|
131
134
|
writeFileSync(target, windowsCmdShim(), "utf8");
|
|
132
|
-
writeProgress(90, "install: command ready (embedlabs.cmd)");
|
|
133
135
|
return;
|
|
134
136
|
}
|
|
135
137
|
const target = join(prefix, "bin", "embedlabs");
|
|
136
138
|
mkdirSync(dirname(target), { recursive: true });
|
|
137
139
|
writeFileSync(target, unixShellShim(), "utf8");
|
|
138
140
|
chmodSync(target, 0o755);
|
|
139
|
-
writeProgress(90, "install: command ready (embedlabs)");
|
|
140
141
|
}
|
|
141
142
|
|
|
142
143
|
function windowsCmdShim() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "embedlabs",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.112",
|
|
4
4
|
"description": "EmbedLabs CLI alias package for local-first embedded agent testing.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"README.md"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@kvell007/embed-labs-cli": "0.1.0-alpha.
|
|
16
|
+
"@kvell007/embed-labs-cli": "0.1.0-alpha.112"
|
|
17
17
|
},
|
|
18
18
|
"publishConfig": {
|
|
19
19
|
"access": "public",
|