Skip to content

Commit f0e89fb

Browse files
feat: launch docs site and release distribution workflow
Add a dedicated Next.js docs app, registry hosting automation, and CI/release workflows while aligning package and registry usage with the @DevsTool scope for npm and shadcn installation flows. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 60dc677 commit f0e89fb

File tree

814 files changed

+177923
-1505
lines changed

Some content is hidden

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

814 files changed

+177923
-1505
lines changed

.changeset/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Changesets
2+
3+
This project uses Changesets for versioning and release notes.
4+
5+
## Create a changeset
6+
7+
```bash
8+
pnpm changeset
9+
```
10+
11+
## Apply version updates
12+
13+
```bash
14+
pnpm version-packages
15+
```
16+
17+
## Publish
18+
19+
```bash
20+
pnpm release
21+
```

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
verify:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v4
19+
with:
20+
version: 10
21+
22+
- name: Setup Node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 22
26+
cache: pnpm
27+
28+
- name: Install dependencies
29+
run: pnpm install --frozen-lockfile
30+
31+
- name: Type check
32+
run: pnpm type-check
33+
34+
- name: Lint
35+
run: pnpm lint
36+
37+
- name: Build package
38+
run: pnpm build
39+
40+
- name: Build registry assets
41+
run: pnpm registry:build
42+
43+
- name: Verify registry assets
44+
run: pnpm registry:verify
45+
46+
- name: Build docs app
47+
run: pnpm -C apps/www build
48+
49+
- name: Verification suite (without visual baseline)
50+
run: pnpm verify
51+
env:
52+
SKIP_VISUAL: "1"

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v4
22+
with:
23+
version: 10
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: 22
29+
cache: pnpm
30+
registry-url: https://registry.npmjs.org
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Create release PR or publish
36+
uses: changesets/action@v1
37+
with:
38+
version: pnpm version-packages
39+
publish: pnpm release
40+
commit: "chore: version packages"
41+
title: "chore: version packages"
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
# Dependencies
22
node_modules
3+
.pnpm-store
4+
.pnpm-store/
35
.pnp
46
.pnp.js
57

68
# Build outputs
79
dist
810
build
11+
.next
12+
apps/www/public/r
13+
apps/www/public/registry.json
914
*.tsbuildinfo
1015

1116
# Environment
@@ -34,6 +39,10 @@ pnpm-debug.log*
3439
# Testing
3540
coverage
3641
.nyc_output
42+
test-results
43+
test-results/
44+
playwright-report
45+
playwright-report/
3746

3847
# Misc
3948
.cache

README.md

Lines changed: 77 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,105 @@
1-
# @shadcn/echarts
1+
# @devstool/shadcn-echarts
22

3-
Apache ECharts charts styled to match shadcn/ui's design language with full dark/light mode support and excellent developer experience.
3+
Apache ECharts components styled to match shadcn/ui design language with automatic light/dark theming, minimal defaults, and tree-shakeable chart exports.
44

5-
## 🚧 Work in Progress
5+
## What you get
66

7-
This package is currently under active development. Phase 1 (Core Package Setup) is complete.
7+
- shadcn-style visual language with CSS variable driven theming
8+
- Auto dark/light mode sync
9+
- Defaults-only minimal preset that does not override explicit styling
10+
- Tree-shakeable per-chart imports
11+
- npm package + shadcn registry distribution
812

9-
## Features
13+
## Installation methods
1014

11-
- 🎨 **shadcn/ui Design Language**: Charts automatically match your shadcn/ui theme
12-
- 🌓 **Dark/Light Mode**: Seamless theme switching with automatic detection
13-
- 📦 **Tree-shakeable**: Import only what you need for optimal bundle size
14-
- 🔒 **Type-safe**: Full TypeScript support with ECharts' ComposeOption pattern
15-
-**SSR Support**: Server-side rendering utilities included
16-
- 🎯 **Developer Experience**: Clean API with React hooks and utilities
15+
### 1) npm package
1716

18-
## Installation
17+
```bash
18+
pnpm add @devstool/shadcn-echarts echarts react
19+
```
20+
21+
### 2) shadcn direct URL install
1922

2023
```bash
21-
pnpm add @shadcn/echarts echarts react
24+
npx shadcn@latest add https://shadcn-echarts.vercel.app/r/bar-chart.json
2225
```
2326

24-
## Usage
27+
### 3) shadcn namespace install
28+
29+
Add a registry namespace in your `components.json`:
30+
31+
```json
32+
{
33+
"registries": {
34+
"@devstool": "https://shadcn-echarts.vercel.app/r/{name}.json"
35+
}
36+
}
37+
```
38+
39+
Then install by namespace:
40+
41+
```bash
42+
npx shadcn@latest add @devstool/bar-chart
43+
```
2544

26-
### Basic Example
45+
### 4) Manual source ownership
46+
47+
Copy files from `registry/default/*` into your project and customize freely.
48+
49+
## Usage
2750

2851
```tsx
29-
import { BarChart } from '@shadcn/echarts'
30-
import { useEChartsTheme } from '@shadcn/echarts/hooks'
52+
import { BarChart } from "@devstool/shadcn-echarts";
3153

32-
function MyChart() {
33-
const { theme } = useEChartsTheme()
34-
54+
export function MyChart() {
3555
return (
3656
<BarChart
37-
data={[5, 20, 36, 10, 10, 20]}
38-
categories={['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']}
39-
theme={theme}
57+
option={{
58+
xAxis: { type: "category", data: ["Mon", "Tue", "Wed"] },
59+
yAxis: { type: "value" },
60+
series: [{ type: "bar", data: [150, 230, 224] }],
61+
}}
62+
height={320}
4063
/>
41-
)
64+
);
4265
}
4366
```
4467

45-
### Theme Setup
68+
## Local development
4669

47-
```tsx
48-
import { registerShadcnThemes } from '@shadcn/echarts/themes'
70+
```bash
71+
# library build/watch
72+
pnpm build
73+
pnpm dev
74+
75+
# registry assets for docs site
76+
pnpm registry:build
77+
pnpm registry:verify
4978

50-
// Register themes on app initialization
51-
registerShadcnThemes()
79+
# public docs website
80+
pnpm www:dev
81+
pnpm www:build
82+
83+
# interactive demo workspace
84+
pnpm -C demo dev
5285
```
5386

54-
## Documentation
87+
## Registry endpoints
88+
89+
- Registry index: `/registry.json`
90+
- Registry items: `/r/<component>.json`
91+
92+
On Vercel this resolves to:
93+
94+
- `https://shadcn-echarts.vercel.app/registry.json`
95+
- `https://shadcn-echarts.vercel.app/r/bar-chart.json`
96+
97+
## Project docs
5598

56-
Full documentation coming soon. See the [implementation plan](.cursor/plans/shadcn-echarts_implementation_plan_44021a4f.plan.md) for current progress.
99+
- `docs/polish/style-spec.md`
100+
- `docs/polish/presets.md`
101+
- `docs/polish/theming.md`
102+
- `docs/release/vercel-github-checklist.md`
57103

58104
## License
59105

apps/www/.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["next/core-web-vitals"]
3+
}

apps/www/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# www
2+
3+
Public docs website for shadcn-echarts.
4+
5+
## Local development
6+
7+
```bash
8+
pnpm registry:build
9+
pnpm -C apps/www dev
10+
```
11+
12+
## Production build
13+
14+
```bash
15+
pnpm registry:build
16+
pnpm -C apps/www build
17+
```

apps/www/app/components/page.tsx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { registryItemUrl } from "../../lib/site-config";
2+
3+
const componentExamples = [
4+
"area-chart",
5+
"bar-chart",
6+
"line-chart",
7+
"pie-chart",
8+
"radar-chart",
9+
"scatter-chart",
10+
"heatmap-chart",
11+
"sankey-chart",
12+
"treemap-chart",
13+
"bar-3d-chart",
14+
"globe-3d-chart",
15+
"surface-3d-chart",
16+
];
17+
18+
export default function ComponentsPage() {
19+
return (
20+
<>
21+
<h1>Components and examples</h1>
22+
<p className="lead">
23+
Registry currently includes 36 chart components (2D + 3D/WebGL).
24+
</p>
25+
26+
<h2>Install examples</h2>
27+
{componentExamples.map((name) => (
28+
<pre key={name}>
29+
<code>{`npx shadcn@latest add ${registryItemUrl(name)}`}</code>
30+
</pre>
31+
))}
32+
33+
<h2>Interactive demo</h2>
34+
<p>
35+
For broad example exploration, use the demo workspace in this repository:
36+
</p>
37+
<pre>
38+
<code>{`pnpm -C demo dev`}</code>
39+
</pre>
40+
<p>
41+
Demo source:{" "}
42+
<a
43+
href="https://github.com/noobships/shadcn-echarts/tree/main/demo"
44+
target="_blank"
45+
rel="noreferrer"
46+
>
47+
github.com/noobships/shadcn-echarts/tree/main/demo
48+
</a>
49+
</p>
50+
</>
51+
);
52+
}

0 commit comments

Comments
 (0)