sparkle-design 0.9.0 → 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/README.en.md +67 -157
- package/README.md +67 -157
- package/package.json +27 -1
package/README.en.md
CHANGED
|
@@ -24,52 +24,62 @@ It implements [Goodpatch](https://goodpatch.com/)'s "Sparkle Design" system on t
|
|
|
24
24
|
- 🎨 **Customizability** ... A dedicated CLI tool lets you apply the same customizations found in the Figma files. This makes it easy to spin up code for design systems built on Sparkle Design.
|
|
25
25
|
- 🤖 **AI Friendly** ... Ships with skills and guard configurations for Claude Code, Cursor, and Codex. Maintain design system quality even during AI-assisted coding.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Quick Start
|
|
28
28
|
|
|
29
|
-
###
|
|
29
|
+
### 1. Set up
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
In an existing Next.js / Vite project, a single command completes the integration:
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
|
|
35
|
-
# or
|
|
36
|
-
pnpm add sparkle-design
|
|
37
|
-
# or
|
|
38
|
-
yarn add sparkle-design
|
|
34
|
+
npx --yes sparkle-design-cli setup --assistant claude
|
|
39
35
|
```
|
|
40
36
|
|
|
41
|
-
|
|
37
|
+
This automatically:
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
### Install individual components
|
|
39
|
+
1. Detects your package manager (pnpm / npm / yarn / bun)
|
|
40
|
+
2. Adds `sparkle-design` to dependencies and `tailwindcss` + `@tailwindcss/postcss` to devDependencies
|
|
41
|
+
3. Generates `sparkle.config.json` / `postcss.config.mjs` / `globals.css` if missing
|
|
42
|
+
4. Adds a Sparkle Design guard block and `lint:sparkle` script to `CLAUDE.md`
|
|
43
|
+
5. Generates `sparkle-design.css` and `SparkleHead.tsx`
|
|
50
44
|
|
|
51
|
-
|
|
52
|
-
Refer to the [official documentation](https://ui.shadcn.com/docs/registry/getting-started) for details on the shadcn/ui registry.
|
|
45
|
+
`--assistant` accepts `claude` / `cursor` / `codex` / `generic`. Existing files are never overwritten.
|
|
53
46
|
|
|
54
|
-
|
|
55
|
-
pnpm dlx shadcn@latest add [registry URL]
|
|
56
|
-
```
|
|
47
|
+
Once the setup is complete, place the generated `SparkleHead` in the `<head>` of your root layout.
|
|
57
48
|
|
|
58
|
-
|
|
49
|
+
```tsx
|
|
50
|
+
import { SparkleHead } from "./SparkleHead";
|
|
59
51
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
52
|
+
export default function RootLayout({ children }) {
|
|
53
|
+
return (
|
|
54
|
+
<html>
|
|
55
|
+
<head>
|
|
56
|
+
<SparkleHead />
|
|
57
|
+
</head>
|
|
58
|
+
<body>{children}</body>
|
|
59
|
+
</html>
|
|
60
|
+
);
|
|
65
61
|
}
|
|
66
62
|
```
|
|
67
63
|
|
|
64
|
+
> **`@next/next/no-head-element` in Next.js App Router**: If your project extends `next/core-web-vitals`, placing a `<head>` element directly in `layout.tsx` may trigger a lint error. Add `// eslint-disable-next-line @next/next/no-head-element` to suppress it, or consider using `next/font` as an alternative.
|
|
65
|
+
|
|
66
|
+
Customize primary color, fonts, border radius, and more via `sparkle.config.json`. To tweak settings inside Figma, the [Sparkle Design Theme Settings](https://www.figma.com/community/plugin/1443500367756891364/sparkle-design-theme-settings) plugin is available. See `sparkle-design-cli generate --help` for details.
|
|
67
|
+
|
|
68
|
+
#### Installing as an AI Agent Skill (optional)
|
|
69
|
+
|
|
70
|
+
If you use an AI agent such as Claude Code, Codex, or Cursor, you can also install the Sparkle Design skills with [Vercel's skills CLI](https://github.com/vercel-labs/skills) to have the agent walk you through setup.
|
|
71
|
+
|
|
68
72
|
```bash
|
|
69
|
-
|
|
73
|
+
# Install only the setup-sparkle-design skill
|
|
74
|
+
npx skills add goodpatch/sparkle-design -s setup-sparkle-design
|
|
75
|
+
|
|
76
|
+
# Install all skills (setup / add-component / accessibility-checker)
|
|
77
|
+
npx skills add goodpatch/sparkle-design --all
|
|
70
78
|
```
|
|
71
79
|
|
|
72
|
-
|
|
80
|
+
After installation, asking the agent to "install Sparkle Design" triggers the `setup-sparkle-design` skill, which inspects the project and guides you through only the missing steps. Use `-a claude-code` / `-a codex` etc. to target a specific agent.
|
|
81
|
+
|
|
82
|
+
### 2. Use components
|
|
73
83
|
|
|
74
84
|
```tsx
|
|
75
85
|
import React from "react";
|
|
@@ -92,96 +102,56 @@ function App() {
|
|
|
92
102
|
export default App;
|
|
93
103
|
```
|
|
94
104
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
Import these files to take advantage of everything Sparkle Design offers.
|
|
102
|
-
|
|
103
|
-
#### Using as an npm package
|
|
104
|
-
|
|
105
|
-
When using `sparkle-design` as an npm package, TailwindCSS v4 needs `@source` directives to detect utility classes inside the package.
|
|
106
|
-
|
|
107
|
-
`sparkle-design-cli generate` auto-detects CSS files containing `@import "tailwindcss"` and inserts `@source` directives. This works with any filename (`globals.css`, `index.css`, etc.). If auto-detection fails, specify the path via `extend.globals-path` in `sparkle.config.json` or the `--globals-path` CLI option.
|
|
108
|
-
|
|
109
|
-
To configure manually, add the following to your Tailwind entrypoint CSS:
|
|
110
|
-
|
|
111
|
-
```css
|
|
112
|
-
@import "tailwindcss";
|
|
113
|
-
/* Scan sparkle-design classes */
|
|
114
|
-
/* Adjust the path relative to the CSS file (example for src/app/globals.css) */
|
|
115
|
-
@source "../../node_modules/sparkle-design/dist";
|
|
116
|
-
/* Sparkle Design custom definitions (import after Tailwind) */
|
|
117
|
-
@import "./sparkle-design.css";
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
> **Note**: The relative path for `@source` depends on where your CSS file is located. The example above assumes `src/app/globals.css`.
|
|
105
|
+
> **Using with Server Components**: For components that contain `"use client"`, use subpath imports. Each component's [README](src/components/ui/) includes Server Component / Client Component information.
|
|
106
|
+
>
|
|
107
|
+
> ```tsx
|
|
108
|
+
> import { Button } from "sparkle-design/button";
|
|
109
|
+
> ```
|
|
121
110
|
|
|
122
|
-
|
|
111
|
+
### 3. Update settings and check for anti-patterns
|
|
123
112
|
|
|
124
|
-
|
|
113
|
+
After editing `sparkle.config.json`, regenerate the CSS:
|
|
125
114
|
|
|
126
115
|
```bash
|
|
127
116
|
npx sparkle-design-cli generate
|
|
128
117
|
```
|
|
129
118
|
|
|
130
|
-
|
|
131
|
-
- `sparkle-design.css` — Design token CSS
|
|
132
|
-
- `SparkleHead.tsx` — Font loading React component
|
|
119
|
+
After making Sparkle Design-related code changes, check for anti-patterns:
|
|
133
120
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
```tsx
|
|
137
|
-
import { SparkleHead } from "./SparkleHead";
|
|
138
|
-
|
|
139
|
-
export default function RootLayout({ children }) {
|
|
140
|
-
return (
|
|
141
|
-
<html>
|
|
142
|
-
<head>
|
|
143
|
-
<SparkleHead />
|
|
144
|
-
</head>
|
|
145
|
-
<body>{children}</body>
|
|
146
|
-
</html>
|
|
147
|
-
);
|
|
148
|
-
}
|
|
121
|
+
```bash
|
|
122
|
+
npx sparkle-design-cli check src
|
|
149
123
|
```
|
|
150
124
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
> **`@next/next/no-head-element` in Next.js App Router**: If your project extends `next/core-web-vitals`, a `<head>` element in `layout.tsx` may trigger a lint error. In that case, use `eslint-disable` on the relevant line or consider alternative approaches with `next/font`.
|
|
154
|
-
|
|
155
|
-
Core configuration options for `sparkle.config.json`:
|
|
125
|
+
### Manual installation (advanced)
|
|
156
126
|
|
|
157
|
-
|
|
158
|
-
- `font-pro`: Proportional font ([Google Fonts](https://fonts.google.com/) name)
|
|
159
|
-
- `font-mono`: Monospace font ([Google Fonts](https://fonts.google.com/) name)
|
|
160
|
-
- `radius`: Border radius preset (none, sm, md, lg, xl, full)
|
|
127
|
+
If you prefer a step-by-step installation without CLI setup, see the [CLI documentation](https://github.com/goodpatch/sparkle-design-cli#readme).
|
|
161
128
|
|
|
162
|
-
|
|
129
|
+
## Install individual components
|
|
163
130
|
|
|
164
|
-
|
|
131
|
+
Sparkle Design works with the shadcn/ui registry. You can copy the registry URL from Storybook.<br />
|
|
132
|
+
Refer to the [official documentation](https://ui.shadcn.com/docs/registry/getting-started) for details on the shadcn/ui registry.
|
|
165
133
|
|
|
166
134
|
```bash
|
|
167
|
-
|
|
168
|
-
|
|
135
|
+
pnpm dlx shadcn@latest add [registry URL]
|
|
136
|
+
```
|
|
169
137
|
|
|
170
|
-
|
|
171
|
-
npx sparkle-design-cli check src --strict
|
|
138
|
+
You can also specify [namespaces](https://ui.shadcn.com/docs/registry/namespace) in `components.json` to install components by name.
|
|
172
139
|
|
|
173
|
-
|
|
174
|
-
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"registries": {
|
|
143
|
+
"@sparkle-design": "https://sparkle-design.goodpatch.com/r/{name}.json"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
175
146
|
```
|
|
176
147
|
|
|
177
|
-
|
|
148
|
+
```bash
|
|
149
|
+
pnpm dlx shadcn@latest add @sparkle-design/button
|
|
150
|
+
```
|
|
178
151
|
|
|
179
152
|
## Development Guide
|
|
180
153
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
- Node.js 22.14.0 or later
|
|
184
|
-
- pnpm 10 or later
|
|
154
|
+
For environment setup, component creation, testing, and contribution guidelines, see [CONTRIBUTING.md](./CONTRIBUTING.md).
|
|
185
155
|
|
|
186
156
|
### Directory structure
|
|
187
157
|
|
|
@@ -196,58 +166,6 @@ npx sparkle-design-cli setup --assistant claude
|
|
|
196
166
|
└─ .github/ # GitHub configuration
|
|
197
167
|
```
|
|
198
168
|
|
|
199
|
-
### Build the package
|
|
200
|
-
|
|
201
|
-
```bash
|
|
202
|
-
pnpm build:package
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
### Start Storybook
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
pnpm storybook
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### Run tests
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
pnpm test
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
Refer to `docs/ai-instructions/testing.md` for testing guidelines.
|
|
218
|
-
|
|
219
|
-
### Code formatting
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
# Check formatting
|
|
223
|
-
pnpm format:check
|
|
224
|
-
|
|
225
|
-
# Format automatically
|
|
226
|
-
pnpm format
|
|
227
|
-
|
|
228
|
-
# ESLint check (via Next.js)
|
|
229
|
-
pnpm lint:check
|
|
230
|
-
# or
|
|
231
|
-
pnpm lint
|
|
232
|
-
|
|
233
|
-
# ESLint auto-fix (via Next.js)
|
|
234
|
-
pnpm lint:fix
|
|
235
|
-
|
|
236
|
-
# Type check
|
|
237
|
-
pnpm type-check
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
**Note**: ESLint uses the `next lint` command, applying rules optimized for Next.js projects.
|
|
241
|
-
|
|
242
|
-
### About the Makefile
|
|
243
|
-
|
|
244
|
-
The Makefile defines the following targets:
|
|
245
|
-
|
|
246
|
-
- `registry` ... Generate the registry and copy files to the public directory
|
|
247
|
-
- `new-component` ... Interactive flow for creating a new component
|
|
248
|
-
|
|
249
|
-
Run `make help` for details.
|
|
250
|
-
|
|
251
169
|
### Sparkle Design badge
|
|
252
170
|
|
|
253
171
|
The Sparkle Design badge indicates that a component uses Sparkle Design. Add the following snippet to your README:
|
|
@@ -256,14 +174,6 @@ The Sparkle Design badge indicates that a component uses Sparkle Design. Add the
|
|
|
256
174
|
[](https://sparkle-design.goodpatch.com/)
|
|
257
175
|
```
|
|
258
176
|
|
|
259
|
-
### Miscellaneous
|
|
260
|
-
|
|
261
|
-
- Follow `docs/ai-instructions/comment-style.md` for comment conventions.
|
|
262
|
-
- Follow `.github/copilot-commit-message-instructions.md` for commit message format.
|
|
263
|
-
- Refer to `CHANGELOG.md` for release notes.
|
|
264
|
-
- If the public registry domain changes, run `pnpm update:public-domain -- --to https://new-domain.example.com --dry-run` to preview the impact, then rerun without `--dry-run` to apply the replacement.
|
|
265
|
-
- See the `docs/ai-instructions/` directory for additional development, testing, and AI guidelines.
|
|
266
|
-
|
|
267
177
|
## Component status
|
|
268
178
|
|
|
269
179
|
Please refer to the table on [README.md](./README.md#コンポーネント公開状況) for the current implementation status of components.
|
package/README.md
CHANGED
|
@@ -24,52 +24,62 @@ shadcn/ui をベースに、[グッドパッチ](https://goodpatch.com/)のデ
|
|
|
24
24
|
- 🎨 **カスタマイズ性** ... 専用CLIツールを利用し、Figmaファイルと同等のカスタマイズを適用することが出来ます。これによりSparkle Designをベースとしたデザインシステムのコードを素早く用意することが出来ます。
|
|
25
25
|
- 🤖 **AI フレンドリー** ... Claude Code / Cursor / Codex 向けのスキルとガード設定を同梱。AI コーディングでもデザインシステムの品質を維持できます。
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## クイックスタート
|
|
28
28
|
|
|
29
|
-
###
|
|
29
|
+
### 1. セットアップ
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
既存の Next.js / Vite プロジェクトで次の 1 コマンドを実行するだけで導入が完了します。
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
|
|
35
|
-
# または
|
|
36
|
-
pnpm add sparkle-design
|
|
37
|
-
# または
|
|
38
|
-
yarn add sparkle-design
|
|
34
|
+
npx --yes sparkle-design-cli setup --assistant claude
|
|
39
35
|
```
|
|
40
36
|
|
|
41
|
-
|
|
37
|
+
これで以下が自動で行われます:
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
### 個別コンポーネントの導入
|
|
39
|
+
1. パッケージマネージャー(pnpm / npm / yarn / bun)を自動検出
|
|
40
|
+
2. `sparkle-design` を dependencies、`tailwindcss` + `@tailwindcss/postcss` を devDependencies に追加
|
|
41
|
+
3. `sparkle.config.json` / `postcss.config.mjs` / `globals.css` を必要に応じて生成
|
|
42
|
+
4. `CLAUDE.md` に Sparkle Design ガードブロックと `lint:sparkle` スクリプトを追加
|
|
43
|
+
5. `sparkle-design.css` と `SparkleHead.tsx` を生成
|
|
50
44
|
|
|
51
|
-
|
|
52
|
-
shadcn/ui registry の詳細な情報は [公式ドキュメント](https://ui.shadcn.com/docs/registry/getting-started) を参照してください。
|
|
45
|
+
`--assistant` は `claude` / `cursor` / `codex` / `generic` から選択できます。既存ファイルは上書きされません。
|
|
53
46
|
|
|
54
|
-
|
|
55
|
-
pnpm dlx shadcn@latest add [registry URL]
|
|
56
|
-
```
|
|
47
|
+
セットアップが完了したら、生成された `SparkleHead` をルートレイアウトの `<head>` に配置してください。
|
|
57
48
|
|
|
58
|
-
|
|
49
|
+
```tsx
|
|
50
|
+
import { SparkleHead } from "./SparkleHead";
|
|
59
51
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
52
|
+
export default function RootLayout({ children }) {
|
|
53
|
+
return (
|
|
54
|
+
<html>
|
|
55
|
+
<head>
|
|
56
|
+
<SparkleHead />
|
|
57
|
+
</head>
|
|
58
|
+
<body>{children}</body>
|
|
59
|
+
</html>
|
|
60
|
+
);
|
|
65
61
|
}
|
|
66
62
|
```
|
|
67
63
|
|
|
64
|
+
> **Next.js App Router で `@next/next/no-head-element` が出る場合**: `next/core-web-vitals` を使用しているプロジェクトでは、`layout.tsx` に `<head>` を直接書くと lint エラーになることがあります。該当行に `// eslint-disable-next-line @next/next/no-head-element` を追加するか、`next/font` による代替方法を検討してください。
|
|
65
|
+
|
|
66
|
+
`sparkle.config.json` でプライマリカラー・フォント・角丸などをカスタマイズできます。Figma 上で設定を調整したい場合は [Sparkle Design Theme Settings](https://www.figma.com/community/plugin/1443500367756891364/sparkle-design-theme-settings) プラグインを利用できます。詳細は `sparkle-design-cli generate --help` を参照してください。
|
|
67
|
+
|
|
68
|
+
#### AI エージェントに Skill として導入する場合(任意)
|
|
69
|
+
|
|
70
|
+
Claude Code / Codex / Cursor などの AI エージェントを使っている場合は、[Vercel の skills CLI](https://github.com/vercel-labs/skills) 経由で Sparkle Design のスキルセットを導入しておくと、会話から誘導してもらうこともできます。
|
|
71
|
+
|
|
68
72
|
```bash
|
|
69
|
-
|
|
73
|
+
# setup-sparkle-design スキルだけを導入
|
|
74
|
+
npx skills add goodpatch/sparkle-design -s setup-sparkle-design
|
|
75
|
+
|
|
76
|
+
# 全スキル(setup / add-component / accessibility-checker)を導入
|
|
77
|
+
npx skills add goodpatch/sparkle-design --all
|
|
70
78
|
```
|
|
71
79
|
|
|
72
|
-
|
|
80
|
+
導入後に「Sparkle Design を導入して」と依頼すると `setup-sparkle-design` スキルが発動し、プロジェクト状態に合わせて不足ステップだけ案内してくれます。`-a claude-code` / `-a codex` などで対象エージェントを指定することもできます。
|
|
81
|
+
|
|
82
|
+
### 2. コンポーネントの使用
|
|
73
83
|
|
|
74
84
|
```tsx
|
|
75
85
|
import React from "react";
|
|
@@ -92,96 +102,56 @@ function App() {
|
|
|
92
102
|
export default App;
|
|
93
103
|
```
|
|
94
104
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
これらのファイルをインポートすることで、Sparkle Design の全機能を利用できます。
|
|
102
|
-
|
|
103
|
-
#### npm パッケージとして利用する場合
|
|
104
|
-
|
|
105
|
-
`sparkle-design` を npm パッケージとしてインストールして利用する場合、TailwindCSS v4 がパッケージ内のユーティリティクラスを検出できるよう `@source` ディレクティブが必要です。
|
|
106
|
-
|
|
107
|
-
`sparkle-design-cli generate` を実行すると、`@import "tailwindcss"` を含む CSS ファイルを自動検出し、`@source` ディレクティブを挿入します。`globals.css` 以外のファイル名(Vite の `index.css` 等)にも対応しています。自動検出がうまく動かない場合は `sparkle.config.json` の `extend.globals-path` か CLI の `--globals-path` オプションで明示的に指定できます。
|
|
108
|
-
|
|
109
|
-
手動で設定する場合は、Tailwind エントリポイント CSS に以下を追加してください:
|
|
110
|
-
|
|
111
|
-
```css
|
|
112
|
-
@import "tailwindcss";
|
|
113
|
-
/* sparkle-design のクラスをスキャン対象にする */
|
|
114
|
-
/* パスは CSS ファイルの配置に応じて調整(src/app/globals.css なら ../../node_modules/...) */
|
|
115
|
-
@source "../../node_modules/sparkle-design/dist";
|
|
116
|
-
/* Sparkle Design のカスタム定義(Tailwindの後にインポート) */
|
|
117
|
-
@import "./sparkle-design.css";
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
> **注意**: `@source` の相対パスは CSS ファイルの配置場所に依存します。上記は `src/app/globals.css` の場合の例です。
|
|
105
|
+
> **Server Component で使う場合**: `"use client"` を含むコンポーネントは個別 import を推奨します。各コンポーネントの [README](src/components/ui/) に Server Component / Client Component の情報が記載されています。
|
|
106
|
+
>
|
|
107
|
+
> ```tsx
|
|
108
|
+
> import { Button } from "sparkle-design/button";
|
|
109
|
+
> ```
|
|
121
110
|
|
|
122
|
-
|
|
111
|
+
### 3. 設定の更新とアンチパターンの検査
|
|
123
112
|
|
|
124
|
-
`sparkle.config.json`
|
|
113
|
+
`sparkle.config.json` を編集した後は以下で CSS を再生成できます。
|
|
125
114
|
|
|
126
115
|
```bash
|
|
127
116
|
npx sparkle-design-cli generate
|
|
128
117
|
```
|
|
129
118
|
|
|
130
|
-
|
|
131
|
-
- `sparkle-design.css` — デザイントークン CSS
|
|
132
|
-
- `SparkleHead.tsx` — フォント読み込み用 React コンポーネント
|
|
119
|
+
Sparkle Design に関するコード変更後は、アンチパターンを検出できます。
|
|
133
120
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
```tsx
|
|
137
|
-
import { SparkleHead } from "./SparkleHead";
|
|
138
|
-
|
|
139
|
-
export default function RootLayout({ children }) {
|
|
140
|
-
return (
|
|
141
|
-
<html>
|
|
142
|
-
<head>
|
|
143
|
-
<SparkleHead />
|
|
144
|
-
</head>
|
|
145
|
-
<body>{children}</body>
|
|
146
|
-
</html>
|
|
147
|
-
);
|
|
148
|
-
}
|
|
121
|
+
```bash
|
|
122
|
+
npx sparkle-design-cli check src
|
|
149
123
|
```
|
|
150
124
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
> `SparkleHead` は `<link rel="preconnect">` と `<link rel="stylesheet">` でフォントを読み込みます。CSS の `@import` に比べてフォントの発見が早く、特にモバイル環境でのアイコン表示が改善されます。
|
|
154
|
-
|
|
155
|
-
設定ファイル (`sparkle.config.json`) の基本設定:
|
|
125
|
+
### 手動インストール(高度な利用)
|
|
156
126
|
|
|
157
|
-
|
|
158
|
-
- `font-pro`: プロポーショナルフォント([Google Fonts](https://fonts.google.com/) の名前)
|
|
159
|
-
- `font-mono`: モノスペースフォント([Google Fonts](https://fonts.google.com/) の名前)
|
|
160
|
-
- `radius`: 角丸設定(none, sm, md, lg, xl, full)
|
|
127
|
+
CLI setup を使わずに段階的に導入したい場合は、[CLI ドキュメント](https://github.com/goodpatch/sparkle-design-cli#readme) を参照してください。
|
|
161
128
|
|
|
162
|
-
|
|
129
|
+
## 個別コンポーネントの導入
|
|
163
130
|
|
|
164
|
-
|
|
131
|
+
Sparkle Design は shadcn/ui registry に対応しています。レジストリの URL は Storybook からコピーすることができます。<br />
|
|
132
|
+
shadcn/ui registry の詳細な情報は [公式ドキュメント](https://ui.shadcn.com/docs/registry/getting-started) を参照してください。
|
|
165
133
|
|
|
166
134
|
```bash
|
|
167
|
-
|
|
168
|
-
|
|
135
|
+
pnpm dlx shadcn@latest add [registry URL]
|
|
136
|
+
```
|
|
169
137
|
|
|
170
|
-
|
|
171
|
-
npx sparkle-design-cli check src --strict
|
|
138
|
+
また[Namespaces](https://ui.shadcn.com/docs/registry/namespace)を`components.json`に指定することで、コンポーネント名でのインストールも可能になります。
|
|
172
139
|
|
|
173
|
-
|
|
174
|
-
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"registries": {
|
|
143
|
+
"@sparkle-design": "https://sparkle-design.goodpatch.com/r/{name}.json"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
175
146
|
```
|
|
176
147
|
|
|
177
|
-
|
|
148
|
+
```bash
|
|
149
|
+
pnpm dlx shadcn@latest add @sparkle-design/button
|
|
150
|
+
```
|
|
178
151
|
|
|
179
152
|
## 開発ガイド
|
|
180
153
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
- Node.js 22.14.0 以上
|
|
184
|
-
- pnpm 10 以上
|
|
154
|
+
開発環境のセットアップ・コンポーネントの作成・テスト・コントリビューション方法は [CONTRIBUTING.md](./CONTRIBUTING.md) を参照してください。
|
|
185
155
|
|
|
186
156
|
### ディレクトリ構成
|
|
187
157
|
|
|
@@ -196,58 +166,6 @@ npx sparkle-design-cli setup --assistant claude
|
|
|
196
166
|
└─ .github/ # GitHub関連の設定ファイル
|
|
197
167
|
```
|
|
198
168
|
|
|
199
|
-
### Package のビルド
|
|
200
|
-
|
|
201
|
-
```bash
|
|
202
|
-
pnpm build:package
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
### Storybook の起動
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
pnpm storybook
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### テストの実行
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
pnpm test
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
テストガイドラインについては `docs/ai-instructions/testing.md` を参照してください。
|
|
218
|
-
|
|
219
|
-
### コードフォーマット
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
# フォーマットチェック
|
|
223
|
-
pnpm format:check
|
|
224
|
-
|
|
225
|
-
# 自動フォーマット
|
|
226
|
-
pnpm format
|
|
227
|
-
|
|
228
|
-
# ESLint チェック (Next.js 経由)
|
|
229
|
-
pnpm lint:check
|
|
230
|
-
# または
|
|
231
|
-
pnpm lint
|
|
232
|
-
|
|
233
|
-
# ESLint 自動修正 (Next.js 経由)
|
|
234
|
-
pnpm lint:fix
|
|
235
|
-
|
|
236
|
-
# 型チェック
|
|
237
|
-
pnpm type-check
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
**注意**: ESLintは`next lint`コマンドを使用しており、Next.jsプロジェクトに最適化された設定とルールが適用されます。
|
|
241
|
-
|
|
242
|
-
### Makefile について
|
|
243
|
-
|
|
244
|
-
Makefile では次のターゲットが定義されています。
|
|
245
|
-
|
|
246
|
-
- `registry` ... レジストリの生成と公開ファイルへのコピー
|
|
247
|
-
- `new-component` ... 対話形式で新規コンポーネントを作成
|
|
248
|
-
|
|
249
|
-
`make help` で詳細は確認してください。
|
|
250
|
-
|
|
251
169
|
### Sparkle Design バッジ
|
|
252
170
|
|
|
253
171
|
Sparkle Design のバッジは、コンポーネントが Sparkle Design を使用していることを示します。README に次のように追加してください。
|
|
@@ -256,14 +174,6 @@ Sparkle Design のバッジは、コンポーネントが Sparkle Design を使
|
|
|
256
174
|
[](https://sparkle-design.goodpatch.com/)
|
|
257
175
|
```
|
|
258
176
|
|
|
259
|
-
### その他
|
|
260
|
-
|
|
261
|
-
- コメントの書き方は `docs/ai-instructions/comment-style.md` を参照してください。
|
|
262
|
-
- コミットメッセージの形式は `.github/copilot-commit-message-instructions.md` のルールに従います。
|
|
263
|
-
- 変更履歴は `CHANGELOG.md` を参照してください。
|
|
264
|
-
- 公開用ドメインを切り替える場合は `pnpm update:public-domain -- --to https://new-domain.example.com --dry-run` で影響範囲を確認し、その後 `--dry-run` を外して一括更新できます。
|
|
265
|
-
- その他開発・テスト・AI関連のガイドラインは `docs/ai-instructions/` ディレクトリを参照してください。
|
|
266
|
-
|
|
267
177
|
## コンポーネント公開状況
|
|
268
178
|
|
|
269
179
|
現在公開されているコンポーネントの一覧です。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sparkle-design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org",
|
|
6
6
|
"access": "public"
|
|
@@ -101,6 +101,32 @@
|
|
|
101
101
|
"vite": "6.4.2",
|
|
102
102
|
"vitest": "^3.0.9"
|
|
103
103
|
},
|
|
104
|
+
"pnpm": {
|
|
105
|
+
"overrides": {
|
|
106
|
+
"lodash": "^4.17.23",
|
|
107
|
+
"path-to-regexp": "^8.4.0",
|
|
108
|
+
"brace-expansion@>=2.0.0 <2.0.3": "^2.0.3",
|
|
109
|
+
"picomatch": "^4.0.4",
|
|
110
|
+
"flatted": "^3.4.2",
|
|
111
|
+
"undici": "^6.24.0",
|
|
112
|
+
"tar": "^7.5.11",
|
|
113
|
+
"minimatch@>=7.0.0 <7.4.8": "^7.4.8",
|
|
114
|
+
"minimatch@>=9.0.0 <9.0.7": "^9.0.7",
|
|
115
|
+
"minimatch@>=10.0.0 <10.2.3": "^10.2.3",
|
|
116
|
+
"minimatch@<3.1.3": "^3.1.3",
|
|
117
|
+
"ajv@<6.14.0": "^6.14.0",
|
|
118
|
+
"qs@<6.14.2": "^6.14.2",
|
|
119
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
120
|
+
"@isaacs/brace-expansion": "^5.0.1",
|
|
121
|
+
"diff@>=5.0.0 <5.2.2": "^5.2.2",
|
|
122
|
+
"body-parser@>=2.2.0 <2.2.1": "^2.2.1",
|
|
123
|
+
"glob@>=10.2.0 <10.5.0": "^10.5.0",
|
|
124
|
+
"glob@>=11.0.0 <11.1.0": "^11.1.0",
|
|
125
|
+
"js-yaml@>=4.0.0 <4.1.1": "^4.1.1",
|
|
126
|
+
"playwright": "^1.59.1",
|
|
127
|
+
"form-data": "^4.0.4"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
104
130
|
"main": "./dist/index.js",
|
|
105
131
|
"types": "./dist/index.d.ts",
|
|
106
132
|
"exports": {
|