Last active
July 23, 2021 10:50
-
-
Save kevinfodness/2cc55225e572218f8c51783c1aea1c37 to your computer and use it in GitHub Desktop.
A node script for extracting @WordPress npm package versions from a git checkout of Gutenberg at a specific tag.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const metapackage = require('./gutenberg/package.json'); | |
Object.keys(metapackage.dependencies) | |
.map((package) => package.replace(/^@wordpress\//, '')) | |
.forEach((package) => { | |
const packageJSON = require(`./gutenberg/packages/${package}/package.json`); | |
if (![ | |
'edit-navigation', | |
'react-native-aztec', | |
'react-native-bridge', | |
'react-native-editor', | |
].includes(package)) { | |
console.log(`"@wordpress/${package}": "^${packageJSON.version}",`); | |
} | |
}); | |
console.log(''); | |
const dewp = require('./gutenberg/packages/dependency-extraction-webpack-plugin/package.json'); | |
console.log(`"@wordpress/dependency-extraction-webpack-plugin": "^${dewp.version}",`); | |
console.log(''); | |
console.log(`"react": "^${metapackage.devDependencies.react}",`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment