@stackvibe-studio/cli 0.0.0-stage → 0.2.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 StackVibe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,33 @@
1
- # Temporary Holding Version
1
+ # @stackvibe-studio/cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ CLI for scaffolding and installing StackVibe packages into React apps.
4
+
5
+ ## Highlights
6
+
7
+ - Initialize a project with StackVibe UI dependencies
8
+ - Add individual components by name
9
+ - Keeps project setup quick for design-system adoption
10
+ - Updated in v0.2.0 with more package coverage and component commands
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npm install -g @stackvibe-studio/cli
16
+ ```
17
+
18
+ ## Commands
19
+
20
+ ```bash
21
+ stackvibe init
22
+ stackvibe add button
23
+ stackvibe add tabs
24
+ stackvibe add spotlight-card
25
+ stackvibe add orb-cluster
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ ```bash
31
+ npx @stackvibe-studio/cli init
32
+ npx @stackvibe-studio/cli add button
33
+ ```
package/dist/index.cjs ADDED
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ // src/index.ts
5
+ var import_node_fs = require("fs");
6
+ var import_node_path = require("path");
7
+ var import_node_url = require("url");
8
+ var import_meta = {};
9
+ var args = process.argv.slice(2);
10
+ var command = args[0] ?? "help";
11
+ var projectRoot = process.cwd();
12
+ var cliRoot = (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
13
+ function printHelp() {
14
+ console.log(`StackVibe CLI
15
+
16
+ Usage:
17
+ npx @stackvibe-studio/cli init
18
+ npx @stackvibe-studio/cli add <component>
19
+
20
+ Available components:
21
+ button
22
+ tabs
23
+ skeleton
24
+ spotlight-card
25
+ fade-in-section
26
+ glass-3d-card
27
+ orb-cluster
28
+ `);
29
+ }
30
+ function ensurePackageJson() {
31
+ const pkgPath = (0, import_node_path.join)(projectRoot, "package.json");
32
+ try {
33
+ const raw = (0, import_node_fs.readFileSync)(pkgPath, "utf8");
34
+ return JSON.parse(raw);
35
+ } catch {
36
+ console.error(
37
+ "No package.json found in the target project. Run this inside a React app directory."
38
+ );
39
+ process.exit(1);
40
+ }
41
+ }
42
+ function addComponent(component) {
43
+ const pkg = ensurePackageJson();
44
+ const packageMap = {
45
+ button: "@stackvibe-studio/ui",
46
+ tabs: "@stackvibe-studio/ui",
47
+ skeleton: "@stackvibe-studio/ui",
48
+ "spotlight-card": "@stackvibe-studio/motion",
49
+ "fade-in-section": "@stackvibe-studio/motion",
50
+ "glass-3d-card": "@stackvibe-studio/three",
51
+ "orb-cluster": "@stackvibe-studio/three"
52
+ };
53
+ const selected = packageMap[component];
54
+ if (!selected) {
55
+ console.error(`Component "${component}" is not available in the registry.`);
56
+ process.exit(1);
57
+ }
58
+ pkg.dependencies ??= {};
59
+ pkg.dependencies[selected] = pkg.dependencies[selected] ?? "latest";
60
+ (0, import_node_fs.writeFileSync)((0, import_node_path.join)(projectRoot, "package.json"), `${JSON.stringify(pkg, null, 2)}
61
+ `);
62
+ console.log(`Added ${component} via ${selected}.`);
63
+ }
64
+ switch (command) {
65
+ case "init": {
66
+ const pkg = ensurePackageJson();
67
+ pkg.dependencies ??= {};
68
+ pkg.dependencies["@stackvibe-studio/ui"] ??= "latest";
69
+ (0, import_node_fs.writeFileSync)((0, import_node_path.join)(projectRoot, "package.json"), `${JSON.stringify(pkg, null, 2)}
70
+ `);
71
+ console.log("StackVibe UI initialized in this project.");
72
+ break;
73
+ }
74
+ case "add": {
75
+ const component = args[1];
76
+ if (!component) {
77
+ console.error("Please provide a component name, for example: stackvibe add button");
78
+ process.exit(1);
79
+ }
80
+ addComponent(component);
81
+ break;
82
+ }
83
+ case "help":
84
+ default:
85
+ printHelp();
86
+ break;
87
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import { readFileSync, writeFileSync } from "fs";
5
+ import { dirname, join } from "path";
6
+ import { fileURLToPath } from "url";
7
+ var args = process.argv.slice(2);
8
+ var command = args[0] ?? "help";
9
+ var projectRoot = process.cwd();
10
+ var cliRoot = dirname(fileURLToPath(import.meta.url));
11
+ function printHelp() {
12
+ console.log(`StackVibe CLI
13
+
14
+ Usage:
15
+ npx @stackvibe-studio/cli init
16
+ npx @stackvibe-studio/cli add <component>
17
+
18
+ Available components:
19
+ button
20
+ tabs
21
+ skeleton
22
+ spotlight-card
23
+ fade-in-section
24
+ glass-3d-card
25
+ orb-cluster
26
+ `);
27
+ }
28
+ function ensurePackageJson() {
29
+ const pkgPath = join(projectRoot, "package.json");
30
+ try {
31
+ const raw = readFileSync(pkgPath, "utf8");
32
+ return JSON.parse(raw);
33
+ } catch {
34
+ console.error(
35
+ "No package.json found in the target project. Run this inside a React app directory."
36
+ );
37
+ process.exit(1);
38
+ }
39
+ }
40
+ function addComponent(component) {
41
+ const pkg = ensurePackageJson();
42
+ const packageMap = {
43
+ button: "@stackvibe-studio/ui",
44
+ tabs: "@stackvibe-studio/ui",
45
+ skeleton: "@stackvibe-studio/ui",
46
+ "spotlight-card": "@stackvibe-studio/motion",
47
+ "fade-in-section": "@stackvibe-studio/motion",
48
+ "glass-3d-card": "@stackvibe-studio/three",
49
+ "orb-cluster": "@stackvibe-studio/three"
50
+ };
51
+ const selected = packageMap[component];
52
+ if (!selected) {
53
+ console.error(`Component "${component}" is not available in the registry.`);
54
+ process.exit(1);
55
+ }
56
+ pkg.dependencies ??= {};
57
+ pkg.dependencies[selected] = pkg.dependencies[selected] ?? "latest";
58
+ writeFileSync(join(projectRoot, "package.json"), `${JSON.stringify(pkg, null, 2)}
59
+ `);
60
+ console.log(`Added ${component} via ${selected}.`);
61
+ }
62
+ switch (command) {
63
+ case "init": {
64
+ const pkg = ensurePackageJson();
65
+ pkg.dependencies ??= {};
66
+ pkg.dependencies["@stackvibe-studio/ui"] ??= "latest";
67
+ writeFileSync(join(projectRoot, "package.json"), `${JSON.stringify(pkg, null, 2)}
68
+ `);
69
+ console.log("StackVibe UI initialized in this project.");
70
+ break;
71
+ }
72
+ case "add": {
73
+ const component = args[1];
74
+ if (!component) {
75
+ console.error("Please provide a component name, for example: stackvibe add button");
76
+ process.exit(1);
77
+ }
78
+ addComponent(component);
79
+ break;
80
+ }
81
+ case "help":
82
+ default:
83
+ printHelp();
84
+ break;
85
+ }
package/package.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
2
  "name": "@stackvibe-studio/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0",
4
+ "type": "module",
5
+ "description": "CLI for installing and scaffolding StackVibe UI packages.",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/StackVibe-Studio/stackvibe-ui.git"
9
+ },
10
+ "homepage": "https://stackvibe-studio.github.io/stackvibe-ui/",
11
+ "bugs": {
12
+ "url": "https://github.com/StackVibe-Studio/stackvibe-ui/issues"
13
+ },
14
+ "license": "MIT",
15
+ "bin": {
16
+ "stackvibe": "./dist/index.js"
17
+ },
18
+ "main": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js"
24
+ }
25
+ },
26
+ "publishConfig": {
27
+ "access": "public",
28
+ "registry": "https://registry.npmjs.org/"
29
+ },
30
+ "files": [
31
+ "dist"
32
+ ],
33
+ "devDependencies": {
34
+ "tsup": "^8.1.0",
35
+ "tsx": "^4.19.2",
36
+ "typescript": "^5.7.0"
37
+ },
38
+ "scripts": {
39
+ "build": "tsup src/index.ts --format esm,cjs --clean && tsc --project tsconfig.json --emitDeclarationOnly",
40
+ "typecheck": "tsc --noEmit",
41
+ "dev": "node --loader tsx src/index.ts"
42
+ }
6
43
  }