-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix(gatsby-dev-cli): infer correct prefix from package path #8683
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DSchau
changed the title
WIP: fix(gatsby-dev-cli): infer correct prefix from package path
fix(gatsby-dev-cli): infer correct prefix from package path
Oct 2, 2018
DSchau
commented
Oct 2, 2018
.on(`all`, (event, filePath) => { | ||
if (event === `change` || event === `add`) { | ||
const packageName = path.basename(path.dirname(filePath.split(`packages/`).pop())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given something like packages/gatsby/dist/gatsby/cache-dir/something.js
this was inferring the packageName
to be cache-dir
rather than gatsby. This is the main fix here.
pieh
approved these changes
Oct 2, 2018
pieh
approved these changes
Oct 2, 2018
|
lipis
added a commit
to lipis/gatsby
that referenced
this pull request
Oct 3, 2018
* 'master' of github.com:gatsbyjs/gatsby: (72 commits) fix: fix wording in plopfile (gatsbyjs#8735) fix: navigateTo deprecation message (gatsbyjs#8745) Add deploying-to-heroku.md (gatsbyjs#8721) fix(docs): Link to instructions on adding to plugin library (gatsbyjs#8686) updated gatsby-plugin-remove-trailing-slashes docs to include link re… (gatsbyjs#8720) feat(www/starters): Add TypeScript and Contentful starter (gatsbyjs#8704) fix(docs): fix typos in template doc (gatsbyjs#8692) feat(www): change chevron direction on sticky responsive sidebar (gatsbyjs#8664) chore(release): Publish [integration] [cypress-gatsby] feat: Add Gatsby API support to our Cypress plugin (gatsbyjs#8641) chore(release): Publish fix(gatsby): add mjs config to webpack and resolve correctly (gatsbyjs#8717) feat(gatsby-plugin-netlify): add force option to createRedirect (gatsbyjs#8521) [www/starters] tweaks to fix DX for no GH token on www (gatsbyjs#8718) chore(release): Publish fix(gatsby-dev-cli): infer correct prefix from package path (gatsbyjs#8683) fix(www/starters): fix broken link to submission instructions (gatsbyjs#8715) chore(release): Publish feat(gatsby) : add createContentDigest helper (gatsbyjs#8687) feat: publish SendGrid case study blogpost (gatsbyjs#8592) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a bug in gatsby-dev-cli where the cache-dir was copying to the wrong spot--and likely other files as well.
path.basename(path.dirname(somePath))
infers the parent folder of the current file, not thepackages/${packageName}
that we actually want.Additionally, this PR fixes an issue with non-existant files causing the
ready
event to never be triggered. That particular issue has been fixed, and seems to be related to paulmillr/chokidar#449