Skip to content
This repository was archived by the owner on Apr 5, 2026. It is now read-only.

Commit d61c0ad

Browse files
author
phernandez
committed
feat(docs): add installation tabs for multiple package managers
Updated installation documentation to include tabs for uv, poetry, and pip commands. Also added details about component dependencies with examples.
1 parent 1944bde commit d61c0ad

File tree

4 files changed

+176
-67
lines changed

4 files changed

+176
-67
lines changed

basic_components/cli/components.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ def add_component(
7878
excludes = ["*", f"!{pattern}"]
7979

8080
# Debug output
81-
console.print("[yellow]Debug: Copying with args:[/yellow]")
82-
console.print(f" src_path: {repo_url}")
83-
console.print(f" dst_path: {dest_dir}")
84-
console.print(f" exclude patterns: {excludes}")
85-
console.print(f" vcs_ref: {branch}")
81+
# console.print("[yellow]Debug: Copying with args:[/yellow]")
82+
# console.print(f" src_path: {repo_url}")
83+
# console.print(f" dst_path: {dest_dir}")
84+
# console.print(f" exclude patterns: {excludes}")
85+
# console.print(f" vcs_ref: {branch}")
8686

8787
copier.run_copy(
8888
src_path=repo_url,
@@ -142,7 +142,7 @@ def add(
142142
if with_deps:
143143
dependencies = set(deps_map.get(component, []))
144144
if dependencies:
145-
console.print(f"\n[yellow]Debug: Found dependencies: {dependencies}[/yellow]")
145+
#console.print(f"\n[yellow]Debug: Found dependencies: {dependencies}[/yellow]")
146146
components_to_install.update(dependencies)
147147
else:
148148
dependencies = set()
@@ -157,7 +157,7 @@ def add(
157157
# Install each component separately with its own exclude pattern
158158
installed = []
159159
for comp in sorted(components_to_install):
160-
console.print(f"\n[yellow]Debug: Installing component: {comp}[/yellow]")
160+
#console.print(f"\n[yellow]Debug: Installing component: {comp}[/yellow]")
161161
add_component(comp, components_dir, repo_url, branch, dry_run)
162162
installed.append(comp)
163163

docs/content/docs/changelog.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,43 @@ description: Latest updates and announcements.
44
---
55

66
<Prose>
7+
8+
## v0.2.0 (2024-11-17)
9+
10+
### Bug Fixes
11+
12+
- Fix dependecy groups in pyproject.toml
13+
([`b6e4fc8`](https://github.com/basicmachines-co/basic-components/commit/b6e4fc80e23410d5d0bc990d40000b4a7bfbd585))
14+
15+
### Documentation
16+
17+
- Add CHANGELOG to docs site
18+
([`0b35e1d`](https://github.com/basicmachines-co/basic-components/commit/0b35e1df3c154a20a64399d93a9ad363c84d90f5))
19+
20+
### Features
21+
22+
- Add component dependency analyzer tool
23+
([`3aa76c8`](https://github.com/basicmachines-co/basic-components/commit/3aa76c8868887e010aca4e6af925cea37988f32f))
24+
25+
Introduce a new tool to analyze component dependencies with optional TOML and JSON output. This tool
26+
can identify PascalCase component references and supports integrations, special icon cases, and
27+
core components. Added a corresponding TOML file for known dependencies.
28+
29+
### Refactoring
30+
31+
- Adjust project configuration and file structure
32+
([`7fc49f2`](https://github.com/basicmachines-co/basic-components/commit/7fc49f272ccb9616270bd2c5142af658e22e94f2))
33+
34+
Move dependencies and script definitions in pyproject.toml for better structure. Rename and relocate
35+
cli.py to components.py to improve clarity. Update .gitignore to include .env files.
36+
37+
- Restructure component files and update dependencies
38+
([`d74ea0e`](https://github.com/basicmachines-co/basic-components/commit/d74ea0eb55b11a9b6b403541e24de80960921751))
39+
40+
Moved component files to new directories for better organization. Updated pyproject.toml and uv.lock
41+
reflecting changes and added tomli-w dependency. Enhanced CLI tool with dependency handling and a
42+
dry run feature.
43+
744
## v0.1.7 (2024-11-15)
845

946
### Bug Fixes

docs/content/docs/cli.md

Lines changed: 85 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,41 @@ install components because it will also include any dependencies (other referenc
1515

1616
To vendor a component into your project using the `components` tool, run
1717

18-
```bash
19-
uvx --from basic-components components add <component_name>
20-
```
18+
<Tabs defaultValue="uv">
19+
<TabsList className="grid grid-cols-2">
20+
<TabsTrigger value="uv">uv</TabsTrigger>
21+
<TabsTrigger value="pipx">pipx</TabsTrigger>
22+
</TabsList>
23+
<TabsContent value="uv">
24+
<div class="relative" x-data><CopyPasteButton/>
25+
<pre class="language-bash bg-zinc-50 dark:bg-zinc-900 rounded-md"><code x-ref="code" class="language-bash">uvx --from basic-components components add [component_name] </code></pre>
26+
</div>
27+
</TabsContent>
28+
<TabsContent value="pipx">
29+
<div class="relative" x-data><CopyPasteButton/>
30+
<pre class="language-bash bg-zinc-50 dark:bg-zinc-900 rounded-md"><code x-ref="code" class="language-bash">pipx install basic-components && components add [component_name]</code></pre>
31+
</div>
32+
</TabsContent>
33+
</Tabs>
2134

2235
The components will be added to your project in the `components/ui/<component_name>` directory.
2336

2437
### Example
2538

2639
```bash
27-
➜ uvx --from basic-components components add button
28-
Installing button from
29-
'https://github.com/basicmachines-co/basic-components.git' ...
40+
components add button
41+
button (will be installed)
42+
Installing button...
3043

31-
Copying from template version 0.0.0.post163.dev0+70554ca
32-
create button
44+
Copying from template version 0.2.0
3345
create button/Button.jinja
3446

3547

36-
╭─────────────────────────── Installation Complete ────────────────────────────╮
37-
│ ✓ Added button component │
38-
│ │
39-
│ components-dir=components/ui │
40-
╰──────────────────────────────────────────────────────────────────────────────╯
41-
48+
╭────────────────────────────────────────────────────────── Installation Complete ───────────────────────────────────────────────────────────╮
49+
│ ✓ Added button component │
50+
│ │
51+
│ components-dir=components/ui │
52+
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
4253
```
4354
View the results
4455
```bash
@@ -52,7 +63,64 @@ components
5263

5364
```
5465

55-
See the [utilities](/docs/utilities) docs for more information about setting up your project to use the components.
66+
### Dependencies
67+
68+
Some components have dependencies on other components. When using the `components` command, any required components
69+
will also be installed.
70+
71+
```bash
72+
✗ components add dropdown_menu
73+
dropdown_menu (will be installed)
74+
└── Dependencies
75+
├── checkbox
76+
├── icons/ChevronRight
77+
└── radio
78+
Installing checkbox...
79+
80+
Copying from template version 0.2.0
81+
create checkbox/Checkbox.jinja
82+
83+
84+
Installing dropdown_menu...
85+
86+
Copying from template version 0.2.0
87+
create dropdown_menu/DropdownMenuItem.jinja
88+
create dropdown_menu/DropdownMenu.jinja
89+
create dropdown_menu/DropdownMenuSubTrigger.jinja
90+
create dropdown_menu/DropdownMenuTrigger.jinja
91+
create dropdown_menu/DropdownMenuRadioItem.jinja
92+
create dropdown_menu/DropdownMenuGroup.jinja
93+
create dropdown_menu/DropdownMenuSub.jinja
94+
create dropdown_menu/DropdownMenuSeparator.jinja
95+
create dropdown_menu/DropdownMenuContent.jinja
96+
create dropdown_menu/DropdownMenuSubContent.jinja
97+
create dropdown_menu/DropdownMenuLabel.jinja
98+
create dropdown_menu/DropdownMenuCheckboxItem.jinja
99+
100+
101+
Installing icons/ChevronRight...
102+
103+
Copying from template version 0.2.0
104+
create icons/ChevronRightIcon.jinja
105+
106+
107+
Installing radio...
108+
109+
Copying from template version 0.2.0
110+
create radio/RadioGroupItem.jinja
111+
create radio/RadioGroup.jinja
112+
113+
114+
╭────────────────────────────────────────────────────────── Installation Complete ───────────────────────────────────────────────────────────╮
115+
│ ✓ Added dropdown_menu component │
116+
│ Installed dependencies: │
117+
│ - dropdown_menu │
118+
│ - icons/ChevronRight │
119+
│ - radio │
120+
│ │
121+
│ components-dir=components/ui │
122+
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
123+
```
56124

57125
### Components cli tool
58126

@@ -82,32 +150,8 @@ Code for components can also be copy/pasted directly from the example pages via
82150
anywhere in you project. The rest of the information in these docs assume they are located in the `components/ui` dir in
83151
your project. See the [JinjaX](/docs/utilities#jinjax) docs for more info on how to set up components in your project.
84152

85-
## Other tools
86-
87-
If you don't want to use `uv`, then you can also use the `components` cli by installing it using `pip` or `poetry`. This
88-
will only install the libs needed for the cli, not the actual components.
89-
90-
### Pip
91-
```bash
92-
pip install basic-components
93-
```
94-
95-
To use the `components` tool, you can run
96-
97-
```bash
98-
pipx run components add <component>
99-
```
100-
101-
### Poetry
102-
```bash
103-
poetry add basic-components
104-
```
105-
106-
To use the `components` tool, you can run
107-
108-
```bash
109-
poetry run components add <component>
110-
```
153+
## Next steps
111154

155+
See the [utilities](/docs/utilities) docs for more information about setting up your project to use the components.
112156

113157
</Prose>

docs/content/docs/installation.md

Lines changed: 47 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,29 @@ description: How to install dependencies.
77

88
## Install JinjaX
99

10-
```bash
11-
uv add jinjax
12-
```
10+
<Tabs defaultValue="uv">
11+
<TabsList className="grid grid-cols-3">
12+
<TabsTrigger value="uv">uv</TabsTrigger>
13+
<TabsTrigger value="poetry">poetry</TabsTrigger>
14+
<TabsTrigger value="pip">pip</TabsTrigger>
15+
</TabsList>
16+
<TabsContent value="uv">
17+
<div class="relative" x-data><CopyPasteButton/>
18+
<pre class="language-bash bg-zinc-50 dark:bg-zinc-900 rounded-md"><code x-ref="code" class="language-bash">uv add jinjax</code></pre>
19+
</div>
20+
</TabsContent>
21+
<TabsContent value="poetry">
22+
<div class="relative" x-data><CopyPasteButton/>
23+
<pre class="language-bash bg-zinc-50 dark:bg-zinc-900 rounded-md"><code x-ref="code" class="language-bash">poetry add jinjax</code></pre>
24+
</div>
25+
</TabsContent>
26+
<TabsContent value="pip">
27+
<div class="relative" x-data><CopyPasteButton/>
28+
<pre class="language-bash bg-zinc-50 dark:bg-zinc-900 rounded-md"><code x-ref="code" class="language-bash">pip install jinjax</code></pre>
29+
</div>
30+
</TabsContent>
31+
</Tabs>
32+
1333

1434
JinjaX is the only required python dependency to use basic-components. However, the `basic-components` includes several
1535
[helper functions](/docs/utilities) to set up the JinjaX template environment and merge tailwind classes within components.
@@ -20,24 +40,32 @@ You can install `basic-components` utilities into your project using your packag
2040

2141
Installing the basic-components package is **optional**.
2242

23-
```bash
24-
uv add "basic-components[utils]"
25-
```
26-
This will only add the python functions in the [utils](https://github.com/basicmachines-co/basic-components/tree/main/basic_components)
27-
directory of the project. Components should be added via the [cli](/docs/cli).
43+
<Tabs defaultValue="uv">
44+
<TabsList className="grid grid-cols-3">
45+
<TabsTrigger value="uv">uv</TabsTrigger>
46+
<TabsTrigger value="poetry">poetry</TabsTrigger>
47+
<TabsTrigger value="pip">pip</TabsTrigger>
48+
</TabsList>
49+
<TabsContent value="uv">
50+
<div class="relative" x-data><CopyPasteButton/>
51+
<pre class="language-bash bg-zinc-50 dark:bg-zinc-900 rounded-md"><code x-ref="code" class="language-bash">uv add "basic-components[utils]"</code></pre>
52+
</div>
53+
</TabsContent>
54+
<TabsContent value="poetry">
55+
<div class="relative" x-data><CopyPasteButton/>
56+
<pre class="language-bash bg-zinc-50 dark:bg-zinc-900 rounded-md"><code x-ref="code" class="language-bash">poetry add "basic-components[utils]"</code></pre>
57+
</div>
58+
</TabsContent>
59+
<TabsContent value="pip">
60+
<div class="relative" x-data><CopyPasteButton/>
61+
<pre class="language-bash bg-zinc-50 dark:bg-zinc-900 rounded-md"><code x-ref="code" class="language-bash">pip install "basic-components[utils]"</code></pre>
62+
</div>
63+
</TabsContent>
64+
</Tabs>
2865

29-
<Card>
30-
<CardTitle className="mt-4 ml-6 text-sm">
31-
NOTE
32-
</CardTitle>
33-
<CardDescription className="my-2 ml-6">
34-
Using `uv` is optional
35-
</CardDescription>
36-
<CardContent className="text-sm">
37-
You can use `pip` or `poetry`. [UV](https://docs.astral.sh/uv/) is
38-
used in these examples because it enables components to be vendored directly into your project via the [components](/docs/cli) cli.</CardContent>
39-
</Card>
4066

67+
This will only add the python functions in the [utils](https://github.com/basicmachines-co/basic-components/tree/main/basic_components)
68+
directory of the project. Components should be added via the [cli](/docs/cli).
4169

4270
You can also add the code for the [helper functions](/docs/utilities) directly to your codebase if you don't want to add an
4371
extra dependency.

0 commit comments

Comments
 (0)