@open-tomato/charts 0.1.0 → 0.1.1
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 +33 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,8 @@ ECharts 6 behind it, the names of the theme tokens it reads, formatters,
|
|
|
5
5
|
and a headless engine subpath that draws a chart to SVG with no React and
|
|
6
6
|
no DOM. Other projects consume it on its own; `@open-tomato/atlas-ui`
|
|
7
7
|
builds Atlas's cards on it. The consuming app brings the token values;
|
|
8
|
-
|
|
8
|
+
the Atlas demo in the open-tomato/rafa repository is the reference
|
|
9
|
+
consumer.
|
|
9
10
|
|
|
10
11
|
## Layout
|
|
11
12
|
|
|
@@ -150,11 +151,12 @@ The `Engine/Formats` stories draw one series under each kind.
|
|
|
150
151
|
`cn(chartRootVariants({ cursor }), className)`. `cn` (`src/lib/cn.ts`)
|
|
151
152
|
is clsx plus tailwind-merge, so the later class wins a conflict.
|
|
152
153
|
- No inline `style`, and no class string written on an element. The lint
|
|
153
|
-
rule
|
|
154
|
-
allows a `className` value only as a
|
|
155
|
-
variants calls and the passthrough, or
|
|
156
|
-
tests are exempt.
|
|
157
|
-
- The
|
|
154
|
+
rule `@open-tomato/cva-only-classname` (in
|
|
155
|
+
`@open-tomato/eslint-config/cva`) allows a `className` value only as a
|
|
156
|
+
variants call, a `cn(...)` over variants calls and the passthrough, or
|
|
157
|
+
the passthrough alone. Stories and tests are exempt.
|
|
158
|
+
- The package compiles with `isolatedDeclarations` (from
|
|
159
|
+
`@open-tomato/typescript-config`), so an exported `cva` call
|
|
158
160
|
carries an explicit function type, as `chartRootVariants` does.
|
|
159
161
|
|
|
160
162
|
## Theming
|
|
@@ -168,20 +170,21 @@ Tailwind v4 colour token, so `--color-series-1` is also `bg-series-1`.
|
|
|
168
170
|
The consuming app defines every name: light values in its Tailwind
|
|
169
171
|
`@theme` block, the dark re-step under `:root[data-theme="dark"]`, and
|
|
170
172
|
`@custom-variant dark` on that attribute. Dark mode is
|
|
171
|
-
`data-theme="dark"` on `<html>`.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
`data-theme="dark"` on `<html>`. This package's `.storybook/theme.css`
|
|
174
|
+
and the Atlas demo's `src/styles.css` hold the reference set, and the
|
|
175
|
+
demo's test holds it to the names listed here. The app's stylesheet
|
|
176
|
+
adds `@source` for this package's files so Tailwind generates the
|
|
177
|
+
classes the components use. Canvas cannot read CSS variables, so the
|
|
178
|
+
React engine reads the tokens from the computed style
|
|
176
179
|
(`useResolvedTokens`) and re-reads them on a theme flip.
|
|
177
180
|
|
|
178
181
|
## Stories
|
|
179
182
|
|
|
180
183
|
Storybook 10 on `@storybook/react-vite`. Vite is Storybook's own builder
|
|
181
|
-
and appears nowhere else: the package builds with `bun build
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
Its `theme` toolbar global sets `data-theme` on the document.
|
|
184
|
+
and appears nowhere else: the package builds with `bun build`.
|
|
185
|
+
`.storybook/preview.ts` imports `.storybook/theme.css`, the token values
|
|
186
|
+
in light and dark, which Tailwind compiles there, so no story imports
|
|
187
|
+
tokens. Its `theme` toolbar global sets `data-theme` on the document.
|
|
185
188
|
|
|
186
189
|
- A story sits beside its component as `{C}.stories.tsx`.
|
|
187
190
|
- The header is `import type { Meta, StoryObj } from '@storybook/react-vite'`,
|
|
@@ -213,8 +216,8 @@ each test. Component tests use `@testing-library/react`.
|
|
|
213
216
|
- The headless engine is tested by drawing: a line chart and a radar to
|
|
214
217
|
SVG, the same string twice, a bundle of the entry with no React import,
|
|
215
218
|
and a drawing in a child process with no DOM.
|
|
216
|
-
-
|
|
217
|
-
`
|
|
219
|
+
- Run the tests from this folder, so `bun test` reads this folder's
|
|
220
|
+
`bunfig.toml` and its preload.
|
|
218
221
|
|
|
219
222
|
## Visual regression
|
|
220
223
|
|
|
@@ -232,8 +235,9 @@ A machine only ever compares against baselines it wrote:
|
|
|
232
235
|
CI runs no visual gate yet, because baselines have no durable store there.
|
|
233
236
|
The suite's file is `stories.visual.ts`, never `.spec.ts`, so `bun test`
|
|
234
237
|
never picks it up. Playwright is pinned to an exact version, since a new
|
|
235
|
-
Chromium moves pixels. The suite serves on port 6016
|
|
236
|
-
serves on 6017, so the two can
|
|
238
|
+
Chromium moves pixels. The suite serves on port 6016, and
|
|
239
|
+
`@open-tomato/atlas-ui`'s suite in rafa serves on 6017, so the two can
|
|
240
|
+
run at once.
|
|
237
241
|
|
|
238
242
|
## Gate order
|
|
239
243
|
|
|
@@ -249,8 +253,10 @@ bun run check:stories # every story, light and dark, no console or page erro
|
|
|
249
253
|
bun run test:visual # local only, against this machine's baselines
|
|
250
254
|
```
|
|
251
255
|
|
|
252
|
-
CI's `
|
|
253
|
-
|
|
256
|
+
CI's `verify` job (`.github/workflows/verify.yml`) runs this package's
|
|
257
|
+
`check-types` and `lint`, through the root's `check-types:all` and
|
|
258
|
+
`lint:all`. The tests, the build and the Storybook gates run locally for
|
|
259
|
+
now.
|
|
254
260
|
|
|
255
261
|
## Publish shape
|
|
256
262
|
|
|
@@ -270,15 +276,12 @@ on `ubuntu-latest`, as one matrix leg per package.
|
|
|
270
276
|
- `publishConfig` names npmjs for the registry and for the
|
|
271
277
|
`@open-tomato` scope, and `access: public`.
|
|
272
278
|
- Peer: `react` ^19. Dependencies: `echarts`, `class-variance-authority`,
|
|
273
|
-
`clsx`, `tailwind-merge` and `zod`, all from the public npm registry
|
|
274
|
-
dependency on a private
|
|
275
|
-
for a publishable member.
|
|
279
|
+
`clsx`, `tailwind-merge` and `zod`, all from the public npm registry,
|
|
280
|
+
and no dependency on a private package.
|
|
276
281
|
|
|
277
282
|
## Privacy
|
|
278
283
|
|
|
279
|
-
This package is public. No tracked file
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
the banned lowercase terms, so the terms never appear in it, and its
|
|
284
|
-
header gives the one-line command that prints the hash of a new term.
|
|
284
|
+
This package is public. No tracked file in it names a host, a home path,
|
|
285
|
+
an IP, a LAN name, a private registry, a self-hosted runner or a private
|
|
286
|
+
repository. The repository's privacy gate (`bun run gate:privacy`, and
|
|
287
|
+
`gate:privacy:history` in CI) enforces it over every file here.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tomato/charts",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "React 19 charting for the @open-tomato scope: a chart-engine seam over ECharts 6, the theme token names, formatters, and a headless engine subpath.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"openTomato": {
|