Unverified Commit 9f76476a authored by Will Binns-Smith's avatar Will Binns-Smith Committed by GitHub

pack-next: use default `--js-build` as option instead of `--no-js-build` (#77686)

Yargs automatically creates `--no-` variations of options. Using
`--no-js-build` as an option directly confuses it.

`--no-js-build` remains a valid cli argument.

Test Plan: Verify `pnpm pack-next` builds JS by default and `pnpm
pack-next --no-js-build` doesn’t.

Help now looks like this:

```
pack-next.ts

Options:
      --help      Show help                                            [boolean]
      --version   Show version number                                  [boolean]
      --js-build  Build JavaScript code (default). Use `--no-js-build` to skip
                  building JavaScript                  [boolean] [default: true]
  -p, --project                                                         [string]
      --tar       Create tarballs instead of direct reflinks           [boolean]
      --compress  How compress the binary, useful on platforms where tarballs
                  can exceed 2 GiB, which causes ERR_FS_FILE_TOO_LARGE with
                  pnpm. Defaults to "strip" on Linux, otherwise defaults to
                  "none". Requires `--tar` to be set.
                                             [string] [choices: "none", "strip"]
```
parent ad5f5db6
......@@ -33,9 +33,11 @@ interface CliOptions {
const cliOptions = yargs(process.argv.slice(2))
.command('$0')
.option('no-js-build', {
.option('js-build', {
type: 'boolean',
describe: 'Skip building JavaScript code',
default: true,
describe:
'Build JavaScript code (default). Use `--no-js-build` to skip building JavaScript',
})
.option('project', {
alias: 'p',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment