Skip to content

Commit

Permalink
fix: 🐛 Make gatsby-source-filesystem a peer dependency
Browse files Browse the repository at this point in the history
Use the version installed by the user, since it depends on the overall
Gatsby version.

BREAKING CHANGE: gatsby-source-filesystem is now a peer dependency. Install the correct
version for the version of Gatsby your site uses (v3 or v4).
  • Loading branch information
dylanon committed Jan 9, 2022
1 parent 75a0e81 commit da3a77e
Show file tree
Hide file tree
Showing 9 changed files with 364 additions and 777 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Install the package from npm:

`npm i gatsby-source-etsy`

Install peer dependencies:

`npm i gatsby-source-filesystem`

### Sites on Gatsby v1, v2

Install version 1 from npm:
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
},
"dependencies": {
"bottleneck": "^2.19.5",
"gatsby-source-filesystem": "^4.4.0",
"node-fetch": "^2.6.0"
},
"peerDependencies": {
"gatsby-source-filesystem": "^3.0.0 || ^4.0.0"
},
"engines": {
"node": ">=14.15.0"
},
Expand Down
1 change: 1 addition & 0 deletions test_sites/gatsby_v3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ GATSBY_ETSY_API_KEY=your-api-key
GATSBY_ETSY_STORE_ID=your-store-id
```

- `yalc add gatsby-source-etsy`
- `yarn develop`
3 changes: 2 additions & 1 deletion test_sites/gatsby_v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
},
"dependencies": {
"gatsby": "^3.0.0",
"gatsby-source-etsy": "file:.yalc/gatsby-source-etsy",
"gatsby-source-etsy": "^2.0.0-alpha.1",
"gatsby-source-filesystem": "^3.0.0",
"react": "^17.0.1",
"react-dom": "^17.0.1"
}
Expand Down
29 changes: 25 additions & 4 deletions test_sites/gatsby_v3/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4347,7 +4347,7 @@ fastest-levenshtein@^1.0.12:
resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2"
integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==

fastq@^1.10.0, fastq@^1.13.0, fastq@^1.6.0:
fastq@^1.10.0, fastq@^1.11.1, fastq@^1.13.0, fastq@^1.6.0:
version "1.13.0"
resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c"
integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==
Expand Down Expand Up @@ -4801,13 +4801,34 @@ gatsby-recipes@^0.25.0:
xstate "^4.9.1"
yoga-layout-prebuilt "^1.9.6"

"gatsby-source-etsy@file:.yalc/gatsby-source-etsy":
version "2.0.0"
gatsby-source-etsy@^2.0.0-alpha.1:
version "2.0.0-alpha.1"
resolved "https://registry.yarnpkg.com/gatsby-source-etsy/-/gatsby-source-etsy-2.0.0-alpha.1.tgz#37acc4e134f6e9f85b92999bc17e1352e49da4c1"
integrity sha512-JXlXc46zNEGy3Rsx2cyo0D0NKSRlguwB51TCZ2vRsYAGO7SrGYJJ0wx11dscTKy0MtW20IeRmvH+EMPKmU43fQ==
dependencies:
bottleneck "^2.19.5"
gatsby-source-filesystem "^4.4.0"
node-fetch "^2.6.0"

gatsby-source-filesystem@^3.0.0:
version "3.14.0"
resolved "https://registry.yarnpkg.com/gatsby-source-filesystem/-/gatsby-source-filesystem-3.14.0.tgz#ae2b930091a932b33270cb9cc2d9caaf0abc1742"
integrity sha512-Gg5GGxiWXhjapWMYdXOGk7zp+ajYowS+xNmaDUkL1gH+IQLvE18XbvKh00B/HiFaHm4azJfS2QRrRI/mPTZX+w==
dependencies:
"@babel/runtime" "^7.15.4"
chokidar "^3.5.2"
fastq "^1.11.1"
file-type "^16.5.3"
fs-extra "^10.0.0"
gatsby-core-utils "^2.14.0"
got "^9.6.0"
md5-file "^5.0.0"
mime "^2.5.2"
pretty-bytes "^5.4.1"
progress "^2.0.3"
valid-url "^1.0.9"
xstate "^4.14.0"

gatsby-source-filesystem@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/gatsby-source-filesystem/-/gatsby-source-filesystem-4.4.0.tgz#9921ac0600166e4ee0cd561d194c2df89a42e11d"
Expand Down Expand Up @@ -10162,7 +10183,7 @@ xss@^1.0.6:
commander "^2.20.3"
cssfilter "0.0.10"

xstate@^4.11.0, xstate@^4.26.1, xstate@^4.9.1:
xstate@^4.11.0, xstate@^4.14.0, xstate@^4.26.1, xstate@^4.9.1:
version "4.27.0"
resolved "https://registry.yarnpkg.com/xstate/-/xstate-4.27.0.tgz#f3c918ac4229bd5e6dec2231e991ba55c6bfa559"
integrity sha512-ohOwDM9tViC/zSSmY9261CHblDPqiaAk5vyjVbi69uJv9fGWMzlm0VDQwM2OvC61GKfXVBeuWSMkL7LPUsTpfA==
Expand Down
1 change: 1 addition & 0 deletions test_sites/gatsby_v4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ GATSBY_ETSY_API_KEY=your-api-key
GATSBY_ETSY_STORE_ID=your-store-id
```

- `yalc add gatsby-source-etsy`
- `yarn develop`
3 changes: 2 additions & 1 deletion test_sites/gatsby_v4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
},
"dependencies": {
"gatsby": "^4.4.0",
"gatsby-source-etsy": "file:.yalc/gatsby-source-etsy",
"gatsby-source-etsy": "^2.0.0-alpha.1",
"gatsby-source-filesystem": "^4.0.0",
"react": "^17.0.1",
"react-dom": "^17.0.1"
}
Expand Down
2 changes: 1 addition & 1 deletion test_sites/gatsby_v4/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4707,7 +4707,7 @@ gatsby-source-etsy@^2.0.0-alpha.1:
gatsby-source-filesystem "^4.4.0"
node-fetch "^2.6.0"

gatsby-source-filesystem@^4.4.0:
gatsby-source-filesystem@^4.0.0, gatsby-source-filesystem@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/gatsby-source-filesystem/-/gatsby-source-filesystem-4.4.0.tgz#9921ac0600166e4ee0cd561d194c2df89a42e11d"
integrity sha512-tN+aJdOnBf92V9oHXaGzPB6gL0EhpYH0mh/dfszroy25CtSq07fZu8SynS/B3ClJVi22MkD0imcDVMlPJGSQ3w==
Expand Down
Loading

0 comments on commit da3a77e

Please sign in to comment.