@strictly/storybook 0.0.41 → 0.0.42
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/dist/index.cjs +3 -6
- package/dist/index.js +3 -6
- package/dist/main.cjs +1 -2
- package/dist/main.js +1 -2
- package/package.json +50 -49
package/dist/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
7
7
|
require("@mantine/core/styles.css");
|
|
8
8
|
let _mantine_core = require("@mantine/core");
|
|
9
9
|
let mobx = require("mobx");
|
|
10
|
-
|
|
10
|
+
// src/expect.ts
|
|
11
11
|
function expectEquals(v1, v2) {
|
|
12
12
|
(0, storybook_test.expect)(v1).toEqual(v2);
|
|
13
13
|
}
|
|
@@ -33,8 +33,7 @@ async function expectPendingPromise(p, timeoutMilliseconds = 500) {
|
|
|
33
33
|
const state = await Promise.race([p.then(() => "fulfilled", () => "rejected"), pendingAfter(timeoutMilliseconds)]);
|
|
34
34
|
await (0, storybook_test.expect)(state).toBe("pending");
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
//#region src/LinguiProvider.tsx
|
|
36
|
+
// src/LinguiProvider.tsx
|
|
38
37
|
function StorybookLinguiProvider({ children, localeMessages, labelsToLocales, locale = "en" }) {
|
|
39
38
|
(0, react.useEffect)(() => {
|
|
40
39
|
const messages = localeMessages[locale] ?? localeMessages[labelsToLocales[locale]];
|
|
@@ -53,8 +52,7 @@ function StorybookLinguiProvider({ children, localeMessages, labelsToLocales, lo
|
|
|
53
52
|
children
|
|
54
53
|
});
|
|
55
54
|
}
|
|
56
|
-
|
|
57
|
-
//#region src/preview.tsx
|
|
55
|
+
// src/preview.tsx
|
|
58
56
|
/**
|
|
59
57
|
* Creates the storybook preview configuration for a package. Every story renders inside mantine and strict mode.
|
|
60
58
|
* Storybook applies decorators innermost first, so the supplied decorators run inside the shared providers.
|
|
@@ -80,7 +78,6 @@ function createStorybookPreview({ args, argTypes, decorators = [] }) {
|
|
|
80
78
|
}]
|
|
81
79
|
};
|
|
82
80
|
}
|
|
83
|
-
//#endregion
|
|
84
81
|
exports.StorybookLinguiProvider = StorybookLinguiProvider;
|
|
85
82
|
exports.createStorybookPreview = createStorybookPreview;
|
|
86
83
|
exports.expectDefined = expectDefined;
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
6
6
|
import "@mantine/core/styles.css";
|
|
7
7
|
import { MantineProvider } from "@mantine/core";
|
|
8
8
|
import { configure } from "mobx";
|
|
9
|
-
|
|
9
|
+
// src/expect.ts
|
|
10
10
|
function expectEquals(v1, v2) {
|
|
11
11
|
expect(v1).toEqual(v2);
|
|
12
12
|
}
|
|
@@ -32,8 +32,7 @@ async function expectPendingPromise(p, timeoutMilliseconds = 500) {
|
|
|
32
32
|
const state = await Promise.race([p.then(() => "fulfilled", () => "rejected"), pendingAfter(timeoutMilliseconds)]);
|
|
33
33
|
await expect(state).toBe("pending");
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
//#region src/LinguiProvider.tsx
|
|
35
|
+
// src/LinguiProvider.tsx
|
|
37
36
|
function StorybookLinguiProvider({ children, localeMessages, labelsToLocales, locale = "en" }) {
|
|
38
37
|
useEffect(() => {
|
|
39
38
|
const messages = localeMessages[locale] ?? localeMessages[labelsToLocales[locale]];
|
|
@@ -52,8 +51,7 @@ function StorybookLinguiProvider({ children, localeMessages, labelsToLocales, lo
|
|
|
52
51
|
children
|
|
53
52
|
});
|
|
54
53
|
}
|
|
55
|
-
|
|
56
|
-
//#region src/preview.tsx
|
|
54
|
+
// src/preview.tsx
|
|
57
55
|
/**
|
|
58
56
|
* Creates the storybook preview configuration for a package. Every story renders inside mantine and strict mode.
|
|
59
57
|
* Storybook applies decorators innermost first, so the supplied decorators run inside the shared providers.
|
|
@@ -79,5 +77,4 @@ function createStorybookPreview({ args, argTypes, decorators = [] }) {
|
|
|
79
77
|
}]
|
|
80
78
|
};
|
|
81
79
|
}
|
|
82
|
-
//#endregion
|
|
83
80
|
export { StorybookLinguiProvider, createStorybookPreview, expectDefined, expectDefinedAndReturn, expectEquals, expectInstanceOf, expectPendingPromise, expectTruthy };
|
package/dist/main.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let node_path = require("node:path");
|
|
3
|
-
|
|
3
|
+
// src/main.ts
|
|
4
4
|
var hiddenSegmentPattern = new RegExp(`/(?:${["specs"].join("|")})(?=/|$)`, "g");
|
|
5
5
|
/**
|
|
6
6
|
* Creates the storybook main configuration for a package. The caller must pass its own `require` so packages resolve
|
|
@@ -36,5 +36,4 @@ function createStorybookMainConfig(require$1, { stories = ["../**/*.stories.@(ts
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
//#endregion
|
|
40
39
|
exports.createStorybookMainConfig = createStorybookMainConfig;
|
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { dirname, join } from "node:path";
|
|
2
|
-
|
|
2
|
+
// src/main.ts
|
|
3
3
|
var hiddenSegmentPattern = new RegExp(`/(?:${["specs"].join("|")})(?=/|$)`, "g");
|
|
4
4
|
/**
|
|
5
5
|
* Creates the storybook main configuration for a package. The caller must pass its own `require` so packages resolve
|
|
@@ -35,5 +35,4 @@ function createStorybookMainConfig(require, { stories = ["../**/*.stories.@(ts|t
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
//#endregion
|
|
39
38
|
export { createStorybookMainConfig };
|
package/package.json
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"name": "@strictly/storybook",
|
|
3
|
+
"version": "0.0.42",
|
|
3
4
|
"description": "Storybook configuration and assertion helpers for React, Mantine, MobX and Lingui",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"@types/react-dom": "^19.3.0",
|
|
15
|
-
"mobx": "^7.0.0",
|
|
16
|
-
"react": "^19.2.0",
|
|
17
|
-
"react-dom": "^19.2.0",
|
|
18
|
-
"storybook": "^10.6.0",
|
|
19
|
-
"vite-plus": "1.0.0",
|
|
20
|
-
"@strictly/typescript": "0.0.41",
|
|
21
|
-
"@strictly/vite": "0.0.41"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"storybook"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/madmaw/strictly/tree/main/support/storybook",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"author": "Chris <chris.glover@gmail.com> (@madmaw)",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/madmaw/strictly.git",
|
|
14
|
+
"directory": "support/storybook"
|
|
22
15
|
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"main": "./dist/index.js",
|
|
23
21
|
"exports": {
|
|
24
22
|
".": {
|
|
25
23
|
"import": {
|
|
@@ -42,43 +40,46 @@
|
|
|
42
40
|
}
|
|
43
41
|
}
|
|
44
42
|
},
|
|
45
|
-
"files": [
|
|
46
|
-
"dist"
|
|
47
|
-
],
|
|
48
|
-
"homepage": "https://github.com/madmaw/strictly/tree/main/support/storybook",
|
|
49
|
-
"keywords": [
|
|
50
|
-
"storybook"
|
|
51
|
-
],
|
|
52
|
-
"license": "MIT",
|
|
53
|
-
"main": "./dist/index.js",
|
|
54
|
-
"name": "@strictly/storybook",
|
|
55
|
-
"peerDependencies": {
|
|
56
|
-
"@chromatic-com/storybook": "^5.3.1",
|
|
57
|
-
"@lingui/core": "^6.8.0",
|
|
58
|
-
"@lingui/react": "^6.8.0",
|
|
59
|
-
"@mantine/core": "^9.0.0",
|
|
60
|
-
"@storybook/addon-docs": "^10.6.0",
|
|
61
|
-
"@storybook/addon-links": "^10.6.0",
|
|
62
|
-
"@storybook/react-vite": "^10.6.0",
|
|
63
|
-
"mobx": "^7.0.0",
|
|
64
|
-
"react": "^19.2.0",
|
|
65
|
-
"react-dom": "^19.2.0",
|
|
66
|
-
"storybook": "^10.6.0"
|
|
67
|
-
},
|
|
68
43
|
"publishConfig": {
|
|
69
44
|
"access": "public"
|
|
70
45
|
},
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@chromatic-com/storybook": "^5.5.1",
|
|
48
|
+
"@lingui/core": "^6.9.1",
|
|
49
|
+
"@lingui/react": "^6.9.1",
|
|
50
|
+
"@mantine/core": "^9.7.2",
|
|
51
|
+
"@storybook/addon-docs": "^10.6.2",
|
|
52
|
+
"@storybook/addon-links": "^10.6.2",
|
|
53
|
+
"@storybook/react-vite": "^10.6.2",
|
|
54
|
+
"@types/node": "^26.6.5",
|
|
55
|
+
"@types/react": "^19.3.0",
|
|
56
|
+
"@types/react-dom": "^19.3.0",
|
|
57
|
+
"mobx": "^7.0.6",
|
|
58
|
+
"react": "^19.3.1",
|
|
59
|
+
"react-dom": "^19.3.1",
|
|
60
|
+
"storybook": "^10.6.2",
|
|
61
|
+
"vite-plus": "1.4.0",
|
|
62
|
+
"@strictly/vite": "0.0.42",
|
|
63
|
+
"@strictly/typescript": "0.0.42"
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"@chromatic-com/storybook": "^5.5.1",
|
|
67
|
+
"@lingui/core": "^6.9.1",
|
|
68
|
+
"@lingui/react": "^6.9.1",
|
|
69
|
+
"@mantine/core": "^9.7.2",
|
|
70
|
+
"@storybook/addon-docs": "^10.6.2",
|
|
71
|
+
"@storybook/addon-links": "^10.6.2",
|
|
72
|
+
"@storybook/react-vite": "^10.6.2",
|
|
73
|
+
"mobx": "^7.0.6",
|
|
74
|
+
"react": "^19.3.1",
|
|
75
|
+
"react-dom": "^19.3.1",
|
|
76
|
+
"storybook": "^10.6.2"
|
|
75
77
|
},
|
|
76
|
-
"type": "module",
|
|
77
|
-
"version": "0.0.41",
|
|
78
78
|
"scripts": {
|
|
79
79
|
"build": "vp build --configLoader runner",
|
|
80
80
|
"check-types": "tsc -b",
|
|
81
|
-
"clean": "del-cli dist .out"
|
|
81
|
+
"clean": "del-cli dist .out",
|
|
82
|
+
"version:patch": "npm version patch --no-git-tag-version"
|
|
82
83
|
},
|
|
83
84
|
"types": "./dist/index.d.ts"
|
|
84
85
|
}
|