embedboard 0.1.0-alpha.4 → 0.1.0-alpha.41

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 CHANGED
@@ -7,4 +7,4 @@ npm install -g embedboard@alpha
7
7
  embedboard --help
8
8
  ```
9
9
 
10
- This package forwards to `@kvell007/embed-labs-cli@0.1.0-alpha.5`.
10
+ This package forwards to `@kvell007/embed-labs-cli@0.1.0-alpha.41`.
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+ import { writeFileSync } from "node:fs";
3
+ import { arch, platform } from "node:os";
4
+
5
+ const phase = process.argv[2] === "preinstall" ? "preinstall" : "postinstall";
6
+ const target = `${platform()}-${arch()}`;
7
+
8
+ const steps = phase === "preinstall"
9
+ ? [
10
+ [3, `install: initializing (${target})`],
11
+ [8, "install: preparing npm package graph"],
12
+ [15, "install: resolving Embed Labs package"]
13
+ ]
14
+ : [
15
+ [85, "install: linking CLI command"],
16
+ [95, "install: finalizing package"],
17
+ [100, "install: complete"]
18
+ ];
19
+
20
+ for (const [percent, message] of steps) {
21
+ writeProgress(percent, message);
22
+ await sleep(1000);
23
+ }
24
+
25
+ function writeProgress(percent, message) {
26
+ const line = `[Embed Labs] ${String(percent).padStart(3, " ")}% ${message}\n`;
27
+ process.stdout.write(line);
28
+ if (!process.stdout.isTTY && process.env.EMBEDLABS_INSTALL_NO_TTY !== "1") {
29
+ try {
30
+ writeFileSync(platform() === "win32" ? "\\\\.\\CONOUT$" : "/dev/tty", line, { flag: "a" });
31
+ } catch {}
32
+ }
33
+ }
34
+
35
+ function sleep(ms) {
36
+ return new Promise((resolve) => setTimeout(resolve, ms));
37
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "embedboard",
3
- "version": "0.1.0-alpha.4",
3
+ "version": "0.1.0-alpha.41",
4
4
  "description": "EmbedBoard CLI alias package for Embed Labs Cloud integration testing.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -8,12 +8,16 @@
8
8
  "embedboard": "bin/embedboard.js",
9
9
  "embed": "bin/embed.js"
10
10
  },
11
+ "scripts": {
12
+ "preinstall": "node bin/install-progress.js preinstall",
13
+ "postinstall": "node bin/install-progress.js postinstall"
14
+ },
11
15
  "files": [
12
16
  "bin",
13
17
  "README.md"
14
18
  ],
15
19
  "dependencies": {
16
- "@kvell007/embed-labs-cli": "0.1.0-alpha.5"
20
+ "@kvell007/embed-labs-cli": "0.1.0-alpha.41"
17
21
  },
18
22
  "publishConfig": {
19
23
  "access": "public",