@squadbase/vantage-template 0.1.0-dev.c40b771 → 0.1.0-dev1.f48cfad
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/.squadbase/skills/vantage-design/SKILL.md +137 -0
- package/base-template/.squadbase/skills/vantage-design/references/extract.md +110 -0
- package/base-template/.squadbase/skills/vantage-design/references/format.md +172 -0
- package/base-template/.squadbase/skills/vantage-design/references/presets.md +110 -0
- package/base-template/.squadbase/skills/vantage-design/scripts/contrast.mjs +166 -0
- package/base-template/AGENTS.md +62 -229
- package/base-template/DESIGN.md +108 -0
- package/base-template/agents/api.md +49 -0
- package/base-template/agents/csv.md +32 -0
- package/base-template/agents/doc.md +73 -0
- package/base-template/agents/page.md +187 -0
- package/base-template/agents/slide.md +41 -0
- package/base-template/agents/xlsx.md +33 -0
- package/base-template/automations/.gitkeep +0 -0
- package/base-template/bun.lock +907 -0
- package/base-template/package.json +2 -2
- package/base-template/pipelines/pyproject.toml +5 -0
- package/base-template/squadbase.yml +1 -0
- package/base-template/src/index.tsx +53 -8
- package/dist/index.js +15 -6
- package/package.json +2 -2
- package/ui-templates/chart-grid/pages/index.tsx +1 -1
- package/ui-templates/chart-grid-ja/pages/index.tsx +1 -1
- package/ui-templates/funnel/pages/index.tsx +2 -2
- package/ui-templates/funnel-ja/pages/index.tsx +2 -2
- package/base-template/package-lock.json +0 -5767
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@squadbase/react": "^0.1.0",
|
|
15
|
-
"@squadbase/vantage": "
|
|
16
|
-
"@squadbase/vantage-sdk": "
|
|
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",
|
|
@@ -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
|
-
|
|
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((
|
|
51
|
-
<DashboardCardPreset key={title} title={title}>
|
|
52
|
-
<
|
|
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",
|
|
1029
|
-
log("dim",
|
|
1029
|
+
log("dim", ` ${packageManager} install`);
|
|
1030
|
+
log("dim", ` ${packageManager} run dev`);
|
|
1030
1031
|
return;
|
|
1031
1032
|
}
|
|
1032
|
-
log("green",
|
|
1033
|
-
|
|
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",
|
|
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",
|
|
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-
|
|
3
|
+
"version": "0.1.0-dev1.f48cfad",
|
|
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": "
|
|
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
|
|
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
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
121
|
+
icon: <TrendingDown className="size-4 text-destructive" />,
|
|
122
122
|
},
|
|
123
123
|
]
|
|
124
124
|
|