Skip to content

Commit 4740bd2

Browse files
committed
chore: trying to get storybook to work
1 parent 58b0d76 commit 4740bd2

File tree

8 files changed

+2751
-913
lines changed

8 files changed

+2751
-913
lines changed

package.json

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,20 @@
2222
"@cypress/vite-dev-server": "^2.2.1",
2323
"@floating-ui/dom": "1.0.10",
2424
"@jscutlery/semver": "^2.30.1",
25-
"@nrwl/cli": "15.7.1",
26-
"@nrwl/cypress": "15.7.1",
27-
"@nrwl/eslint-plugin-nx": "15.7.1",
28-
"@nrwl/linter": "15.7.1",
29-
"@nrwl/nx-cloud": "15.0.3",
30-
"@nrwl/storybook": "15.7.1",
31-
"@nrwl/vite": "15.7.1",
32-
"@nrwl/workspace": "15.7.1",
33-
"@storybook/addon-essentials": "7.0.0-beta.30",
34-
"@storybook/addon-interactions": "7.0.0-beta.30",
35-
"@storybook/addon-links": "7.0.0-beta.30",
36-
"@storybook/blocks": "7.0.0-beta.30",
25+
"@nrwl/cli": "15.8.6",
26+
"@nrwl/cypress": "15.8.6",
27+
"@nrwl/eslint-plugin-nx": "15.8.6",
28+
"@nrwl/linter": "15.8.6",
29+
"@nrwl/nx-cloud": "15.2.1",
30+
"@nrwl/storybook": "15.8.6",
31+
"@nrwl/vite": "15.8.6",
32+
"@nrwl/workspace": "15.8.6",
33+
"@storybook/addon-essentials": "7.0.0-rc.3",
34+
"@storybook/addon-interactions": "7.0.0-rc.3",
35+
"@storybook/addon-links": "7.0.0-rc.3",
36+
"@storybook/blocks": "7.0.0-rc.3",
3737
"@storybook/builder-vite": "0.4.2",
38-
"@storybook/html": "7.0.0-beta.30",
39-
"@storybook/html-vite": "7.0.0-beta.30",
40-
"@storybook/testing-library": "0.0.13",
38+
"@storybook/testing-library": "0.0.14-next.1",
4139
"@types/eslint": "8.21.1",
4240
"@types/node": "18.13.0",
4341
"@typescript-eslint/eslint-plugin": "5.52.0",
@@ -57,20 +55,23 @@
5755
"eslint-config-prettier": "8.6.0",
5856
"eslint-plugin-cypress": "^2.12.1",
5957
"eslint-plugin-qwik": "0.18.1",
58+
"eslint-plugin-storybook": "^0.6.11",
6059
"html-webpack-plugin": "^5.5.0",
6160
"husky": "^8.0.3",
6261
"jsdom": "~20.0.3",
6362
"lodash.includes": "4.3.0",
6463
"ngx-deploy-npm": "^5.0.0",
6564
"node-fetch": "3.3.0",
6665
"np": "7.6.3",
67-
"nx": "15.7.1",
66+
"nx": "15.8.6",
6867
"postcss": "^8.4.21",
6968
"prettier": "2.8.4",
7069
"pretty-quick": "^3.1.3",
71-
"qwik-nx": "0.11.1",
70+
"qwik-nx": "0.13.2",
71+
"react": "18.2.0",
72+
"react-dom": "18.2.0",
7273
"sass": "1.58.1",
73-
"storybook": "7.0.0-beta.30",
74+
"storybook": "7.0.0-rc.3",
7475
"storybook-framework-qwik": "0.0.8",
7576
"tailwindcss": "^3.2.6",
7677
"ts-node": "10.9.1",

packages/headless/.storybook/main.ts

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,43 @@
11
import { qwikVite } from '@builder.io/qwik/optimizer';
2-
import { rootMain } from '../../../.storybook/main';
3-
4-
import type { StorybookViteConfig } from '@storybook/builder-vite';
2+
import { StorybookConfig } from 'storybook-framework-qwik';
3+
// import { rootMain } from '../../../.storybook/main';
54

65
import { mergeConfig } from 'vite';
76
import viteTsConfigPaths from 'vite-tsconfig-paths';
87

9-
const config: StorybookViteConfig = {
10-
...rootMain,
11-
core: {
12-
...rootMain.core,
13-
builder: '@storybook/builder-vite',
14-
},
15-
stories: [
16-
...rootMain.stories,
17-
'../src/lib/**/*.stories.mdx',
18-
'../src/lib/**/*.stories.@(js|jsx|ts|tsx)',
8+
const config: StorybookConfig = {
9+
// ...rootMain,
10+
11+
addons: [
12+
'@storybook/addon-links',
13+
'@storybook/addon-essentials',
14+
'@storybook/addon-interactions',
1915
],
20-
addons: ['@storybook/addon-essentials', ...(rootMain.addons || [])],
16+
// addons: ['@storybook/addon-essentials', ...(rootMain.addons || [])],
17+
2118
framework: {
2219
name: 'storybook-framework-qwik',
2320
},
24-
viteFinal: async (config: any) => {
25-
return mergeConfig(config, {
26-
plugins: [
27-
viteTsConfigPaths({
28-
root: '../../../',
29-
}),
30-
qwikVite(),
31-
],
32-
});
21+
core: {
22+
// ...rootMain.core,
23+
renderer: 'storybook-framework-qwik',
3324
},
25+
stories: [
26+
// ...rootMain.stories,
27+
'../src/components/**/*.stories.mdx',
28+
'../src/components/**/*.stories.@(js|jsx|ts|tsx)',
29+
],
30+
31+
// viteFinal: async (config: any) => {
32+
// return mergeConfig(config, {
33+
// plugins: [
34+
// viteTsConfigPaths({
35+
// root: '../../../',
36+
// }),
37+
// qwikVite(),
38+
// ],
39+
// });
40+
// },
3441
};
3542

3643
export default config;

packages/headless/.storybook/preview.ts

Whitespace-only changes.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// import { qwikCityDecorator } from 'storybook-framework-qwik/qwik-city-decorator';
2+
import { Parameters } from 'storybook-framework-qwik';
3+
import type { Preview } from '@storybook/types';
4+
// export const decorators: Decorator[] = [qwikCityDecorator];
5+
6+
// const preview: Preview = {
7+
// parameters: {
8+
// backgrounds: {
9+
// default: 'light'
10+
// },
11+
// actions: { argTypesRegex: '^on[A-Z].*' },
12+
// controls: {
13+
// matchers: {
14+
// color: /(background|color)$/i,
15+
// date: /Date$/
16+
// }
17+
// }
18+
// }
19+
// }
20+
21+
// export default preview
22+
23+
export const parameters: Parameters = {
24+
a11y: {
25+
config: {},
26+
options: {
27+
checks: { 'color-contrast': { options: { noScroll: true } } },
28+
restoreScroll: true,
29+
},
30+
},
31+
options: {
32+
showRoots: true,
33+
},
34+
docs: {
35+
iframeHeight: '200px',
36+
},
37+
};

packages/headless/.storybook/tsconfig.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@
44
"emitDecoratorMetadata": true
55
},
66

7-
"exclude": ["../**/*.spec.ts"],
7+
"exclude": [
8+
"../**/*.spec.ts",
9+
"../**/*.test.ts",
10+
"../**/*.spec.tsx",
11+
"../**/*.test.tsx"
12+
],
813
"include": [
914
"../src/**/*.stories.ts",
1015
"../src/**/*.stories.js",
1116
"../src/**/*.stories.jsx",
1217
"../src/**/*.stories.tsx",
1318
"../src/**/*.stories.mdx",
1419
"*.ts",
15-
"*.js"
20+
"*.js",
21+
"preview.tsx"
1622
]
1723
}

packages/headless/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
"fmt.check": "prettier --check .",
3131
"release": "np",
3232
"start": "vite --open --mode ssr",
33-
"qwik": "qwik"
33+
"qwik": "qwik",
34+
"storybook1": "storybook dev -p 6006",
35+
"build-storybook1": "storybook build"
3436
},
3537
"dependencies": {
3638
"@floating-ui/dom": "1.0.10"

packages/headless/src/components/tooltip/tooltip.stories.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import { Meta, StoryObj } from 'storybook-framework-qwik';
22
import { Tooltip, TooltipProps } from './tooltip';
33

4-
export default {
4+
const meta: Meta<typeof Tooltip> = {
55
component: Tooltip,
6-
} as Meta<TooltipProps>;
6+
};
7+
8+
type Story = StoryObj<typeof Tooltip>;
9+
10+
export default meta;
711

8-
export const Primary: StoryObj<TooltipProps> = {
12+
export const Primary: Story = {
913
args: {
1014
content: 'Hi there',
1115
},

0 commit comments

Comments
 (0)