viora-ui 1.0.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.
Files changed (2) hide show
  1. package/index.js +36 -0
  2. package/package.json +25 -0
package/index.js ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { program } = require('commander');
4
+ const { execSync } = require('child_process');
5
+
6
+ const REGISTRY_URL = 'https://viora-ui.com/registry';
7
+
8
+ program
9
+ .name('viora-ui')
10
+ .description('The official CLI for Viora UI components')
11
+ .version('1.0.0');
12
+
13
+ program
14
+ .command('add [component]')
15
+ .description('Add a Viora UI component to your project')
16
+ .action((component) => {
17
+ if (!component) {
18
+ console.error('Please specify a component to add. Example: npx viora-ui add accordion');
19
+ process.exit(1);
20
+ }
21
+
22
+ console.log(`\x1b[36mAdding ${component} from Viora UI...\x1b[0m\n`);
23
+
24
+ const url = `${REGISTRY_URL}/${component}.json`;
25
+
26
+ try {
27
+ // Execute Shadcn CLI under the hood with the full URL
28
+ // This gives us the full power of Shadcn without maintaining a custom fork!
29
+ execSync(`npx shadcn@latest add ${url}`, { stdio: 'inherit' });
30
+ } catch (error) {
31
+ console.error(`\x1b[31m\nFailed to add ${component}. Please make sure you are in a Next.js project initialized with Shadcn.\x1b[0m`);
32
+ process.exit(1);
33
+ }
34
+ });
35
+
36
+ program.parse(process.argv);
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "viora-ui",
3
+ "version": "1.0.0",
4
+ "description": "The official CLI for Viora UI components.",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "viora-ui": "./index.js"
8
+ },
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ },
12
+ "keywords": [
13
+ "viora-ui",
14
+ "shadcn",
15
+ "cli",
16
+ "components",
17
+ "react",
18
+ "tailwind"
19
+ ],
20
+ "author": "Viora UI",
21
+ "license": "MIT",
22
+ "dependencies": {
23
+ "commander": "^11.1.0"
24
+ }
25
+ }