@levi-gemcommerce/analytics
v3.0.1-dev.2
Published
GemX-specific analytic components, hooks, and types — extracted from `gemx-shopify-app` so they can be shared across repos (dev / staging apps, and future consumers).
Downloads
7,731
Readme
@gem-sdk/analytic
GemX-specific analytic components, hooks, and types — extracted from gemx-shopify-app
so they can be shared across repos (dev / staging apps, and future consumers).
Migration is incremental, bottom-up: pure types and helpers first, then leaf presentational charts, then the orchestration components. We do not move the whole feature at once — each slice is moved only after its dependencies already live here.
Status
| Slice | Source in app | Status |
| --- | --- | --- |
| types/chart | app/modules/page-analytic/modules/analytic/types/chart.ts | ✅ migrated |
Extraction order (planned)
- Pure types / helpers — zero app coupling (
types/chart, chart transform helpers). - Leaf charts — depend only on
@shopify/polaris-viz+ the types above (PAFunnelChart,PALineChartTooltip,PAPercent). - Shared foundations — decide per dependency whether to extract, inject, or keep:
~/types/metric,~/core/gemxqltypes, design-system primitives. - Composite charts —
PALineChart,PACardLineChart,PADonutChart, grids. - Orchestration —
PageAnalyticDetailand providers (last; depends on everything).
Consuming from the app
The app consumes published dev versions (e.g. "@gem-sdk/analytic": "0.0.1-dev.x"),
the same way it consumes @gem-sdk/heatmap-react. After migrating a slice:
yarn build && yarn changeset # publish a dev version
# then bump the version in the app's package.json and rewire imports@shopify/polaris-viz, @shopify/polaris-viz-core, react and react-dom are
peerDependencies — provided by the consuming app, never bundled.
