Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include 10up-toolkit in NPM dependencies instead of devDependencies #138

Open
1 task done
johnwatkins0 opened this issue Jun 13, 2022 · 0 comments
Open
1 task done

Comments

@johnwatkins0
Copy link
Member

johnwatkins0 commented Jun 13, 2022

Is your enhancement related to a problem? Please describe.

I suggest reconsidering this project's approach to dev dependencies vs. dependencies.

Any production build/deployment process for a project based on WP Scaffold should have a mechanism to exclude dependencies that are not needed within the automated job -- specifically, we should be able to run npm install --production in a build script to exclude devDependencies, similarly to how we use composer install --no-dev. This can have a noticeable impact on build times wherever there are multiple dev dependencies.

I suggest differentiating dev dependencies vs. production dependencies this way:

  • A dev dependency is a dependency that's not needed to build, run, or deploy a production site. husky and lint-staged would fall in this category because they're local development tools. A testing library like jest would also fall in this category because, even though it's used in automated test jobs, it's not needed in the final build/deployment script that builds the production version of a project.
  • A production dependency is a dependency used to build, run or deploy the production version of a project. This includes 10up-toolkit, as 10up-toolkit is crucial to build any project that uses the theme or plugin from WP Scaffold.

So my suggestion is:

  • Keep husky and lint-staged where they are, because they're not needed for anything outside local development.
  • Move 10up-toolkit into dependencies

This would allow engineers to selectively run npm install --production in build/deploy scripts wherever it makes sense to do so.

Designs

No response

Describe alternatives you've considered

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant