@describe-me/core 0.5.3 → 0.5.4
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 +52 -31
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -1,47 +1,68 @@
|
|
|
1
1
|
# @describe-me/core
|
|
2
2
|
|
|
3
|
-
The
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
nothing here knows about React.
|
|
3
|
+
**Your tests are your stories.** The recorder and the manifest types of
|
|
4
|
+
describe-me: living component documentation generated from the Vitest tests
|
|
5
|
+
you already have.
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
**[Read the docs](https://grzehub.github.io/describe-me/)** · open the viewer
|
|
8
|
+
of the [browser-mode example](https://grzehub.github.io/describe-me/examples/react-browser/)
|
|
9
|
+
or the [jsdom example](https://grzehub.github.io/describe-me/examples/react-jsdom/)
|
|
10
|
+
· [Limitations](https://grzehub.github.io/describe-me/limitations.html)
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
describe-me captures the DOM after each step of a test and shows the result as
|
|
13
|
+
a browsable catalog. `describe` blocks become the sidebar, each `it` is a
|
|
14
|
+
story, and each step is a frame you can scrub through. Stories cannot rot,
|
|
15
|
+
because they are tests. If one drifts from the component, CI goes red.
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```
|
|
17
|
+
Status: prototype. React 18 and 19, Vitest 4 and 5 in browser mode or jsdom,
|
|
18
|
+
static snapshots.
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
([One version for all packages](https://grzehub.github.io/describe-me/installation.html#lockstep)).
|
|
20
|
+
## Which package do I need
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
| Package | What it is | Install it |
|
|
23
|
+
| --------------------- | ------------------------------------------- | ----------------------- |
|
|
24
|
+
| `describe-me` | the viewer and the `describe-me` CLI | yes |
|
|
25
|
+
| `@describe-me/vitest` | the Vitest plugin, setup files and reporter | yes |
|
|
26
|
+
| `@describe-me/react` | `render` functions that record frames | yes |
|
|
27
|
+
| `@describe-me/core` | the recorder and the manifest types (this) | no, the others bring it |
|
|
21
28
|
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
## Quick start
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
pnpm add -D describe-me @describe-me/vitest @describe-me/react
|
|
33
|
+
```
|
|
24
34
|
|
|
25
35
|
```ts
|
|
26
|
-
|
|
36
|
+
// vitest.config.ts
|
|
37
|
+
import { describeMe } from '@describe-me/vitest/plugin'
|
|
27
38
|
|
|
28
|
-
|
|
39
|
+
export default defineConfig({
|
|
40
|
+
plugins: [react(), describeMe()],
|
|
41
|
+
test: { environment: 'jsdom' }, // or your browser-mode settings
|
|
42
|
+
})
|
|
29
43
|
```
|
|
30
44
|
|
|
31
|
-
|
|
32
|
-
|
|
45
|
+
Run your tests, then `describe-me dev` opens the viewer.
|
|
46
|
+
[Getting started](https://grzehub.github.io/describe-me/getting-started.html)
|
|
47
|
+
walks through both environments. Keep all describe-me packages on one version
|
|
48
|
+
([why](https://grzehub.github.io/describe-me/installation.html#lockstep)).
|
|
49
|
+
|
|
50
|
+
## This package
|
|
51
|
+
|
|
52
|
+
The framework-agnostic heart of describe-me. Snapshots are serialized DOM via
|
|
53
|
+
`rrweb-snapshot`, so nothing here knows about React. You need it directly only
|
|
54
|
+
to write an adapter for another framework or to read the output yourself.
|
|
55
|
+
|
|
56
|
+
| Entry point | What it holds |
|
|
57
|
+
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
|
|
58
|
+
| [`@describe-me/core`](https://grzehub.github.io/describe-me/api.html#entry-core) | `step()`, `recorder` and `elementLabel()`, for adapters |
|
|
59
|
+
| [`@describe-me/core/types`](https://grzehub.github.io/describe-me/api.html#entry-core-types) | the types of `.describe-me/manifest.json` |
|
|
60
|
+
| [`@describe-me/core/diagnostics`](https://grzehub.github.io/describe-me/api.html#entry-core-diagnostics) | what a manifest could not document |
|
|
61
|
+
| [`@describe-me/core/css-references`](https://grzehub.github.io/describe-me/api.html#entry-core-css-references) | the `url()` and `@import` references in CSS text |
|
|
33
62
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
pass `recorder.generation`, read when the interaction began, so a capture that
|
|
37
|
-
outlives its test is dropped. `recorder.flush()` waits for the captures in
|
|
38
|
-
flight and takes a deferred render frame.
|
|
63
|
+
[How it works](https://grzehub.github.io/describe-me/how-it-works.html) explains
|
|
64
|
+
the recorder and the output directory.
|
|
39
65
|
|
|
40
|
-
|
|
41
|
-
read `.describe-me/manifest.json` themselves. Stored snapshots point into
|
|
42
|
-
`assets/` and `styles/` through `ASSET_URL_PREFIX` and `STYLE_URL_PREFIX`
|
|
43
|
-
([The output directory](https://grzehub.github.io/describe-me/how-it-works.html#storage) in
|
|
44
|
-
the docs). `@describe-me/core/css-references` lists the `url()` and
|
|
45
|
-
`@import` references in CSS text.
|
|
66
|
+
## License
|
|
46
67
|
|
|
47
|
-
|
|
68
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@describe-me/core",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.5.4",
|
|
4
|
+
"description": "Living component documentation from your Vitest tests: the recorder and manifest types of describe-me",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vitest",
|
|
7
|
+
"react",
|
|
7
8
|
"storybook",
|
|
9
|
+
"storybook alternative",
|
|
8
10
|
"component documentation",
|
|
9
|
-
"
|
|
11
|
+
"living documentation",
|
|
12
|
+
"jsdom",
|
|
10
13
|
"testing"
|
|
11
14
|
],
|
|
12
15
|
"license": "MIT",
|