-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from qupaya/me/feature/storybook
add & deploy storybook
- Loading branch information
Showing
17 changed files
with
5,859 additions
and
343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: 'Storybook Publish' | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
storybook-deployment: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: 'package.json' | ||
cache: 'npm' | ||
|
||
- uses: nrwl/nx-set-shas@v4 | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm ci | ||
- name: Restore nx cache | ||
id: nxcache | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules/.cache/nx | ||
key: ${{ runner.os }}-nxcache-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-nxcache- | ||
- name: build storybook | ||
run: nx run sketch:build-storybook | ||
|
||
- name: Publish to Chromatic | ||
# see https://github.com/chromaui/action/tags for versions | ||
uses: chromaui/[email protected] | ||
with: | ||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
storybookBuildDir: ./dist/storybook/sketch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,4 @@ Thumbs.db | |
|
||
.nx/cache | ||
.angular | ||
.eslintcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"*.ts": ["npx nx lint --fix --files"], | ||
"*.ts": ["eslint --cache --fix"], | ||
"*": ["npx nx format:write --files"], | ||
"*.css": ["npx stylelint --fix"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"projectId": "Project:661d194a3f6d14d86c328554", | ||
"autoAcceptChanges": "main", | ||
"exitOnceUploaded": true, | ||
"externals": ["public/**"], | ||
"onlyChanged": true, | ||
"storybookBuildDir": "dist/storybook/sketch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { StorybookConfig } from '@storybook/angular'; | ||
|
||
const config: StorybookConfig = { | ||
stories: ['../**/*.stories.@(js|jsx|ts|tsx|mdx)'], | ||
addons: ['@storybook/addon-essentials'], | ||
framework: { | ||
name: '@storybook/angular', | ||
options: {}, | ||
}, | ||
}; | ||
|
||
export default config; | ||
|
||
// To customize your webpack configuration you can use the webpackFinal field. | ||
// Check https://storybook.js.org/docs/react/builders/webpack#extending-storybooks-webpack-config | ||
// and https://nx.dev/recipes/storybook/custom-builder-configs |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"emitDecoratorMetadata": true | ||
}, | ||
"exclude": ["../**/*.spec.ts"], | ||
"include": [ | ||
"../src/**/*.stories.ts", | ||
"../src/**/*.stories.js", | ||
"../src/**/*.stories.jsx", | ||
"../src/**/*.stories.tsx", | ||
"../src/**/*.stories.mdx", | ||
"*.js", | ||
"*.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { Meta, StoryObj } from '@storybook/angular'; | ||
import { SketchComponent } from './sketch.component'; | ||
|
||
const meta: Meta<SketchComponent> = { | ||
component: SketchComponent, | ||
title: 'SketchComponent', | ||
}; | ||
export default meta; | ||
type Story = StoryObj<SketchComponent>; | ||
|
||
export const Primary: Story = { | ||
args: {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.