@journal-ds/cli 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.
- package/LICENSE +21 -0
- package/README.md +103 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1108 -0
- package/package.json +61 -0
- package/registry/accordion.tsx +66 -0
- package/registry/alert-dialog.tsx +157 -0
- package/registry/alert.tsx +66 -0
- package/registry/aspect-ratio.tsx +11 -0
- package/registry/avatar.tsx +53 -0
- package/registry/badge.tsx +46 -0
- package/registry/breadcrumb.tsx +109 -0
- package/registry/button.tsx +59 -0
- package/registry/calendar.tsx +213 -0
- package/registry/card.tsx +92 -0
- package/registry/carousel.tsx +241 -0
- package/registry/chart.tsx +353 -0
- package/registry/checkbox.tsx +32 -0
- package/registry/collapsible.tsx +33 -0
- package/registry/command.tsx +186 -0
- package/registry/context-menu.tsx +252 -0
- package/registry/dialog.tsx +143 -0
- package/registry/drawer.tsx +135 -0
- package/registry/dropdown-menu.tsx +257 -0
- package/registry/form.tsx +167 -0
- package/registry/hover-card.tsx +44 -0
- package/registry/input-otp.tsx +77 -0
- package/registry/input.tsx +21 -0
- package/registry/label.tsx +24 -0
- package/registry/menubar.tsx +276 -0
- package/registry/navigation-menu.tsx +168 -0
- package/registry/pagination.tsx +127 -0
- package/registry/popover.tsx +48 -0
- package/registry/progress.tsx +31 -0
- package/registry/radio-group.tsx +45 -0
- package/registry/resizable.tsx +56 -0
- package/registry/scroll-area.tsx +58 -0
- package/registry/select.tsx +185 -0
- package/registry/separator.tsx +28 -0
- package/registry/sheet.tsx +139 -0
- package/registry/sidebar.tsx +726 -0
- package/registry/skeleton.tsx +13 -0
- package/registry/slider.tsx +63 -0
- package/registry/sonner.tsx +25 -0
- package/registry/switch.tsx +31 -0
- package/registry/table.tsx +116 -0
- package/registry/tabs.tsx +66 -0
- package/registry/textarea.tsx +18 -0
- package/registry/toast.tsx +129 -0
- package/registry/toaster.tsx +35 -0
- package/registry/toggle-group.tsx +73 -0
- package/registry/toggle.tsx +47 -0
- package/registry/tooltip.tsx +61 -0
- package/registry/use-mobile.ts +19 -0
- package/registry/use-toast.ts +194 -0
- package/registry/utils.ts +6 -0
- package/templates/globals.css +322 -0
- package/templates/utils.ts +6 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Journal Design System
|
|
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,103 @@
|
|
|
1
|
+
# @journal-ds/cli
|
|
2
|
+
|
|
3
|
+
Command-line tool for adding [Journal Design System](https://journal-ds.dev) components to your project.
|
|
4
|
+
|
|
5
|
+
## Quick start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Initialize the config (creates journal.json + theme)
|
|
9
|
+
npx @journal-ds/cli init
|
|
10
|
+
|
|
11
|
+
# Add a single component
|
|
12
|
+
npx @journal-ds/cli add button
|
|
13
|
+
|
|
14
|
+
# Add multiple components
|
|
15
|
+
npx @journal-ds/cli add button card dialog input label
|
|
16
|
+
|
|
17
|
+
# Add every component
|
|
18
|
+
npx @journal-ds/cli add --all
|
|
19
|
+
|
|
20
|
+
# List available components
|
|
21
|
+
npx @journal-ds/cli list
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Commands
|
|
25
|
+
|
|
26
|
+
### `init`
|
|
27
|
+
|
|
28
|
+
Creates a `journal.json` config file in your project root, appends the Journal theme CSS to your global stylesheet, and creates the `cn()` utility if it doesn't exist.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx @journal-ds/cli init
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Flags:
|
|
35
|
+
- `--defaults` — use default config without prompts
|
|
36
|
+
- `--yes` — skip confirmation prompts
|
|
37
|
+
- `--cwd <path>` — run in a different directory
|
|
38
|
+
|
|
39
|
+
### `add <slug> [<slug> ...]`
|
|
40
|
+
|
|
41
|
+
Copies one or more components into your project. Automatically resolves and installs transitive dependencies (e.g., `sidebar` pulls in `button`, `separator`, `sheet`, `tooltip`, etc.).
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx @journal-ds/cli add button
|
|
45
|
+
npx @journal-ds/cli add button card dialog
|
|
46
|
+
npx @journal-ds/cli add --all
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Flags:
|
|
50
|
+
- `-o, --overwrite` — overwrite existing files
|
|
51
|
+
- `-y, --yes` — skip confirmation prompts
|
|
52
|
+
- `-d, --dry-run` — print what would happen without writing files
|
|
53
|
+
- `-a, --all` — install every component
|
|
54
|
+
- `--cwd <path>` — run in a different directory
|
|
55
|
+
|
|
56
|
+
### `list`
|
|
57
|
+
|
|
58
|
+
Prints all available components, grouped by category.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx @journal-ds/cli list
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## How it works
|
|
65
|
+
|
|
66
|
+
The CLI ships with a `registry/` folder containing the source code of every component as plain `.tsx` files. When you run `add`, the CLI:
|
|
67
|
+
|
|
68
|
+
1. Reads your `journal.json` to learn your path aliases (e.g. `@/components/ui`, `@/lib/utils`)
|
|
69
|
+
2. Resolves the transitive dependency tree for the requested component(s)
|
|
70
|
+
3. Transforms import paths in the source to match your aliases
|
|
71
|
+
4. Writes each file to the correct location (`components/ui/`, `lib/`, or `hooks/`)
|
|
72
|
+
5. Prints the npm packages you need to install (it does **not** auto-install to avoid modifying your lockfile)
|
|
73
|
+
|
|
74
|
+
The result: you own the source code. No runtime dependency on `@journal-ds/react`. You can customize every line.
|
|
75
|
+
|
|
76
|
+
## journal.json
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"$schema": "https://journal-ds.dev/schema.json",
|
|
81
|
+
"style": "default",
|
|
82
|
+
"rsc": true,
|
|
83
|
+
"tsx": true,
|
|
84
|
+
"tailwind": {
|
|
85
|
+
"config": "tailwind.config.ts",
|
|
86
|
+
"css": "src/app/globals.css",
|
|
87
|
+
"baseColor": "neutral",
|
|
88
|
+
"cssVariables": true
|
|
89
|
+
},
|
|
90
|
+
"aliases": {
|
|
91
|
+
"components": "@/components",
|
|
92
|
+
"utils": "@/lib/utils",
|
|
93
|
+
"ui": "@/components/ui",
|
|
94
|
+
"lib": "@/lib",
|
|
95
|
+
"hooks": "@/hooks"
|
|
96
|
+
},
|
|
97
|
+
"iconLibrary": "lucide"
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
MIT © [Journal Design System](https://journal-ds.dev)
|
package/dist/index.d.ts
ADDED