KhronosGroup / glTF-Project-Explorer

Tool to provide a filterable registry of glTF community projects.
Apache License 2.0
87 stars 47 forks source link

Missing and unused dependencies #69

Open javagl opened 4 years ago

javagl commented 4 years ago

When running depcheck in the main directory (after a yarn global add depcheck), there are some unused and missing dependencies reported:

Unused dependencies
* @types/jest
* @types/node
Missing dependencies
* eslint-config-react-app: .\package.json
* babel-eslint: .\package.json
* eslint-plugin-import: .\package.json
* eslint-plugin-flowtype: .\package.json
* eslint-plugin-jsx-a11y: .\package.json
* eslint-plugin-react: .\package.json
* eslint-plugin-react-hooks: .\package.json
* @redux-saga/core: .\src\index.tsx

(Where one of the "unused" dependencies caused some issues in another context).

Can somebody who is more familiar with dependency management confirm that

  1. the unused dependencies can safely be removed
  2. it makes sense to add the missing dependencies

?

(The missing ones don't seem to be strictly necessary, that's why I'm not sure...)

weegeekps commented 4 years ago

The unused dependencies are type packages for TypeScript. @types/jest is for the Jest unit test stuff which we aren't using much of, and @types/node is the typical node stuff. Including each isn't necessarily a bad thing, although both could be moved to devDependencies.

I believe the eslint missing dependencies are due to the fact that depcheck checks against the package.json, and all of the linter configuration is within the react-scripts package. I'm not sure why it's also flagging @redux-saga/core as a missing dependency as the project wouldn't build without that.

We probably can do a little cleanup of the package.json file. I see a bunch of things under dependencies that should probably be moved to devDependencies for the sake of the CI build process. Ultimately, the production builds are only including what is actually being used by the code under /src given how react-scripts configures webpack.

weegeekps commented 4 years ago

Recently the new version of React and Create React App came out, which I'll be upgrading us to soon. When I do so I will audit the dependencies and move those that should be moved to devDependencies.