@stackvibe-studio/cli 0.0.0-stage → 0.1.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/dist/index.cjs ADDED
@@ -0,0 +1,79 @@
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
+ spotlight-card
23
+ glass-3d-card
24
+ `);
25
+ }
26
+ function ensurePackageJson() {
27
+ const pkgPath = (0, import_node_path.join)(projectRoot, "package.json");
28
+ try {
29
+ const raw = (0, import_node_fs.readFileSync)(pkgPath, "utf8");
30
+ return JSON.parse(raw);
31
+ } catch {
32
+ console.error(
33
+ "No package.json found in the target project. Run this inside a React app directory."
34
+ );
35
+ process.exit(1);
36
+ }
37
+ }
38
+ function addComponent(component) {
39
+ const pkg = ensurePackageJson();
40
+ const packageMap = {
41
+ button: "@stackvibe-studio/ui",
42
+ "spotlight-card": "@stackvibe-studio/motion",
43
+ "glass-3d-card": "@stackvibe-studio/three"
44
+ };
45
+ const selected = packageMap[component];
46
+ if (!selected) {
47
+ console.error(`Component "${component}" is not available in the registry.`);
48
+ process.exit(1);
49
+ }
50
+ pkg.dependencies ??= {};
51
+ pkg.dependencies[selected] = pkg.dependencies[selected] ?? "latest";
52
+ (0, import_node_fs.writeFileSync)((0, import_node_path.join)(projectRoot, "package.json"), `${JSON.stringify(pkg, null, 2)}
53
+ `);
54
+ console.log(`Added ${component} via ${selected}.`);
55
+ }
56
+ switch (command) {
57
+ case "init": {
58
+ const pkg = ensurePackageJson();
59
+ pkg.dependencies ??= {};
60
+ pkg.dependencies["@stackvibe-studio/ui"] ??= "latest";
61
+ (0, import_node_fs.writeFileSync)((0, import_node_path.join)(projectRoot, "package.json"), `${JSON.stringify(pkg, null, 2)}
62
+ `);
63
+ console.log("StackVibe UI initialized in this project.");
64
+ break;
65
+ }
66
+ case "add": {
67
+ const component = args[1];
68
+ if (!component) {
69
+ console.error("Please provide a component name, for example: stackvibe add button");
70
+ process.exit(1);
71
+ }
72
+ addComponent(component);
73
+ break;
74
+ }
75
+ case "help":
76
+ default:
77
+ printHelp();
78
+ break;
79
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,77 @@
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
+ spotlight-card
21
+ glass-3d-card
22
+ `);
23
+ }
24
+ function ensurePackageJson() {
25
+ const pkgPath = join(projectRoot, "package.json");
26
+ try {
27
+ const raw = readFileSync(pkgPath, "utf8");
28
+ return JSON.parse(raw);
29
+ } catch {
30
+ console.error(
31
+ "No package.json found in the target project. Run this inside a React app directory."
32
+ );
33
+ process.exit(1);
34
+ }
35
+ }
36
+ function addComponent(component) {
37
+ const pkg = ensurePackageJson();
38
+ const packageMap = {
39
+ button: "@stackvibe-studio/ui",
40
+ "spotlight-card": "@stackvibe-studio/motion",
41
+ "glass-3d-card": "@stackvibe-studio/three"
42
+ };
43
+ const selected = packageMap[component];
44
+ if (!selected) {
45
+ console.error(`Component "${component}" is not available in the registry.`);
46
+ process.exit(1);
47
+ }
48
+ pkg.dependencies ??= {};
49
+ pkg.dependencies[selected] = pkg.dependencies[selected] ?? "latest";
50
+ writeFileSync(join(projectRoot, "package.json"), `${JSON.stringify(pkg, null, 2)}
51
+ `);
52
+ console.log(`Added ${component} via ${selected}.`);
53
+ }
54
+ switch (command) {
55
+ case "init": {
56
+ const pkg = ensurePackageJson();
57
+ pkg.dependencies ??= {};
58
+ pkg.dependencies["@stackvibe-studio/ui"] ??= "latest";
59
+ writeFileSync(join(projectRoot, "package.json"), `${JSON.stringify(pkg, null, 2)}
60
+ `);
61
+ console.log("StackVibe UI initialized in this project.");
62
+ break;
63
+ }
64
+ case "add": {
65
+ const component = args[1];
66
+ if (!component) {
67
+ console.error("Please provide a component name, for example: stackvibe add button");
68
+ process.exit(1);
69
+ }
70
+ addComponent(component);
71
+ break;
72
+ }
73
+ case "help":
74
+ default:
75
+ printHelp();
76
+ break;
77
+ }
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.1.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
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
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.