ds-scan
v0.9.3
Published
Built for tracking design system usage but works for all imports.
Downloads
11
Maintainers
Readme
DS Scanner
Built for tracking design system components but works for all components that are being imported.
After installing, run npx ds-scan-init
and update the created dsScanConfig.json
file with the name of components / libraries you want to track.
[
{ "component": "Button", "from": "@library/components" },
{ "component": "Button", "from": "@other-library/components" },
{ "component": "Select", "from": "@library/components" },
{ "component": "Card", "from": "@other-library/components" },
]
Run npx ds-scan -p=[RELATIVE_PATH_TO_PARENT_FOLDER]
add -d
to have it return the which files are using each component.
Example
npx ds-scan -p=app/assets/javascripts/ui -d
Will output:
Component: Button | Usage Count: 3
Files using component: [
'/app/assets/javascripts/ui/layouts/settings/main.tsx'
'/app/assets/javascripts/ui/layouts/home/main.tsx'
]
Component: Select | Usage Count: 4
Files using component: [
'/app/assets/javascripts/ui/layouts/home/main.tsx'
'/app/assets/javascripts/ui/layouts/settings/main.tsx'
]
Component: Card | Usage Count: 2
Files using component: [
'/app/assets/javascripts/ui/layouts/profile/header.tsx'
]