react/scripts/release/prepare-release-from-npm-commands/parse-params.js
Brian Vaughn 8e13f099ab
Overhauled release scripts and docs (#18569)
* Overhauled release scripts and docs
2020-04-10 12:28:40 -07:00

43 lines
880 B
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: '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-ddaf2b07c)',
},
];
module.exports = () => {
const params = commandLineArgs(paramDefinitions);
splitCommaParams(params.skipPackages);
return params;
};