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

Build & Doc Fixes #41

Merged
merged 3 commits into from
Aug 1, 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
5 changes: 3 additions & 2 deletions .github/workflows/develop_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

# Get head commit message
- name: Print head git commit message
id: get_head_commit_message
Expand Down Expand Up @@ -78,11 +78,12 @@ jobs:
API_USER_NAME: ${{ secrets.API_USER_NAME}}
API_USER_PASS: ${{ secrets.API_USER_PASS }}
id: chromatic_publish
uses: chromaui/action@v1
uses: chromaui/action@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitZeroOnChanges: true
allowConsoleErrors: true

# Create new release
- name: Create a release
Expand Down
23 changes: 11 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Tests

on:
Expand All @@ -23,12 +22,12 @@ jobs:
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

# Get head commit message
- name: Print head git commit message
id: get_head_commit_message
run: echo "::set-output name=HEAD_COMMIT_MESSAGE::$(git show -s --format=%s)"

# Setup git user
- name: Setup git user
run: |
Expand All @@ -40,7 +39,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: latest

# Install modules
- name: Installing modules
id: install_modules
Expand All @@ -52,7 +51,7 @@ jobs:
- name: Save release version to outputs
id: save_release_version
run: echo ::set-output name=version::$(node -pe "require('./pullRequestRelease.json').version")

# Run Unit Tests
- name: Running tests
env:
Expand All @@ -61,7 +60,7 @@ jobs:
API_USER_PASS: ${{ secrets.API_USER_PASS }}
id: tests
run: yarn run test

# Test the build
- name: Build test
env:
Expand All @@ -70,30 +69,30 @@ jobs:
API_USER_PASS: ${{ secrets.API_USER_PASS }}
id: build_test
run: yarn run build:test

# Build storybook documentation
- name: Build documentation JSON
id: build_docs_json
run: yarn docs

# Publish documentation to chromatic
- name: Publish to Chromatic
env:
ENDPOINT_API: ${{ secrets.ENDPOINT_API}}
API_USER_NAME: ${{ secrets.API_USER_NAME}}
API_USER_PASS: ${{ secrets.API_USER_PASS }}
id: chromatic_publish
uses: chromaui/action@v1
uses: chromaui/action@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitZeroOnChanges: true

# Change package version to make release
- name: Change npm version
id: change_npm_version
run: npm version ${{ steps.save_release_version.outputs.version }} --no-git-tag-version --force

# Publish new release to NPM
- name: Publish to NPM
id: npm_publish
Expand All @@ -102,7 +101,7 @@ jobs:
token: ${{ secrets.NPM_TOKEN }}
tag: pull_request_${{ steps.save_release_version.outputs.version }}
access: public

# Notify discord if all steps succeeded
- name: Discord notification
env:
Expand Down
42 changes: 28 additions & 14 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
import type { StorybookConfig } from '@storybook/core-common';
export default {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-jest',
'@storybook/addon-webpack5-compiler-swc',
'@chromatic-com/storybook',
],
core: {},

module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-jest'],
features: {
storyStoreV7: true,
modernInlineRender: true,
framework: {
name: '@storybook/react-webpack5',
options: {},
},
core: {
builder: {
name: 'webpack5',
lazyCompilation: true,
},

// webpackFinal: async (config) => {
// // Add node externals to webpack config
// config.externals = [
// nodeExternals({
// allowlist: [/^node:/],
// }),
// ];

// // Return the altered config
// return config;
// },
typescript: {
reactDocgen: 'react-docgen-typescript',
},
framework: '@storybook/react',
} as StorybookConfig;
};
3 changes: 2 additions & 1 deletion .storybook/preview-body.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<style>
html,
body,
#root {
#root,
#storybook-root {
height: 100%;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
Expand Down
2 changes: 1 addition & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const decorators = [
(Story) => (
<ReqoreUIProvider theme={{ main: '#111111', intents: { info: '#7f4098' } }}>
<ReqoreLayoutContent>
<ReqoreContent style={{ padding: '20px' }}>
<ReqoreContent style={{ padding: '20px', height: '100%' }}>
<Story />
</ReqoreContent>
</ReqoreLayoutContent>
Expand Down
14 changes: 14 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"jsc": {
"parser": {
"syntax": "ecmascript",
"jsx": true,
"tsx": true
},
"transform": {
"react": {
"runtime": "automatic" // Use the new JSX transform
}
}
}
}
Loading
Loading