google / wireit

Wireit upgrades your npm/pnpm/yarn scripts to make them smarter and more efficient.
Apache License 2.0
6.07k stars 107 forks source link

Is there a way to pass extra arguments to the command in a key/value array? #767

Open scherler opened 1 year ago

scherler commented 1 year ago

Hi there, love the tool so far,

my edge case is

 "openapi-generator:generate": {
      "command": "yarn openapi-generator-cli generate --global-property models --global-property supportingFiles=models.ts --additional-properties=enumPropertyNaming=UPPERCASE --additional-properties=useTags=true -g typescript-node -i backend-for-frontend.yaml -t .openapi-generator/typescript-node -o src/main/ts/generated --enable-post-process-file --inline-schema-name-mappings findInfosDetails_200_response=IndexData,findLogs_200_response=LogsData,findInfosSummary_200_response=SummaryData"
    },

looking into breaking that down I would consider something like this:

"command-args": [['global-property':'...'], ['o', 'src/main/ts/generated']

there I mixed -- and - maybe they need to separated.

Is there something like this? If not would that be interesting for the project?

aomarks commented 1 year ago

Is the problem that your command is very long, so you want to split up the flags into an array to make it more readable?

I think I prefer it just written out the normal way, personally. That way the command you'd run on the terminal is identical to what's in the wireit config.

BTW you probably don't need the "yarn" at the beginning of your command.