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

Release/storybook #4790

Merged
merged 15 commits into from
Jan 9, 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
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = {
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:storybook/recommended',
],
ignorePatterns: ['./leather-styles'],
plugins: ['react', 'react-hooks', '@typescript-eslint', 'deprecation'],
Expand Down Expand Up @@ -112,7 +113,7 @@ module.exports = {
{
name: 'react-redux',
importNames: ['useSelector'],
message: 'Selectors must be expored from the store via a hook',
message: 'Selectors must be exported from the store via a hook',
},
{
name: '@radix-ui/themes',
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: PR Extensions builds
name: PR extension build

on: [pull_request, workflow_dispatch]

jobs:
pre-run:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@main
with:
access_token: ${{ github.token }}
Expand Down Expand Up @@ -54,7 +55,7 @@ jobs:
COMMIT_SHA: ${{ env.SHORT_SHA }}

- uses: actions/upload-artifact@v3
name: Upload ${{ matrix.target }} Extension Zip
name: Upload ${{ matrix.target }} extension zip
with:
name: leather-${{ matrix.target }}-${{ env.SHORT_SHA }}
path: dist
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Chromatic

on: [pull_request, workflow_dispatch]

jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: yarn

- uses: chromaui/action@latest
with:
autoAcceptChanges: 'main'
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/development-extension.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Development Extension
name: Development extension

on:
push:
branches:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/notify-release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sends a notification to Discord whenever a new version of Leather is available in FireFox or Chrome stores
name: Notify on release

name: Notify on Release
on:
schedule:
# Run every hour
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Integration Tests
name: Integration tests

env:
CI: true
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish-extensions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Publish Extensions
name: Publish extensions

on:
push:
tags-ignore:
Expand Down
1 change: 1 addition & 0 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ ignore:
- .git
- dist
- node_modules
- storybook-static
9 changes: 9 additions & 0 deletions .storybook/leather-theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { create } from '@storybook/theming/create';

export default create({
base: 'dark',
brandTitle: 'Leather Storybook',
brandUrl: 'https://leather.io',
brandImage: 'assets/images/leather.png',
brandTarget: '_self',
});
70 changes: 70 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import type { StorybookConfig } from '@storybook/react-webpack5';
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';

const config: StorybookConfig = {
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-onboarding',
'@storybook/addon-interactions',
{
name: '@storybook/addon-styling-webpack',
options: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: ['postcss-preset-env', '@pandacss/dev/postcss'],
},
},
},
],
},
],
},
},
],
docs: {
autodocs: 'tag',
},
framework: {
name: '@storybook/react-webpack5',
options: {
builder: {
useSWC: true,
},
},
},
staticDirs: ['../public'],
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(ts|tsx)'],
swc: () => ({
jsc: {
transform: {
react: {
runtime: 'automatic',
},
},
},
}),
typescript: {
check: true,
reactDocgen: 'react-docgen-typescript',
},
webpackFinal: config => {
config.resolve ??= {};
config.resolve.plugins ??= [];
config.resolve.plugins.push(
new TsconfigPathsPlugin({
extensions: config.resolve.extensions,
})
);
return config;
},
};
export default config;
7 changes: 7 additions & 0 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { addons } from '@storybook/manager-api';

import leatherTheme from './leather-theme';

addons.setConfig({
theme: leatherTheme,
});
4 changes: 4 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<link rel="stylesheet" href="/assets/base.css" />
<link rel="preload" href="/assets/fonts/diatype/diatype-medium.woff2" />
<link rel="preload" href="/assets/fonts/diatype/diatype-regular.woff2" />
<link rel="preload" href="/assets/fonts/marche/marche-super-pro.woff2" />
17 changes: 17 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { Preview } from '@storybook/react';

import '../src/app/index.css';

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
Loading
Loading