Skip to content

Commit c993a84

Browse files
committed
Move storybook interaction wrapper to with-storybook package
1 parent dd85dcd commit c993a84

File tree

15 files changed

+137
-7
lines changed

15 files changed

+137
-7
lines changed

.changeset/thin-experts-ring.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@interactors/material-ui": patch
3+
"@interactors/with-storybook": patch
4+
---
5+
6+
Add Storybook addon `with-storybook` package

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"packages/keyboard",
1414
"packages/html",
1515
"packages/material-ui",
16-
"packages/with-cypress"
16+
"packages/with-cypress",
17+
"packages/with-storybook"
1718
]
1819
},
1920
"scripts": {

packages/material-ui/.storybook/main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
module.exports = {
22
stories: ["../stories/**/*.stories.@(md|ts)x"],
3-
addons: ["@storybook/addon-postcss", "@storybook/addon-essentials", '@storybook/addon-interactions'],
3+
addons: [
4+
"@storybook/addon-postcss",
5+
"@storybook/addon-essentials",
6+
"@storybook/addon-interactions",
7+
"@interactors/with-storybook",
8+
],
49
features: { previewCsfV3: true, interactionsDebugger: true },
510
core: { builder: "webpack5" },
611
typescript: { reactDocgen: false },

packages/material-ui/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
},
6767
"dependencies": {
6868
"effection": "^2.0.4",
69-
"@interactors/html": "1.0.0-rc1.2"
69+
"@interactors/html": "1.0.0-rc1.2",
70+
"@interactors/with-storybook": "1.0.0-rc1.2"
7071
}
7172
}

packages/material-ui/tsconfig.build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"types"
1111
],
1212
"references": [
13+
{ "path": "../globals/tsconfig.build.json" },
1314
{ "path": "../html/tsconfig.build.json" }
1415
]
1516
}

packages/with-storybook/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
node_modules
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# @interactors/with-storybook

packages/with-storybook/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## @interactors/with-storybook
2+
3+
[![npm](https://img.shields.io/npm/v/@interactors/with-storybook.svg)](https://www.npmjs.com/package/@interactors/with-storybook)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5+
[![Created by Frontside](https://img.shields.io/badge/created%20by-frontside-26abe8.svg)](https://frontside.com)
6+
[![Chat on Discord](https://img.shields.io/discord/700803887132704931?Label=Discord)](https://discord.gg/mv4uxxcAKd)
7+
8+
[Interactors][] are Page Objects for component libraries and design systems.
9+
This package lets you use them seamlessly within [Storybook][] interactive stories. Learn more at
10+
[https://frontside.com/interactors/docs/integrations#storybook](https://frontside.com/interactors/docs/integrations#storybook)
11+
12+
[Interactors]: https://frontside.com/interactors
13+
[Storybook]: https://storybook.js.org
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "@interactors/with-storybook",
3+
"version": "1.0.0-rc1.2",
4+
"description": "Storybook addon integration for Interactors",
5+
"main": "dist/index.js",
6+
"module": "dist/index.js",
7+
"types": "dist/index.d.ts",
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/thefrontside/interactors.git"
11+
},
12+
"homepage": "https://frontside.com/interactors",
13+
"author": "Frontside Engineering <engineering@frontside.com>",
14+
"license": "MIT",
15+
"files": [
16+
"dist/**/*",
17+
"src/**/*",
18+
"preset.js",
19+
"README.md"
20+
],
21+
"dependencies": {
22+
"@interactors/globals": "^1.0.0-rc1.1"
23+
},
24+
"peerDependencies": {
25+
"@storybook/addon-interactions": "*"
26+
},
27+
"scripts": {
28+
"clean": "rm -rf dist *.tsbuildinfo",
29+
"lint": "eslint \"src/**/*.ts\"",
30+
"prepack": "tsc --build ./tsconfig.build.json && yarn prepack:es2015 && yarn prepack:commonjs",
31+
"prepack:es2015": "tsc --project ./tsconfig.build.json --outdir dist/esm --module es2015",
32+
"prepack:commonjs": "tsc --project ./tsconfig.build.json --outdir dist/cjs --module commonjs"
33+
},
34+
"devDependencies": {
35+
"@frontside/eslint-config": "^2.1.0",
36+
"@frontside/tsconfig": "^1.2.0",
37+
"@frontside/typescript": "^1.1.1"
38+
},
39+
"volta": {
40+
"node": "14.17.5",
41+
"yarn": "1.22.11"
42+
},
43+
"keywords": ["storybook", "addons", "interactors", "testing", "debug"],
44+
"displayName": "Interactors inspector",
45+
"icon": "https://frontside.com/interactors/img/interactors-logo@4x.png"
46+
}

packages/with-storybook/preset.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
config(entry = []) {
3+
return [...entry, require.resolve('./dist/esm/wrapper')];
4+
}
5+
}

0 commit comments

Comments
 (0)