Skip to content

Use primer/react-scripts toolchain #2046

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

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
044dd20
Move theme decorator into helper util
siddharthkp Apr 22, 2022
80d7fff
fix height
siddharthkp Apr 22, 2022
530aeff
is addons import the problem?
siddharthkp Apr 22, 2022
2830b36
does this work better for consumer-tests?
siddharthkp Apr 22, 2022
9839140
yep, deep import doesn't work either
siddharthkp Apr 22, 2022
c93ffeb
use @primer/react-scripts
siddharthkp Apr 22, 2022
853271e
update to latest primer-scripts
siddharthkp Apr 25, 2022
c3b305e
Merge branch 'main' into siddharth/primer-scripts
siddharthkp Apr 25, 2022
a5cbd27
move primer/react-scripts to devDependencies
siddharthkp Apr 25, 2022
2c58aac
Install with fixed peer dependencies
siddharthkp Apr 25, 2022
967e961
use special preview.js for primer/react
siddharthkp Apr 25, 2022
dd603d1
use webpack aliases to use local version of primer/react
siddharthkp Apr 26, 2022
192dfe9
Merge branch 'main' into siddharth/primer-scripts
siddharthkp May 23, 2022
e703daf
add missing newline
siddharthkp May 23, 2022
3ce93a8
Merge branch 'main' into siddharth/primer-scripts
siddharthkp May 25, 2022
d5d2d18
use stable version!
siddharthkp May 25, 2022
158a221
update react-scripts to 0.0.2
siddharthkp Jun 1, 2022
3dd9c5d
Merge branch 'main' into siddharth/primer-scripts
siddharthkp Jun 1, 2022
f317e9c
idk
siddharthkp Jul 18, 2022
6b30739
Merge branch 'main' into siddharth/primer-scripts
siddharthkp Jul 18, 2022
940269b
remove unintentional changes
siddharthkp Jul 19, 2022
a62f31b
remove unintentional changes
siddharthkp Jul 19, 2022
8270713
remove unintentional changes
siddharthkp Jul 19, 2022
c9e221b
missing newline
siddharthkp Jul 19, 2022
0a6056d
change node version to 16 for deploys
siddharthkp Jul 19, 2022
e49d5ef
resolve docs peer dependencies
siddharthkp Jul 19, 2022
9fe5b92
use --legacy-peer-deps as hotfix
siddharthkp Jul 19, 2022
a5e6caa
Revert "use --legacy-peer-deps as hotfix"
siddharthkp Jul 19, 2022
8cab324
Revert "resolve docs peer dependencies"
siddharthkp Jul 19, 2022
5d01542
Revert "change node version to 16 for deploys"
siddharthkp Jul 19, 2022
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
17 changes: 11 additions & 6 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
const path = require('path')
const defaultConfig = require('@primer/react-scripts/storybook/main')

module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
...defaultConfig,
addons: [
'@storybook/addon-a11y',
'@storybook/addon-links',
{name: '@storybook/addon-essentials', options: {backgrounds: false}},
'storybook-addon-performance/register',
{name: 'storybook-addon-turbo-build', options: {optimizationLevel: 2}},
...defaultConfig.addons,

...(process.env.NODE_ENV === 'production' && process.env.GITHUB_JOB !== 'chromatic'
? ['@whitespace/storybook-addon-html']
: [])
],
webpackFinal: config => {
// we alias node_modules/@primer/react for storybook to use local version instead
config.resolve.alias['@primer/react/lib-esm'] = path.resolve(__dirname, '../src')
return config
},
babel: options => {
options.plugins.push(['open-source', {editor: process.env.NODE_ENV === 'production' ? 'github' : 'vscode'}])
return options
Expand Down
16 changes: 4 additions & 12 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import {addons} from '@storybook/addons'
import {withPerformance} from 'storybook-addon-performance'
import {withThemeProvider, toolbarTypes} from '../src/utils/story-helpers'

export const globalTypes = toolbarTypes
export const decorators = [withThemeProvider, withPerformance]

addons.setConfig({
// Some stories may set up keyboard event handlers, which can be interfered
// with by these keyboard shortcuts.
enableShortcuts: false
})
export * from '@primer/react-scripts/storybook/preview'

// additional parameters for addons
export const parameters = {
actions: {argTypesRegex: '^on[A-Z].*'},

// for @whitespace/storybook-addon-html,
html: {
root: '#html-addon-root',
removeEmptyComments: true
Expand Down
Loading