From ab3a0f328526a4b53b9f96f8cf0f308c4f7da0e5 Mon Sep 17 00:00:00 2001 From: Jack Pope Date: Wed, 24 Jul 2024 17:05:40 -0400 Subject: [PATCH] Fix existing usage of names/type in build command --- scripts/rollup/build-all-release-channels.js | 14 +++++--------- scripts/rollup/build.js | 10 +++++++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/rollup/build-all-release-channels.js b/scripts/rollup/build-all-release-channels.js index b7bc76a1aaaed..9ddfec0831e7e 100644 --- a/scripts/rollup/build-all-release-channels.js +++ b/scripts/rollup/build-all-release-channels.js @@ -80,16 +80,12 @@ const argv = yargs.wrap(yargs.terminalWidth()).options({ type: 'choices', choices: ['circleci', 'github'], }, - bundle: { - describe: 'Build the given bundle type.', + type: { + describe: `Build the given bundle type. (${Object.values( + Bundles.bundleTypes + )})`, requiresArg: false, - type: 'choices', - choices: [...Object.values(Bundles.bundleTypes)], - }, - names: { - describe: 'Build for matched bundle names. Example: "react-test,index.js".', - requiresArg: false, - type: 'array', + type: 'string', }, pretty: { describe: 'Force pretty output.', diff --git a/scripts/rollup/build.js b/scripts/rollup/build.js index cfa8710354e73..50e1b1750e477 100644 --- a/scripts/rollup/build.js +++ b/scripts/rollup/build.js @@ -84,11 +84,15 @@ function parseRequestedNames(names, toCase) { } return result; } -const argvType = Array.isArray(argv.bundle) ? argv.bundle : [argv.bundle]; -const requestedBundleTypes = argv.bundle ? argvType : []; +const argvType = Array.isArray(argv.type) ? argv.type : [argv.type]; +const requestedBundleTypes = parseRequestedNames( + argv.type ? argvType : [], + 'uppercase' +); +const names = argv._; const requestedBundleNames = parseRequestedNames( - argv.names ? argv.names : [], + names ? names : [], 'lowercase' ); const forcePrettyOutput = argv.pretty;