feat(tool): 🔧 Knip tool to find unused files
Part of https://github.com/digdir/designsystemet/issues/1502
A proof of concept for adding Knip.
knip: Runs knip in all workspaces defined in package.json
knip:storybook: Does not find any unused files 😄
knip:react: Note:🗒️ The package.json sets it index to the /dist so Knip thinks dist is the folder to check for unused files. Should add custom config for this package to fix it.
knip:storefront: Finds some interesting files that might not be used
I haven't look to closely on this but is it not possible to use this with just npx and some cli commands? I see there is some configuration to get it working 🤔
I haven't look to closely on this but is it not possible to use this with just
npxand some cli commands? I see there is some configuration to get it working 🤔
Yes, most of the configuration is just to make it simpler to use for a monorepo.
The package.json in each repo would have to be correct in either case or a separate config file created. (The packages/react folder needs a separate config file, the current entry file points to dist/ files).
hmm, I think we'll save this for later as we still have a lot of code lying around that might or might not be used again. Things are still in flux before V1. Ideally I would like for a tool to not be installed as a dependency also 🤔
Yeah, I agree. Hopefully we can make it into a single command that does the installation so we have less dependencies. But currently I don't see a way to avoid the setup file.
Closing the pull request for when you want to look at this again another time.
Closing the pull request for when you want to look at this again another time.
Thanks for taking the time to investigate this for us! <3