@squadbase/vantage-template 0.1.1-dev1.ac4fa22 → 0.1.1-dev1.ce5d265
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.md +11 -1
- package/base-template/.squadbase/skills/vantage-add-feature/SKILL.md +9 -7
- package/base-template/.squadbase/skills/vantage-app/SKILL.md +10 -6
- package/base-template/.squadbase/skills/vantage-design/SKILL.md +34 -24
- package/base-template/.squadbase/skills/vantage-design/references/extract.md +16 -14
- package/base-template/.squadbase/skills/vantage-design/references/format.md +6 -5
- package/base-template/.squadbase/skills/vantage-design/references/presets.md +60 -110
- package/base-template/.squadbase/skills/vantage-pitfalls/SKILL.md +45 -1
- package/base-template/.squadbase/skills/vantage-slide/SKILL.md +281 -0
- package/base-template/.squadbase/skills/vantage-slide/references/morph.md +102 -0
- package/base-template/.squadbase/skills/vantage-slide/references/steps.md +57 -0
- package/base-template/.squadbase/skills/vantage-slide/references/tokens.md +87 -0
- package/base-template/.squadbase/skills/vantage-slide/references/transitions.md +196 -0
- package/base-template/AGENTS.md +76 -5
- package/base-template/DESIGN.md +7 -6
- package/base-template/agents/csv.md +2 -1
- package/base-template/agents/doc.md +4 -3
- package/base-template/agents/page.md +32 -8
- package/base-template/agents/xlsx.md +2 -1
- package/base-template/bun.lock +78 -68
- package/base-template/bunfig.toml +5 -0
- package/base-template/package.json +6 -6
- package/base-template/src/_layout.tsx +9 -9
- package/base-template/src/components/build-recovery.tsx +37 -1
- package/base-template/src/components/user-card.tsx +10 -10
- package/base-template/src/styles.css +105 -18
- package/dist/index.js +956 -0
- package/package.json +20 -17
- package/ui-templates/CLAUDE.md +2 -0
- package/ui-templates/kpi-chart-simple/pages/index.tsx +47 -47
- package/ui-templates/kpi-chart-simple-ja/pages/index.tsx +47 -47
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squadbase/vantage-template",
|
|
3
|
-
"version": "0.1.1-dev1.
|
|
3
|
+
"version": "0.1.1-dev1.ce5d265",
|
|
4
4
|
"description": "CLI tool for initializing and customizing Squadbase Vantage projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"squadbase",
|
|
@@ -36,29 +36,32 @@
|
|
|
36
36
|
"access": "public",
|
|
37
37
|
"registry": "https://registry.npmjs.org"
|
|
38
38
|
},
|
|
39
|
-
"scripts": {
|
|
40
|
-
"sync-base": "rsync -a --delete --exclude='node_modules' --exclude='dist' --exclude='.vantage' --exclude='*.tsbuildinfo' --exclude='*.log' template/ base-template/ && mv base-template/.gitignore base-template/_gitignore",
|
|
41
|
-
"build": "npm run sync-base && tsup",
|
|
42
|
-
"type-check": "tsc",
|
|
43
|
-
"agents": "node scripts/build-agents.cjs",
|
|
44
|
-
"agents:check": "node scripts/build-agents.cjs --check",
|
|
45
|
-
"template:install": "bun install --cwd template --frozen-lockfile",
|
|
46
|
-
"template:build": "npm --prefix template run build",
|
|
47
|
-
"prepublishOnly": "npm run agents:check && npm run build",
|
|
48
|
-
"release": "npm publish --@squadbase:registry=https://registry.npmjs.org",
|
|
49
|
-
"dev": "node scripts/dev.mjs",
|
|
50
|
-
"screenshot": "node scripts/screenshot.mjs"
|
|
51
|
-
},
|
|
52
39
|
"devDependencies": {
|
|
53
40
|
"@types/node": "^22.15.0",
|
|
54
41
|
"playwright": "^1.49.0",
|
|
55
42
|
"tsup": "^8.4.0",
|
|
56
|
-
"typescript": "~5.7.0"
|
|
43
|
+
"typescript": "~5.7.0",
|
|
44
|
+
"vitest": "^5.0.5",
|
|
45
|
+
"@squadbase/squadkit": "0.0.0"
|
|
57
46
|
},
|
|
58
47
|
"optionalDependencies": {
|
|
59
48
|
"@ai-sdk/anthropic": "^2.0.0",
|
|
60
49
|
"@ai-sdk/google": "^2.0.0",
|
|
61
|
-
"@ai-sdk/openai": "
|
|
50
|
+
"@ai-sdk/openai": "2.0.122",
|
|
62
51
|
"ai": "^5.0.52"
|
|
52
|
+
},
|
|
53
|
+
"gitHead": "ce5d2654e356f2ee5bcfabdf7919cc9758531ebd",
|
|
54
|
+
"scripts": {
|
|
55
|
+
"sync-base": "rsync -a --delete --exclude='node_modules' --exclude='dist' --exclude='.vantage' --exclude='*.tsbuildinfo' --exclude='*.log' template/ base-template/ && mv base-template/.gitignore base-template/_gitignore",
|
|
56
|
+
"build": "pnpm run sync-base && tsup",
|
|
57
|
+
"type-check": "tsc",
|
|
58
|
+
"test": "vitest run",
|
|
59
|
+
"agents": "node scripts/build-agents.cjs",
|
|
60
|
+
"agents:check": "node scripts/build-agents.cjs --check",
|
|
61
|
+
"template:install": "bun install --cwd template --frozen-lockfile",
|
|
62
|
+
"template:build": "bun run --cwd template build",
|
|
63
|
+
"release": "pnpm publish --@squadbase:registry=https://registry.npmjs.org",
|
|
64
|
+
"dev": "node scripts/dev.mjs",
|
|
65
|
+
"screenshot": "node scripts/screenshot.mjs"
|
|
63
66
|
}
|
|
64
|
-
}
|
|
67
|
+
}
|
package/ui-templates/CLAUDE.md
CHANGED
|
@@ -96,6 +96,8 @@ server/api/<endpoint>.ts # ★ サンプルデータ + GET ハ
|
|
|
96
96
|
| --- | --- |
|
|
97
97
|
| `PageShell*` / `DashboardCard*` / `EChart` / `EChartsOption` / `DataTable*` / `ColumnDef` / `DateRangePicker` / `FilterBar*` / `FunnelSteps` / `MetricValue` / `TrendIndicator` / `StatusBadge` / `SegmentedControl` / `MultiSelect` / `SearchableSelect` / `SectionHeader` / `AppShell` / `Placeholder` / `Sparkline` | `@squadbase/vantage/components` |
|
|
98
98
|
| `Button` / `Input` / `Badge` / `Tabs*` / `ToggleGroup*` / `Table*` / `Select*` / `Dialog*` / `cn` ほか shadcn プリミティブ | `@squadbase/vantage/ui` |
|
|
99
|
+
|
|
100
|
+
型付きチャート(`LineChart` / `AreaChart` / `BarChart` / `DonutChart` / `BarList` / `CategoryBar` / `ProgressCircle` / `Tracker`、`@squadbase/vantage/components`)と `Avatar` / `Pagination` / `RadioGroup` / `AlertDialog` / `Drawer` / `Toaster` / `Field` / `Combobox` / `HoverCard` / `Kbd`(`@squadbase/vantage/ui`)は 0.6.3 で入った。雛形の依存が `^0.5.3` の間は使わない(上の EChart の書き方のまま)。
|
|
99
101
|
| `definePage` | `@squadbase/vantage` |
|
|
100
102
|
| `Link` / `Outlet` / `useParams` / `useSearch` / `useNavigate` / `useRoutes` / `useCurrentRoute` / `useSearchParam` / `useSearchState` | `@squadbase/vantage/router` |
|
|
101
103
|
| `useApiQuery` / `useApiMutation` / `useQuery` / `useMutation` / `apiFetch` | `@squadbase/vantage/query` |
|
|
@@ -104,6 +104,53 @@ const RANGE_OPTIONS: SegmentOption[] = [
|
|
|
104
104
|
{ label: "90 days", value: "90d" },
|
|
105
105
|
]
|
|
106
106
|
|
|
107
|
+
export default function HomePage() {
|
|
108
|
+
// Filter state belongs in the URL rather than `useState`: it survives a
|
|
109
|
+
// reload, and a pasted link reproduces exactly what you were looking at.
|
|
110
|
+
const [range, setRange] = useSearchParam("range", "30d")
|
|
111
|
+
|
|
112
|
+
// `search` goes into the query string *and* the cache key, so changing the
|
|
113
|
+
// range refetches instead of serving the previous window.
|
|
114
|
+
const summary = useApiQuery<KpiSummary>("/api/kpi-summary", { search: { range } })
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<PageShell>
|
|
118
|
+
<PageShellHeader>
|
|
119
|
+
<PageShellHeading>
|
|
120
|
+
<PageShellTitle>[Template] Performance overview</PageShellTitle>
|
|
121
|
+
<PageShellDescription>
|
|
122
|
+
Key metrics and trends for the selected period.
|
|
123
|
+
</PageShellDescription>
|
|
124
|
+
</PageShellHeading>
|
|
125
|
+
<PageShellHeaderEnd>
|
|
126
|
+
<SegmentedControl
|
|
127
|
+
options={RANGE_OPTIONS}
|
|
128
|
+
value={range}
|
|
129
|
+
onChange={setRange}
|
|
130
|
+
ariaLabel="Period"
|
|
131
|
+
/>
|
|
132
|
+
</PageShellHeaderEnd>
|
|
133
|
+
</PageShellHeader>
|
|
134
|
+
|
|
135
|
+
<PageShellContent className="space-y-6">
|
|
136
|
+
{summary.isPending ? (
|
|
137
|
+
<Loading />
|
|
138
|
+
) : summary.isError ? (
|
|
139
|
+
// `summary.error` is an `ApiError`: `message` is the text the handler
|
|
140
|
+
// passed to `HttpError`, so there is no cast and no generic wording.
|
|
141
|
+
<ErrorState
|
|
142
|
+
title="Could not load the dashboard"
|
|
143
|
+
message={summary.error.message}
|
|
144
|
+
action={<Button onClick={() => void summary.refetch()}>Retry</Button>}
|
|
145
|
+
/>
|
|
146
|
+
) : (
|
|
147
|
+
<DashboardBody data={summary.data} />
|
|
148
|
+
)}
|
|
149
|
+
</PageShellContent>
|
|
150
|
+
</PageShell>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
|
|
107
154
|
function DashboardBody({ data }: { data: KpiSummary }) {
|
|
108
155
|
return (
|
|
109
156
|
<>
|
|
@@ -151,50 +198,3 @@ function DashboardBody({ data }: { data: KpiSummary }) {
|
|
|
151
198
|
</>
|
|
152
199
|
)
|
|
153
200
|
}
|
|
154
|
-
|
|
155
|
-
export default function HomePage() {
|
|
156
|
-
// Filter state belongs in the URL rather than `useState`: it survives a
|
|
157
|
-
// reload, and a pasted link reproduces exactly what you were looking at.
|
|
158
|
-
const [range, setRange] = useSearchParam("range", "30d")
|
|
159
|
-
|
|
160
|
-
// `search` goes into the query string *and* the cache key, so changing the
|
|
161
|
-
// range refetches instead of serving the previous window.
|
|
162
|
-
const summary = useApiQuery<KpiSummary>("/api/kpi-summary", { search: { range } })
|
|
163
|
-
|
|
164
|
-
return (
|
|
165
|
-
<PageShell>
|
|
166
|
-
<PageShellHeader>
|
|
167
|
-
<PageShellHeading>
|
|
168
|
-
<PageShellTitle>[Template] Performance overview</PageShellTitle>
|
|
169
|
-
<PageShellDescription>
|
|
170
|
-
Key metrics and trends for the selected period.
|
|
171
|
-
</PageShellDescription>
|
|
172
|
-
</PageShellHeading>
|
|
173
|
-
<PageShellHeaderEnd>
|
|
174
|
-
<SegmentedControl
|
|
175
|
-
options={RANGE_OPTIONS}
|
|
176
|
-
value={range}
|
|
177
|
-
onChange={setRange}
|
|
178
|
-
ariaLabel="Period"
|
|
179
|
-
/>
|
|
180
|
-
</PageShellHeaderEnd>
|
|
181
|
-
</PageShellHeader>
|
|
182
|
-
|
|
183
|
-
<PageShellContent className="space-y-6">
|
|
184
|
-
{summary.isPending ? (
|
|
185
|
-
<Loading />
|
|
186
|
-
) : summary.isError ? (
|
|
187
|
-
// `summary.error` is an `ApiError`: `message` is the text the handler
|
|
188
|
-
// passed to `HttpError`, so there is no cast and no generic wording.
|
|
189
|
-
<ErrorState
|
|
190
|
-
title="Could not load the dashboard"
|
|
191
|
-
message={summary.error.message}
|
|
192
|
-
action={<Button onClick={() => void summary.refetch()}>Retry</Button>}
|
|
193
|
-
/>
|
|
194
|
-
) : (
|
|
195
|
-
<DashboardBody data={summary.data} />
|
|
196
|
-
)}
|
|
197
|
-
</PageShellContent>
|
|
198
|
-
</PageShell>
|
|
199
|
-
)
|
|
200
|
-
}
|
|
@@ -104,6 +104,53 @@ const RANGE_OPTIONS: SegmentOption[] = [
|
|
|
104
104
|
{ label: "90日", value: "90d" },
|
|
105
105
|
]
|
|
106
106
|
|
|
107
|
+
export default function HomePage() {
|
|
108
|
+
// 絞り込み状態は useState ではなく URL に置く。リロードで消えず、URL を
|
|
109
|
+
// そのまま共有すれば相手も同じ画面を見られる。
|
|
110
|
+
const [range, setRange] = useSearchParam("range", "30d")
|
|
111
|
+
|
|
112
|
+
// search はクエリ文字列とキャッシュキーの両方に入るので、期間を変えると
|
|
113
|
+
// 前の期間のデータを返さずに再取得される。
|
|
114
|
+
const summary = useApiQuery<KpiSummary>("/api/kpi-summary", { search: { range } })
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<PageShell>
|
|
118
|
+
<PageShellHeader>
|
|
119
|
+
<PageShellHeading>
|
|
120
|
+
<PageShellTitle>[テンプレート] パフォーマンス概要</PageShellTitle>
|
|
121
|
+
<PageShellDescription>
|
|
122
|
+
選択期間の主要指標とトレンド。
|
|
123
|
+
</PageShellDescription>
|
|
124
|
+
</PageShellHeading>
|
|
125
|
+
<PageShellHeaderEnd>
|
|
126
|
+
<SegmentedControl
|
|
127
|
+
options={RANGE_OPTIONS}
|
|
128
|
+
value={range}
|
|
129
|
+
onChange={setRange}
|
|
130
|
+
ariaLabel="期間"
|
|
131
|
+
/>
|
|
132
|
+
</PageShellHeaderEnd>
|
|
133
|
+
</PageShellHeader>
|
|
134
|
+
|
|
135
|
+
<PageShellContent className="space-y-6">
|
|
136
|
+
{summary.isPending ? (
|
|
137
|
+
<Loading />
|
|
138
|
+
) : summary.isError ? (
|
|
139
|
+
// summary.error は ApiError。message にはハンドラが HttpError に
|
|
140
|
+
// 渡した文言がそのまま入るので、キャストも汎用文言も要らない。
|
|
141
|
+
<ErrorState
|
|
142
|
+
title="ダッシュボードを読み込めませんでした"
|
|
143
|
+
message={summary.error.message}
|
|
144
|
+
action={<Button onClick={() => void summary.refetch()}>再試行</Button>}
|
|
145
|
+
/>
|
|
146
|
+
) : (
|
|
147
|
+
<DashboardBody data={summary.data} />
|
|
148
|
+
)}
|
|
149
|
+
</PageShellContent>
|
|
150
|
+
</PageShell>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
|
|
107
154
|
function DashboardBody({ data }: { data: KpiSummary }) {
|
|
108
155
|
return (
|
|
109
156
|
<>
|
|
@@ -151,50 +198,3 @@ function DashboardBody({ data }: { data: KpiSummary }) {
|
|
|
151
198
|
</>
|
|
152
199
|
)
|
|
153
200
|
}
|
|
154
|
-
|
|
155
|
-
export default function HomePage() {
|
|
156
|
-
// 絞り込み状態は useState ではなく URL に置く。リロードで消えず、URL を
|
|
157
|
-
// そのまま共有すれば相手も同じ画面を見られる。
|
|
158
|
-
const [range, setRange] = useSearchParam("range", "30d")
|
|
159
|
-
|
|
160
|
-
// search はクエリ文字列とキャッシュキーの両方に入るので、期間を変えると
|
|
161
|
-
// 前の期間のデータを返さずに再取得される。
|
|
162
|
-
const summary = useApiQuery<KpiSummary>("/api/kpi-summary", { search: { range } })
|
|
163
|
-
|
|
164
|
-
return (
|
|
165
|
-
<PageShell>
|
|
166
|
-
<PageShellHeader>
|
|
167
|
-
<PageShellHeading>
|
|
168
|
-
<PageShellTitle>[テンプレート] パフォーマンス概要</PageShellTitle>
|
|
169
|
-
<PageShellDescription>
|
|
170
|
-
選択期間の主要指標とトレンド。
|
|
171
|
-
</PageShellDescription>
|
|
172
|
-
</PageShellHeading>
|
|
173
|
-
<PageShellHeaderEnd>
|
|
174
|
-
<SegmentedControl
|
|
175
|
-
options={RANGE_OPTIONS}
|
|
176
|
-
value={range}
|
|
177
|
-
onChange={setRange}
|
|
178
|
-
ariaLabel="期間"
|
|
179
|
-
/>
|
|
180
|
-
</PageShellHeaderEnd>
|
|
181
|
-
</PageShellHeader>
|
|
182
|
-
|
|
183
|
-
<PageShellContent className="space-y-6">
|
|
184
|
-
{summary.isPending ? (
|
|
185
|
-
<Loading />
|
|
186
|
-
) : summary.isError ? (
|
|
187
|
-
// summary.error は ApiError。message にはハンドラが HttpError に
|
|
188
|
-
// 渡した文言がそのまま入るので、キャストも汎用文言も要らない。
|
|
189
|
-
<ErrorState
|
|
190
|
-
title="ダッシュボードを読み込めませんでした"
|
|
191
|
-
message={summary.error.message}
|
|
192
|
-
action={<Button onClick={() => void summary.refetch()}>再試行</Button>}
|
|
193
|
-
/>
|
|
194
|
-
) : (
|
|
195
|
-
<DashboardBody data={summary.data} />
|
|
196
|
-
)}
|
|
197
|
-
</PageShellContent>
|
|
198
|
-
</PageShell>
|
|
199
|
-
)
|
|
200
|
-
}
|