forked from processing/p5.js-web-editor
-
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 branch 'develop' into refactor/getProjectsForUser
- Loading branch information
Showing
246 changed files
with
49,514 additions
and
35,031 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 |
---|---|---|
|
@@ -19,7 +19,6 @@ MAILGUN_KEY=<your-mailgun-api-key> | |
ML5_LIBRARY_USERNAME=ml5 | ||
ML5_LIBRARY_EMAIL=[email protected] | ||
ML5_LIBRARY_PASS=helloml5 | ||
MOBILE_ENABLED=true | ||
MONGO_URL=mongodb://localhost:27017/p5js-web-editor | ||
PORT=8000 | ||
PREVIEW_PORT=8002 | ||
|
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 |
---|---|---|
@@ -1,29 +1,35 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
/** @type { import('@storybook/react-webpack5').StorybookConfig } */ | ||
const config = { | ||
stories: ['../client/**/*.stories.(jsx|mdx)'], | ||
addons: [ | ||
'@storybook/addon-actions', | ||
'@storybook/addon-docs', | ||
'@storybook/addon-knobs', | ||
'@storybook/addon-links', | ||
'storybook-addon-theme-playground/dist/register' | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-interactions' | ||
], | ||
webpackFinal: async config => { | ||
// do mutation to the config | ||
|
||
const rules = config.module.rules; | ||
|
||
// modify storybook's file-loader rule to avoid conflicts with svgr | ||
const fileLoaderRule = rules.find(rule => rule.test.test('.svg')); | ||
fileLoaderRule.exclude = path.resolve(__dirname, '../client'); | ||
framework: { | ||
name: '@storybook/react-webpack5', | ||
options: {} | ||
}, | ||
docs: { | ||
autodocs: 'tag' | ||
}, | ||
async webpackFinal(config) { | ||
// https://storybook.js.org/docs/react/builders/webpack | ||
// this modifies the existing image rule to exclude .svg files | ||
// since we want to handle those files with @svgr/webpack | ||
const imageRule = config.module.rules.find(rule => rule.test.test('.svg')) | ||
imageRule.exclude = /\.svg$/ | ||
|
||
// use svgr for svg files | ||
rules.push({ | ||
// configure .svg files to be loaded with @svgr/webpack | ||
config.module.rules.push({ | ||
test: /\.svg$/, | ||
use: ["@svgr/webpack"], | ||
use: ['@svgr/webpack'] | ||
}) | ||
|
||
return config; | ||
return config | ||
}, | ||
}; | ||
|
||
export default config; | ||
|
||
|
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,5 @@ | ||
<script> | ||
// https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/176#issuecomment-683150213 | ||
window.$RefreshReg$ = () => {}; | ||
window.$RefreshSig$ = () => () => {}; | ||
</script> |
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,31 +1,25 @@ | ||
import React from 'react'; | ||
import { addDecorator, addParameters } from '@storybook/react'; | ||
import { withKnobs } from "@storybook/addon-knobs"; | ||
import { withThemePlayground } from 'storybook-addon-theme-playground'; | ||
import { ThemeProvider } from "styled-components"; | ||
import { Provider } from 'react-redux'; | ||
import { MemoryRouter } from 'react-router'; | ||
|
||
import theme, { Theme } from '../client/theme'; | ||
import ThemeProvider from '../client/modules/App/components/ThemeProvider'; | ||
import configureStore from '../client/store'; | ||
import '../client/i18n-test'; | ||
import '../client/styles/storybook.css' | ||
|
||
addDecorator(withKnobs); | ||
const initialState = window.__INITIAL_STATE__; | ||
|
||
const themeConfigs = Object.values(Theme).map( | ||
name => { | ||
return { name, theme: theme[name] }; | ||
} | ||
); | ||
const store = configureStore(initialState); | ||
|
||
addDecorator(withThemePlayground({ | ||
theme: themeConfigs, | ||
provider: ThemeProvider | ||
})); | ||
export const decorators = [ | ||
(Story) => ( | ||
<Provider store={store}> | ||
<MemoryRouter> | ||
<ThemeProvider> | ||
<Story /> | ||
</ThemeProvider> | ||
</MemoryRouter> | ||
</Provider> | ||
), | ||
] | ||
|
||
addParameters({ | ||
options: { | ||
/** | ||
* display the top-level grouping as a "root" in the sidebar | ||
*/ | ||
showRoots: true, | ||
}, | ||
}) | ||
|
||
// addDecorator(storyFn => <ThemeProvider theme={theme}>{storyFn()}</ThemeProvider>); |
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,5 @@ | ||
import { createBrowserHistory } from 'history'; | ||
|
||
const browserHistory = createBrowserHistory(); | ||
|
||
export default browserHistory; |
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
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.