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

feature: apply pnp #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

feature: apply pnp #1

wants to merge 2 commits into from

Conversation

rizchelwood
Copy link
Owner

@rizchelwood rizchelwood commented Dec 11, 2018

This pull request resolves Task 3 in the work samples.

I enabled the Plug'n'Play feature when a user creates a new Gatsby site.

New features proposed:

  • Use --use-pnp when creating a new Gatsby site (i.e. gatsby new some-app --use-pnp)
  • When --use-pnp is flagged, node_modules will not appear

I do show the installation times when it's finished. If I had more time, I would've reached out to someone on the team to fully understand what was wanted from Installation times should be compared/contrasted via using the flag and not using the flag. Currently, it just outputs the installation time depending on if it's using PnP or not.

I didn't have enough time to write tests but I did manually test it. If I had more time, I would've written some tests for the functions used and compare if the output is what was expected.

Basic testing:

  • Run npm link in the gatsby-cli node_module
  • Run npx gatsby new test --use-pnp to test PnP
  • Run npx gatsby new test to test without PnP
  • Check if there are node_modules in the new Gatsby site

Note: I referenced create-react-app on how to validate if the user is using yarn and if it's the right version as well as the general implementation of PnP.

Let me know if you have any questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant