@squadbase/vantage-template 0.1.0 → 0.1.1-dev1.2be5c44
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 +7 -7
- package/base-template/.squadbase/skills/vantage-app/SKILL.md +6 -6
- package/base-template/AGENTS.md +18 -0
- package/base-template/agents/doc.md +2 -0
- package/base-template/bun.lock +907 -0
- package/base-template/package.json +2 -2
- package/base-template/squadbase.yml +1 -0
- package/base-template/src/_layout.tsx +3 -1
- package/dist/index.js +15 -6
- package/package.json +2 -2
- package/base-template/package-lock.json +0 -5841
package/README.md
CHANGED
|
@@ -19,20 +19,20 @@ Initialize a new Vantage project in the current directory. Copies the base templ
|
|
|
19
19
|
```bash
|
|
20
20
|
npx @squadbase/vantage-template init
|
|
21
21
|
npx @squadbase/vantage-template init --force # Overwrite existing files
|
|
22
|
-
npx @squadbase/vantage-template init --skip-install # Skip npm
|
|
22
|
+
npx @squadbase/vantage-template init --skip-install # Skip dependency install (bun, or npm if bun is absent)
|
|
23
23
|
npx @squadbase/vantage-template init --chart sunset # Apply a chart preset during init
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
After initialization:
|
|
26
|
+
After initialization (the template ships `bun.lock` and declares `package_manager: bun` in `squadbase.yml`; `npm run` works too once dependencies are installed):
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
bun run dev # vantage dev --no-overlay — dev server + API on :5173
|
|
30
|
+
bun run build # vantage build → dist/
|
|
31
|
+
bun run check # vantage check — static diagnostics
|
|
32
|
+
bun run routes # vantage routes — page/API route map
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
There is no `vite.config.ts`, no `main.tsx`, and no route table: adding a file under `src/` adds a route (`src/index.tsx` → `/`, `src/sales/[id].tsx` → `/sales/:id`), and `src/_layout.tsx` builds the nav from `useRoutes()`.
|
|
35
|
+
There is no `vite.config.ts`, no `main.tsx`, and no route table: adding a file under `src/` adds a route (`src/index.tsx` → `/`, `src/sales/[id].tsx` → `/sales/:id`), and `src/_layout.tsx` builds the nav from `useRoutes()`. The layout passes Vantage's `useNavigate()` to the header page selector so selecting a page updates the route without reloading the app.
|
|
36
36
|
|
|
37
37
|
Since `@squadbase/vantage` v0.3.0, `src/` is the page-scan root and does not appear in URLs. `server/` and `public/` stay at the project root — `src/server/` is never scanned.
|
|
38
38
|
|
|
@@ -14,7 +14,7 @@ description: Vantage(@squadbase/vantage)ダッシュボードアプリを一か
|
|
|
14
14
|
|
|
15
15
|
## 全体の流れ
|
|
16
16
|
|
|
17
|
-
1. **骨組み** — `
|
|
17
|
+
1. **骨組み** — `bun run dev` が上がるところまで
|
|
18
18
|
2. **ルートを決める** — ページファイルを置き、`vantage routes` で URL を確認
|
|
19
19
|
3. **データを繋ぐ** — 外部 API か、自前の `server/api` か
|
|
20
20
|
4. **仕上げ** — `check` → `build` → `preview`
|
|
@@ -52,7 +52,7 @@ exit 1 になる。
|
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
`index.tsx` はデフォルトエクスポートの React コンポーネント 1 つ(これが `/` になる)。あとは
|
|
55
|
-
`
|
|
55
|
+
`bun install && bun run dev` で http://localhost:5173 が上がる(このプロジェクトの package manager は bun。`bun.lock` を持つ)。
|
|
56
56
|
|
|
57
57
|
**既存アプリに合流したときは、作る前に現状を読む:**
|
|
58
58
|
|
|
@@ -105,10 +105,10 @@ vantage add skill # 配置済みの skill(このファイルの仲間)と、そ
|
|
|
105
105
|
## Step 4 — 仕上げ
|
|
106
106
|
|
|
107
107
|
```bash
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
bun run check # エラーが残っていないか(exit 1 なら残っている)
|
|
109
|
+
bun run routes # 公開される URL の最終確認
|
|
110
|
+
bun run build # dist/ に client(+ server)+ vantage-manifest.json
|
|
111
|
+
bun run preview # 本番ビルドをローカルで動かす
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
`vantage-manifest.json` の `mode` は `server/` の有無から自動で決まる(手で書かない)。
|
package/base-template/AGENTS.md
CHANGED
|
@@ -331,3 +331,21 @@ const res = await fetch(`${baseUrl}/queries/${QUERY_ID}?since=2026-01-01`, {
|
|
|
331
331
|
- **データ取得の失敗は各ページが `ErrorState` で出す。** `BuildRecovery` が拾うのは
|
|
332
332
|
「レンダリングが throw した」場合だけで、`useApiQuery` の `isError` はページの責任
|
|
333
333
|
(→ `agents/page.md` の「データ取得」)。
|
|
334
|
+
|
|
335
|
+
## 依存の追加とスクリプトの実行は bun で
|
|
336
|
+
|
|
337
|
+
このプロジェクトの package manager は **bun** です(`squadbase.yml` の `package_manager: bun`、
|
|
338
|
+
lockfile は `bun.lock`)。Squadbase のサンドボックスは bun と依存のキャッシュを持っており、
|
|
339
|
+
`bun install` はキャッシュだけで終わります。上のフレームワーク規約に出てくる
|
|
340
|
+
`pnpm install` / `pnpm dev` / `pnpm check` は、そのまま `bun install` / `bun run dev` /
|
|
341
|
+
`bun run check` に読み替えてください。
|
|
342
|
+
|
|
343
|
+
### 追加の不変条件
|
|
344
|
+
|
|
345
|
+
- **依存を足すときは `bun add <pkg>`(開発用は `bun add -d <pkg>`)。** `npm install` や
|
|
346
|
+
`pnpm add` を使わない — `package-lock.json` / `pnpm-lock.yaml` が生えて `bun.lock` と別の断面に
|
|
347
|
+
なり、次回起動時の install が lockfile を作り直す。
|
|
348
|
+
- **`bun.lock` を消さない・手で編集しない。** `package.json` の依存を直接書き換えたときは
|
|
349
|
+
`bun install` を一度走らせて `bun.lock` を追従させ、両方を同じコミットに入れる。
|
|
350
|
+
- スクリプトは `bun run <script>`(`bun run dev` / `bun run build` / `bun run check` /
|
|
351
|
+
`bun run routes`)。`npm run <script>` でも動くが、install に npm を使わないこと。
|
|
@@ -44,6 +44,8 @@ export default function JuneSummary() {
|
|
|
44
44
|
`useApiQuery` などで読み込むと、開くたびに値が変わります。
|
|
45
45
|
- **チャートは `EChart`(`@squadbase/vantage/components`)を文中に置く。** `figure` で囲めば
|
|
46
46
|
`figcaption` がキャプションになります。
|
|
47
|
+
- **PDF の保存ボタンは作らない。** `<Document>` が右下に PDF 保存のボタンを出し、印刷時は
|
|
48
|
+
本文だけをライトの配色で出します。
|
|
47
49
|
- **ページ全体を包むのは `<Document>` だけ。** `PageShell` などのダッシュボード用の枠で包まない
|
|
48
50
|
(本文の幅と余白は `<Document>` が決めます)。
|
|
49
51
|
|