@squadbase/vantage-template 0.1.0-dev.a6b88b8 → 0.1.0-dev1.23da1b2

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.
@@ -12,8 +12,8 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@squadbase/react": "^0.1.0",
15
- "@squadbase/vantage": "0.6.0-dev.3cc6138",
16
- "@squadbase/vantage-sdk": "^0.1.0",
15
+ "@squadbase/vantage": "0.6.1-dev1.354b39b",
16
+ "@squadbase/vantage-sdk": "0.1.1-dev1.25f1dd3",
17
17
  "date-fns": "^4.1.0",
18
18
  "lucide-react": "^0.468.0",
19
19
  "react": "^19.2.7",
@@ -2,4 +2,4 @@
2
2
  name = "pipelines"
3
3
  version = "0.1.0"
4
4
  requires-python = ">=3.11"
5
- dependencies = ["adamas>=0.2.0", "pandas", "requests"]
5
+ dependencies = ["adamas>=0.3.0", "pandas", "requests"]
@@ -3,3 +3,4 @@ version: "1"
3
3
  build:
4
4
  framework: squadbase-vantage
5
5
  runtime: node20
6
+ package_manager: bun
@@ -1,6 +1,6 @@
1
1
  import type { ComponentProps } from "react"
2
2
  import { SquadbaseProvider } from "@squadbase/react"
3
- import { Link, Outlet, useCurrentRoute, useRoutes } from "@squadbase/vantage/router"
3
+ import { Link, Outlet, useCurrentRoute, useNavigate, useRoutes } from "@squadbase/vantage/router"
4
4
  import { AppShell } from "@squadbase/vantage/components"
5
5
  import type { NavGroup } from "@squadbase/vantage/components"
6
6
 
@@ -50,6 +50,7 @@ function useNavGroups(): NavGroup[] {
50
50
  * 「Something went wrong」のままリロードするまで残る。
51
51
  */
52
52
  export default function RootLayout() {
53
+ const navigate = useNavigate()
53
54
  return (
54
55
  <SquadbaseProvider>
55
56
  <AppShell
@@ -57,6 +58,7 @@ export default function RootLayout() {
57
58
  groups={useNavGroups()}
58
59
  actions={<UserCard />}
59
60
  linkComponent={RouterLink}
61
+ onNavigate={(href) => navigate({ to: href })}
60
62
  >
61
63
  <BuildRecovery>
62
64
  <Outlet />
@@ -1,6 +1,7 @@
1
1
  import { definePage } from "@squadbase/vantage"
2
2
  import {
3
3
  DashboardCardPreset,
4
+ EChart,
4
5
  PageShell,
5
6
  PageShellContent,
6
7
  PageShellDescription,
@@ -8,6 +9,8 @@ import {
8
9
  PageShellHeading,
9
10
  PageShellTitle,
10
11
  Placeholder,
12
+ Sparkline,
13
+ type EChartsOption,
11
14
  } from "@squadbase/vantage/components"
12
15
 
13
16
  export const page = definePage({
@@ -17,13 +20,49 @@ export const page = definePage({
17
20
  })
18
21
 
19
22
  const METRICS = [
20
- { label: "Metric 1", value: "1,234" },
21
- { label: "Metric 2", value: "5,678" },
22
- { label: "Metric 3", value: "90.1%" },
23
- { label: "Metric 4", value: "$12.3k" },
23
+ { label: "Metric 1", value: "1,234", trend: [3, 4, 3, 5, 6, 5, 7] },
24
+ { label: "Metric 2", value: "5,678", trend: [6, 5, 6, 4, 5, 6, 6] },
25
+ { label: "Metric 3", value: "90.1%", trend: [2, 3, 5, 4, 6, 7, 8] },
26
+ { label: "Metric 4", value: "$12.3k", trend: [5, 6, 4, 6, 5, 7, 6] },
24
27
  ]
25
28
 
26
- const CHARTS = ["Chart 1", "Chart 2"]
29
+ // Sample charts. `EChart` paints series with `--chart-1..5` and the sparklines
30
+ // use `--primary` (both from `styles.css`), so a theme change shows up here.
31
+ const BAR_OPTION: EChartsOption = {
32
+ legend: { top: 0 },
33
+ grid: { top: 36, right: 8, bottom: 24, left: 36 },
34
+ xAxis: { type: "category", data: ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] },
35
+ yAxis: { type: "value" },
36
+ series: [
37
+ { name: "Series A", type: "bar", data: [12, 18, 15, 22, 26, 24] },
38
+ { name: "Series B", type: "bar", data: [8, 11, 13, 12, 16, 19] },
39
+ { name: "Series C", type: "bar", data: [5, 7, 6, 9, 8, 11] },
40
+ ],
41
+ }
42
+
43
+ const PIE_OPTION: EChartsOption = {
44
+ legend: { bottom: 0 },
45
+ series: [
46
+ {
47
+ type: "pie",
48
+ radius: ["45%", "70%"],
49
+ center: ["50%", "45%"],
50
+ label: { show: false },
51
+ data: [
52
+ { name: "Category A", value: 35 },
53
+ { name: "Category B", value: 25 },
54
+ { name: "Category C", value: 18 },
55
+ { name: "Category D", value: 12 },
56
+ { name: "Category E", value: 10 },
57
+ ],
58
+ },
59
+ ],
60
+ }
61
+
62
+ const CHARTS = [
63
+ { title: "Chart 1", option: BAR_OPTION },
64
+ { title: "Chart 2", option: PIE_OPTION },
65
+ ]
27
66
 
28
67
  export default function HomePage() {
29
68
  return (
@@ -42,14 +81,20 @@ export default function HomePage() {
42
81
  {METRICS.map((metric) => (
43
82
  <DashboardCardPreset key={metric.label} title={metric.label}>
44
83
  <Placeholder className="text-2xl font-bold">{metric.value}</Placeholder>
84
+ <Sparkline
85
+ className="mt-2"
86
+ data={metric.trend.map((value) => ({ value }))}
87
+ color="text-primary"
88
+ area
89
+ />
45
90
  </DashboardCardPreset>
46
91
  ))}
47
92
  </section>
48
93
 
49
94
  <section className="grid grid-cols-1 gap-4 lg:grid-cols-2">
50
- {CHARTS.map((title) => (
51
- <DashboardCardPreset key={title} title={title}>
52
- <Placeholder className="h-64 w-full" />
95
+ {CHARTS.map((chart) => (
96
+ <DashboardCardPreset key={chart.title} title={chart.title}>
97
+ <EChart option={chart.option} height={256} ariaLabel={chart.title} />
53
98
  </DashboardCardPreset>
54
99
  ))}
55
100
  </section>
package/dist/index.js CHANGED
@@ -1022,27 +1022,36 @@ function initProject(options) {
1022
1022
  applyChartPreset(targetDir, options.chart);
1023
1023
  log("cyan", ` chart preset: ${options.chart}`);
1024
1024
  }
1025
+ const packageManager = isBunAvailable() ? "bun" : "npm";
1025
1026
  if (options.skipInstall) {
1026
1027
  log("green", "\nProject initialized successfully!");
1027
1028
  log("dim", "\nNext steps:");
1028
- log("dim", " npm install");
1029
- log("dim", " npm run dev");
1029
+ log("dim", ` ${packageManager} install`);
1030
+ log("dim", ` ${packageManager} run dev`);
1030
1031
  return;
1031
1032
  }
1032
- log("green", "\nInstalling dependencies...");
1033
- const install = spawnSync("npm", ["install"], {
1033
+ log("green", `
1034
+ Installing dependencies with ${packageManager}...`);
1035
+ const install = spawnSync(packageManager, ["install"], {
1034
1036
  cwd: targetDir,
1035
1037
  stdio: "inherit",
1036
1038
  shell: process.platform === "win32"
1037
1039
  });
1038
1040
  if (install.error || install.status !== 0) {
1039
1041
  log("red", "\nDependency installation failed.");
1040
- log("yellow", "Run 'npm install' manually in the project directory.");
1042
+ log("yellow", `Run '${packageManager} install' manually in the project directory.`);
1041
1043
  process.exit(1);
1042
1044
  }
1043
1045
  log("green", "\nProject initialized successfully!");
1044
1046
  log("dim", "\nNext steps:");
1045
- log("dim", " npm run dev");
1047
+ log("dim", ` ${packageManager} run dev`);
1048
+ }
1049
+ function isBunAvailable() {
1050
+ const probe = spawnSync("bun", ["--version"], {
1051
+ stdio: "ignore",
1052
+ shell: process.platform === "win32"
1053
+ });
1054
+ return !probe.error && probe.status === 0;
1046
1055
  }
1047
1056
 
1048
1057
  // src/commands/list.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squadbase/vantage-template",
3
- "version": "0.1.0-dev.a6b88b8",
3
+ "version": "0.1.0-dev1.23da1b2",
4
4
  "description": "CLI tool for initializing and customizing Squadbase Vantage projects.",
5
5
  "keywords": [
6
6
  "squadbase",
@@ -42,7 +42,7 @@
42
42
  "type-check": "tsc",
43
43
  "agents": "node scripts/build-agents.cjs",
44
44
  "agents:check": "node scripts/build-agents.cjs --check",
45
- "template:install": "npm --prefix template ci",
45
+ "template:install": "bun install --cwd template --frozen-lockfile",
46
46
  "template:build": "npm --prefix template run build",
47
47
  "prepublishOnly": "npm run agents:check && npm run build",
48
48
  "release": "npm publish --@squadbase:registry=https://registry.npmjs.org",
@@ -223,7 +223,7 @@ function heatmapOption(
223
223
  type: "heatmap",
224
224
  data: data.map((c) => [xAxis.indexOf(c.x), yAxis.indexOf(c.y), c.value]),
225
225
  label: { show: false },
226
- emphasis: { itemStyle: { shadowBlur: 8, shadowColor: "rgba(0,0,0,0.4)" } },
226
+ emphasis: { itemStyle: { shadowBlur: 8 } },
227
227
  },
228
228
  ],
229
229
  }
@@ -223,7 +223,7 @@ function heatmapOption(
223
223
  type: "heatmap",
224
224
  data: data.map((c) => [xAxis.indexOf(c.x), yAxis.indexOf(c.y), c.value]),
225
225
  label: { show: false },
226
- emphasis: { itemStyle: { shadowBlur: 8, shadowColor: "rgba(0,0,0,0.4)" } },
226
+ emphasis: { itemStyle: { shadowBlur: 8 } },
227
227
  },
228
228
  ],
229
229
  }
@@ -113,13 +113,13 @@ const summaryCards = [
113
113
  label: "Best step",
114
114
  value: "31.9%",
115
115
  sub: "Highest step conversion",
116
- icon: <TrendingUp className="size-4 text-emerald-600" />,
116
+ icon: <TrendingUp className="size-4 text-chart-2" />,
117
117
  },
118
118
  {
119
119
  label: "Biggest drop",
120
120
  value: "68.2%",
121
121
  sub: "Largest step drop-off",
122
- icon: <TrendingDown className="size-4 text-rose-600" />,
122
+ icon: <TrendingDown className="size-4 text-destructive" />,
123
123
  },
124
124
  ]
125
125
 
@@ -112,13 +112,13 @@ const summaryCards = [
112
112
  label: "最良ステップ",
113
113
  value: "31.9%",
114
114
  sub: "最も高いステップ転換率",
115
- icon: <TrendingUp className="size-4 text-emerald-600" />,
115
+ icon: <TrendingUp className="size-4 text-chart-2" />,
116
116
  },
117
117
  {
118
118
  label: "最大の離脱",
119
119
  value: "68.2%",
120
120
  sub: "最大のステップ離脱率",
121
- icon: <TrendingDown className="size-4 text-rose-600" />,
121
+ icon: <TrendingDown className="size-4 text-destructive" />,
122
122
  },
123
123
  ]
124
124