@squadbase/vantage 0.2.1 → 0.2.2

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/dist/index.d.ts CHANGED
@@ -10,6 +10,6 @@ import 'react';
10
10
  */
11
11
 
12
12
  /** Framework version, kept in sync with package.json at build time. */
13
- declare const VERSION = "0.2.1";
13
+ declare const VERSION = "0.2.2";
14
14
 
15
15
  export { VERSION };
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ function definePage(config) {
6
6
  }
7
7
 
8
8
  // src/index.ts
9
- var VERSION = "0.2.1";
9
+ var VERSION = "0.2.2";
10
10
 
11
11
  export { VERSION, definePage };
12
12
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/runtime/define-page.ts","../src/index.ts"],"names":[],"mappings":";;;AAyCO,SAAS,WAAW,MAAA,EAAgC;AACzD,EAAA,OAAO,MAAA;AACT;;;AChCO,IAAM,OAAA,GAAU","file":"index.js","sourcesContent":["import type { ComponentType, ReactNode } from \"react\"\n\n/**\n * Optional per-page configuration. The only required part of a page module is\n * its default-exported component; `definePage` covers everything else.\n */\nexport interface PageConfig {\n /** Document title applied when this route is active. */\n title?: string\n /** Description metadata for the page. */\n description?: string\n /**\n * Short label for navigation built from `useRoutes()`. Defaults to `title`,\n * which is often too long for a nav (\"Overview · Acme Analytics\").\n */\n navLabel?: string\n /**\n * Component rendered while the route is loading.\n * (Reserved — not yet applied to Vantage's code-split routes in the prototype.)\n */\n pendingComponent?: ComponentType\n /**\n * Component rendered when the route throws.\n * (Reserved — not yet applied to Vantage's code-split routes in the prototype.)\n */\n errorComponent?: ComponentType<{ error: unknown }>\n /**\n * Validate/transform the URL search params for this route.\n * (Reserved — not yet applied to Vantage's code-split routes in the prototype.)\n */\n validateSearch?: (search: Record<string, unknown>) => Record<string, unknown>\n}\n\n/**\n * Declare optional page configuration.\n *\n * ```tsx\n * export const page = definePage({ title: \"Monthly Analysis\" })\n * export default function MonthlyAnalysis() { return <div/> }\n * ```\n */\nexport function definePage(config: PageConfig): PageConfig {\n return config\n}\n\n/** Convenience type for a Vantage page component. */\nexport type PageComponent = ComponentType & { (): ReactNode }\n","/**\n * `@squadbase/vantage` — public runtime surface.\n *\n * The only import most pages need. Server state lives in\n * `@squadbase/vantage/query`, navigation in `@squadbase/vantage/router`,\n * UI in `@squadbase/vantage/ui`, and API types in `@squadbase/vantage/server`.\n */\nexport { definePage } from \"./runtime/define-page\"\nexport type { PageConfig, PageComponent } from \"./runtime/define-page\"\n\n/** Framework version, kept in sync with package.json at build time. */\nexport const VERSION = \"0.2.1\"\n"]}
1
+ {"version":3,"sources":["../src/runtime/define-page.ts","../src/index.ts"],"names":[],"mappings":";;;AAyCO,SAAS,WAAW,MAAA,EAAgC;AACzD,EAAA,OAAO,MAAA;AACT;;;AChCO,IAAM,OAAA,GAAU","file":"index.js","sourcesContent":["import type { ComponentType, ReactNode } from \"react\"\n\n/**\n * Optional per-page configuration. The only required part of a page module is\n * its default-exported component; `definePage` covers everything else.\n */\nexport interface PageConfig {\n /** Document title applied when this route is active. */\n title?: string\n /** Description metadata for the page. */\n description?: string\n /**\n * Short label for navigation built from `useRoutes()`. Defaults to `title`,\n * which is often too long for a nav (\"Overview · Acme Analytics\").\n */\n navLabel?: string\n /**\n * Component rendered while the route is loading.\n * (Reserved — not yet applied to Vantage's code-split routes in the prototype.)\n */\n pendingComponent?: ComponentType\n /**\n * Component rendered when the route throws.\n * (Reserved — not yet applied to Vantage's code-split routes in the prototype.)\n */\n errorComponent?: ComponentType<{ error: unknown }>\n /**\n * Validate/transform the URL search params for this route.\n * (Reserved — not yet applied to Vantage's code-split routes in the prototype.)\n */\n validateSearch?: (search: Record<string, unknown>) => Record<string, unknown>\n}\n\n/**\n * Declare optional page configuration.\n *\n * ```tsx\n * export const page = definePage({ title: \"Monthly Analysis\" })\n * export default function MonthlyAnalysis() { return <div/> }\n * ```\n */\nexport function definePage(config: PageConfig): PageConfig {\n return config\n}\n\n/** Convenience type for a Vantage page component. */\nexport type PageComponent = ComponentType & { (): ReactNode }\n","/**\n * `@squadbase/vantage` — public runtime surface.\n *\n * The only import most pages need. Server state lives in\n * `@squadbase/vantage/query`, navigation in `@squadbase/vantage/router`,\n * UI in `@squadbase/vantage/ui`, and API types in `@squadbase/vantage/server`.\n */\nexport { definePage } from \"./runtime/define-page\"\nexport type { PageConfig, PageComponent } from \"./runtime/define-page\"\n\n/** Framework version, kept in sync with package.json at build time. */\nexport const VERSION = \"0.2.2\"\n"]}
@@ -22,12 +22,29 @@ The skills ship inside the `@squadbase/vantage` package. `vantage add skill` cop
22
22
  your app. They land **directly under the project root** by default; `--dir` puts them elsewhere.
23
23
 
24
24
  ```bash
25
- vantage add skill --all # every bundled skill, under the root
25
+ vantage add skill # list the skills and where they sit (writes nothing)
26
+ vantage add skill --all # every skill that isn't placed yet, under the root
26
27
  vantage add skill vantage-app # a single skill by name
27
28
  vantage add skill --all --dir .claude/skills # where Claude Code looks for them
28
- vantage add skill vantage-app --force # overwrite an existing copy
29
+ vantage add skill --all --force # refresh the placed copies in place
29
30
  ```
30
31
 
32
+ **The destination is scanned for, not assumed.** `add skill` walks the project first (skipping
33
+ `node_modules` and friends) and **skips any skill that is already placed, reporting where it is** —
34
+ under the root, under `.claude/skills/`, under `.squadbase/skills/`, it doesn't matter, so
35
+ **re-running never creates a second copy**. Drop the name to get just the list:
36
+
37
+ ```text
38
+ $ vantage add skill
39
+ Bundled skills:
40
+ vantage-add-feature .claude/skills/vantage-add-feature/
41
+ vantage-app .claude/skills/vantage-app/
42
+ vantage-pitfalls not placed
43
+ ```
44
+
45
+ With `--force`, the copies that were found are rewritten **where they are** (an explicit `--dir`
46
+ still wins as the destination).
47
+
31
48
  A `--dir` path resolves from the project root (absolute paths work too). To have Claude Code pick
32
49
  them up automatically, place them in `.claude/skills/`:
33
50
 
@@ -54,8 +71,8 @@ skill based on the task at hand. For other agents, pass whatever directory that
54
71
 
55
72
  - **The source of truth lives in the package.** Skills are distributed and updated together with
56
73
  the framework version, so bumping `@squadbase/vantage` gets you the latest procedures. To refresh
57
- copies you've already placed, run `vantage add skill --all --force` with the same `--dir` you
58
- used originally.
74
+ copies you've already placed, run `vantage add skill --all --force` the destination is scanned
75
+ for, so you don't have to remember the `--dir` you used originally.
59
76
  - **The Squadbase template ships them pre-placed.** Apps created from the template already contain
60
77
  `.claude/skills/`. For a hand-made app, add them with `vantage add skill`.
61
78
 
@@ -9,6 +9,37 @@ What changed in each Vantage release. Newest is on top.
9
9
  > minor release may include backwards-incompatible changes. A patch is limited to
10
10
  > backwards-compatible additions and bug fixes.
11
11
 
12
+ ## v0.2.2
13
+
14
+ `vantage add skill` now scans for where the skills already are, and charts follow
15
+ stylesheet swaps too. Both are backwards-compatible.
16
+
17
+ ### Changed
18
+
19
+ - **`vantage add skill` looks for placed skills before copying** — it walks the
20
+ project for `<skill>/SKILL.md` and **skips anything already placed, reporting
21
+ where it is**. Under the root, under `.claude/skills/`, under
22
+ `.squadbase/skills/` — it makes no difference, so **re-running never creates a
23
+ second copy**, and an agent no longer has to know the candidate locations.
24
+ - `--force` rewrites the copies **where they were found** (an explicit `--dir`
25
+ still wins as the destination), so refreshing placed copies doesn't require
26
+ remembering the `--dir` you used originally.
27
+ - `vantage add skill` with no name is now a listing command: it prints the
28
+ bundled skills and where each one sits, and writes nothing.
29
+ - The bundled `AGENTS.md` drops its `ls`-the-usual-places routine in favour of
30
+ letting the CLI find them (a placed `AGENTS.md` is synced by `vantage upgrade`).
31
+
32
+ ### Fixed
33
+
34
+ - **[`EChart`](parts/echart) could miss a CSS update** — token
35
+ changes were only watched through attributes on `<html>` / `<body>`, so a
36
+ change that **only rewrites the injected `<style>`** (editing `styles.css` with
37
+ the dev server running, applying a theme preset, …) left the chart painted in
38
+ the previous colours while the DOM tokens were already new. A reload fixed it,
39
+ which made it read as "the preset didn't apply". Stylesheet swaps are now
40
+ watched as well, and the chart repaints **only when the token values actually
41
+ change**.
42
+
12
43
  ## v0.2.1
13
44
 
14
45
  Charts now follow the theme tokens, and `Select` works out the value-to-label
@@ -13,7 +13,7 @@
13
13
  | `vantage preview` | Run the production build locally (fullstack default `:4173`; spa via Vite preview) |
14
14
  | `vantage check` | Static checks (routes, boundaries, forbidden files). Exit 1 on error |
15
15
  | `vantage routes` | Print the page + API URL map |
16
- | `vantage add <kind> <name>` | Scaffold or place a `page` / `api` / `ui` / `block` / `skill` / `agents` (`--force` to overwrite; `skill` takes `--dir` for the destination) |
16
+ | `vantage add <kind> <name>` | Scaffold or place a `page` / `api` / `ui` / `block` / `skill` / `agents` (`--force` to overwrite; `skill` scans for copies already placed and skips them, `--dir` picks the destination) |
17
17
  | `vantage docs [name]` | Show the bundled guide and component reference |
18
18
  | `vantage search <query>` | Search that same reference in full text (natural language or `--regex`) |
19
19
  | `vantage doctor` | Diagnose environment / installation health |
@@ -27,8 +27,10 @@ import type { EChartsOption } from "@squadbase/vantage/components";
27
27
 
28
28
  By default the theme's `--chart-1` through `--chart-5` become the series colours. ECharts can't read
29
29
  CSS variables *while painting*, but `EChart` resolves the tokens once at init with
30
- `getComputedStyle` and passes them in as an ECharts theme. It watches for the `.dark` class going on
31
- and off, and re-reads the tokens when it changes.
30
+ `getComputedStyle` and passes them in as an ECharts theme. It watches for anything that can change
31
+ those tokens and re-reads them when the values actually move — the `.dark` class going on and off,
32
+ and **stylesheet swaps** too (editing `styles.css` with the dev server running, applying a theme
33
+ preset, …).
32
34
 
33
35
  To give series their own colours, set `option.color` (or `series[].itemStyle.color`). Your option
34
36
  wins over the theme, so **axes, legend and tooltip keep following the tokens**.
@@ -22,12 +22,29 @@ Skill のソースは `@squadbase/vantage` パッケージに同梱されてい
22
22
  対象アプリにコピーします。配置先は既定で**プロジェクトルート直下**で、`--dir` で変えられます。
23
23
 
24
24
  ```bash
25
- vantage add skill --all # 同梱スキルをすべて、ルート直下に配置
25
+ vantage add skill # 一覧と配置場所を表示するだけ(何も書かない)
26
+ vantage add skill --all # 未配置のものを、ルート直下に配置
26
27
  vantage add skill vantage-app # 名前を指定して1つだけ配置
27
28
  vantage add skill --all --dir .claude/skills # Claude Code が読む場所に配置
28
- vantage add skill vantage-app --force # 既存を上書き
29
+ vantage add skill --all --force # 配置済みのコピーをその場で最新に更新
29
30
  ```
30
31
 
32
+ **配置先は決め打ちではなく、走査して見つけます。** `add skill` はまずプロジェクト内
33
+ (`node_modules` などを除く)を走査し、**既に配置されている skill はスキップして場所を報告**
34
+ します。ルート直下でも `.claude/skills/` でも `.squadbase/skills/` でも同じで、**再実行しても
35
+ 二重に配置されません**。名前を省いて実行すると、一覧と配置場所だけが出ます:
36
+
37
+ ```text
38
+ $ vantage add skill
39
+ Bundled skills:
40
+ vantage-add-feature .claude/skills/vantage-add-feature/
41
+ vantage-app .claude/skills/vantage-app/
42
+ vantage-pitfalls not placed
43
+ ```
44
+
45
+ `--force` を付けると、**見つかった場所をそのまま**新しい内容で書き換えます(`--dir` を明示した
46
+ ときは、そちらが配置先として優先されます)。
47
+
31
48
  `--dir` のパスはプロジェクトルートからの相対で解決されます(絶対パスも可)。Claude Code に
32
49
  自動認識させるなら `.claude/skills/` に置きます:
33
50
 
@@ -54,8 +71,8 @@ Skill の手順を読み込んで実行します。他のエージェントに
54
71
 
55
72
  - **source-of-truth はパッケージ内**にあります。Skill はフレームワークのバージョンと一緒に
56
73
  配布・更新されるため、`@squadbase/vantage` を上げれば最新の手順が手に入ります。配置済みの
57
- コピーを更新したいときは、配置したときと同じ `--dir` を付けて
58
- `vantage add skill --all --force` を実行します。
74
+ コピーを更新したいときは `vantage add skill --all --force` を実行します(置き場所は走査して
75
+ 見つけるので、`--dir` を覚えておく必要はありません)。
59
76
  - **Squadbase テンプレートには配置済み**です。テンプレートから作ったアプリには、最初から
60
77
  `.claude/skills/` が入っています。手で作ったアプリには `vantage add skill` で足してください。
61
78
 
@@ -8,6 +8,34 @@ Vantage のリリースごとの変更点です。新しいものが上に来ま
8
8
  > まだプロトタイプ(**0.x**)です。0.x の間は **minor が実質のメジャー**扱いで、後方互換性の
9
9
  > ない変更は minor で入ることがあります。patch は後方互換の機能追加とバグ修正のみです。
10
10
 
11
+ ## v0.2.2
12
+
13
+ `vantage add skill` が配置先を走査するようになり、チャートがスタイルシートの差し替えにも
14
+ 追従するようになりました。どちらも後方互換です。
15
+
16
+ ### 変更
17
+
18
+ - **`vantage add skill` が配置済みの Skill を探してからコピーします** ― プロジェクト内を
19
+ 走査して `<skill>/SKILL.md` を探し、**既にあればスキップして場所を報告**します。ルート直下
20
+ でも `.claude/skills/` でも `.squadbase/skills/` でも同じなので、**再実行しても二重に配置
21
+ されません**。エージェント側が置き場所の候補を覚えておく必要がなくなります。
22
+ - `--force` は**見つかった場所をその場で**書き換えます(`--dir` を明示したときは、そちらが
23
+ 配置先として優先されます)。配置済みコピーの更新に、前回と同じ `--dir` を思い出す必要は
24
+ ありません。
25
+ - 名前を省いた `vantage add skill` は、**一覧と配置場所を出すだけ**の表示コマンドに
26
+ なりました(何も書き込まず exit 0)。
27
+ - 同梱の `AGENTS.md` も更新し、置き場所を `ls` で当てにいく手順を「CLI が探す」に
28
+ 置き換えました(配置済みの `AGENTS.md` は `vantage upgrade` で同期されます)。
29
+
30
+ ### 修正
31
+
32
+ - **[`EChart`](parts/echart) が CSS の更新に追従しない場合がありました** ―
33
+ トークンの変化を `html` / `body` の属性でしか見ていなかったため、**注入済みの `<style>` の
34
+ 中身だけが差し替わる経路**(開発中の `styles.css` の書き換え、テーマプリセットの適用など)で
35
+ DOM のトークンは新しいのにチャートだけ前の色のまま残っていました(リロードで直るため
36
+ 「プリセットが効いていない」と誤解しやすい状態でした)。スタイルシートの差し替えも監視
37
+ 対象になり、**トークンの値が実際に変わったときだけ**描き直します。
38
+
11
39
  ## v0.2.1
12
40
 
13
41
  チャートをテーマトークンに追従させ、`Select` の値とラベルの対応を Vantage 側で組むように
@@ -13,7 +13,7 @@
13
13
  | `vantage preview` | 本番ビルドをローカルで起動(fullstack は既定 `:4173`、spa は Vite プレビュー) |
14
14
  | `vantage check` | 静的検査(ルート・境界・禁止ファイル)。エラーがあれば exit 1 |
15
15
  | `vantage routes` | ページ + API の URL マップを表示 |
16
- | `vantage add <kind> <name>` | `page` / `api` / `ui` / `block` / `skill` / `agents` を雛形生成・配置(`--force` で上書き、`skill` は `--dir` で配置先を指定) |
16
+ | `vantage add <kind> <name>` | `page` / `api` / `ui` / `block` / `skill` / `agents` を雛形生成・配置(`--force` で上書き、`skill` は配置済みを走査してスキップ・`--dir` で配置先を指定) |
17
17
  | `vantage docs [name]` | 同梱のガイド + コンポーネントリファレンスを表示 |
18
18
  | `vantage search <query>` | 同じリファレンスを全文検索(自然言語 or `--regex`) |
19
19
  | `vantage doctor` | 環境・インストールの健全性を診断 |
@@ -27,8 +27,9 @@ import type { EChartsOption } from "@squadbase/vantage/components";
27
27
 
28
28
  既定ではテーマの `--chart-1` 〜 `--chart-5` がそのまま系列色になります。ECharts は**描画中**には
29
29
  CSS 変数を読めませんが、`EChart` は init のタイミングで `getComputedStyle` からトークンの実値を
30
- 解決し、ECharts のテーマとして渡しています。`.dark` の付け外しを見張っていて、切り替われば
31
- 読み直します。
30
+ 解決し、ECharts のテーマとして渡しています。**トークンが変わりうる操作は見張っていて**、値が
31
+ 実際に変わったときだけ読み直します ― `.dark` の付け外しだけでなく、**スタイルシートの差し替え**
32
+ (開発中に `styles.css` を書き換えた・テーマプリセットを当てた、など)も拾います。
32
33
 
33
34
  系列に固有の色を当てたいときは `option.color`(または `series[].itemStyle.color`)で上書きします。
34
35
  option はテーマより優先されるので、**軸・凡例・ツールチップのトークン追従は残ります**。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squadbase/vantage",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Data dashboard framework for Squadbase Editor. Vite-powered, config-free, one-file first.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -57,7 +57,7 @@ API export・env 誤用)はユーザーコードを実行しないので速く
57
57
  vantage routes # 既にあるページと API の URL マップ
58
58
  vantage check # いま壊れていないか(これから出すエラーと切り分ける)
59
59
  ls server/ # あれば fullstack モード。無ければ SPA
60
- ls .claude/skills # 配置済みの skill(このファイルの仲間)
60
+ vantage add skill # 配置済みの skill(このファイルの仲間)と、その場所
61
61
  ```
62
62
 
63
63
  ## Step 2 — ルートを決める
@@ -37,8 +37,9 @@ Base UI の `SelectValue` は選択中の **value をそのまま描き**、`Sel
37
37
 
38
38
  ## チャート:`EChart` の配色はトークン追従。上書きは `option.color`
39
39
 
40
- 系列色は `--chart-1..5`、軸・凡例・ツールチップは文字色/境界色のトークンから組まれ、
41
- ライト / ダークの切り替えにも追従する(init 時にトークンの実値を解決している)
40
+ 系列色は `--chart-1..5`、軸・凡例・ツールチップは文字色/境界色のトークンから組まれる
41
+ (init 時にトークンの実値を解決している)。ライト / ダークの切り替えにも、`styles.css` の
42
+ 書き換えやテーマプリセットの適用にも追従する。
42
43
 
43
44
  - **`theme` プロップを渡すと追従は完全に止まる。** 系列の色だけ変えたいなら `option.color` を
44
45
  使う ― option はテーマより優先されるので、軸まわりの追従は残る。
@@ -318,18 +318,20 @@ pnpm preview # 本番ビルドをローカル実行
318
318
  - **`vantage-add-feature`** — 既存アプリに page / api / ui を 1 つ足す定型
319
319
  - **`vantage-pitfalls`** — Base UI(≠ Radix)の癖など、静かに壊れる落とし穴のリファレンス
320
320
 
321
- **まず、このアプリに配置済みかを探す。** 手順書の本体は SKILL.md というファイルで、置き場所は
322
- アプリによって違う:
321
+ 手順書の本体は `SKILL.md` というファイルで、置き場所はアプリによって違う(ルート直下・
322
+ `.claude/skills/`・`.squadbase/skills/` など)。**探す必要はない ― CLI が探す:**
323
323
 
324
324
  ```bash
325
- ls .claude/skills # よくある置き場所
326
- ls -d vantage-* # ルート直下に置くのが既定
325
+ vantage add skill # 同梱 skill の一覧と、それぞれの配置場所
327
326
  ```
328
327
 
329
- 見つかったらその `SKILL.md` を読む(`vantage add skill` を再実行する必要はない)。**無いときだけ**
330
- 配置する ― 一覧は名前を省いて実行すると出る:
328
+ 配置済みならその場所が出るので、その `SKILL.md` を読む。`not placed` のものだけ配置する:
331
329
 
332
330
  ```bash
333
- vantage add skill # 同梱されている skill 名の一覧
334
- vantage add skill --all --dir .claude/skills # 配置(--dir を省くとルート直下)
331
+ vantage add skill --all # 配置済みはスキップ(場所を報告するだけ)
332
+ vantage add skill --all --dir .claude/skills # 置き場所を指定(既定はルート直下)
335
333
  ```
334
+
335
+ `add skill` はプロジェクト内を走査してから動くので、**再実行しても二重に配置されない**。
336
+ 配置済みのコピーを新しいバージョンに更新したいときだけ `--force` を付ける(見つかった場所を
337
+ そのまま書き換える)。