required
-
- {required ? 'yes' : 'no'}
-
+ {required ? 'yes' : 'no'}
type
@@ -77,9 +75,7 @@ export default function Api({params}) {
}
if (docs) {
- return Array.isArray(docs)
- ? docs.map(renderComponentDoc)
- : renderComponentDoc(docs)
+ return Array.isArray(docs) ? docs.map(renderComponentDoc) : renderComponentDoc(docs)
}
return null
diff --git a/packages/sui-studio/src/components/documentation/Markdown.js b/packages/sui-studio/src/components/documentation/Markdown.js
index aee7f2791..8210921c9 100644
--- a/packages/sui-studio/src/components/documentation/Markdown.js
+++ b/packages/sui-studio/src/components/documentation/Markdown.js
@@ -3,14 +3,7 @@ import PropTypes from 'prop-types'
import snarkdown from '../../snarkdown.js'
export default function Markdown({content}) {
- return (
- content && (
-
- )
- )
+ return content &&
}
Markdown.propTypes = {
diff --git a/packages/sui-studio/src/components/layout/Logo.js b/packages/sui-studio/src/components/layout/Logo.js
index ed9d6417b..e30c9c34d 100644
--- a/packages/sui-studio/src/components/layout/Logo.js
+++ b/packages/sui-studio/src/components/layout/Logo.js
@@ -1,8 +1,3 @@
import {getStudioLogo} from '../utils'
-export default () => (
-
-)
+export default () =>
diff --git a/packages/sui-studio/src/components/layout/index.js b/packages/sui-studio/src/components/layout/index.js
index 809db869f..65fbd4579 100644
--- a/packages/sui-studio/src/components/layout/index.js
+++ b/packages/sui-studio/src/components/layout/index.js
@@ -1,4 +1,4 @@
-import React, {useEffect, useState, useRef} from 'react'
+import React, {useEffect, useRef, useState} from 'react'
import cx from 'classnames'
import PropTypes from 'prop-types'
diff --git a/packages/sui-studio/src/components/navigation/index.js b/packages/sui-studio/src/components/navigation/index.js
index d50caa5b6..0adb17b39 100644
--- a/packages/sui-studio/src/components/navigation/index.js
+++ b/packages/sui-studio/src/components/navigation/index.js
@@ -10,10 +10,7 @@ export default function Navigation({handleClick, search}) {
const filterComponentsFromSearch = ({search}) => {
return componentsList.filter(({category, component}) => {
const lowerCasedSearch = search.toLowerCase()
- return (
- category.toLowerCase().includes(lowerCasedSearch) ||
- component.toLowerCase().includes(lowerCasedSearch)
- )
+ return category.toLowerCase().includes(lowerCasedSearch) || component.toLowerCase().includes(lowerCasedSearch)
})
}
@@ -53,9 +50,7 @@ export default function Navigation({handleClick, search}) {
return (
-
- {renderListFilteredBySearch({handleClick, search})}
-
+ {renderListFilteredBySearch({handleClick, search})}
)
}
diff --git a/packages/sui-studio/src/components/preview/index.js b/packages/sui-studio/src/components/preview/index.js
index 31eced51a..433d43872 100644
--- a/packages/sui-studio/src/components/preview/index.js
+++ b/packages/sui-studio/src/components/preview/index.js
@@ -57,19 +57,13 @@ export default function Preview({code, scope = {React}}) {
const compiledCode = getCompiledCode({code, scope})
const Component = eval(compiledCode)(...Object.values(scope)) // eslint-disable-line
- return (
-
- {Component}
-
- )
+ return
{Component}
}
return (
-
- {renderCode()}
-
+ {renderCode()}
)
diff --git a/packages/sui-studio/src/components/tryRequire.js b/packages/sui-studio/src/components/tryRequire.js
index b18d0e0cd..7ef5815e7 100644
--- a/packages/sui-studio/src/components/tryRequire.js
+++ b/packages/sui-studio/src/components/tryRequire.js
@@ -15,12 +15,9 @@ export const fetchComponentSrcRawFile = ({category, component}) =>
fetchStaticFile(`/components/${category}/${component}/src/index.js`)
export const fetchComponentsDefinitions = ({category, component}) =>
- window
- .fetch(`/components/${category}/${component}/src/definitions.json`)
- .then(res => res.json())
+ window.fetch(`/components/${category}/${component}/src/definitions.json`).then(res => res.json())
-export const fetchComponentsReadme = () =>
- fetchStaticFile(`/components/README.md`)
+export const fetchComponentsReadme = () => fetchStaticFile(`/components/README.md`)
export const fetchMarkdownFile = ({category, component, file}) =>
fetchStaticFile(`/components/${category}/${component}/${file}.md`)
@@ -38,12 +35,7 @@ export const importContexts = ({category, component}) =>
)
})
-export const importReactComponent = ({
- category,
- component,
- subComponentName = null,
- extractDefault = false
-}) => {
+export const importReactComponent = ({category, component, subComponentName = null, extractDefault = false}) => {
if (typeof subComponentName === 'string') {
return safeImport({
extractDefault,
@@ -93,8 +85,4 @@ export const importGlobals = () => {
}
export const importMainModules = params =>
- Promise.all([
- importReactComponent(params),
- importContexts(params),
- importDemo(params)
- ])
+ Promise.all([importReactComponent(params), importContexts(params), importDemo(params)])
diff --git a/packages/sui-studio/src/components/utils.js b/packages/sui-studio/src/components/utils.js
index 74a8c9e68..d19f8d960 100644
--- a/packages/sui-studio/src/components/utils.js
+++ b/packages/sui-studio/src/components/utils.js
@@ -47,9 +47,7 @@ export const getStudioLogo = () => {
* @return {string}
*/
export const extractDisplayName = Component =>
- Component.displayName ||
- (Component.type && Component.type.displayName) ||
- Component.name
+ Component.displayName || (Component.type && Component.type.displayName) || Component.name
/**
* Add React Context
@@ -86,11 +84,7 @@ export const addReactContextToComponent = (Component, {context}) => {
* @param {() => Promise
} params.importFile function to import dynamically a module
* @return {Promise}
*/
-export const safeImport = async ({
- defaultValue = false,
- extractDefault = true,
- importFile
-}) => {
+export const safeImport = async ({defaultValue = false, extractDefault = true, importFile}) => {
const file = await importFile().catch(() => defaultValue)
if (typeof file === 'undefined') {
return Promise.reject(new Error('Error requiring file'))
diff --git a/packages/sui-studio/src/environment-mocha/setupEnvironment.js b/packages/sui-studio/src/environment-mocha/setupEnvironment.js
index d7c020464..0ca2310d0 100644
--- a/packages/sui-studio/src/environment-mocha/setupEnvironment.js
+++ b/packages/sui-studio/src/environment-mocha/setupEnvironment.js
@@ -10,12 +10,7 @@ DefaultWrapper.propTypes = {
const getWrapper = ({contexts = [], wrapper: Wrapper = DefaultWrapper}) => {
const ContextsWrapper = ({children}) =>
- contexts.reduce(
- (children, {provider: Provider, value}) => (
- {children}
- ),
- children
- )
+ contexts.reduce((children, {provider: Provider, value}) => {children} , children)
const CustomWrapper = ({children}) => (
diff --git a/packages/sui-studio/src/patcher-mocha/index.js b/packages/sui-studio/src/patcher-mocha/index.js
index 6b7fbe403..c0a879e21 100644
--- a/packages/sui-studio/src/patcher-mocha/index.js
+++ b/packages/sui-studio/src/patcher-mocha/index.js
@@ -23,20 +23,14 @@ class DescribeContext {
return function (title, cb, componentKey) {
const originalFn = global[FUNCTION_TO_PATCH]
- const Component =
- global.__STUDIO_COMPONENT__[componentKey] || global.__STUDIO_COMPONENT__
+ const Component = global.__STUDIO_COMPONENT__[componentKey] || global.__STUDIO_COMPONENT__
const {displayName} = Component
- const contextsForComponent =
- global.__STUDIO_CONTEXTS__[componentKey] ||
- global.__STUDIO_CONTEXTS__ ||
- {}
+ const contextsForComponent = global.__STUDIO_CONTEXTS__[componentKey] || global.__STUDIO_CONTEXTS__ || {}
if (!contextsForComponent) {
- console.error(
- `[${displayName}] Using context ${contextToUse} but no contexts defined in context.js file.`
- )
+ console.error(`[${displayName}] Using context ${contextToUse} but no contexts defined in context.js file.`)
return originalFn(title, cb)
}
@@ -54,9 +48,7 @@ class DescribeContext {
const NextComponent = addReactContextToComponent(Component, {context})
- return originalFn(`[${contextToUse}] ${title}`, () =>
- cb(NextComponent, {context})
- )
+ return originalFn(`[${contextToUse}] ${title}`, () => cb(NextComponent, {context}))
}
}
}
diff --git a/packages/sui-studio/src/routes.js b/packages/sui-studio/src/routes.js
index 3e35e0716..a725456dd 100644
--- a/packages/sui-studio/src/routes.js
+++ b/packages/sui-studio/src/routes.js
@@ -10,25 +10,14 @@ import {FILES} from './constants.js'
export default (
-
+
- }
- />
- (
-
- )}
- />
+ } />
+ } />
diff --git a/packages/sui-studio/src/runtime-mocha/index.js b/packages/sui-studio/src/runtime-mocha/index.js
index d780f704c..3bd12a255 100644
--- a/packages/sui-studio/src/runtime-mocha/index.js
+++ b/packages/sui-studio/src/runtime-mocha/index.js
@@ -20,9 +20,7 @@ const categories = CATEGORIES ? CATEGORIES.split(',') : null
const filterAll = key => {
const [, category] = key.split('/')
- return categories
- ? categories.includes(category)
- : micromatch.isMatch(key, globPattern, {contains: true})
+ return categories ? categories.includes(category) : micromatch.isMatch(key, globPattern, {contains: true})
}
// Require all the files from a context
@@ -49,8 +47,7 @@ Promise.all(
let categoryComponentKey = `${category}/${component}`
let subComponentName = null
- const subComponentRegex =
- /components\.(?\w+)\.test\.(js|jsx)/
+ const subComponentRegex = /components\.(?\w+)\.test\.(js|jsx)/
const matchesSubComponent = key.match(subComponentRegex)
if (matchesSubComponent !== null) {
@@ -59,8 +56,7 @@ Promise.all(
}
const getContexts = await importContexts({category, component})
- const contexts =
- typeof getContexts === 'function' ? await getContexts() : getContexts
+ const contexts = typeof getContexts === 'function' ? await getContexts() : getContexts
const componentModule = await importReactComponent({
category,
@@ -69,13 +65,10 @@ Promise.all(
extractDefault: true
})
- const Component =
- componentModule && (componentModule.type || componentModule)
+ const Component = componentModule && (componentModule.type || componentModule)
if (!componentModule) {
- console.error(
- `Could not find component ${categoryComponentKey} in ${key}`
- )
+ console.error(`Could not find component ${categoryComponentKey} in ${key}`)
console.error(`Available keys: `, selectedTestFiles.keys())
throw new Error(`Missing export default from ${categoryComponentKey}`)
}
diff --git a/packages/sui-studio/src/snarkdown.js b/packages/sui-studio/src/snarkdown.js
index d292cb6c5..c5676f6fd 100644
--- a/packages/sui-studio/src/snarkdown.js
+++ b/packages/sui-studio/src/snarkdown.js
@@ -22,10 +22,7 @@ function outdent(str) {
* @private
*/
function encodeAttr(str) {
- return (str + '')
- .replace(/"/g, '"')
- .replace(//g, '>')
+ return (str + '').replace(/"/g, '"').replace(//g, '>')
}
/** Parse Markdown into an HTML String. */
@@ -96,16 +93,11 @@ export default function parse(md, prevLinks) {
}
// Images:
else if (token[8]) {
- chunk = ` `
+ chunk = ` `
}
// Links:
else if (token[10]) {
- out = out.replace(
- '',
- ` `
- )
+ out = out.replace(' ', ` `)
chunk = flush() + ' '
} else if (token[9]) {
chunk = ''
@@ -113,8 +105,7 @@ export default function parse(md, prevLinks) {
// Headings:
else if (token[12] || token[14]) {
t = 'h' + (token[14] ? token[14].length : token[13][0] === '=' ? 1 : 2)
- chunk =
- '<' + t + '>' + parse(token[12] || token[15], links) + '' + t + '>'
+ chunk = '<' + t + '>' + parse(token[12] || token[15], links) + '' + t + '>'
}
// `code`:
else if (token[16]) {
diff --git a/packages/sui-studio/test/server/copySpec.js b/packages/sui-studio/test/server/copySpec.js
index da09c0caf..ce5a113cc 100644
--- a/packages/sui-studio/test/server/copySpec.js
+++ b/packages/sui-studio/test/server/copySpec.js
@@ -32,10 +32,7 @@ describe('copyfiles', () => {
const to = 'runtime'
return copyfiles([from, to], {up: 1}).then(async () => {
- const out = path.join(
- __dirname,
- 'runtime/components/atom/button/index.js'
- )
+ const out = path.join(__dirname, 'runtime/components/atom/button/index.js')
const stat = await fs.stat(out)
expect(stat.isFile()).to.be.true
})
diff --git a/packages/sui-studio/test/server/integration/static-server.js b/packages/sui-studio/test/server/integration/static-server.js
index ecd4d9ad9..c95b0b22f 100644
--- a/packages/sui-studio/test/server/integration/static-server.js
+++ b/packages/sui-studio/test/server/integration/static-server.js
@@ -14,10 +14,7 @@ const server = http.createServer((req, res) => {
const ext = path.extname(req.url)
- const resource = fs.readFileSync(
- path.join(BASE_PATH, ext === '' ? 'index.html' : req.url),
- {encoding: 'utf8'}
- )
+ const resource = fs.readFileSync(path.join(BASE_PATH, ext === '' ? 'index.html' : req.url), {encoding: 'utf8'})
res.statusCode = 200
res.setHeader(
@@ -28,7 +25,5 @@ const server = http.createServer((req, res) => {
})
server.listen(port, hostname, () => {
- console.log(
- `Stactically serving content from ${BASE_PATH} in http://${hostname}:${port}`
- )
+ console.log(`Stactically serving content from ${BASE_PATH} in http://${hostname}:${port}`)
})
diff --git a/packages/sui-studio/test/server/integrationSpec.js b/packages/sui-studio/test/server/integrationSpec.js
index e211ad2c8..f66f50816 100644
--- a/packages/sui-studio/test/server/integrationSpec.js
+++ b/packages/sui-studio/test/server/integrationSpec.js
@@ -19,16 +19,13 @@ describe.skip('[Integration] sui-studio', () => {
it('Should compile and build a static version with one component', async function () {
this.timeout(0)
- const {stdout: stdoutStudioBuild} = await exec(
- `node "${SUI_STUDIO_BINARY_DIR}/sui-studio-build" -C`,
- {
- cwd: SAMPLE_STUDIO_PATH,
- env: {
- ...process.env,
- PWD: SAMPLE_STUDIO_PATH
- }
+ const {stdout: stdoutStudioBuild} = await exec(`node "${SUI_STUDIO_BINARY_DIR}/sui-studio-build" -C`, {
+ cwd: SAMPLE_STUDIO_PATH,
+ env: {
+ ...process.env,
+ PWD: SAMPLE_STUDIO_PATH
}
- )
+ })
expect(stdoutStudioBuild.includes('Error')).to.be.false
})
@@ -37,17 +34,13 @@ describe.skip('[Integration] sui-studio', () => {
this.timeout(0)
let server
try {
- server = childProcess.spawn(
- 'node',
- [`${SUI_STUDIO_BINARY_DIR}/sui-studio-dev`, 'atom/button'],
- {
- detached: false,
- env: {
- ...process.env,
- PWD: SAMPLE_STUDIO_PATH
- }
+ server = childProcess.spawn('node', [`${SUI_STUDIO_BINARY_DIR}/sui-studio-dev`, 'atom/button'], {
+ detached: false,
+ env: {
+ ...process.env,
+ PWD: SAMPLE_STUDIO_PATH
}
- )
+ })
// server.stdout.pipe(process.stdout)
// server.stderr.pipe(process.stdout)
@@ -82,12 +75,9 @@ describe.skip('[Integration] sui-studio', () => {
const {
stdout: stdoutStudioGenerate,
stderr: stderrStudioGenerate // eslint-disable-line
- } = await exec(
- `node "${SUI_STUDIO_BINARY_DIR}/sui-studio-generate.js" -P tst -S t-est fake component`,
- {
- cwd: EMPTY_STUDIO_PATH
- }
- )
+ } = await exec(`node "${SUI_STUDIO_BINARY_DIR}/sui-studio-generate.js" -P tst -S t-est fake component`, {
+ cwd: EMPTY_STUDIO_PATH
+ })
// console.log(stdoutStudioGenerate, stderrStudioGenerate)
@@ -102,17 +92,7 @@ describe.skip('[Integration] sui-studio', () => {
expect(stdoutStudioGenerate.includes('Error')).to.be.false
expect(componentManifest.name).to.be.eql('@t-est/tst-fake-component')
expect(
- fs.readFileSync(
- path.join(
- `${EMPTY_STUDIO_PATH}`,
- 'components',
- 'fake',
- 'component',
- 'src',
- 'index.js'
- ),
- 'utf8'
- )
+ fs.readFileSync(path.join(`${EMPTY_STUDIO_PATH}`, 'components', 'fake', 'component', 'src', 'index.js'), 'utf8')
).to.be.eql(`// import PropTypes from 'prop-types'
export default function FakeComponent() {
@@ -128,14 +108,7 @@ FakeComponent.propTypes = {}
`)
expect(
fs.readFileSync(
- path.join(
- `${EMPTY_STUDIO_PATH}`,
- 'components',
- 'fake',
- 'component',
- 'src',
- 'index.scss'
- ),
+ path.join(`${EMPTY_STUDIO_PATH}`, 'components', 'fake', 'component', 'src', 'index.scss'),
'utf8'
)
).to.be.eql(`@import '~@s-ui/theme/lib/index';
@@ -146,30 +119,11 @@ FakeComponent.propTypes = {}
`)
expect(
- fs.readFileSync(
- path.join(
- `${EMPTY_STUDIO_PATH}`,
- 'demo',
- 'fake',
- 'component',
- 'playground'
- ),
- 'utf8'
- )
+ fs.readFileSync(path.join(`${EMPTY_STUDIO_PATH}`, 'demo', 'fake', 'component', 'playground'), 'utf8')
).to.be.eql('return ( )')
- expect(
- fs.readFileSync(
- path.join(
- `${EMPTY_STUDIO_PATH}`,
- 'test',
- 'fake',
- 'component',
- 'index.js'
- ),
- 'utf8'
- )
- ).to.be.eql(`/*
+ expect(fs.readFileSync(path.join(`${EMPTY_STUDIO_PATH}`, 'test', 'fake', 'component', 'index.js'), 'utf8')).to.be
+ .eql(`/*
* Remember: YOUR COMPONENT IS DEFINED GLOBALLY
* */
diff --git a/packages/sui-studio/workbench/src/app.js b/packages/sui-studio/workbench/src/app.js
index e10ce4149..e3de42a59 100644
--- a/packages/sui-studio/workbench/src/app.js
+++ b/packages/sui-studio/workbench/src/app.js
@@ -26,9 +26,7 @@ const params = queryStringToJSON(window.location.href)
const importAll = requireContext => requireContext.keys().map(requireContext)
;(async () => {
- const {default: defaultStyle} = await import(
- '!css-loader!@s-ui/sass-loader!component/index.scss'
- )
+ const {default: defaultStyle} = await import('!css-loader!@s-ui/sass-loader!component/index.scss')
let styles = []
let requireContextThemesKeys = []
@@ -43,11 +41,7 @@ const importAll = requireContext => requireContext.keys().map(requireContext)
* ]
* We might want to filter those to avoid importAll to import twice the same
*/
- const requireContextThemes = require.context(
- '!css-loader!@s-ui/sass-loader!demo/themes',
- false,
- /\.scss$/
- )
+ const requireContextThemes = require.context('!css-loader!@s-ui/sass-loader!demo/themes', false, /\.scss$/)
requireContextThemesKeys = requireContextThemes.keys()
styles = importAll(requireContextThemes)
} catch {}
diff --git a/packages/sui-studio/workbench/src/components/Raw/index.js b/packages/sui-studio/workbench/src/components/Raw/index.js
index 1a23f30fc..b7e81c19d 100644
--- a/packages/sui-studio/workbench/src/components/Raw/index.js
+++ b/packages/sui-studio/workbench/src/components/Raw/index.js
@@ -6,11 +6,7 @@ import PropTypes from 'prop-types'
import SUIContext from '@s-ui/react-context'
-import {
- cleanDisplayName,
- createContextByType,
- removeDefaultContext
-} from '../../../../src/components/demo/utilities.js'
+import {cleanDisplayName, createContextByType, removeDefaultContext} from '../../../../src/components/demo/utilities.js'
import Preview from '../../../../src/components/preview/index.js'
import Style from '../../../../src/components/style/index.js'
import {fetchPlayground} from '../../../../src/components/tryRequire.js'
@@ -29,8 +25,7 @@ export default function Raw({
}) {
const [playground, setPlayground] = useState(null)
- const context =
- Object.keys(contexts).length && createContextByType(contexts, actualContext)
+ const context = Object.keys(contexts).length && createContextByType(contexts, actualContext)
// check if is a normal component or it's wrapped with a React.memo method
const ComponentToRender = Component.type ? Component.type : Component
@@ -50,8 +45,7 @@ export default function Raw({
scope={{
context,
React,
- [cleanDisplayName(ComponentToRender.displayName)]:
- ComponentToRender,
+ [cleanDisplayName(ComponentToRender.displayName)]: ComponentToRender,
...nonDefault
}}
code={playground}
diff --git a/packages/sui-studio/workbench/src/components/Root/index.js b/packages/sui-studio/workbench/src/components/Root/index.js
index 8568ccb45..37f324270 100644
--- a/packages/sui-studio/workbench/src/components/Root/index.js
+++ b/packages/sui-studio/workbench/src/components/Root/index.js
@@ -9,8 +9,7 @@ import Test from '../Suite/index.js'
const importComponent = () => import('component/index.js')
const importTest = () => import('test/index.test.js')
-const getFromStorage = (key, defaultValue) =>
- window.sessionStorage[key] || defaultValue
+const getFromStorage = (key, defaultValue) => window.sessionStorage[key] || defaultValue
const updateOnChange = (setState, sessionKey) => nextValue => {
window.sessionStorage.setItem(sessionKey, nextValue)
@@ -18,15 +17,9 @@ const updateOnChange = (setState, sessionKey) => nextValue => {
}
export default function Root({componentID, contexts = {}, themes}) {
- const [actualContext, setActualContext] = useState(() =>
- getFromStorage('actualContext', 'default')
- )
- const [actualStyle, setActualStyle] = useState(() =>
- getFromStorage('actualStyle', 'default')
- )
- const [showTests, setShowTests] = useState(() =>
- getFromStorage('showTests', 'show')
- )
+ const [actualContext, setActualContext] = useState(() => getFromStorage('actualContext', 'default'))
+ const [actualStyle, setActualStyle] = useState(() => getFromStorage('actualStyle', 'default'))
+ const [showTests, setShowTests] = useState(() => getFromStorage('showTests', 'show'))
const iframeSrc = `/?raw=true&actualStyle=${actualStyle}&actualContext=${actualContext}`
@@ -48,10 +41,7 @@ export default function Root({componentID, contexts = {}, themes}) {
{
- updateOnChange(
- setShowTests,
- 'showTests'
- )(showTests === 'show' ? 'hide' : 'show')
+ updateOnChange(setShowTests, 'showTests')(showTests === 'show' ? 'hide' : 'show')
}}
>
{showTests === 'show' ? 'Close Tests' : 'Open Tests'}
@@ -60,12 +50,7 @@ export default function Root({componentID, contexts = {}, themes}) {
-
+
)
diff --git a/packages/sui-studio/workbench/src/components/Suite/index.js b/packages/sui-studio/workbench/src/components/Suite/index.js
index 026e5bc0a..bc457a02a 100644
--- a/packages/sui-studio/workbench/src/components/Suite/index.js
+++ b/packages/sui-studio/workbench/src/components/Suite/index.js
@@ -3,10 +3,7 @@ import {useEffect, useState} from 'react'
import cx from 'classnames'
import PropTypes from 'prop-types'
-import {
- addReactContextToComponent,
- extractDisplayName
-} from '../../../../src/components/utils.js'
+import {addReactContextToComponent, extractDisplayName} from '../../../../src/components/utils.js'
import {addSetupEnvironment} from '../../../../src/environment-mocha/setupEnvironment.js'
addSetupEnvironment(window)
@@ -27,8 +24,7 @@ const Test = ({open, importTest, importComponent, contexts}) => {
const Component = module.default || module
const displayName = extractDisplayName(Component)
- const nextContexts =
- typeof contexts !== 'function' ? contexts : await contexts()
+ const nextContexts = typeof contexts !== 'function' ? contexts : await contexts()
window.__STUDIO_CONTEXTS__ = nextContexts
window.__STUDIO_COMPONENT__ = Component
diff --git a/packages/sui-svg/bin/sui-svg-build.js b/packages/sui-svg/bin/sui-svg-build.js
index cde80fe5e..c11b619e4 100755
--- a/packages/sui-svg/bin/sui-svg-build.js
+++ b/packages/sui-svg/bin/sui-svg-build.js
@@ -60,17 +60,10 @@ const installNeededDependencies = () => {
: exec(`npm install ${ATOM_ICON_PACKAGE}@${ATOM_ICON_VERSION} --save-exact`)
}
-const copyStylesFile = () =>
- copy(
- require.resolve('../templates/icon-styles.scss'),
- `${LIB_FOLDER}/index.scss`
- )
+const copyStylesFile = () => copy(require.resolve('../templates/icon-styles.scss'), `${LIB_FOLDER}/index.scss`)
const createIndexFile = () =>
- outputFile(
- `${LIB_FOLDER}/_demo.js`,
- `export const icons = import.meta.globEager('./**/*.js')`
- )
+ outputFile(`${LIB_FOLDER}/_demo.js`, `export const icons = import.meta.globEager('./**/*.js')`)
emptyDir(LIB_FOLDER)
.then(installNeededDependencies)
diff --git a/packages/sui-svg/bin/sui-svg-demo.js b/packages/sui-svg/bin/sui-svg-demo.js
index 415ad967b..4e244ca0b 100644
--- a/packages/sui-svg/bin/sui-svg-demo.js
+++ b/packages/sui-svg/bin/sui-svg-demo.js
@@ -13,13 +13,7 @@ console.log('[sui-svg] Preparing server with icons...')
const server = await createServer({
root,
optimizeDeps: {
- include: [
- 'classnames',
- 'prop-types',
- 'react',
- 'react/jsx-runtime',
- 'react-dom'
- ]
+ include: ['classnames', 'prop-types', 'react', 'react/jsx-runtime', 'react-dom']
},
resolve: {
alias: [
diff --git a/packages/sui-svg/bin/sui-svg-dist.js b/packages/sui-svg/bin/sui-svg-dist.js
index d2bf4e928..6c60bb972 100644
--- a/packages/sui-svg/bin/sui-svg-dist.js
+++ b/packages/sui-svg/bin/sui-svg-dist.js
@@ -14,13 +14,7 @@ console.log('[sui-svg] Preparing build with icons...')
await build({
root,
optimizeDeps: {
- include: [
- 'classnames',
- 'prop-types',
- 'react',
- 'react/jsx-runtime',
- 'react-dom'
- ]
+ include: ['classnames', 'prop-types', 'react', 'react/jsx-runtime', 'react-dom']
},
resolve: {
alias: [
diff --git a/packages/sui-svg/src/app.jsx b/packages/sui-svg/src/app.jsx
index 203112782..fe58bf891 100644
--- a/packages/sui-svg/src/app.jsx
+++ b/packages/sui-svg/src/app.jsx
@@ -65,18 +65,8 @@ const App = () => {
/>