Skip to content

Commit e5e4c08

Browse files
committed
updating to storybook v9. Ran npx @storybook latest and made some compatiblity changes
1 parent 0da1dbd commit e5e4c08

File tree

10 files changed

+711
-2008
lines changed

10 files changed

+711
-2008
lines changed

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.storybook/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { StorybookConfig } from "@storybook/vue3-vite";
22

33
const config: StorybookConfig = {
44
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
5-
addons: ["@storybook/addon-essentials", "@chromatic-com/storybook", "@storybook/experimental-addon-test"],
5+
addons: ["@chromatic-com/storybook", "@storybook/addon-vitest", "@storybook/addon-docs"],
66
framework: {
77
name: "@storybook/vue3-vite",
88
options: {},

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.storybook/preview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// .storybook/preview.ts
22

3-
import type { Preview } from "@storybook/vue3";
4-
import { setup } from "@storybook/vue3"; // ✅ Use the setup function from Storybook
3+
import type { Preview } from "@storybook/vue3-vite";
4+
import { setup } from "@storybook/vue3-vite"; // ✅ Use the setup function from Storybook
55
import { createVuetify } from "vuetify";
66
import "vuetify/styles"; // Import Vuetify base styles
77
import "@mdi/font/css/materialdesignicons.css"; // Optional: MDI icons

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.storybook/vitest.setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { beforeAll } from 'vitest';
2-
import { setProjectAnnotations } from '@storybook/vue3';
2+
import { setProjectAnnotations } from '@storybook/vue3-vite';
33
import * as projectAnnotations from './preview';
44

55
// This is an important step to apply the right configuration when testing your stories.

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/package-lock.json

Lines changed: 670 additions & 1967 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/package.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,10 @@
3434
"vuetify": "^3.9.0"
3535
},
3636
"devDependencies": {
37-
"@chromatic-com/storybook": "^3.2.7",
38-
"@storybook/addon-essentials": "^8.6.14",
39-
"@storybook/blocks": "^8.6.14",
40-
"@storybook/experimental-addon-test": "^8.6.14",
41-
"@storybook/test": "^8.6.14",
42-
"@storybook/vue3": "^8.6.14",
43-
"@storybook/vue3-vite": "^8.6.14",
37+
"@chromatic-com/storybook": "^4.0.1",
38+
"@storybook/addon-vitest": "^9.0.17",
39+
"@storybook/vue3-vite": "^9.0.17",
40+
"@storybook/addon-docs": "^9.0.17",
4441
"@tsconfig/node18": "^18.2.4",
4542
"@types/lodash": "^4.17.20",
4643
"@types/luxon": "^3.6.2",
@@ -58,16 +55,16 @@
5855
"eslint-plugin-cypress": "^5.1.0",
5956
"eslint-plugin-mocha": "^11.1.0",
6057
"eslint-plugin-simple-import-sort": "^12.1.1",
61-
"eslint-plugin-storybook": "^0.12.0",
58+
"eslint-plugin-storybook": "^9.0.17",
6259
"eslint-plugin-unused-imports": "^4.1.4",
6360
"eslint-plugin-vue": "^10.3.0",
6461
"openapicmd": "^2.6.1",
6562
"playwright": "^1.53.1",
66-
"storybook": "^8.6.14",
63+
"storybook": "^9.0.17",
6764
"vitest": "^3.2.4",
6865
"sass": "^1.86.3",
6966
"typescript": "~5.8.3",
70-
"vite": "^6.3.2",
67+
"vite": "^7.0.2",
7168
"vue-eslint-parser": "^10.2.0",
7269
"vue-tsc": "^3.0.3"
7370
},

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/ApplicationCardList.stories.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { Meta, StoryObj } from "@storybook/vue3";
2-
import { action } from "@storybook/addon-actions";
1+
import type { Meta, StoryObj } from "@storybook/vue3-vite";
2+
import { action } from "storybook/actions";
33

44
import ApplicationCardList from "./ApplicationCardList.vue";
55
import { getTodayDate, getDatePlusYears, getDateMinusYears } from "../utils/dateHelpers";

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/CertificationCard.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Meta, StoryObj } from "@storybook/vue3";
1+
import type { Meta, StoryObj } from "@storybook/vue3-vite";
22

33
import CertificationCard from "./CertificationCard.vue";
44

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/CertificationList.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Meta, StoryObj } from "@storybook/vue3";
1+
import type { Meta, StoryObj } from "@storybook/vue3-vite";
22

33
import CertificationList from "./CertificationList.vue";
44

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/RenewAction.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Meta, StoryObj } from "@storybook/vue3";
1+
import type { Meta, StoryObj } from "@storybook/vue3-vite";
22

33
import RenewAction from "./RenewAction.vue";
44

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
import path from "node:path";
22
import { fileURLToPath } from "node:url";
33

4-
import { storybookTest } from "@storybook/experimental-addon-test/vitest-plugin";
5-
import { defineWorkspace } from "vitest/config";
4+
import storybookTest from "@storybook/addon-vitest/vitest-plugin";
5+
import { defineConfig } from "vitest/config";
66

77
const dirname = typeof __dirname !== "undefined" ? __dirname : path.dirname(fileURLToPath(import.meta.url));
88

9-
// More info at: https://storybook.js.org/docs/writing-tests/test-addon
10-
export default defineWorkspace([
11-
"vite.config.mts",
12-
{
13-
extends: "vite.config.mts",
14-
plugins: [
15-
// The plugin will run tests for the stories defined in your Storybook config
16-
// See options at: https://storybook.js.org/docs/writing-tests/test-addon#storybooktest
17-
storybookTest({ configDir: path.join(dirname, ".storybook") }),
18-
],
19-
test: {
20-
name: "storybook",
21-
browser: {
22-
enabled: true,
23-
headless: true,
24-
name: "chromium",
25-
provider: "playwright",
9+
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
10+
export default defineConfig({
11+
test: {
12+
projects: [
13+
{
14+
extends: true,
15+
plugins: [
16+
// The plugin will run tests for the stories defined in your Storybook config
17+
// See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
18+
storybookTest({ configDir: path.join(dirname, ".storybook") }),
19+
],
20+
test: {
21+
name: "storybook",
22+
browser: {
23+
enabled: true,
24+
headless: true,
25+
name: "chromium",
26+
provider: "playwright",
27+
},
28+
setupFiles: ["SETUP_FILE"],
29+
},
2630
},
27-
setupFiles: [".storybook/vitest.setup.ts"],
28-
},
31+
],
2932
},
30-
]);
33+
});

0 commit comments

Comments
 (0)