@weasel-js/forge 1.9.4 → 1.10.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 +13 -7
- package/dist/{FrameController-BQjKhdwk.d.ts → FrameController-UeTY7ubF.d.ts} +25 -1
- package/dist/{chunk-B3PPHJTS.js → chunk-AP3DRQLI.js} +16 -16
- package/dist/chunk-AP3DRQLI.js.map +1 -0
- package/dist/{chunk-MQSFPRF6.js → chunk-BIAEGWGJ.js} +37 -19
- package/dist/chunk-BIAEGWGJ.js.map +1 -0
- package/dist/{chunk-JHL4ERDA.js → chunk-DFKCLZKS.js} +3 -3
- package/dist/chunk-DFKCLZKS.js.map +1 -0
- package/dist/{chunk-FRUA5WJF.js → chunk-DKWHGSBZ.js} +3 -3
- package/dist/{chunk-FRUA5WJF.js.map → chunk-DKWHGSBZ.js.map} +1 -1
- package/dist/{chunk-ZZCCIXEJ.js → chunk-E2FHBDNQ.js} +16 -25
- package/dist/chunk-E2FHBDNQ.js.map +1 -0
- package/dist/{chunk-TXLWQFF6.js → chunk-FL2MUPUL.js} +2 -2
- package/dist/chunk-FL2MUPUL.js.map +1 -0
- package/dist/{chunk-5KI5YSQ5.js → chunk-GB6PRJET.js} +3 -3
- package/dist/{chunk-5KI5YSQ5.js.map → chunk-GB6PRJET.js.map} +1 -1
- package/dist/{chunk-HRGPFQBW.js → chunk-ZAWXMUGZ.js} +6 -3
- package/dist/chunk-ZAWXMUGZ.js.map +1 -0
- package/dist/{config-Dfu-NKxd.d.ts → config-Cz7ZyGF-.d.ts} +5 -5
- package/dist/csf/preview-api.d.ts +5 -2
- package/dist/csf/preview-api.js +2 -2
- package/dist/csf/preview-api.js.map +1 -1
- package/dist/frame/index.css +19 -2
- package/dist/frame/index.css.map +1 -1
- package/dist/frame/index.d.ts +2 -2
- package/dist/frame/index.js +5 -5
- package/dist/frame/index.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/shell/index.css +41 -5
- package/dist/shell/index.css.map +1 -1
- package/dist/shell/index.d.ts +7 -6
- package/dist/shell/index.js +537 -334
- package/dist/shell/index.js.map +1 -1
- package/dist/test/index.d.ts +1 -1
- package/dist/test/index.js +6 -6
- package/dist/test/play.d.ts +3 -5
- package/dist/test/play.js.map +1 -1
- package/dist/vite/index.d.ts +28 -1
- package/dist/vite/index.js +413 -79
- package/dist/vite/index.js.map +1 -1
- package/package.json +10 -5
- package/dist/chunk-B3PPHJTS.js.map +0 -1
- package/dist/chunk-HRGPFQBW.js.map +0 -1
- package/dist/chunk-JHL4ERDA.js.map +0 -1
- package/dist/chunk-MQSFPRF6.js.map +0 -1
- package/dist/chunk-TXLWQFF6.js.map +0 -1
- package/dist/chunk-ZZCCIXEJ.js.map +0 -1
package/dist/test/index.d.ts
CHANGED
package/dist/test/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { StoryTrial } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import { loadStories } from '../chunk-
|
|
1
|
+
import { StoryTrial } from '../chunk-E2FHBDNQ.js';
|
|
2
|
+
import '../chunk-DFKCLZKS.js';
|
|
3
|
+
import { loadStories } from '../chunk-AP3DRQLI.js';
|
|
4
4
|
import '../chunk-L5XM5VKB.js';
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-ZAWXMUGZ.js';
|
|
6
|
+
import '../chunk-GB6PRJET.js';
|
|
7
|
+
import '../chunk-FL2MUPUL.js';
|
|
8
8
|
import { withValueAtPath } from '@weasel-js/labkit/config';
|
|
9
9
|
import { useState, useEffect } from 'react';
|
|
10
10
|
import { createRoot } from 'react-dom/client';
|
package/dist/test/play.d.ts
CHANGED
|
@@ -5,12 +5,10 @@ export { default as userEvent } from '@testing-library/user-event';
|
|
|
5
5
|
/**
|
|
6
6
|
* What a CSF `play` function asserts with.
|
|
7
7
|
*
|
|
8
|
-
* A play runs in the test page beside the story
|
|
9
|
-
*
|
|
10
|
-
* cannot import `vitest`, whose entry only exists inside a test worker. This module assembles the same
|
|
8
|
+
* A play runs in the test page beside the story, so it cannot import `vitest`,
|
|
9
|
+
* whose entry only exists inside a test worker. This module assembles the same
|
|
11
10
|
* `expect` vitest hands a test: chai carrying `@vitest/expect`'s jest-style
|
|
12
|
-
* matchers.
|
|
13
|
-
* browser-only.
|
|
11
|
+
* matchers.
|
|
14
12
|
*
|
|
15
13
|
* No jest-dom matchers. They install through `expect.extend`, which wants the
|
|
16
14
|
* matcher state a test worker sets up, and there is none here — the call
|
package/dist/test/play.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test/play.ts"],"names":["expect"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"sources":["../../src/test/play.ts"],"names":["expect"],"mappings":";;;;;;AAiBK,IAAA,CAAA,GAAA,CAAI,UAAU,CAAA;AACd,IAAA,CAAA,GAAA,CAAI,cAAc,CAAA;AAClB,IAAA,CAAA,GAAA,CAAI,sBAAsB,CAAA;AAGxB,IAAMA,OAAAA,GAAc,IAAA,CAAA","file":"play.js","sourcesContent":["/**\n * What a CSF `play` function asserts with.\n *\n * A play runs in the test page beside the story, so it cannot import `vitest`,\n * whose entry only exists inside a test worker. This module assembles the same\n * `expect` vitest hands a test: chai carrying `@vitest/expect`'s jest-style\n * matchers.\n *\n * No jest-dom matchers. They install through `expect.extend`, which wants the\n * matcher state a test worker sets up, and there is none here — the call\n * throws at module scope. Assert on the DOM directly instead:\n * `expect(el.textContent).toBe(…)` for `toHaveTextContent`,\n * `expect(el).not.toBeNull()` for `toBeInTheDocument`.\n */\nimport { type ExpectStatic, JestAsymmetricMatchers, JestChaiExpect, JestExtend } from '@vitest/expect';\nimport * as chai from 'chai';\n\nchai.use(JestExtend);\nchai.use(JestChaiExpect);\nchai.use(JestAsymmetricMatchers);\n\n/** `expect`, with jest's matchers. */\nexport const expect = chai.expect as unknown as ExpectStatic;\n\nexport { screen, waitFor, within } from '@testing-library/dom';\nexport { default as userEvent } from '@testing-library/user-event';\n"]}
|
package/dist/vite/index.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
2
|
|
|
3
|
+
/** Narrows which props get a control. */
|
|
4
|
+
interface PropControlsOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Leaves out a prop declared in a file this answers true for, given the file's absolute path. Props that React's
|
|
7
|
+
* types or TypeScript's libraries declare are always left out.
|
|
8
|
+
*/
|
|
9
|
+
skip?: (declaredIn: string) => boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
3
12
|
/** Options for the `forge` vite plugin. */
|
|
4
13
|
interface ForgeOptions {
|
|
5
14
|
/** Globs of story files, relative to the vite root. */
|
|
@@ -12,6 +21,12 @@ interface ForgeOptions {
|
|
|
12
21
|
frameStyles?: string[];
|
|
13
22
|
/** Alias Storybook's runtime modules to forge shims. Default true. */
|
|
14
23
|
storybookShims?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Give a CSF story a control for each prop of its meta's `component`, read from the component's TypeScript types;
|
|
26
|
+
* the story's own `args` and `argTypes` refine them. Needs `typescript` installed. Default true; an object narrows
|
|
27
|
+
* which props are read.
|
|
28
|
+
*/
|
|
29
|
+
propControls?: boolean | PropControlsOptions;
|
|
15
30
|
}
|
|
16
31
|
/**
|
|
17
32
|
* The vite plugin that serves the workshop: it indexes the story files, serves the workshop at `/` and the frame
|
|
@@ -34,4 +49,16 @@ interface ForgeTestOptions {
|
|
|
34
49
|
*/
|
|
35
50
|
declare function forgeTest(options: ForgeTestOptions): Plugin[];
|
|
36
51
|
|
|
37
|
-
|
|
52
|
+
/** Options for the `watchProbe` vite plugin. */
|
|
53
|
+
interface WatchProbeOptions {
|
|
54
|
+
/**
|
|
55
|
+
* Answers whether the OS is reporting file changes: false makes the plugin log its warning. Called once, as the
|
|
56
|
+
* dev server starts, and not at all where the server polls or does not watch. Default: {@link fileEventsArrive},
|
|
57
|
+
* which writes a temp file and waits five seconds for the report.
|
|
58
|
+
*/
|
|
59
|
+
probe?: () => Promise<boolean>;
|
|
60
|
+
}
|
|
61
|
+
/** A plugin giving any dev server the warning forge's own gives when the OS reports no file changes. */
|
|
62
|
+
declare function watchProbe({ probe }?: WatchProbeOptions): Plugin;
|
|
63
|
+
|
|
64
|
+
export { type ForgeOptions, type ForgeTestOptions, type PropControlsOptions, type WatchProbeOptions, forge, forgeTest, watchProbe };
|