Skip to content

Commit 0c2ba9b

Browse files
committed
feat: Storybook publishing
1 parent c83fa0f commit 0c2ba9b

File tree

13 files changed

+104
-45269
lines changed

13 files changed

+104
-45269
lines changed

.github/workflows/build-test-deploy.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ jobs:
4343
- name: Install Dependencies
4444
run: |
4545
npm config set legacy-peer-deps true
46-
npm ci --ignore-scripts --workspace @alexwilson/personal-website
46+
npm ci --workspace @alexwilson/personal-website
47+
npm rebuild
4748
- name: Build
4849
run: npx lerna run --scope @alexwilson/personal-website build
4950
env:
@@ -80,7 +81,7 @@ jobs:
8081
- name: Install Dependencies
8182
run: |
8283
npm config set legacy-peer-deps true
83-
npm ci --ignore-scripts --workspace @alexwilson/personal-website
84+
npm ci --include optional --workspace @alexwilson/personal-website
8485
- name: Run Tests
8586
run: npx lerna run --scope @alexwilson/personal-website test
8687

.github/workflows/monorepo-deploy.yml

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ jobs:
7070
runs-on: ubuntu-latest
7171
env:
7272
NODE_ENV: ${{ secrets.NODE_ENV }}
73+
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
7374
strategy:
7475
matrix: ${{ fromJson(needs.prepare.outputs.projects) }}
7576
steps:
@@ -123,6 +124,7 @@ jobs:
123124
run: npx lerna run deploy --scope ${{ matrix.name }}
124125
env:
125126
CI: true
127+
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
126128
CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }}
127129
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
128130
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
20
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,53 @@
1-
import { Link } from "@reach/router"
2-
import { format as formatDate } from 'date-fns'
3-
import React from "react"
4-
import ResponsiveImage from '../responsive-image'
5-
6-
export default function articleCard({ article, linkImplementation = Link, withBody = true, withImage = true, withDate = true }) {
7-
8-
const date = new Date(article.date)
9-
const LinkImplementation = linkImplementation
1+
import { Link } from "@reach/router";
2+
import { format as formatDate } from "date-fns";
3+
import React from "react";
4+
import ResponsiveImage from "../responsive-image";
5+
6+
export function ArticleCard({
7+
article,
8+
linkImplementation = Link,
9+
withBody = true,
10+
withImage = true,
11+
withDate = true,
12+
}) {
13+
const date = new Date(article.date);
14+
const LinkImplementation = linkImplementation;
1015

1116
return (
1217
<div className="alex-card">
13-
1418
<div className="alex-card__content--container">
15-
1619
<div className="alex-card__title">
17-
<h3><LinkImplementation to={article.slug}>{article.title}</LinkImplementation></h3>
20+
<h3>
21+
<LinkImplementation to={article.slug}>
22+
{article.title}
23+
</LinkImplementation>
24+
</h3>
1825
</div>
1926

20-
{(withBody !== false) ?
27+
{withBody !== false ? (
2128
<div className="alex-card__abstract">
22-
<p>
23-
{article.content.excerpt}
24-
</p>
29+
<p>{article.content.excerpt}</p>
2530
</div>
26-
: null}
31+
) : null}
2732

28-
{(withDate !== false) ?
33+
{withDate !== false ? (
2934
<div className="alex-card__timetamp">
3035
<span className="dateline">
31-
<time dateTime={date.toISOString()}>{formatDate(date, "d MMM yyyy")}</time>
36+
<time dateTime={date.toISOString()}>
37+
{formatDate(date, "d MMM yyyy")}
38+
</time>
3239
</span>
3340
</div>
34-
: null}
35-
41+
) : null}
3642
</div>
3743

38-
{(withImage !== false && article.image && article.image.thumbnail) ?
44+
{withImage !== false && article.image && article.image.thumbnail ? (
3945
<div className="alex-card__image">
4046
<ResponsiveImage src={article.image.thumbnail} width={400} />
4147
</div>
42-
: null}
43-
48+
) : null}
4449
</div>
45-
)
46-
50+
);
4751
}
52+
53+
export default ArticleCard;
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import './responsive-image.scss'
2-
import ResponsiveImage from './responsive-image'
3-
export {ResponsiveImage}
4-
export default ResponsiveImage
1+
import "./responsive-image.scss";
2+
import ResponsiveImage from "./responsive-image";
3+
export { ResponsiveImage };
4+
export default ResponsiveImage;
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
1-
import React from 'react'
1+
import React from "react";
22

3-
export default function responsiveImage({src, alt, width, height, quality, format, className}) {
4-
5-
const queryParams = []
6-
if (Number.isInteger(width)) queryParams.push(`width=${width}`)
7-
if (Number.isInteger(height)) queryParams.push(`height=${height}`)
3+
export function ResponsiveImage({
4+
src,
5+
alt,
6+
width,
7+
height,
8+
quality,
9+
format,
10+
className,
11+
}) {
12+
const queryParams = [];
13+
if (Number.isInteger(width)) queryParams.push(`width=${width}`);
14+
if (Number.isInteger(height)) queryParams.push(`height=${height}`);
815

916
if (quality) {
10-
queryParams.push(`quality=${quality}`)
17+
queryParams.push(`quality=${quality}`);
1118
}
1219

1320
if (format) {
14-
queryParams.push(`format=${format}`)
21+
queryParams.push(`format=${format}`);
1522
}
1623

1724
return (
1825
<img
19-
src={`https://imagecdn.app/v2/image/${encodeURIComponent(src)}?${queryParams.join('&')}`}
20-
className={`responsive-image ${className}`}
21-
alt={alt}
26+
src={`https://imagecdn.app/v2/image/${encodeURIComponent(src)}?${queryParams.join("&")}`}
27+
className={`responsive-image ${className}`}
28+
alt={alt}
2229
/>
23-
)
30+
);
2431
}
32+
33+
export default ResponsiveImage;

package-lock.json

+25-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)