Skip to content

Commit 1f40071

Browse files
authored
fix(layer): resolve UI components from layer directory in multi-layer setup (#3)
* fix(layer): resolve UI components from layer directory in multi-layer setup - Fixed shadcn.ts to properly discover UI components from Nuxt layer packages - Updated shadcn module to search node_modules for @pleaseai/docs-layer when resolving components - Modified templates to use UiSeparator prefix for component references - Added missing return type annotations to utils and composables (ESLint compliance) - Added content components for documentation rendering - Updated nuxt.config.ts shadcn configuration for layer compatibility - Fixed process import in utils/git.ts for node environment This resolves component resolution issues in multi-layer Nuxt setups where UI components are defined in the layer package but need to be discovered at runtime. * fix(layer): resolve content collection and component issues in multi-layer setup - Add useNuxt() to content.config.ts to resolve app's content directory - Register content components globally via components:dirs hook - Add CopyButton, CodeBlockCommand components and Icons.ts from shadcn-vue - Add tooltip UI components via shadcn-vue CLI - Add useConfig composable for package manager preference - Fix container utility class definition for Tailwind CSS v4 - Add @tabler/icons-vue dependency for icon components * fix(layer): resolve Tailwind CSS and component registration in multi-layer setup - Register app/components/app and app/components/docs directories explicitly - Fix CSS module to import main.css after @source directives - Remove duplicate tailwindcss import from main.css - Use @Utility directive for container class (Tailwind v4 syntax) - Add exsolve dependency for module path resolution * fix: add relative positioning to code block containers for CopyButton visibility * feat: Add Gemini settings file to specify context filenames for Claude and Gemini.
1 parent 1e8b02b commit 1f40071

43 files changed

Lines changed: 828 additions & 229 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/settings.local.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__new_page",
5+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__take_snapshot",
6+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__list_console_messages",
7+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__take_screenshot",
8+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__list_network_requests",
9+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__evaluate_script",
10+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__get_network_request",
11+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__navigate_page",
12+
"Bash(bun run dev)",
13+
"WebFetch(domain:www.shadcn-vue.com)",
14+
"WebFetch(domain:shadcn-vue.com)",
15+
"Bash(gh label list:*)",
16+
"Bash(gh repo view:*)"
17+
],
18+
"deny": [],
19+
"ask": []
20+
}
21+
}

.env.secrets

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
# Secrets (will be encrypted with dotenvx)
22
# Run: bun x dotenvx encrypt
3-
4-
# Cloudflare deployment credentials
5-
CLOUDFLARE_API_TOKEN=rGeRpJxv4E3wU_DrDaxihWmAb1DHNFwdaHF72-kD
6-
CLOUDFLARE_ACCOUNT_ID=20f4dac8c33060fc42fd560d8e90b630

.gemini/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"context": {
3+
"fileName": [
4+
"CLAUDE.md",
5+
"GEMINI.md"
6+
]
7+
}
8+
}

CLAUDE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ packages/layer/
7272
### Configuration Schema
7373

7474
Site configuration in `app.config.ts`:
75+
7576
- `docs.title` - Site title
7677
- `docs.description` - Site description
7778
- `docs.url` - Site URL
@@ -80,6 +81,7 @@ Site configuration in `app.config.ts`:
8081
### Using the Layer
8182

8283
Apps extend the layer via `nuxt.config.ts`:
84+
8385
```ts
8486
export default defineNuxtConfig({
8587
extends: ['@pleaseai/docs'],
@@ -88,4 +90,4 @@ export default defineNuxtConfig({
8890

8991
## ESLint
9092

91-
Uses `@antfu/eslint-config` with Vue and formatters enabled.
93+
Uses `@antfu/eslint-config` with Vue and formatters enabled.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ A documentation system using **shadcn-vue** + **Nuxt Content**, inspired by Docu
99
A Nuxt layer for documentation sites. Replaces nuxt-ui with shadcn-vue components.
1010

1111
**Features:**
12+
1213
- shadcn-vue UI components (Button, Separator, etc.)
1314
- Tailwind CSS v4 with CSS variables (oklch colors)
1415
- Documentation layout with sidebar navigation

apps/docs/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/node_modules/
2+
/.wrangler/
3+
/.nuxt/
4+
/.data/

apps/docs/content/docs/1.getting-started/2.installation.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ export default defineNuxtConfig({
4343
Create a `content` directory and add your first page:
4444

4545
```md
46-
<!-- content/index.md -->
47-
---
46+
## <!-- content/index.md -->
47+
4848
title: Welcome
4949
description: My documentation site
50+
5051
---
5152

5253
# Welcome to My Docs

apps/docs/content/docs/1.getting-started/3.configuration.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ docs: {
6767

6868
The layer automatically detects environment variables:
6969

70-
| Variable | Description |
71-
|----------|-------------|
72-
| `NUXT_SITE_URL` | Site URL |
73-
| `VERCEL_GIT_REPO_OWNER` | GitHub owner (Vercel) |
74-
| `GITHUB_REPOSITORY` | GitHub repository (GitHub Actions) |
70+
| Variable | Description |
71+
| ----------------------- | ---------------------------------- |
72+
| `NUXT_SITE_URL` | Site URL |
73+
| `VERCEL_GIT_REPO_OWNER` | GitHub owner (Vercel) |
74+
| `GITHUB_REPOSITORY` | GitHub repository (GitHub Actions) |
7575

7676
## Next Steps
7777

apps/docs/content/docs/1.getting-started/4.writing-content.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Prefix folders and files with numbers to control the order:
3030
- `1.introduction.md` appears before `2.installation.md`
3131

3232
The numbers are stripped from the URL:
33+
3334
- `content/docs/1.getting-started/1.introduction.md``/docs/getting-started/introduction`
3435

3536
## Frontmatter
@@ -51,7 +52,9 @@ description: A brief description for SEO
5152

5253
```md
5354
# H1 - Page Title
55+
5456
## H2 - Section
57+
5558
### H3 - Subsection
5659
```
5760

@@ -85,7 +88,7 @@ const hello = 'world'
8588

8689
```md
8790
| Column 1 | Column 2 |
88-
|----------|----------|
91+
| -------- | -------- |
8992
| Cell 1 | Cell 2 |
9093
```
9194

apps/docs/content/docs/2.components/1.overview.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The site header with navigation and dark mode toggle.
1818
```
1919

2020
Features:
21+
2122
- Site title/logo
2223
- Navigation links
2324
- Dark/light mode toggle
@@ -40,6 +41,7 @@ Navigation sidebar for documentation pages.
4041
```
4142

4243
Features:
44+
4345
- Hierarchical navigation
4446
- Active state highlighting
4547
- Collapsible sections
@@ -53,6 +55,7 @@ Table of contents for the current page.
5355
```
5456

5557
Features:
58+
5659
- Auto-generated from headings
5760
- Scroll-aware active state
5861
- Depth-based indentation
@@ -103,15 +106,24 @@ The layer includes shadcn-vue components:
103106
### Button
104107

105108
```vue
106-
<Button variant="default">Click me</Button>
107-
<Button variant="outline">Outline</Button>
108-
<Button variant="ghost">Ghost</Button>
109+
<Button variant="default">
110+
Click me
111+
</Button>
112+
113+
<Button variant="outline">
114+
Outline
115+
</Button>
116+
117+
<Button variant="ghost">
118+
Ghost
119+
</Button>
109120
```
110121

111122
### Separator
112123

113124
```vue
114125
<Separator />
126+
115127
<Separator orientation="vertical" />
116128
```
117129

0 commit comments

Comments
 (0)