react/scripts/release/prepare-release-from-npm-commands/parse-params.js
lauren 2df9622477
[release] Update publishing scripts to make publishing allowlisted packages easier (#32486)
It's getting unwieldy to list every single package to skip in these
commands when you only want to publish one, ie
eslint-plugin-react-hooks.

This adds a new `onlyPackages` and `publishVersion` option to the
publish commands to make that easier.
2025-02-27 11:24:30 -05:00

51 lines
1.0 KiB
JavaScript

#!/usr/bin/env node
'use strict';
const commandLineArgs = require('command-line-args');
const {splitCommaParams} = require('../utils');
const paramDefinitions = [
{
name: 'local',
type: Boolean,
description:
'Skip NPM and use the build already present in "build/node_modules".',
defaultValue: false,
},
{
name: 'onlyPackages',
type: String,
multiple: true,
description: 'Packages to include in publishing',
defaultValue: [],
},
{
name: 'skipPackages',
type: String,
multiple: true,
description: 'Packages to exclude from publishing',
defaultValue: [],
},
{
name: 'skipTests',
type: Boolean,
description: 'Skip automated fixture tests.',
defaultValue: false,
},
{
name: 'version',
type: String,
description:
'Version of published "next" release (e.g. 0.0.0-0e526bcec-20210202)',
},
];
module.exports = () => {
const params = commandLineArgs(paramDefinitions);
splitCommaParams(params.skipPackages);
return params;
};