Skip to content

Commit

Permalink
chore(run): warn in docs about using yarn and passing args to lerna r…
Browse files Browse the repository at this point in the history
…un (#3521)
  • Loading branch information
fahslaj committed Feb 3, 2023
1 parent b8dff21 commit aaccdfb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Expand Up @@ -17,6 +17,7 @@ env:
NX_CLOUD_DISTRIBUTED_EXECUTION: true
NX_BRANCH: ${{ github.event.number || github.ref_name }}
NX_VERBOSE_LOGGING: true
NX_CLOUD_NUMBER_OF_RETRIES: 1

jobs:
main:
Expand Down
8 changes: 8 additions & 0 deletions libs/commands/run/README.md
Expand Up @@ -18,6 +18,14 @@ $ lerna run --parallel watch
Run an [npm script](https://docs.npmjs.com/misc/scripts) in each package that contains that script. A double-dash (`--`)
is necessary to pass dashed arguments to the script execution.

> **Note for using yarn:**
>
> ```sh
> $ yarn lerna <script> -- [..args]
> ```
>
> The double dash (`--`) will be stripped by `yarn`. This results in the inability for Lerna to pass additional args to child scripts through the command line alone. To get around this, either globally install Lerna and run it directly, or create a script in `package.json` with your `lerna run` command and use `yarn` to directly run that instead.
## Options

`lerna run` accepts all [filter flags](https://www.npmjs.com/package/@lerna/filter-options).
Expand Down
11 changes: 7 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -119,7 +119,7 @@
"@nrwl/eslint-plugin-nx": "15.5.2",
"@nrwl/jest": "15.5.2",
"@nrwl/js": "15.5.2",
"@nrwl/nx-cloud": "15.0.2",
"@nrwl/nx-cloud": "15.0.4-beta.3",
"@nrwl/nx-plugin": "15.5.2",
"@nrwl/web": "15.5.2",
"@swc-node/register": "^1.4.2",
Expand Down
4 changes: 2 additions & 2 deletions tools/scripts/build.sh
Expand Up @@ -13,8 +13,8 @@ workspaceRoot=$(pwd)
# Teardown any old outputs
rm -rf ./dist

# Build any packages which require a build step (ensure no DTE to avoid looping agents)
npx nx run-many -t build --no-dte
# Build any packages which require a build step
npx nx run-many -t build

# Resolve the packages using lerna itself
IFS=$'\n' read -d '' -a packageLocations < <((./node_modules/node-jq/bin/jq -c -r '.[].location') <<<"$(npx lerna list --json)")
Expand Down

0 comments on commit aaccdfb

Please sign in to comment.