Skip to content

Commit

Permalink
Update storybook-checker.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
54nd10 committed Jan 5, 2024
1 parent 2ba8957 commit 55751cf
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions apps/www/scripts/storybook-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@ import fg from 'fast-glob'
import fs from 'fs'
;(async () => {
const uiComponents = fg.sync(join(__dirname, `../src/components/ui/**/*/index.tsx`))
console.log(process.cwd())
const componentsStories = await Promise.all(
uiComponents.map(async (path) => {
const splitedPath = path.split('/')
splitedPath.pop()
const parent = splitedPath.join('/')
const name = parent.split('/').pop()
const fileExists = fs.existsSync(`${parent}/${name}.stories.tsx`)
if (fileExists) {
const projectName = process.cwd().split('/').pop() || ''
const relativePath = `.${parent.split(projectName)[1]}`
return {name, hasStory: '✅', path: `${relativePath}/${name}.stories.tsx`}
} else {
return {name, hasStory: '❌', path: ''}
}
return {name, hasStory: fileExists ? '✅' : '❌'}
})
)
console.log(JSON.stringify(componentsStories))
Expand Down

0 comments on commit 55751cf

Please sign in to comment.