Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test App
on: [pull_request, workflow_dispatch]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Using Node latest
uses: actions/setup-node@v4
with:
node-version: ">=18.0"
- name: Install packages
run: npm ci
- name: Run lint check
run: npm run lint
- name: Install playwright
run: npx playwright install --with-deps
- name: Run Tests
run: npm test

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Using Node latest
uses: actions/setup-node@v4
with:
node-version: ">=18.0"
- name: Install packages
run: npm ci
- name: Run lint check
run: npm run lint
- name: Build
run: npm run build
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

*storybook.log
storybook-static
16 changes: 16 additions & 0 deletions .storybook/devoteam.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { create } from 'storybook/theming';
import theme from '../src/core/theme';

export default create({
base: 'dark',
brandTitle: 'Devoteam',
brandUrl: "https://gcloud.devoteam.com/home/",
brandImage: "/logo-devoteam.svg",
brandTarget: "_blank",
fontBase: '"Open Sans", sans-serif',
fontCode: 'monospace',

barSelectedColor: theme.colors.primary,
barHoverColor: theme.colors.primary,
colorSecondary: theme.colors.primary
});
22 changes: 22 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { StorybookConfig } from '@storybook/react-vite';

const config: StorybookConfig = {
"stories": [
"../src/**/*.mdx",
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
],
"addons": [
"@chromatic-com/storybook",
"@storybook/addon-docs",
"@storybook/addon-a11y",
"@storybook/addon-vitest"
],
"framework": {
"name": "@storybook/react-vite",
"options": {}
},
managerHead: (head) =>
`${head}
<link rel="shortcut icon" href="/favicon.ico" type="image/ico">`,
};
export default config;
8 changes: 8 additions & 0 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {addons} from 'storybook/manager-api';
import theme from './devoteam';

addons.setConfig({
theme: theme
});

export default theme;
32 changes: 32 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import type { Preview } from '@storybook/react-vite';
import { withThemeFromJSXProvider } from '@storybook/addon-themes';
import theme from '../src/core/theme';
import { ThemeProvider } from '@emotion/react';

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},

a11y: {
// 'todo' - show a11y violations in the test UI only
// 'error' - fail CI on a11y violations
// 'off' - skip a11y checks entirely
test: 'todo',
}
},
decorators: [
withThemeFromJSXProvider({
themes: {
theme
},
Provider: ThemeProvider
})
]
};

export default preview;
7 changes: 7 additions & 0 deletions .storybook/vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview";
import { setProjectAnnotations } from '@storybook/react-vite';
import * as projectAnnotations from './preview';

// This is an important step to apply the right configuration when testing your stories.
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);
15 changes: 13 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
import storybook from "eslint-plugin-storybook";

import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
Expand All @@ -6,8 +9,16 @@ import tseslint from 'typescript-eslint'
import { globalIgnores } from 'eslint/config'

export default tseslint.config([
globalIgnores(['dist']),
globalIgnores(['dist', 'node_modules', 'public']),
{
rules: {
"indent": ["error", 4, { "SwitchCase": 2 }],
"no-tabs": ["error"],
"no-trailing-spaces": ["error"],
"prefer-const": "error",
"no-console": "warn",
semi: 'warn'
},
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
Expand All @@ -20,4 +31,4 @@ export default tseslint.config([
globals: globals.browser,
},
},
])
], storybook.configs["flat/recommended"]);
Loading