0.9.3 • Published 12 months ago

ds-scan v0.9.3

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

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'
]