Skip to content

Commit f3054c3

Browse files
authored
next: Tailwind 4 + Storybook (#1837)
* Upgrade to tailwind 4 * Add storybook (copied from new sveltekit project) * Removed unplug icons, only was using two icons both deprecated and not supported by storybook * Updated storybook * Added stack trace * WIP: Fixing tests * Added some real stack traces for stories * Fixed unit test * Updated package * Fixed lock file * Fixed build warnings. * Added test cases * Fixed linting * Fixed streams page
1 parent 6869fe3 commit f3054c3

File tree

107 files changed

+7754
-5494
lines changed

Some content is hidden

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

107 files changed

+7754
-5494
lines changed

src/Exceptionless.Web/ClientApp/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
test-results
12
node_modules
23

34
# Output
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { StorybookConfig } from '@storybook/sveltekit';
2+
3+
const config: StorybookConfig = {
4+
addons: [
5+
'@storybook/addon-svelte-csf',
6+
'@storybook/addon-essentials',
7+
'@chromatic-com/storybook',
8+
'@storybook/addon-interactions',
9+
'@storybook/addon-a11y'
10+
],
11+
framework: {
12+
name: '@storybook/sveltekit',
13+
options: {}
14+
},
15+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|ts|svelte)']
16+
};
17+
export default config;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { Preview } from '@storybook/svelte';
2+
3+
import '../src/app.css';
4+
5+
const preview: Preview = {
6+
parameters: {
7+
controls: {
8+
matchers: {
9+
color: /(background|color)$/i,
10+
date: /Date$/i
11+
}
12+
}
13+
}
14+
};
15+
16+
export default preview;

src/Exceptionless.Web/ClientApp/.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131
"webRoot": "${workspaceFolder}",
3232
"preLaunchTask": "npm run dev:api"
3333
},
34+
{
35+
"type": "msedge",
36+
"request": "launch",
37+
"name": "Storybook (Edge)",
38+
"url": "http://localhost:6006",
39+
"webRoot": "${workspaceFolder}",
40+
"preLaunchTask": "npm run storybook"
41+
},
3442
{
3543
"type": "chrome",
3644
"request": "launch",
@@ -46,6 +54,14 @@
4654
"url": "http://localhost:5173/next",
4755
"webRoot": "${workspaceFolder}",
4856
"preLaunchTask": "npm run dev:api"
57+
},
58+
{
59+
"type": "chrome",
60+
"request": "launch",
61+
"name": "Storybook (Chrome)",
62+
"url": "http://localhost:6006",
63+
"webRoot": "${workspaceFolder}",
64+
"preLaunchTask": "npm run storybook"
4965
}
5066
]
5167
}

src/Exceptionless.Web/ClientApp/.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"debug.allowBreakpointsEverywhere": true,
33
"cSpell.words": [
44
"acacode",
5+
"autodocs",
56
"classvalidator",
67
"clsx",
78
"cmdk",

src/Exceptionless.Web/ClientApp/.vscode/tasks.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,18 @@
122122
"script": "test:unit",
123123
"problemMatcher": [],
124124
"label": "npm run test:unit"
125+
},
126+
{
127+
"type": "npm",
128+
"script": "test:e2e",
129+
"problemMatcher": [],
130+
"label": "npm run test:e2e"
131+
},
132+
{
133+
"type": "npm",
134+
"script": "storybook",
135+
"problemMatcher": [],
136+
"label": "npm run storybook"
125137
}
126138
]
127139
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { expect, test } from '@playwright/test';
2+
3+
test('default route should redirect to login page when unauthorized', async ({ page }) => {
4+
await page.goto('/next');
5+
await page.waitForURL('/next/login');
6+
await expect(page.getByRole('button', { name: 'Login' })).toBeVisible();
7+
});

src/Exceptionless.Web/ClientApp/eslint.config.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
import eslint from '@eslint/js';
1+
import { includeIgnoreFile } from '@eslint/compat';
2+
import js from '@eslint/js';
23
import prettier from 'eslint-config-prettier';
34
import perfectionist from 'eslint-plugin-perfectionist';
45
import svelte from 'eslint-plugin-svelte';
56
import globals from 'globals';
6-
import tseslint from 'typescript-eslint';
7+
import { fileURLToPath } from 'node:url';
8+
import ts from 'typescript-eslint';
9+
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
710

8-
/** @type {import('eslint').Linter.FlatConfig[]} */
9-
export default tseslint.config(
10-
eslint.configs.recommended,
11-
...tseslint.configs.recommended,
11+
export default ts.config(
12+
includeIgnoreFile(gitignorePath),
13+
js.configs.recommended,
14+
...ts.configs.recommended,
1215
...svelte.configs['flat/recommended'],
1316
perfectionist.configs['recommended-natural'],
1417
prettier,
@@ -25,7 +28,7 @@ export default tseslint.config(
2528
files: ['**/*.svelte'],
2629
languageOptions: {
2730
parserOptions: {
28-
parser: tseslint.parser
31+
parser: ts.parser
2932
}
3033
}
3134
},

0 commit comments

Comments
 (0)