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

fix(gatsby-dev-cli): infer correct prefix from package path #8683

Merged
merged 10 commits into from
Oct 2, 2018

Conversation

DSchau
Copy link
Contributor

@DSchau DSchau commented Oct 1, 2018

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 the packages/${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

@DSchau DSchau requested a review from a team as a code owner October 1, 2018 20:24
@DSchau 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
.on(`all`, (event, filePath) => {
if (event === `change` || event === `add`) {
const packageName = path.basename(path.dirname(filePath.split(`packages/`).pop()))
Copy link
Contributor Author

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.

@DSchau DSchau merged commit 30b68e2 into gatsbyjs:master Oct 2, 2018
@DSchau DSchau deleted the gatsby-dev-cli/path-fix branch October 2, 2018 19:07
@DSchau
Copy link
Contributor Author

DSchau commented Oct 2, 2018

Successfully published:
 - gatsby-dev-cli@2.4.4

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants