Skip to content

Commit 4e0207c

Browse files
authored
Merge pull request #107 from buggregator/issue/#38-update-storybook-version
Issue/#38 update storybook version
2 parents 2e63006 + c378431 commit 4e0207c

File tree

81 files changed

+4532
-7480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+4532
-7480
lines changed

.eslintrc.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"plugin:@typescript-eslint/eslint-recommended",
1010
"prettier",
1111
"plugin:nuxt/recommended",
12-
"plugin:@conarti/feature-sliced/recommended"
12+
"plugin:@conarti/feature-sliced/recommended",
13+
"plugin:storybook/recommended"
1314
],
1415
"parser": "vue-eslint-parser",
1516
"plugins": ["@typescript-eslint"],
@@ -31,7 +32,12 @@
3132
},
3233
"rules": {
3334
"import/prefer-default-export": "off",
34-
"no-console": ["error", { "allow": ["info", "warn", "error"] }],
35+
"no-console": [
36+
"error",
37+
{
38+
"allow": ["info", "warn", "error"]
39+
}
40+
],
3541
"vue/component-name-in-template-casing": [
3642
"error",
3743
"PascalCase",

.github/workflows/test-build-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
- run: yarn install
2828
- run: yarn lint
2929
- run: yarn test
30-
- run: yarn build
30+
- run: yarn generate

.storybook/main.ts

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
const fs = require("fs");
22
const path = require('path');
3-
const postcss = require('postcss');
43

54
//storybook-tailwind-dark-mode
6-
module.exports = {
5+
const config = {
76
stories: [
87
"../stories/**/*.stories.mdx",
98
"../stories/**/*.stories.@(js|jsx|ts|tsx)",
@@ -12,61 +11,19 @@ module.exports = {
1211
"../pages/**/*.stories.@(js|jsx|ts|tsx)",
1312
"../src/**/**/**/*.stories.@(js|jsx|ts|tsx)",
1413
],
14+
1515
addons: [
1616
"@storybook/addon-links",
1717
"@storybook/addon-essentials",
1818
"@storybook/addon-interactions",
1919
"storybook-addon-themes",
20-
{
21-
name: "@storybook/addon-postcss",
22-
options: {
23-
cssLoaderOptions: {
24-
importLoaders: 1,
25-
},
26-
postcssLoaderOptions: {
27-
implementation: postcss,
28-
},
29-
},
30-
},
3120
],
32-
core: {
33-
builder: "@storybook/builder-vite",
34-
},
35-
framework: "@storybook/vue3",
36-
async viteFinal(config) {
37-
config.resolve.alias = {
38-
...config.resolve.alias,
39-
'@': path.resolve(__dirname, "../"),
40-
'~': path.resolve(__dirname, "../"),
41-
'#app': path.resolve(
42-
__dirname,
43-
'../node_modules/nuxt/dist/app'
44-
),
45-
'#head': path.resolve(
46-
__dirname,
47-
'../node_modules/nuxt/dist/head/runtime'
48-
),
49-
'#build': path.resolve(
50-
__dirname,
51-
'../.nuxt'
52-
),
53-
"#imports": [
54-
".nuxt/imports"
55-
],
56-
"#components": path.resolve(
57-
__dirname,
58-
'../.nuxt/components'
59-
),
60-
};
6121

62-
return {
63-
...config,
64-
define: {
65-
...config.define,
66-
global: "window",
67-
},
68-
};
22+
framework: {
23+
name: "@storybook-vue/nuxt",
24+
options: {}
6925
},
26+
7027
env: (config) => {
7128
const iconComponentFolder = path.resolve(__dirname, '../src/shared/ui/icon-svg/icon-svg-originals');
7229
const allIconNamesList = !fs.existsSync(iconComponentFolder)
@@ -83,4 +40,7 @@ module.exports = {
8340
...config,
8441
STORYBOOK_ICON_SVG_NAMES: allIconNamesList,
8542
}},
43+
8644
};
45+
46+
export default config;

.storybook/preview.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import {createPinia} from 'pinia';
2-
import {addParameters, app} from '@storybook/vue3';
2+
import { setup } from '@storybook/vue3';
33
import "../assets/index.css";
4-
import "../assets/index";
4+
import "../assets/vendor";
55
import "./stories.css"
6-
import SfdumpWrap from "~/src/shared/lib/vendor/dumper";
6+
import SfdumpWrap from "../src/shared/lib/vendor/dumper";
7+
import 'tailwindcss/tailwind.css'
78

8-
addParameters({
9+
export const parameters = {
910
actions: {argTypesRegex: "^on[A-Z].*"},
1011
controls: {
1112
matchers: {
@@ -29,13 +30,15 @@ addParameters({
2930
color: '#333333'
3031
}
3132
]
32-
}
33-
})
33+
},
34+
};
3435

3536

3637
const pinia = createPinia();
3738

38-
app.use(pinia);
39+
setup((app) => {
40+
app.use(pinia)
41+
})
3942

4043
declare global {
4144
interface Window {

.storybook/stories.css

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1-
.sb-show-main.sb-main-padded {
2-
padding: 0;
1+
html {
2+
position: relative;
3+
}
4+
5+
html:before {
6+
display: block;
7+
content: "";
8+
position: fixed;
9+
top: 0;
10+
right: 0;
11+
bottom: 0;
12+
left: 0;
13+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAK0lEQVQ4y2P8//8/A25w7949PLJMDBSAUc0jQzML/jSkpKQ0GmCjminRDADJNQjBr5nbigAAAABJRU5ErkJggg==");
14+
background-repeat: repeat;
15+
background-position: 0 0;
16+
opacity: 0.2;
17+
z-index: -1;
318
}

layouts/default.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ export default defineComponent({
4545
? `v${apiVersion}`
4646
: `@${apiVersion}`,
4747
clientVersion:
48-
!$config?.version || $config.version === "0.0.1"
48+
!$config?.public?.version || $config.public.version === "0.0.1"
4949
? "@dev"
50-
: `v${$config.version}`,
50+
: `v${$config.public.version}`,
5151
};
5252
}
5353

nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default defineNuxtConfig({
4848
],
4949
modules: [
5050
'@nuxtjs/tailwindcss',
51-
'@pinia/nuxt'
51+
'@pinia/nuxt',
5252
],
5353
typescript: {
5454
strict: true,

package.json

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"scripts": {
55
"dev": "nuxi dev",
66
"build": "nuxi build",
7-
"sb": "NODE_OPTIONS=--openssl-legacy-provider start-storybook -p 6006",
7+
"sb": "storybook dev -p 6006",
88
"generate": "nuxi generate",
99
"preview": "nuxi preview",
1010
"postinstall": "nuxi prepare",
@@ -33,11 +33,11 @@
3333
"@conarti/eslint-plugin-feature-sliced": "^1.0.5",
3434
"@nuxtjs/eslint-config-typescript": "^12.0.0",
3535
"@nuxtjs/tailwindcss": "^6.2.0",
36-
"@storybook/addon-essentials": "^6.5.15",
37-
"@storybook/addon-interactions": "^6.5.15",
38-
"@storybook/addon-links": "^6.5.15",
39-
"@storybook/addon-postcss": "^2.0.0",
40-
"@storybook/builder-vite": "^0.3.0",
36+
"@storybook-vue/nuxt": "^0.2.0",
37+
"@storybook/addon-essentials": "^7.6.5",
38+
"@storybook/addon-interactions": "^7.6.5",
39+
"@storybook/addon-links": "^7.6.5",
40+
"@storybook/vue3-vite": "^7.6.5",
4141
"@types/cytoscape-dagre": "^2.3.1",
4242
"@types/downloadjs": "^1.4.3",
4343
"@types/lodash.debounce": "^4.0.7",
@@ -51,13 +51,18 @@
5151
"eslint-config-prettier": "^8.6.0",
5252
"eslint-plugin-import": "^2.29.0",
5353
"eslint-plugin-nuxt": "^4.0.0",
54+
"eslint-plugin-storybook": "^0.6.15",
5455
"eslint-plugin-vue": "^9.9.0",
5556
"husky": "^8.0.3",
5657
"lint-staged": "^13.1.0",
5758
"nuxi": "^3.3.1",
5859
"postcss": "^8.3.11",
5960
"prettier": "^2.8.3",
61+
"react": "^18.2.0",
62+
"react-dom": "^18.2.0",
6063
"sass": "^1.57.1",
64+
"storybook": "^7.6.5",
65+
"storybook-addon-nuxt": "^1.3.3",
6166
"storybook-addon-themes": "^6.1.0",
6267
"typescript": "^5.1.6",
6368
"vitest": "^0.34.2",
@@ -68,8 +73,8 @@
6873
"@hpcc-js/wasm": "^2.8.0",
6974
"@pinia/nuxt": "^0.4.6",
7075
"@sentry/types": "^7.80.0",
71-
"@storybook/addon-actions": "^6.5.15",
72-
"@storybook/vue3": "^6.5.16",
76+
"@storybook/addon-actions": "^7.6.5",
77+
"@storybook/vue3": "^7.6.5",
7378
"@types/lodash": "^4.14.200",
7479
"@vue/shared": "^3.2.45",
7580
"centrifuge": "^3.1.0",

pages/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
:disabled="visibleEvents.length === 0"
1818
:is-paused="isEventsPaused"
1919
:total-new-events-count="hiddenEventsCount"
20-
@toggleUpdate="toggleUpdate"
20+
@toggle-update="toggleUpdate"
2121
/>
2222
</template>
2323
</PageHeader>
@@ -44,7 +44,7 @@ import { useNuxtApp } from "#app"; // eslint-disable-line @conarti/feature-slice
4444
import { PageHeader, EventCard, PagePlaceholder } from "~/src/widgets/ui";
4545
import { PAGE_TYPES } from "~/src/shared/constants";
4646
import type { EventType } from "~/src/shared/types";
47-
import { PauseButton } from "~/src/screens/events/ui/pause-button";
47+
import { PauseButton } from "~/src/shared/ui/pause-button";
4848
4949
export default defineComponent({
5050
components: {
Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Meta, Story } from "@storybook/vue3";
1+
import type { Meta, StoryObj } from "@storybook/vue3";
22
import { useHttpDump } from "../../lib";
33
import { httpDumpMock } from '../../mocks';
44
import PreviewCard from './preview-card.vue';
@@ -10,18 +10,9 @@ export default {
1010
component: PreviewCard
1111
} as Meta<typeof PreviewCard>;
1212

13-
const Template: Story = (args) => ({
14-
components: { PreviewCard },
15-
setup() {
16-
return {
17-
args,
18-
};
19-
},
20-
template: `<PreviewCard v-bind="args" />`,
21-
});
13+
export const Default: StoryObj<typeof PreviewCard> = {
14+
args: {
15+
event: normalizeHttpDumpEvent(httpDumpMock),
16+
}
17+
}
2218

23-
export const Event = Template.bind({});
24-
25-
Event.args = {
26-
event: normalizeHttpDumpEvent(httpDumpMock),
27-
};

0 commit comments

Comments
 (0)