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: don't use peer deps - use regular deps #736

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 7 additions & 24 deletions plugin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@
"prepare": "npm run build"
},
"dependencies": {
"@gatsbyjs/reach-router": "^2.0.0",
"@netlify/functions": "^1.6.0",
"@netlify/ipx": "^1.4.6",
"abortcontroller-polyfill": "^1.7.3",
"chalk": "^4.1.2",
"co-body": "^6.1.0",
"common-tags": "^1.8.2",
"cookie": "^0.6.0",
"download": "^8.0.0",
"etag": "^1.8.1",
Expand All @@ -61,7 +63,6 @@
"uuid": "^9.0.0"
},
"devDependencies": {
"@gatsbyjs/reach-router": "^2.0.0",
"@netlify/build": "^29.27.0",
"@types/chance": "^1.1.3",
"@types/fs-extra": "^9.0.12",
Expand All @@ -75,9 +76,5 @@
"rimraf": "^5.0.0",
"tmp-promise": "^3.0.3",
"typescript": "^5.0.0"
},
"peerDependencies": {
"@gatsbyjs/reach-router": "*",
"common-tags": "^1.8.2"
}
}
10 changes: 1 addition & 9 deletions plugin/src/templates/api/gatsbyFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { existsSync } from 'fs'
import path from 'path'
import process from 'process'

import {
match as reachRouterMatch,
matchPath as reachRouterMatchPath,
} from '@gatsbyjs/reach-router'
import { match as reachMatch } from '@gatsbyjs/reach-router'
import { HandlerEvent } from '@netlify/functions'
import bodyParser from 'co-body'
import multer from 'multer'
Expand All @@ -16,11 +13,6 @@ import {
AugmentedGatsbyFunctionRequest,
} from './utils'

/**
* Depending on the version of '@gatsbyjs/reach-router' installed, the 'match' method may not be defined.
* This check ensures that this continues to work as expected between v1 and v2 of the package.
*/
const reachMatch = reachRouterMatch || reachRouterMatchPath
Comment on lines -19 to -23
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the behavior of match (v2 of router) / matchPath (v1 of router) did not change - with move to actual dependency we don't need to pick one or the other and can straight import match as reachMatch

const parseForm = multer().any()
type MulterReq = Parameters<typeof parseForm>[0]
type MulterRes = Parameters<typeof parseForm>[1]
Expand Down
Loading