Adds @magpie-community/page-usage-board: a usage dashboard page with its own zero-dependency local service (quota cards with expiry tiers, TTFT, 7x24 heatmap, optional remote attribution). Reviewed at 8ca2562: the author's 80137b0 plus a maintainer merge of main (registry entry re-appended after upstream's newer packages). Since the 6b2625d review: [::1] in MAGPIE_ADDR stays IPv6 loopback (only 0.0.0.0/[::] map to 127.0.0.1), the config-dir test compares real paths so it passes on macOS, and the registry-block test tolerates CRLF. Run on mote at 8ca2562: packages/page-usage-board `bun test` 36 pass, `node --test test/*.test.mjs` 36 pass; `bun scripts/check.mjs` all ok. Not tried this round: the page in a live magpie window.
25 lines
1.2 KiB
JavaScript
25 lines
1.2 KiB
JavaScript
// 定制构建入口:只包含看板用到的图表与组件(见第四轮瘦身分析)。
|
|
// 重建命令:npx esbuild build/echarts-entry.mjs --bundle --minify --global-name=echarts
|
|
// --outfile=static/echarts.min.js
|
|
// 页面通过全局 echarts.init(...) 使用;新增图表类型时在此补 import 并重建。
|
|
import * as echarts from 'echarts/core';
|
|
import { BarChart, LineChart, PieChart, HeatmapChart } from 'echarts/charts';
|
|
import {
|
|
TooltipComponent, LegendComponent, GridComponent, DataZoomComponent,
|
|
DataZoomInsideComponent, DataZoomSliderComponent, VisualMapComponent,
|
|
AxisPointerComponent,
|
|
} from 'echarts/components';
|
|
import { CanvasRenderer } from 'echarts/renderers';
|
|
|
|
echarts.use([
|
|
BarChart, LineChart, PieChart, HeatmapChart,
|
|
TooltipComponent, LegendComponent, GridComponent, DataZoomComponent,
|
|
DataZoomInsideComponent, DataZoomSliderComponent, VisualMapComponent,
|
|
AxisPointerComponent, CanvasRenderer,
|
|
]);
|
|
|
|
// 页面通过全局 echarts.init(...) 使用;--global-name 的 iife 会把 default export
|
|
// 嵌套进 .default,这里直接赋值保证 window.echarts 就是完整命名空间
|
|
if (typeof window !== 'undefined') window.echarts = echarts;
|
|
export default echarts;
|