@rainbow-robotics/muscat-plugin-kit 0.1.2-dev.36 → 0.1.2-dev.38

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
@@ -17,29 +17,29 @@ npm install -g @rainbow-robotics/muscat-plugin-kit@dev
17
17
  npm install -g @rainbow-robotics/muscat-plugin-kit@1.2.3
18
18
  ```
19
19
 
20
- ### 방법 2 — 설치 스크립트 (Node.js 없어도 됨)
20
+ ### 방법 2 — S3 설치 스크립트 (Node.js 없어도 됨)
21
21
 
22
22
  macOS / Linux / WSL:
23
23
 
24
24
  ```bash
25
25
  # 최신 stable
26
- curl -fsSL https://raw.githubusercontent.com/rainbow-robotics/web-rainbow-ui/main/scripts/install-muscat-pk.sh | sh
26
+ curl -fsSL https://rainbow-deploy.s3.ap-northeast-2.amazonaws.com/muscat-plugin-kit/install.sh | sh
27
27
 
28
28
  # dev 채널
29
- MUSCAT_PK_TAG=dev curl -fsSL https://raw.githubusercontent.com/rainbow-robotics/web-rainbow-ui/main/scripts/install-muscat-pk.sh | sh
29
+ curl -fsSL https://rainbow-deploy.s3.ap-northeast-2.amazonaws.com/muscat-plugin-kit/install.sh | MUSCAT_PK_TAG=dev sh
30
30
 
31
31
  # 특정 버전
32
- MUSCAT_PK_TAG=1.2.3 curl -fsSL https://raw.githubusercontent.com/rainbow-robotics/web-rainbow-ui/main/scripts/install-muscat-pk.sh | sh
32
+ curl -fsSL https://rainbow-deploy.s3.ap-northeast-2.amazonaws.com/muscat-plugin-kit/install.sh | MUSCAT_PK_TAG=1.2.3 sh
33
33
  ```
34
34
 
35
35
  Windows PowerShell:
36
36
 
37
37
  ```powershell
38
38
  # 최신 stable
39
- irm https://raw.githubusercontent.com/rainbow-robotics/web-rainbow-ui/main/scripts/install-muscat-pk.ps1 | iex
39
+ irm https://rainbow-deploy.s3.ap-northeast-2.amazonaws.com/muscat-plugin-kit/install.ps1 | iex
40
40
 
41
41
  # dev 채널
42
- $env:MUSCAT_PK_TAG="dev"; irm https://raw.githubusercontent.com/rainbow-robotics/web-rainbow-ui/main/scripts/install-muscat-pk.ps1 | iex
42
+ $env:MUSCAT_PK_TAG="dev"; irm https://rainbow-deploy.s3.ap-northeast-2.amazonaws.com/muscat-plugin-kit/install.ps1 | iex
43
43
  ```
44
44
 
45
45
  > 설치 스크립트는 Node.js 20+가 있으면 npm을 우선 사용하고, 없으면 S3에서 self-contained 바이너리를 받습니다.
@@ -48,12 +48,15 @@ $env:MUSCAT_PK_TAG="dev"; irm https://raw.githubusercontent.com/rainbow-robotics
48
48
 
49
49
  ```
50
50
  https://rainbow-deploy.s3.ap-northeast-2.amazonaws.com/muscat-plugin-kit/v{버전}/{바이너리}
51
+ https://rainbow-deploy.s3.ap-northeast-2.amazonaws.com/muscat-plugin-kit/stable/{바이너리}
52
+ https://rainbow-deploy.s3.ap-northeast-2.amazonaws.com/muscat-plugin-kit/dev/{바이너리}
51
53
  ```
52
54
 
53
55
  | OS | 파일 |
54
56
  |---|---|
55
57
  | Linux x64 | `muscat-pk-linux-x64` |
56
58
  | macOS ARM64 | `muscat-pk-darwin-arm64` |
59
+ | macOS x64 | `muscat-pk-darwin-x64` |
57
60
  | Windows x64 | `muscat-pk-win-x64.exe` |
58
61
 
59
62
  채널 포인터:
@@ -66,6 +69,24 @@ https://rainbow-deploy.s3.ap-northeast-2.amazonaws.com/muscat-plugin-kit/latest-
66
69
  https://rainbow-deploy.s3.ap-northeast-2.amazonaws.com/muscat-plugin-kit/dev-version.txt
67
70
  ```
68
71
 
72
+ ### 삭제
73
+
74
+ 설치 방식과 관계없이 `muscat-pk`가 자기 자신을 삭제합니다.
75
+
76
+ ```bash
77
+ muscat-pk uninstall
78
+ ```
79
+
80
+ 수동 삭제:
81
+
82
+ ```bash
83
+ # npm으로 설치한 경우
84
+ npm uninstall -g @rainbow-robotics/muscat-plugin-kit
85
+
86
+ # S3 바이너리로 설치한 경우 (macOS/Linux 기본 경로)
87
+ sudo rm -f /usr/local/bin/muscat-pk
88
+ ```
89
+
69
90
  ---
70
91
 
71
92
  ## 빠른 시작
package/cli/README.md CHANGED
@@ -16,6 +16,7 @@ muscat-pk dev:ui # preview the plugin in a mini-Muscat (preview-host)
16
16
  muscat-pk dev:back # run the back end in a Docker container (python / cpp / ros2)
17
17
  muscat-pk dev # dev:ui + dev:back
18
18
  muscat-pk update # update @rainbow-robotics/muscat-plugin-kit and @rainbow-robotics/plugin-ui
19
+ muscat-pk uninstall # remove muscat-pk itself (npm global or S3 binary)
19
20
  muscat-pk sdk list | sdk update [version] # manage rainbow-rb-sdk (python)
20
21
  ```
21
22
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  // muscat-pk — Muscat plugin developer CLI.
3
- // Subcommands: new, build, dev, dev:ui, dev:back, update, sdk.
3
+ // Subcommands: new, build, dev, dev:ui, dev:back, update, uninstall, sdk.
4
4
  import { log } from "../src/util.mjs";
5
5
  import { runNew } from "../src/new.mjs";
6
6
  import { runBuild } from "../src/build.mjs";
@@ -8,6 +8,7 @@ import { runDevUi } from "../src/devUi.mjs";
8
8
  import { runDevBack } from "../src/devBack.mjs";
9
9
  import { runDev } from "../src/dev.mjs";
10
10
  import { runUpdate } from "../src/update.mjs";
11
+ import { runUninstall } from "../src/uninstall.mjs";
11
12
  import { runSdk } from "../src/sdk.mjs";
12
13
  import { runType } from "../src/type.mjs";
13
14
  import { runPreview } from "../src/preview.mjs";
@@ -21,12 +22,13 @@ Usage: muscat-pk <command> [options]
21
22
  Commands:
22
23
  new [dir] Scaffold a new plugin project (prompts: author, email, description, type, front-package-manager)
23
24
  type change Switch backend type (python | cpp | ros2-python | ros2-cpp)
24
- build Build + lock deps + vendor wheels + zip (--no-zip: skip zip, --no-lock: skip python lock/vendor, --arch x86_64|aarch64|both)
25
+ build Build + lock deps + vendor wheels + zip (--no-zip: skip zip, --no-lock: skip python lock/vendor, --arch amd64|arm64|both)
25
26
  dev Run Socket.IO bridge, dev:ui, and dev:back together
26
27
  dev:ui Preview the plugin in a mini-Muscat (preview-host)
27
28
  dev:back Run the plugin back end (python: watchfiles reload / ros2: Docker)
28
29
  preview Preview against a real Muscat server (prompts for robot IP)
29
30
  update Update @rainbow-robotics/muscat-plugin-kit and @rainbow-robotics/plugin-ui
31
+ uninstall Remove the installed muscat-pk CLI (npm global or S3 binary)
30
32
  sdk <list|update [version]> Manage the python rainbow-rb-sdk version
31
33
 
32
34
  Run "muscat-pk <command> --help" for details.`;
@@ -50,6 +52,8 @@ async function main() {
50
52
  return await runPreview(args);
51
53
  case "update":
52
54
  return await runUpdate(args);
55
+ case "uninstall":
56
+ return await runUninstall(args);
53
57
  case "sdk":
54
58
  return await runSdk(args);
55
59
  case undefined:
package/cli/src/ros2.mjs CHANGED
@@ -76,6 +76,8 @@ export function colconBuild(root, { image = ROS2_DEV_IMAGE, symlink = false, arc
76
76
  const script = [
77
77
  "pip install -r requirements.txt --break-system-packages --ignore-installed -q || true",
78
78
  "cd ros2_ws",
79
+ // ponytail: rm only on cross-arch; same-arch dev rebuilds keep the cache
80
+ ...(arch ? ["rm -rf build"] : []),
79
81
  `colcon build ${flag} --install-base ${installBase}`.trim(),
80
82
  ].join(" && ");
81
83
  const label = arch
@@ -0,0 +1,98 @@
1
+ // muscat-pk uninstall - remove the installed CLI, whether npm-global or S3 binary.
2
+ import { execSync, spawn, spawnSync } from "node:child_process";
3
+ import { existsSync, realpathSync, rmSync } from "node:fs";
4
+ import { dirname, join, relative } from "node:path";
5
+ import { KIT_PUBLISHED_NAME, kitRoot, log, parseArgs } from "./util.mjs";
6
+
7
+ const isBinaryMode = typeof Bun !== "undefined";
8
+
9
+ function isInside(child, parent) {
10
+ const rel = relative(parent, child);
11
+ return rel === "" || (!!rel && !rel.startsWith("..") && !rel.includes(":"));
12
+ }
13
+
14
+ function npmGlobalRoot() {
15
+ return execSync("npm root -g", { encoding: "utf8" }).trim();
16
+ }
17
+
18
+ function isNpmGlobalInstall() {
19
+ try {
20
+ return isInside(realpathSync(kitRoot), realpathSync(npmGlobalRoot()));
21
+ } catch {
22
+ return false;
23
+ }
24
+ }
25
+
26
+ function uninstallNpmGlobal() {
27
+ log.step(`npm uninstall -g ${KIT_PUBLISHED_NAME}`);
28
+ execSync(`npm uninstall -g ${KIT_PUBLISHED_NAME}`, { stdio: "inherit" });
29
+ log.ok("Global npm package removed.");
30
+ }
31
+
32
+ function uninstallBinary() {
33
+ const execPath = process.execPath;
34
+ log.step(`Removing binary: ${execPath}`);
35
+
36
+ if (process.platform === "win32") {
37
+ const ps = `Start-Sleep -Milliseconds 500; Remove-Item -Force '${execPath}'`;
38
+ spawn("powershell", ["-NoProfile", "-Command", ps], {
39
+ detached: true,
40
+ stdio: "ignore",
41
+ }).unref();
42
+ log.ok("Binary will be removed after this process exits.");
43
+ return;
44
+ }
45
+
46
+ try {
47
+ rmSync(execPath, { force: true });
48
+ } catch (err) {
49
+ if (err?.code !== "EACCES" && err?.code !== "EPERM") throw err;
50
+ log.info(" sudo is required...");
51
+ const result = spawnSync("sudo", ["rm", "-f", execPath], { stdio: "inherit" });
52
+ if (result.status !== 0) throw new Error(`sudo rm failed: ${execPath}`);
53
+ }
54
+
55
+ const parent = dirname(execPath);
56
+ for (const shim of ["muscat-pk.cmd", "muscat-pk.ps1"]) {
57
+ rmSync(join(parent, shim), { force: true });
58
+ }
59
+
60
+ log.ok("Binary removed.");
61
+ }
62
+
63
+ export async function runUninstall(args = []) {
64
+ const opts = parseArgs(args, { booleans: ["help"] });
65
+
66
+ if (opts.help) {
67
+ log.info(
68
+ [
69
+ "Usage: muscat-pk uninstall",
70
+ "",
71
+ "Removes the installed muscat-pk CLI.",
72
+ " npm global install -> npm uninstall -g @rainbow-robotics/muscat-plugin-kit",
73
+ " S3 binary install -> remove the muscat-pk executable",
74
+ ].join("\n"),
75
+ );
76
+ return;
77
+ }
78
+
79
+ if (isBinaryMode) {
80
+ uninstallBinary();
81
+ return;
82
+ }
83
+
84
+ if (isNpmGlobalInstall()) {
85
+ uninstallNpmGlobal();
86
+ return;
87
+ }
88
+
89
+ const localBin = process.argv[1] || "";
90
+ if (localBin.includes(`${join("node_modules", ".bin")}`) || existsSync(join(process.cwd(), "package.json"))) {
91
+ log.warn("This muscat-pk appears to be running from a project/local install.");
92
+ log.warn("Remove it from the project package manager instead, for example:");
93
+ log.warn(` npm uninstall ${KIT_PUBLISHED_NAME}`);
94
+ return;
95
+ }
96
+
97
+ throw new Error("Could not determine install mode. Remove muscat-pk manually from your PATH.");
98
+ }
@@ -386,4 +386,5 @@ muscat-pk type change # switch backend type
386
386
  muscat-pk sdk list # show current Python SDK version
387
387
  muscat-pk sdk update # update Python SDK to latest
388
388
  muscat-pk update # update muscat-plugin-kit itself
389
+ muscat-pk uninstall # remove muscat-pk itself
389
390
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rainbow-robotics/muscat-plugin-kit",
3
- "version": "0.1.2-dev.36",
3
+ "version": "0.1.2-dev.38",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -31,7 +31,7 @@
31
31
  "@types/react-dom": "^19.0.4"
32
32
  },
33
33
  "dependencies": {
34
- "@rainbow-robotics/preview-host": "0.1.2-dev.36",
34
+ "@rainbow-robotics/preview-host": "0.1.2-dev.38",
35
35
  "socket.io": "^4.8.1"
36
36
  },
37
37
  "optionalDependencies": {