Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
54nd10 committed Jan 5, 2024
1 parent e5691b8 commit b719b8d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 41 deletions.
6 changes: 4 additions & 2 deletions apps/www/scripts/storybook-checker.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {join} from 'path'
import fg from 'fast-glob'
import fs from 'fs'
import tablemark from 'tablemark'
;(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('/')
Expand All @@ -12,7 +12,9 @@ import tablemark from 'tablemark'
const name = parent.split('/').pop()
const fileExists = fs.existsSync(`${parent}/${name}.stories.tsx`)
if (fileExists) {
return {name, hasStory: '✅', path: `${parent}/${name}.stories.tsx`}
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: ''}
}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"fs": "0.0.1-security",
"npm-run-all": "^4.1.5",
"prettier": "^3.1.1",
"tablemark": "^3.0.0",
"ts-node": "^10.9.1",
"tsx": "^4.3.0"
},
Expand Down
38 changes: 0 additions & 38 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b719b8d

Please sign in to comment.