Publish only updates react-native-web packages

The script to release react-native-web is now limited to version-locking
related packages, not every package in the monorepo.
This commit is contained in:
Nicolas Gallagher
2022-07-01 13:56:09 -07:00
parent aee652f6c9
commit 50e267b0aa
4 changed files with 13 additions and 9 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"private": true, "private": true,
"version": "0.18.3", "version": "0.0.0",
"name": "monorepo", "name": "monorepo",
"scripts": { "scripts": {
"clean": "del-cli ./packages/*/dist", "clean": "del-cli ./packages/*/dist",
@@ -25,7 +25,7 @@
"lint": "yarn lint:report --fix", "lint": "yarn lint:report --fix",
"lint:report": "eslint configs packages scripts --config ./configs/.eslintrc", "lint:report": "eslint configs packages scripts --config ./configs/.eslintrc",
"prerelease": "yarn test && yarn compile", "prerelease": "yarn test && yarn compile",
"release": "node ./scripts/releasePackages.js", "release": "node ./scripts/releaseReactNativeWebPackages.js",
"postrelease": "yarn docs:release && yarn benchmarks:release", "postrelease": "yarn docs:release && yarn benchmarks:release",
"test": "yarn flow && yarn fmt:report && yarn lint:report && yarn jest --runInBand" "test": "yarn flow && yarn fmt:report && yarn lint:report && yarn jest --runInBand"
}, },
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"private": true, "private": true,
"name": "benchmarks", "name": "benchmarks",
"version": "0.18.3", "version": "0.0.0",
"scripts": { "scripts": {
"dev": "mkdir -p dist && cp -f index.html dist/index.html && ./node_modules/.bin/webpack-cli --config ./webpack.config.js", "dev": "mkdir -p dist && cp -f index.html dist/index.html && ./node_modules/.bin/webpack-cli --config ./webpack.config.js",
"build": "NODE_ENV=production yarn dev" "build": "NODE_ENV=production yarn dev"
@@ -1,7 +1,7 @@
{ {
"private": true, "private": true,
"name": "dom-event-testing-library", "name": "dom-event-testing-library",
"version": "0.18.3", "version": "0.0.0",
"main": "index.js", "main": "index.js",
"description": "Browser event sequences for unit tests", "description": "Browser event sequences for unit tests",
"author": "Nicolas Gallagher", "author": "Nicolas Gallagher",
@@ -15,13 +15,17 @@ const version = argv._[0];
const skipGit = argv['skip-git']; const skipGit = argv['skip-git'];
const oneTimeCode = argv.otp; const oneTimeCode = argv.otp;
console.log(`Publishing ${version}`); console.log(`Publishing react-native-web@${version}`);
// Collect workspaces and package manifests // Collect 'react-native-web' workspaces and package manifests
const workspacePaths = require('../package.json').workspaces.concat(['./']); const workspacePaths = require('../package.json').workspaces;
const workspaces = workspacePaths.reduce((acc, curr) => { const workspaces = workspacePaths.reduce((acc, curr) => {
const packageDirectories = glob.sync(path.resolve(curr)); const packageDirectories = glob.sync(curr);
packageDirectories.forEach((directory) => { const subsetOfpackageDirectories = packageDirectories.filter((dir) => {
return dir.includes('react-native-web');
});
subsetOfpackageDirectories.forEach((dir) => {
const directory = path.resolve(dir);
const packageJsonPath = path.join(directory, 'package.json'); const packageJsonPath = path.join(directory, 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf-8' })); const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf-8' }));
acc.push({ directory, packageJson, packageJsonPath }); acc.push({ directory, packageJson, packageJsonPath });