Skip to content

Commit

Permalink
Adding Chromatic action
Browse files Browse the repository at this point in the history
  • Loading branch information
clintandrewhall committed Sep 12, 2024
1 parent 3c93fc4 commit 2fc2dc9
Show file tree
Hide file tree
Showing 280 changed files with 83,214 additions and 3,950 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Chromatic'

on: push

jobs:
chromatic:
name: Run Chromatic
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Enable Corepack
run: corepack enable
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
# FIXME: Because the setup-node action is dumb, we have to manually
# install the dependencies ourselves. See: https://github.com/actions/setup-node/issues/182
- name: Install dependencies
run: yarn install
- name: Run Chromatic
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitOnceUploaded: true
5 changes: 2 additions & 3 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { csa, css, cx } from '@/lib/css';
import { theme } from '@/theme';
import type { Preview } from '@storybook/react';
import 'ress';
import 'unfonts.css';
import { withRouter } from 'storybook-addon-remix-react-router';

import { csa, css, cx } from '@lib/css';
import { theme } from '@theme';

const preview: Preview = {
parameters: {
controls: {
Expand Down
6 changes: 4 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
nodeLinker: node-modules
compressionLevel: mixed

enableGlobalCache: false

yarnPath: .yarn/releases/yarn-3.6.4.cjs
nodeLinker: node-modules
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build-storybook": "storybook build",
"generate:github": "ts-node ./scripts/github",
"generate:medium": "ts-node ./scripts/medium",
"chromatic": "npx chromatic --project-token=chpt_0a69331ccacaeaf"
"chromatic": "chromatic"
},
"dependencies": {
"@linaria/atomic": "^6.0.0",
Expand Down Expand Up @@ -83,5 +83,5 @@
"vite-imagetools": "^7.0.4",
"vite-plugin-markdown": "^2.2.0"
},
"packageManager": "yarn@3.6.4"
"packageManager": "yarn@4.4.1"
}
3 changes: 1 addition & 2 deletions src/.stories/components/corner.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { GithubCorner } from '@/components/github';
import type { Meta, StoryObj } from '@storybook/react';

import { GithubCorner } from '@components/github';

const meta: Meta<typeof GithubCorner> = {
title: 'Components/Github/Corner',
component: GithubCorner,
Expand Down
3 changes: 1 addition & 2 deletions src/.stories/components/footer.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Footer as Component } from '@/components/layout';
import type { Meta, StoryObj } from '@storybook/react';

import { Footer as Component } from '@components/layout';

const meta: Meta<typeof Component> = {
title: 'Components/Layout/Footer',
component: Component,
Expand Down
9 changes: 4 additions & 5 deletions src/.stories/components/grid.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Layout as Component } from '@/components/layout';
import { csa, cx } from '@/lib/css';
import { useDimensions } from '@/lib/hooks';
import { theme } from '@/theme';
import type { Meta, StoryObj } from '@storybook/react';
import type { ReactNode } from 'react';

import { Layout as Component } from '@components/layout';
import { csa, cx } from '@lib/css';
import { useDimensions } from '@lib/hooks';
import { theme } from '@theme';

const meta: Meta = {
title: 'Components/Layout/Layout',
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { LOC } from '@/components/github';
import type { Meta, StoryObj } from '@storybook/react';

import { LOC } from '@components/github/loc';

const meta: Meta<typeof LOC> = {
title: 'Components/Github/Lines of Code',
component: LOC,
Expand Down
3 changes: 1 addition & 2 deletions src/.stories/components/people_line.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { PeopleLine as Component, Person, type PersonProps } from '@/components/people_line';
import type { Meta, StoryObj } from '@storybook/react';

import { PeopleLine as Component, Person, type PersonProps } from '@components/people_line';

const meta: Meta<typeof Component> = {
title: 'Components/People Line',
component: Component,
Expand Down
7 changes: 3 additions & 4 deletions src/.stories/components/section.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Section as Component, type SectionProps } from '@/components/layout';
import type { SectionHeaderProps } from '@/components/layout/section/section_header';
import { csa } from '@/lib/css';
import type { Meta, StoryObj } from '@storybook/react';

import { Section as Component, type SectionProps } from '@components/layout';
import type { SectionHeaderProps } from '@components/layout/section/section_header';
import { csa } from '@lib/css';

const meta: Meta<typeof Component> = {
title: 'Components/Layout/Section',
component: Component,
Expand Down
3 changes: 1 addition & 2 deletions src/.stories/components/stats.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { GithubStats } from '@/components/github';
import type { Meta, StoryObj } from '@storybook/react';

import { GithubStats } from '@components/github';

const meta: Meta<typeof GithubStats> = {
title: 'Components/Github/Stats',
component: GithubStats,
Expand Down
5 changes: 2 additions & 3 deletions src/.stories/components/timeline.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { TimelineItemProps } from '@/components/timeline';
import { Timeline as Component, TimelineItem } from '@/components/timeline';
import type { Meta, StoryObj } from '@storybook/react';

import type { TimelineItemProps } from '@components/timeline';
import { Timeline as Component, TimelineItem } from '@components/timeline';

const meta: Meta<typeof Component> = {
title: 'Components/Timeline',
component: Component,
Expand Down
3 changes: 1 addition & 2 deletions src/.stories/home/about.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Home } from '@/home';
import type { Meta, StoryObj } from '@storybook/react';

import { Home } from '@home';

const meta: Meta<typeof Home.About> = {
title: 'Home/About',
component: Home.About,
Expand Down
3 changes: 1 addition & 2 deletions src/.stories/home/career.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Home } from '@/home';
import type { Meta, StoryObj } from '@storybook/react';

import { Home } from '@home';

const meta: Meta<typeof Home.Career> = {
title: 'Home/Career',
component: Home.Career,
Expand Down
3 changes: 1 addition & 2 deletions src/.stories/home/home.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Home as Component } from '@/home';
import type { Meta, StoryObj } from '@storybook/react';

import { Home as Component } from '@home';

const meta: Meta<typeof Home> = {
title: 'Pages/Home',
component: Component,
Expand Down
3 changes: 1 addition & 2 deletions src/.stories/home/medium.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Home } from '@/home';
import type { Meta, StoryObj } from '@storybook/react';

import { Home } from '@home';

const meta: Meta<typeof Home.Medium> = {
title: 'Home/Medium',
component: Home.Medium,
Expand Down
3 changes: 1 addition & 2 deletions src/.stories/home/portfolio.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Home } from '@/home';
import type { Meta, StoryObj } from '@storybook/react';

import { Home } from '@home';

const meta: Meta<typeof Home.Portfolio> = {
title: 'Home/Portfolio',
component: Home.Portfolio,
Expand Down
5 changes: 2 additions & 3 deletions src/.stories/theme/font.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { csa } from '@/lib/css';
import { theme } from '@/theme';
import type { Meta, StoryObj } from '@storybook/react';

import { csa } from '@lib/css';
import { theme } from '@theme';

const meta: Meta = {
title: 'Theme/Font',
};
Expand Down
5 changes: 2 additions & 3 deletions src/.stories/theme/icons.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { toProps } from '@/lib/css';
import { theme } from '@/theme';
import type { Meta, StoryObj } from '@storybook/react';

import { toProps } from '@lib/css';
import { theme } from '@theme';

const meta: Meta = {
title: 'Theme/Icons',
};
Expand Down
9 changes: 4 additions & 5 deletions src/.stories/theme/spacing.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { csa, cx } from '@/lib/css';
import { useDimensions } from '@/lib/hooks';
import { theme } from '@/theme';
import { type UtopiaSize } from '@/theme/spacing';
import type { Meta, StoryObj } from '@storybook/react';

import { csa, cx } from '@lib/css';
import { useDimensions } from '@lib/hooks';
import { theme } from '@theme';
import { type UtopiaSize } from '@theme/spacing';

const meta: Meta = {
title: 'Theme/Spacing',
};
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GithubCorner } from '@components/github/corner';
import { GithubCorner } from '@/components/github/corner';

function App() {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/github/corner.styles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { csa, cx, toProps } from '@lib/css';
import { csa, cx, toProps } from '@/lib/css';

const svgRoot = toProps(csa`
fill: #fff;
Expand Down
1 change: 1 addition & 0 deletions src/components/github/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { GithubCorner } from './corner';
export { LOC } from './loc';
export { GithubStats } from './stats';
File renamed without changes.
4 changes: 2 additions & 2 deletions src/components/github/loc_language.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { csa, toProps } from '@lib/css';
import { theme } from '@theme';
import { csa, toProps } from '@/lib/css';
import { theme } from '@/theme';

const { vars, css } = theme;

Expand Down
3 changes: 1 addition & 2 deletions src/components/github/loc_language.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { languageColors } from '@/lib/github_language_colors';
import numeral from 'numeral';

import { languageColors } from '@lib/github_language_colors';

import styles from './loc_language.styles';

export const Language = ({ loc, overallTotal }: { loc: LinesOfCode; overallTotal: number }) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/github/numbers.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { csa, toProps } from '@lib/css';
import { theme } from '@theme';
import { csa, toProps } from '@/lib/css';
import { theme } from '@/theme';

const { vars, css } = theme;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { loc, user } from '@content/github.json';
import { loc, user } from '@/content/github.json';

import { LOC } from './loc';
import { Numbers } from './numbers';
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/footer/footer.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { csa, toProps } from '@lib/css';
import { theme } from '@theme';
import { csa, toProps } from '@/lib/css';
import { theme } from '@/theme';

const { vars } = theme;

Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/footer/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useResume } from '@lib/hooks';
import { useResume } from '@/lib/hooks';

import { SiteCredits } from './site_credits';
import { SiteLogo } from './site_logo';
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/footer/site_credits.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { csa, toProps } from '@lib/css';
import { theme } from '@theme';
import { csa, toProps } from '@/lib/css';
import { theme } from '@/theme';

const { vars, css } = theme;

Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/footer/site_logo.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { csa, toProps } from '@lib/css';
import { theme } from '@theme';
import { csa, toProps } from '@/lib/css';
import { theme } from '@/theme';

const { vars } = theme;

Expand Down
6 changes: 3 additions & 3 deletions src/components/layout/footer/social_profiles.styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { csa, type CSSProps, cx, toProps } from '@lib/css';
import { theme } from '@theme';
import type { IconSocial } from '@theme/icons';
import { csa, type CSSProps, cx, toProps } from '@/lib/css';
import { theme } from '@/theme';
import type { IconSocial } from '@/theme/icons';

const { vars, icons, css } = theme;

Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/footer/social_profiles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IconSocial } from '@theme/icons';
import type { IconSocial } from '@/theme/icons';

import styles from './social_profiles.styles';

Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/layout.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { csa, toProps } from '@lib/css';
import { theme } from '@theme';
import { csa, toProps } from '@/lib/css';
import { theme } from '@/theme';

const outer = toProps(
csa`
Expand Down
3 changes: 1 addition & 2 deletions src/components/layout/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';

import { cx } from '@lib/css';
import { cx } from '@/lib/css';

import { Footer } from './footer';

Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/section/section.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { csa, toProps } from '@lib/css';
import { theme } from '@theme';
import { csa, toProps } from '@/lib/css';
import { theme } from '@/theme';

const { vars } = theme;

Expand Down
7 changes: 3 additions & 4 deletions src/components/layout/section/section.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Layout } from '@/components/layout';
import { cx } from '@/lib/css';
import { slot, useSlots } from '@/lib/hooks';
import type { ReactNode } from 'react';

import { Layout } from '@components/layout';
import { cx } from '@lib/css';
import { slot, useSlots } from '@lib/hooks';

import { SectionDivider as Divider } from './section_divider';
import { SectionHeader } from './section_header';
import { SectionLink as Link } from './section_link';
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/section/section_divider.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { csa, toProps } from '@lib/css';
import { theme } from '@theme';
import { csa, toProps } from '@/lib/css';
import { theme } from '@/theme';

const { vars } = theme;

Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/section/section_header.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { csa, cx, toProps } from '@lib/css';
import { theme } from '@theme';
import { csa, cx, toProps } from '@/lib/css';
import { theme } from '@/theme';

const { css, vars } = theme;

Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/section/section_header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cx } from '@lib/css';
import { cx } from '@/lib/css';

import styles from './section_header.styles';

Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/section/section_link.styles.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { csa, toProps } from '@lib/css';
import { theme } from '@theme';
import { csa, toProps } from '@/lib/css';
import { theme } from '@/theme';

const { css, vars } = theme;

Expand Down
Loading

0 comments on commit 2fc2dc9

Please sign in to comment.