@rainbow-robotics/muscat-plugin-kit 1.3.6-dev.4 → 1.3.6-dev.5
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/cli/src/uninstall.mjs +3 -20
- package/cli/src/util.mjs +16 -4
- package/cli/storybook-dist/project.json +1 -1
- package/package.json +3 -3
package/cli/src/uninstall.mjs
CHANGED
|
@@ -1,28 +1,11 @@
|
|
|
1
1
|
// muscat-pk uninstall - remove the installed CLI, whether npm-global or S3 binary.
|
|
2
2
|
import { execSync, spawn, spawnSync } from "node:child_process";
|
|
3
|
-
import { existsSync,
|
|
4
|
-
import { dirname, join
|
|
5
|
-
import { KIT_PUBLISHED_NAME,
|
|
3
|
+
import { existsSync, rmSync } from "node:fs";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { KIT_PUBLISHED_NAME, isNpmGlobalInstall, log, parseArgs } from "./util.mjs";
|
|
6
6
|
|
|
7
7
|
const isBinaryMode = typeof Bun !== "undefined";
|
|
8
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
9
|
function uninstallNpmGlobal() {
|
|
27
10
|
log.step(`npm uninstall -g ${KIT_PUBLISHED_NAME}`);
|
|
28
11
|
execSync(`npm uninstall -g ${KIT_PUBLISHED_NAME}`, { stdio: "inherit" });
|
package/cli/src/util.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Shared helpers for muscat-pk.
|
|
2
|
-
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { execSync, spawnSync } from "node:child_process";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
|
-
import { dirname, resolve, sep } from "node:path";
|
|
4
|
+
import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
5
|
+
import { dirname, relative, resolve, sep } from "node:path";
|
|
6
6
|
import { tmpdir } from "node:os";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
import { createInterface } from "node:readline/promises";
|
|
@@ -187,9 +187,21 @@ export function resolveLocalCliBin(start = process.cwd()) {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
/** True if the code currently running was installed with `npm install -g`. */
|
|
191
|
+
export function isNpmGlobalInstall() {
|
|
192
|
+
try {
|
|
193
|
+
const globalRoot = realpathSync(execSync("npm root -g", { encoding: "utf8" }).trim());
|
|
194
|
+
const rel = relative(globalRoot, realpathSync(kitRoot));
|
|
195
|
+
return rel === "" || (!rel.startsWith("..") && !rel.includes(":"));
|
|
196
|
+
} catch {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
190
201
|
/** True if the code currently running is a project's local install (not global/binary). */
|
|
191
202
|
export function isLocalKitInstall() {
|
|
192
|
-
|
|
203
|
+
// npm -g 도 node_modules 아래에 놓이므로 global root 는 제외한다.
|
|
204
|
+
return kitRoot.includes(`${sep}node_modules${sep}`) && !isNpmGlobalInstall();
|
|
193
205
|
}
|
|
194
206
|
|
|
195
207
|
const useColor = process.env.NO_COLOR !== "1" && (process.stdout.isTTY || process.env.FORCE_COLOR);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
1
|
+
{"generatedAt":1791434545972,"userSince":1750932757926,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"testPackages":{"@vitest/browser":"3.2.4","@vitest/coverage-v8":"3.2.4","playwright":"1.59.1","vitest":"3.2.4"},"hasRouterPackage":false,"monorepo":"Turborepo","packageManager":{"type":"yarn","version":"berry","agent":"yarn@berry"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","portableStoriesFileCount":0,"applicationFileCount":0,"storybookVersion":"8.6.18","storybookVersionSpecifier":"^8.6.4","language":"typescript","storybookPackages":{"@chromatic-com/storybook":{"version":"3.2.7"},"@storybook/addon-essentials":{"version":"8.6.18"},"@storybook/addon-links":{"version":"8.6.18"},"@storybook/addon-onboarding":{"version":"8.6.18"},"@storybook/addon-themes":{"version":"8.6.18"},"@storybook/blocks":{"version":"8.6.18"},"@storybook/experimental-addon-test":{"version":"8.6.18"},"@storybook/react":{"version":"8.6.18"},"@storybook/react-vite":{"version":"8.6.18"},"@storybook/test":{"version":"8.6.18"},"@storybook/theming":{"version":"8.6.18"},"eslint-plugin-storybook":{"version":"0.11.6"},"storybook":{"version":"8.6.18"},"storybook-addon-react-docgen":{"version":"1.2.44"}},"addons":{"$SNIP/node_modules/@storybook/addon-links":{"version":null},"$SNIP/node_modules/@storybook/addon-essentials":{"version":null},"$SNIP/node_modules/@chromatic-com/storybook":{"version":null},"$SNIP/node_modules/@storybook/addon-themes":{"version":null},"$SNIP/node_modules/@storybook/experimental-addon-test":{"version":null}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rainbow-robotics/muscat-plugin-kit",
|
|
3
|
-
"version": "1.3.6-dev.
|
|
3
|
+
"version": "1.3.6-dev.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20"
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
56
|
-
"@rainbow-robotics/plugin-ui": "1.3.6-dev.
|
|
57
|
-
"@rainbow-robotics/preview-host": "1.3.6-dev.
|
|
56
|
+
"@rainbow-robotics/plugin-ui": "1.3.6-dev.5",
|
|
57
|
+
"@rainbow-robotics/preview-host": "1.3.6-dev.5",
|
|
58
58
|
"postcss": "^8.5.8",
|
|
59
59
|
"socket.io": "^4.8.1",
|
|
60
60
|
"typescript": "^5.8.0",
|