Skip to content

Commit

Permalink
chore(build): add version script to bump peer dependencies on new ver…
Browse files Browse the repository at this point in the history
…sion
  • Loading branch information
wyze authored and plouc committed Nov 16, 2020
1 parent 1d5a483 commit ea55db2
Show file tree
Hide file tree
Showing 30 changed files with 111 additions and 81 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
},
"scripts": {
"changelog": "rm CHANGELOG.md && node scripts/generate-changelog.js",
"make:init": "make init"
"make:init": "make init",
"version": "node scripts/bump-peer-deps.js"
},
"workspaces": [
"packages/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/annotations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/axes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/bullet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@types/d3-scale": "^3.2.1"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"react": ">= 16.8.4 < 18.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/bump/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/calendar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/chord/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/circle-packing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/colors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@types/react-motion": "^0.0.29"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 <= 17.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/funnel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"peerDependencies": {
"@nivo/annotations": "0.63.1",
"@nivo/colors": "0.63.0",
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"@nivo/tooltip": "0.63.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/geo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/heatmap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/legends/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/line/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/marimekko/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@types/d3-shape": "^2.0.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"react": ">= 16.8.4 <= 17.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/network/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/parallel-coordinates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/pie/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@types/d3-shape": "^2.0.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"react": ">= 16.8.4 < 18.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/radar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sankey/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/scatterplot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/stream/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sunburst/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
106 changes: 53 additions & 53 deletions packages/swarmplot/package.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
{
"name": "@nivo/swarmplot",
"version": "0.65.0",
"license": "MIT",
"author": {
"name": "Raphaël Benitte",
"url": "https://github.com/plouc"
},
"repository": {
"type": "git",
"url": "https://github.com/plouc/nivo.git",
"directory": "packages/swarmplot"
},
"keywords": [
"nivo",
"dataviz",
"react",
"d3",
"charts",
"force",
"swarmplot"
],
"main": "./dist/nivo-swarmplot.cjs.js",
"module": "./dist/nivo-swarmplot.es.js",
"files": [
"README.md",
"LICENSE.md",
"index.d.ts",
"dist/"
],
"dependencies": {
"@nivo/annotations": "0.65.0",
"@nivo/axes": "0.65.0",
"@nivo/colors": "0.65.0",
"@nivo/legends": "0.65.0",
"@nivo/scales": "0.65.0",
"@nivo/tooltip": "0.65.0",
"@nivo/voronoi": "0.65.0",
"d3-force": "^2.0.1",
"d3-scale": "^3.0.0",
"lodash": "^4.17.11",
"react-motion": "^0.5.2"
},
"devDependencies": {
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
"publishConfig": {
"access": "public"
}
"name": "@nivo/swarmplot",
"version": "0.65.0",
"license": "MIT",
"author": {
"name": "Raphaël Benitte",
"url": "https://github.com/plouc"
},
"repository": {
"type": "git",
"url": "https://github.com/plouc/nivo.git",
"directory": "packages/swarmplot"
},
"keywords": [
"nivo",
"dataviz",
"react",
"d3",
"charts",
"force",
"swarmplot"
],
"main": "./dist/nivo-swarmplot.cjs.js",
"module": "./dist/nivo-swarmplot.es.js",
"files": [
"README.md",
"LICENSE.md",
"index.d.ts",
"dist/"
],
"dependencies": {
"@nivo/annotations": "0.65.0",
"@nivo/axes": "0.65.0",
"@nivo/colors": "0.65.0",
"@nivo/legends": "0.65.0",
"@nivo/scales": "0.65.0",
"@nivo/tooltip": "0.65.0",
"@nivo/voronoi": "0.65.0",
"d3-force": "^2.0.1",
"d3-scale": "^3.0.0",
"lodash": "^4.17.11",
"react-motion": "^0.5.2"
},
"devDependencies": {
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
"publishConfig": {
"access": "public"
}
}
2 changes: 1 addition & 1 deletion packages/tooltip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0"
"@nivo/core": "0.65.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/treemap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/voronoi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/waffle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@nivo/core": "0.65.0"
},
"peerDependencies": {
"@nivo/core": "0.64.0",
"@nivo/core": "0.65.0",
"prop-types": ">= 15.5.10 < 16.0.0",
"react": ">= 16.8.4 < 18.0.0"
},
Expand Down
29 changes: 29 additions & 0 deletions scripts/bump-peer-deps.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const fs = require('fs')
const { join } = require('path')

function parseFile(file) {
return JSON.parse(fs.readFileSync(file, 'utf-8'))
}

const packages = fs
.readdirSync('./packages', { withFileTypes: true })
.filter(dirent => dirent.isDirectory() && dirent.name !== 'core')
.map(dirent => join('packages', dirent.name, 'package.json'))

packages
.map(file => [file, parseFile(file)])
.filter(
([, { devDependencies, peerDependencies }]) =>
'@nivo/core' in (peerDependencies || {}) &&
'@nivo/core' in (devDependencies || {}) &&
peerDependencies['@nivo/core'] !== devDependencies['@nivo/core']
)
.forEach(([file, package]) => {
const version = package.devDependencies['@nivo/core']

package.peerDependencies['@nivo/core'] = version

console.log(`Bumping peerDependency of '@nivo/core' in '${package.name}' to ${version}.`)

fs.writeFileSync(file, JSON.stringify(package, null, 2) + '\n', { encoding: 'utf-8' })
})

0 comments on commit ea55db2

Please sign in to comment.