Skip to content

Commit

Permalink
Allow React 18 additionally to 17 as a peer dependency of the compone…
Browse files Browse the repository at this point in the history
…nt package (#46)
  • Loading branch information
neesjanvaneck authored Dec 16, 2022
1 parent 21b859d commit 3f32fea
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions copy-component-package-json.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
const fs = require('fs');
const pkg = require('./package.json');

const peerDependenciesList = [
'mobx',
'mobx-react-lite',
'react',
'react-dom',
];
const {
version, author, keywords, license, homepage, repository, bugs, dependencies, engines
} = pkg;
const peerDependencies = {};
peerDependenciesList.forEach(d => {
peerDependencies[d] = dependencies[d];
delete dependencies[d];
const peerDependencies = {
mobx: undefined,
"mobx-react-lite": undefined,
react: "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
};
Object.keys(peerDependencies).forEach(key => {
if (!peerDependencies[key]) peerDependencies[key] = dependencies[key];
delete dependencies[key];
});
const newPkg = {
name: 'vosviewer-online',
Expand Down

0 comments on commit 3f32fea

Please sign in to comment.