Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates #39

Merged
merged 5 commits into from
Oct 8, 2024
Merged
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
12 changes: 4 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,15 @@ jobs:
${{ runner.os }}-pnpm-store-

- name: Install Packages
run: pnpm install
run: |
pnpm install
pnpm exec playwright install
timeout-minutes: 3

- name: Validate and Build
if: "!startsWith(github.ref, 'refs/tags/')"
run: pnpm run validate
timeout-minutes: 3

- name: Validate Storybook
run: |
pnpm exec playwright install --with-deps chromium
npm install -g nyc
pnpm run storybook:build:validate
timeout-minutes: 5

- name: SonarCloud Scan
if: "!startsWith(github.ref, 'refs/tags/')"
Expand Down
8 changes: 0 additions & 8 deletions .nycrc

This file was deleted.

16 changes: 8 additions & 8 deletions .storybook/Story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export interface StoryKnownProps
Pick<WithFlexBox, 'direction'>,
Pick<WithPadding, 'padding'>,
Pick<WithMargin, 'mx'> {
align: string;
align?: string;
children?: ReactNode;
display: string;
justify: string;
display?: string;
justify?: string;
maxWidth?: number;
minHeight?: string;
minWidth?: number;
Expand All @@ -35,13 +35,13 @@ type StoryProps = Simplify<OmitElementProps<HTMLDivElement, StoryKnownProps>>;
export interface Context {
args: Record<string, any>;
globals: {
appearance: 'light' | 'dark' | 'side-by-side';
backgrounds: { value: string };
color: keyof Theme['colors'];
appearance?: 'light' | 'dark' | 'side-by-side';
backgrounds?: { value: string };
color?: keyof Theme['colors'];
};
parameters: StoryProps & {
layout: string;
paddingDocs: SpacingOrZero;
layout?: string;
paddingDocs?: SpacingOrZero;
};
viewMode: string;
}
Expand Down
4 changes: 1 addition & 3 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ const config: StorybookConfig = {
},
},
},
'@storybook/experimental-addon-test',
],
docs: {
autodocs: true,
},
framework: {
name: '@storybook/react-vite',
options: {},
Expand Down
4 changes: 3 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function Preview(StoryFn: FC, context: Context) {
const customTheme = (darkMode: boolean): any => {
return mergeTheme({
dataAttributeName: 'testid',
colors: { primary: themeColors[color] },
colors: { primary: themeColors[color!] },
darkMode,
});
};
Expand Down Expand Up @@ -263,3 +263,5 @@ export const decorators = [
<CacheProvider name="@gilbarbara/components">{Preview(StoryFn, context)}</CacheProvider>
),
];

export const tags = ['autodocs'];
8 changes: 8 additions & 0 deletions .storybook/vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { setProjectAnnotations } from '@storybook/react';
import { beforeAll } from 'vitest';

import * as projectAnnotations from './preview';

const project = setProjectAnnotations([projectAnnotations]);

beforeAll(project.beforeAll);
79 changes: 36 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
"react-dom": "17 - 18"
},
"dependencies": {
"@emotion/is-prop-valid": "^1.3.0",
"@emotion/is-prop-valid": "^1.3.1",
"@gilbarbara/deep-equal": "^0.3.1",
"@gilbarbara/helpers": "^0.9.4",
"@gilbarbara/hooks": "^0.8.2",
"@gilbarbara/react-dropdown": "^0.2.0",
"@gilbarbara/types": "^0.2.2",
"@react-aria/visually-hidden": "^3.8.15",
"@react-aria/visually-hidden": "^3.8.16",
"colorizr": "^2.1.1",
"csstype": "^3.1.3",
"date-fns": "^3.6.0",
"deepmerge-ts": "^7.1.0",
"deepmerge-ts": "^7.1.1",
"disable-scroll": "^0.6.0",
"is-lite": "^1.2.1",
"react-day-picker": "^8.10.1",
Expand All @@ -55,66 +55,64 @@
"scrollparent": "^2.1.0"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.16.1",
"@arethetypeswrong/cli": "^0.16.4",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@gilbarbara/eslint-config": "^0.8.1",
"@gilbarbara/prettier-config": "^1.0.0",
"@gilbarbara/tsconfig": "^0.2.3",
"@size-limit/preset-small-lib": "^11.1.5",
"@storybook/addon-a11y": "^8.2.9",
"@storybook/addon-actions": "^8.2.9",
"@size-limit/preset-small-lib": "^11.1.6",
"@storybook/addon-a11y": "^8.3.5",
"@storybook/addon-actions": "^8.3.5",
"@storybook/addon-coverage": "^1.0.4",
"@storybook/addon-docs": "^8.2.9",
"@storybook/addon-essentials": "^8.2.9",
"@storybook/addon-interactions": "^8.2.9",
"@storybook/addon-links": "^8.2.9",
"@storybook/addon-storysource": "^8.2.9",
"@storybook/addon-viewport": "^8.2.9",
"@storybook/blocks": "8.2.9",
"@storybook/manager-api": "8.2.9",
"@storybook/preview-api": "8.2.9",
"@storybook/react": "^8.2.9",
"@storybook/react-vite": "^8.2.9",
"@storybook/test": "^8.2.9",
"@storybook/addon-docs": "^8.3.5",
"@storybook/addon-essentials": "^8.3.5",
"@storybook/addon-interactions": "^8.3.5",
"@storybook/addon-links": "^8.3.5",
"@storybook/addon-storysource": "^8.3.5",
"@storybook/addon-viewport": "^8.3.5",
"@storybook/blocks": "^8.3.5",
"@storybook/experimental-addon-test": "^8.3.5",
"@storybook/manager-api": "^8.3.5",
"@storybook/preview-api": "^8.3.5",
"@storybook/react": "^8.3.5",
"@storybook/react-vite": "^8.3.5",
"@storybook/test": "^8.3.5",
"@storybook/test-runner": "^0.19.1",
"@storybook/theming": "^8.2.9",
"@storybook/types": "^8.2.9",
"@storybook/theming": "^8.3.5",
"@storybook/types": "^8.3.5",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
"@types/node": "^20.14.12",
"@types/react": "^18.3.5",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"@types/react-syntax-highlighter": "^15.5.13",
"@types/scroll": "^3.0.3",
"@types/scrollparent": "^2.0.3",
"@vitejs/plugin-react-swc": "^3.7.0",
"@vitest/coverage-v8": "^2.0.5",
"chromatic": "^11.7.1",
"concurrently": "^9.0.0",
"del-cli": "^5.1.0",
"deploy-aws-s3-cloudfront": "^3.8.0",
"http-server": "^14.1.1",
"husky": "^9.1.5",
"@vitejs/plugin-react-swc": "^3.7.1",
"@vitest/browser": "^2.1.2",
"@vitest/coverage-v8": "^2.1.2",
"chromatic": "^11.12.0",
"del-cli": "^6.0.0",
"husky": "^9.1.6",
"is-ci-cli": "^2.2.0",
"jest-extended": "^4.0.2",
"jsdom": "^25.0.0",
"playwright": "^1.47.0",
"jsdom": "^25.0.1",
"playwright": "^1.47.2",
"prettier": "^3.3.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-syntax-highlighter": "^15.5.0",
"repo-tools": "^0.3.1",
"size-limit": "^11.1.5",
"storybook": "^8.2.9",
"size-limit": "^11.1.6",
"storybook": "^8.3.5",
"ts-node": "^10.9.2",
"tsup": "^8.2.4",
"tsup": "^8.3.0",
"typescript": "^5.5.4",
"vite": "^5.4.3",
"vite": "^5.4.8",
"vite-tsconfig-paths": "^5.0.1",
"vitest": "^2.0.5",
"wait-on": "^8.0.0"
"vitest": "^2.1.2"
},
"scripts": {
"build": "pnpm run clean && tsup",
Expand All @@ -129,11 +127,6 @@
"size": "size-limit",
"storybook:dev": "storybook dev -p 6006",
"storybook:build": "storybook build -o build",
"storybook:test:watch": "test-storybook --watchAll --verbose",
"storybook:test:coverage": "test-storybook --coverage",
"storybook:merge-coverage": "cp coverage/storybook/coverage-storybook.json coverage/coverage-storybook.json && nyc report --reporter=lcov -t coverage --report-dir coverage",
"storybook:validate": "concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"http-server build --p 6006 -s\" \"wait-on tcp:127.0.0.1:6006 && pnpm run storybook:test:coverage && pnpm run storybook:merge-coverage\"",
"storybook:build:validate": "pnpm run storybook:build && pnpm run storybook:validate",
"prepublishOnly": "pnpm run validate",
"validate": "pnpm run lint && pnpm run typecheck && pnpm run test:coverage && pnpm run build && pnpm run size && npm run typevalidation",
"prepare": "husky"
Expand Down
Loading
Loading