rippleui-cli 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 radeqq007
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 ADDED
@@ -0,0 +1,75 @@
1
+ # ripple-ui
2
+ A shadcn/ui inspired component library for Ripple TS.
3
+
4
+ ## Getting started
5
+
6
+ ### 1. Initialize
7
+
8
+ ```sh
9
+ npx rippleui-cli init
10
+ ```
11
+
12
+ This will:
13
+
14
+ - Detect your tailwind setup and import alias defined in the vite configuration
15
+ - Ask you to chose a base color and an accent theme
16
+ - Write a `components.json` config file
17
+ - Inject CSS variables and theme tokens into your main CSS file
18
+
19
+ ### 2. Add components
20
+
21
+ ```sh
22
+ npx rippleui-cli add <component name>
23
+ ```
24
+
25
+ Components and their dependencies are copied into your src/components/ directory.
26
+
27
+ ### 3. Browse available components
28
+
29
+ ```sh
30
+ npx rippleui-cli list
31
+ ```
32
+
33
+ ### 4. See what's installed
34
+
35
+ ```sh
36
+ npx rippleui-cli installed
37
+ ```
38
+
39
+ ## Aviable components
40
+
41
+ - button
42
+ - checkbox
43
+ - input
44
+ - label
45
+ - utils
46
+
47
+ ## Theming
48
+
49
+ ### Base colors:
50
+ - stone
51
+ - zinc
52
+ - slate
53
+
54
+ ### Accent themes:
55
+ - neutral
56
+ - blue
57
+ - violet
58
+ - rose
59
+ - orange
60
+
61
+ ## components.json
62
+
63
+ Generated during initalization:
64
+ ```json
65
+ {
66
+ "aliases": {
67
+ "components": "@/components",
68
+ "utils": "@/utils"
69
+ },
70
+ "css": "src/index.css",
71
+ "installed": [],
72
+ "componentsDir": "src/components",
73
+ "utilsDir": "src/utils"
74
+ }
75
+ ```
package/dist/cli.js ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from "commander";
3
+ import { add } from "./commands/add.js";
4
+ import { init } from "./commands/init.js";
5
+ import { installed } from "./commands/installed.js";
6
+ import { list } from "./commands/list.js";
7
+ const program = new Command();
8
+ program
9
+ .command("add <component>")
10
+ .description("Add a Ripple UI component")
11
+ .action(add);
12
+ program.command("list").description("List available components").action(list);
13
+ program
14
+ .command("installed")
15
+ .description("List installed components")
16
+ .action(installed);
17
+ program.command("init").description("Creates components.json").action(init);
18
+ program.parse(process.argv);
@@ -0,0 +1,40 @@
1
+ import { readConfig, requireConfig, writeConfig } from "../lib/config.js";
2
+ import { installEntry } from "../lib/install.js";
3
+ import { fetchRegistry } from "../lib/registry.js";
4
+ export const add = async (component) => {
5
+ const config = await readConfig();
6
+ if (!config) {
7
+ console.error("Error reading the config.");
8
+ process.exit(1);
9
+ }
10
+ requireConfig(config);
11
+ const registry = await fetchRegistry();
12
+ if (!registry[component]) {
13
+ console.error(`Component "${component}" not found.`);
14
+ process.exit(1);
15
+ }
16
+ const alreadyInstalled = new Set(config.installed);
17
+ // component + its dependencies
18
+ const toInstall = new Set();
19
+ function collectDeps(name) {
20
+ if (alreadyInstalled.has(name))
21
+ return;
22
+ if (toInstall.has(name))
23
+ return;
24
+ toInstall.add(name);
25
+ for (const dep of registry[name]?.dependencies ?? []) {
26
+ collectDeps(dep);
27
+ }
28
+ }
29
+ collectDeps(component);
30
+ if (toInstall.size === 0) {
31
+ console.log(`"${component}" is already installed.`);
32
+ return;
33
+ }
34
+ console.log(`Installing: ${[...toInstall].join(", ")}\n`);
35
+ const npmDeps = new Set();
36
+ await installEntry(component, config, alreadyInstalled, npmDeps);
37
+ config.installed = [...new Set([...config.installed, ...toInstall])];
38
+ await writeConfig(config);
39
+ console.log(`\nDone.`);
40
+ };
@@ -0,0 +1,78 @@
1
+ import fs from 'fs/promises';
2
+ import path from 'path';
3
+ import prompts from 'prompts';
4
+ import { updateCss } from '../lib/css.js';
5
+ import { detectCssFile, detectImportAlias, detectTailwind, } from '../lib/detect.js';
6
+ import { installNpmDeps } from '../lib/install.js';
7
+ import { accentThemes, bases } from '../lib/themes.js';
8
+ export const init = async () => {
9
+ const cwd = process.cwd();
10
+ try {
11
+ await fs.access(`${cwd}/components.json`);
12
+ console.log('✔ components.json already exists. Skipping initialization.');
13
+ process.exit(1);
14
+ }
15
+ catch { }
16
+ if (await detectTailwind(cwd)) {
17
+ console.log('✔ Validating tailwindcss.');
18
+ }
19
+ else {
20
+ console.error('✖ Tailwind CSS not detected. Please install it first: https://tailwindcss.com/docs/installation');
21
+ process.exit(1);
22
+ }
23
+ let mainCssFile = await detectCssFile(cwd);
24
+ if (mainCssFile === null) {
25
+ console.log('Could not find the main CSS file.');
26
+ const response = await prompts([
27
+ {
28
+ type: 'text',
29
+ name: 'mainCssFile',
30
+ message: 'Where is your main CSS file?',
31
+ initial: 'src/index.css',
32
+ },
33
+ ]);
34
+ mainCssFile = response.mainCssFile;
35
+ }
36
+ const detectedAlias = await detectImportAlias(cwd);
37
+ console.log(`✔ Validating import alias. Found "${detectedAlias}".`);
38
+ const baseChoices = Object.keys(bases).map(name => ({
39
+ title: name.charAt(0).toUpperCase() + name.slice(1),
40
+ value: name,
41
+ }));
42
+ const accentChoices = Object.keys(accentThemes).map(name => ({
43
+ title: name.charAt(0).toUpperCase() + name.slice(1),
44
+ value: name,
45
+ }));
46
+ const { base, accent } = await prompts([
47
+ {
48
+ type: 'select',
49
+ name: 'base',
50
+ message: 'Select a base color (neutral scale for backgrounds, borders, muted tones):',
51
+ choices: baseChoices,
52
+ },
53
+ {
54
+ type: 'select',
55
+ name: 'accent',
56
+ message: 'Select an accent theme (primary/brand color and border radius):',
57
+ choices: accentChoices,
58
+ },
59
+ ]);
60
+ console.log('✔ Writing components.json.');
61
+ const config = {
62
+ aliases: {
63
+ components: `${detectedAlias}/components`,
64
+ utils: `${detectedAlias}/utils`,
65
+ },
66
+ css: mainCssFile,
67
+ installed: [],
68
+ // TODO: maybe detect those instead of hardcoding the directories
69
+ componentsDir: 'src/components',
70
+ utilsDir: 'src/utils',
71
+ };
72
+ await fs.writeFile('components.json', JSON.stringify(config, null, 2) + '\n');
73
+ await updateCss(path.join(cwd, mainCssFile), base, accent);
74
+ console.log(`✔ Updating ${mainCssFile}`);
75
+ console.log('\tInstalling dependencies...');
76
+ await installNpmDeps(['@fontsource-variable/geist', 'tw-animate-css'], cwd);
77
+ console.log('Done.');
78
+ };
@@ -0,0 +1,17 @@
1
+ import { readConfig } from "../lib/config.js";
2
+ export const installed = async () => {
3
+ const config = await readConfig();
4
+ if (!config) {
5
+ console.error("Could not read the components.json file.");
6
+ process.exit(1);
7
+ }
8
+ if (config.installed.length === 0) {
9
+ console.log("No components installed yet.");
10
+ }
11
+ else {
12
+ console.log("Installed:\n");
13
+ for (const name of config.installed) {
14
+ console.log(` ✔ ${name}`);
15
+ }
16
+ }
17
+ };
@@ -0,0 +1,9 @@
1
+ import { fetchRegistry } from "../lib/registry.js";
2
+ export const list = async () => {
3
+ const registry = await fetchRegistry();
4
+ const names = Object.keys(registry);
5
+ console.log("Available components:");
6
+ for (const name of names) {
7
+ console.log(` ${name}`);
8
+ }
9
+ };
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "rippleui-cli",
3
+ "version": "0.1.0",
4
+ "description": "shadcn/ui inspired components library for Ripple TS",
5
+ "type": "module",
6
+ "scripts": {
7
+ "build": "tsc",
8
+ "watch": "tsc --watch",
9
+ "lint": "biome check .",
10
+ "format": "biome format . --write",
11
+ "check": "biome check . --all",
12
+ "prepublishOnly": "npm run build"
13
+ },
14
+ "bin": {
15
+ "rippleui-cli": "dist/cli.js"
16
+ },
17
+ "keywords": [
18
+ "ripple",
19
+ "ui",
20
+ "components",
21
+ "tailwindcss",
22
+ "shadcn"
23
+ ],
24
+ "author": "Radosław Kaczmarczyk",
25
+ "license": "MIT",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/radeqq007/ripple-ui.git"
29
+ },
30
+ "homepage": "https://github.com/radeqq007/ripple-ui#readme",
31
+ "bugs": {
32
+ "url": "https://github.com/radeqq007/ripple-ui/issues"
33
+ },
34
+ "engines": {
35
+ "node": ">=18"
36
+ },
37
+ "packageManager": "pnpm@10.32.1",
38
+ "dependencies": {
39
+ "commander": "^14.0.3",
40
+ "fs-extra": "^11.3.4",
41
+ "prompts": "^2.4.2"
42
+ },
43
+ "devDependencies": {
44
+ "@biomejs/biome": "2.4.10",
45
+ "@types/node": "^25.5.0",
46
+ "@types/prompts": "^2.4.9",
47
+ "ark-ripple": "^0.0.4",
48
+ "clsx": "^2.1.1",
49
+ "lucide-ripple": "^0.0.7",
50
+ "tailwind-merge": "^3.0.0",
51
+ "tsx": "^4.21.0",
52
+ "typescript": "^6.0.2"
53
+ },
54
+ "peerDependencies": {
55
+ "clsx": ">=2",
56
+ "tailwind-merge": ">=3"
57
+ }
58
+ }
package/registry.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "button": {
3
+ "files": ["Button.ripple"],
4
+ "path": "components/button",
5
+ "dependencies": ["utils"],
6
+ "npmDependencies": ["class-variance-authority"]
7
+ },
8
+ "label": {
9
+ "files": ["Label.ripple"],
10
+ "path": "components/label",
11
+ "dependencies": ["utils"]
12
+ },
13
+ "input": {
14
+ "files": ["Input.ripple"],
15
+ "path": "components/input",
16
+ "dependencies": ["utils"]
17
+ },
18
+ "checkbox": {
19
+ "files": ["Checkbox.ripple"],
20
+ "path":"components/checkbox",
21
+ "dependencies": ["utils"],
22
+ "npmDependencies": ["lucide-ripple", "ark-ripple"]
23
+ },
24
+ "utils": {
25
+ "files": ["utils.ts"],
26
+ "path": "lib/",
27
+ "target": "src/lib",
28
+ "npmDependencies": ["clsx", "tailwind-merge"]
29
+ }
30
+ }