Skip to content

Commit 05d9bed

Browse files
committed
test: prepare storybook skeleton
Signed-off-by: Andres Correa Casablanca <castarco@coderspirit.xyz>
1 parent f447421 commit 05d9bed

File tree

5 files changed

+8189
-1261
lines changed

5 files changed

+8189
-1261
lines changed

.storybook/main.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { StorybookConfig } from "@storybook/react-vite";
2+
3+
const config: StorybookConfig = {
4+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
5+
addons: [
6+
"@storybook/addon-links",
7+
"@storybook/addon-essentials",
8+
"@storybook/addon-onboarding",
9+
"@storybook/addon-interactions",
10+
],
11+
framework: {
12+
name: "@storybook/react-vite",
13+
options: {},
14+
},
15+
docs: {
16+
autodocs: "tag",
17+
},
18+
};
19+
export default config;

.storybook/preview.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { Preview } from "@storybook/react";
2+
3+
const preview: Preview = {
4+
parameters: {
5+
actions: { argTypesRegex: "^on[A-Z].*" },
6+
controls: {
7+
matchers: {
8+
color: /(background|color)$/i,
9+
date: /Date$/,
10+
},
11+
},
12+
},
13+
};
14+
15+
export default preview;

package.json

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "@beautiful-tree/react",
33
"version": "0.0.1",
4-
"private": false,
4+
"private": false,
55
"author": "Andres Correa Casablanca <castarco@coderspirit.xyz>",
66
"license": "MIT",
7-
"main": "./dist/beautiful-tree.cjs",
8-
"module": "./dist/beautiful-tree.mjs",
7+
"main": "./dist/beautiful-tree.cjs",
8+
"module": "./dist/beautiful-tree.mjs",
99
"exports": {
1010
".": {
1111
"types": "./dist/beautiful-tree.d.ts",
@@ -27,34 +27,51 @@
2727
],
2828
"scripts": {
2929
"build": "rollup --config rollup.config.prod.mjs",
30+
"build-storybook": "storybook build",
3031
"install-githooks": "if [ -d .git ]; then git config core.hooksPath .hooks; fi",
3132
"lint": "tsc && eslint . --ext ts,mts,tsx --report-unused-disable-directives --max-warnings 0",
3233
"lint:eslint": "eslint . --ext ts,mts,tsx --report-unused-disable-directives --max-warnings 0",
33-
"lint:tsc": "tsc"
34+
"lint:tsc": "tsc",
35+
"storybook": "storybook dev -p 6006",
36+
"test": "vitest run",
37+
"test:coverage": "vitest run --coverage",
38+
"test:watch": "vitest"
3439
},
3540
"devDependencies": {
3641
"@rollup/plugin-commonjs": "^25.0.4",
3742
"@rollup/plugin-node-resolve": "^15.1.0",
3843
"@rollup/plugin-terser": "^0.4.3",
3944
"@rollup/plugin-typescript": "^11.1.2",
45+
"@storybook/addon-essentials": "^7.2.3",
46+
"@storybook/addon-interactions": "^7.2.3",
47+
"@storybook/addon-links": "^7.2.3",
48+
"@storybook/addon-onboarding": "^1.0.8",
49+
"@storybook/blocks": "^7.2.3",
50+
"@storybook/react": "^7.2.3",
51+
"@storybook/react-vite": "^7.2.3",
52+
"@storybook/testing-library": "^0.2.0",
4053
"@types/node": "^20.4.10",
4154
"@types/react": "^18.2.20",
4255
"@types/react-dom": "^18.2.7",
4356
"@typescript-eslint/eslint-plugin": "^6.3.0",
4457
"@typescript-eslint/parser": "^6.3.0",
58+
"@vitest/coverage-v8": "^0.34.1",
4559
"eslint": "^8.47.0",
4660
"eslint-config-prettier": "^9.0.0",
4761
"eslint-plugin-prettier": "^5.0.0",
4862
"eslint-plugin-react": "^7.33.1",
4963
"eslint-plugin-react-hooks": "^4.6.0",
5064
"eslint-plugin-react-refresh": "^0.4.3",
65+
"eslint-plugin-storybook": "^0.6.13",
5166
"prettier": "^3.0.1",
5267
"publint": "^0.2.0",
5368
"react": "^18.2.0",
5469
"react-dom": "^18.2.0",
5570
"rollup": "^3.28.0",
5671
"rollup-plugin-dts": "^5.3.1",
57-
"typescript": "^5.1.6"
72+
"storybook": "^7.2.3",
73+
"typescript": "^5.1.6",
74+
"vitest": "^0.34.1"
5875
},
5976
"peerDependencies": {
6077
"react": "^18.2.0",

0 commit comments

Comments
 (0)