Skip to content

Commit

Permalink
Replace semver with optional peer dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound authored and brianc committed Oct 4, 2020
1 parent 5825843 commit a02dfac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
5 changes: 0 additions & 5 deletions packages/pg/lib/native/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@
// eslint-disable-next-line
var Native = require('pg-native')
var TypeOverrides = require('../type-overrides')
var semver = require('semver')
var pkg = require('../../package.json')
var assert = require('assert')
var EventEmitter = require('events').EventEmitter
var util = require('util')
var ConnectionParameters = require('../connection-parameters')

var msg = 'Version >= ' + pkg.minNativeVersion + ' of pg-native required.'
assert(semver.gte(Native.version, pkg.minNativeVersion), msg)

var NativeQuery = require('./query')

var Client = (module.exports = function (config) {
Expand Down
12 changes: 9 additions & 3 deletions packages/pg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,22 @@
"pg-pool": "^3.2.1",
"pg-protocol": "^1.2.5",
"pg-types": "^2.1.0",
"pgpass": "1.x",
"semver": "4.3.2"
"pgpass": "1.x"
},
"devDependencies": {
"async": "0.9.0",
"bluebird": "3.5.2",
"co": "4.6.0",
"pg-copy-streams": "0.3.0"
},
"minNativeVersion": "2.0.0",
"peerDependencies": {
"pg-native": ">=2.0.0"
},
"peerDependenciesMeta": {
"pg-native": {
"optional": true
}
},
"scripts": {
"test": "make test-all"
},
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5077,11 +5077,6 @@ safe-regex@^1.1.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==

semver@4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.2.tgz#c7a07158a80bedd052355b770d82d6640f803be7"
integrity sha1-x6BxWKgL7dBSNVt3DYLWZA+AO+c=

semver@^6.0.0, semver@^6.1.0, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
Expand Down

0 comments on commit a02dfac

Please sign in to comment.