Skip to content

Commit

Permalink
cleanup(docs): misc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Oct 12, 2022
1 parent 4c82f29 commit 1bb36dc
Show file tree
Hide file tree
Showing 13 changed files with 353 additions and 825 deletions.
6 changes: 3 additions & 3 deletions commands/run/index.js
Expand Up @@ -285,21 +285,21 @@ class RunCommand extends Command {
if (this.options.parallel || this.options.sort !== undefined) {
this.logger.warn(
this.name,
`"parallel", "sort", and "no-sort" are ignored when nx.json has targetDefaults defined. See https://lerna.js.org/docs/recipes/using-lerna-powered-by-nx-to-run-tasks for details.`
`"parallel", "sort", and "no-sort" are ignored when nx.json has targetDefaults defined. See https://lerna.js.org/docs/lerna6-obsolete-options for details.`
);
}

if (this.options.includeDependencies) {
this.logger.info(
this.name,
`Using the "include-dependencies" option when nx.json has targetDefaults defined will include both task dependencies detected by Nx and project dependencies detected by Lerna. See https://lerna.js.org/docs/recipes/using-lerna-powered-by-nx-to-run-tasks#--include-dependencies for details.`
`Using the "include-dependencies" option when nx.json has targetDefaults defined will include both task dependencies detected by Nx and project dependencies detected by Lerna. See https://lerna.js.org/docs/lerna6-obsolete-options#--include-dependencies for details.`
);
}

if (this.options.ignore) {
this.logger.info(
this.name,
`Using the "ignore" option when nx.json has targetDefaults defined will exclude only tasks that are not determined to be required by Nx. See https://lerna.js.org/docs/recipes/using-lerna-powered-by-nx-to-run-tasks#--ignore for details.`
`Using the "ignore" option when nx.json has targetDefaults defined will exclude only tasks that are not determined to be required by Nx. See https://lerna.js.org/docs/lerna6-obsolete-options#--ignore for details.`
);
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion core/global-options/README.md
Expand Up @@ -31,7 +31,7 @@ Disable progress bars. This is always the case in a CI environment.

### `--no-sort`

Note: As of Lerna 6 this property is ignored and should be configured in the `nx.json` file instead. Use `lerna add-caching` to set up the `nx.json` file.
Note: As of Lerna 6 this property is ignored when `nx.json` is present.

By default, all tasks execute on packages in topologically sorted order as to respect the dependency relationships of the packages in question. Cycles are broken on a best-effort basis in a way not guaranteed to be consistent across Lerna invocations.

Expand Down
2 changes: 1 addition & 1 deletion core/lerna/commands/add-caching/index.js
Expand Up @@ -93,7 +93,7 @@ class AddCachingCommand extends Command {
);
this.logger.info(
"add-caching",
"Note that the legacy task runner options of --sort, --no-sort and --parallel no longer apply. Learn more here: https://lerna.js.org/docs/recipes/using-lerna-powered-by-nx-to-run-tasks"
"Note that the legacy task runner options of --sort, --no-sort and --parallel no longer apply. Learn more here: https://lerna.js.org/docs/lerna6-obsolete-options"
);
}

Expand Down
13 changes: 5 additions & 8 deletions e2e/tests/lerna-create/lerna-create.spec.ts
Expand Up @@ -1186,18 +1186,15 @@ describe("lerna-create", () => {
lerna notice cli v999.9.9-e2e.0
lerna notice filter including "test-script"
lerna info filter [ 'test-script' ]
> test-script:test
lerna info Executing command in 1 package: "npm run test"
lerna info run Ran npm script 'test' in 'test-script' in X.Xs:
> test-script@0.0.0 test
> node ./__tests__/test-script.test.js
testScript tests passed
> Lerna (powered by Nx) Successfully ran target test for project test-script
testScript tests passed
lerna success run Ran npm script 'test' in 1 package in X.Xs:
lerna success - test-script
`);
});
Expand Down
44 changes: 22 additions & 22 deletions e2e/tests/lerna-run/lerna-run-legacy-task-runner.spec.ts
Expand Up @@ -223,15 +223,15 @@ describe("lerna-run-legacy-task-runner", () => {
const output = await fixture.lerna(`run print-name --npm-client=yarn`);

expect(output.combinedOutput).toMatchInlineSnapshot(`
yarn run v1.22.18
yarn run v1.22.10
$ echo test-package-X
test-package-X
Done in X.Xs.
yarn run v1.22.18
yarn run v1.22.10
$ echo test-package-X
test-package-X
Done in X.Xs.
yarn run v1.22.18
yarn run v1.22.10
$ echo test-package-X
test-package-X
Done in X.Xs.
Expand All @@ -253,31 +253,31 @@ describe("lerna-run-legacy-task-runner", () => {

expect(output.combinedOutput).toMatchInlineSnapshot(`
> package-X@0.0.0 print-name
> echo test-package-X
> package-X@0.0.0 print-name
> echo test-package-X
test-package-X
test-package-X
> package-X@0.0.0 print-name
> echo test-package-X
> package-X@0.0.0 print-name
> echo test-package-X
test-package-X
test-package-X
> package-X@0.0.0 print-name
> echo test-package-X
> package-X@0.0.0 print-name
> echo test-package-X
test-package-X
lerna notice cli v999.9.9-e2e.0
lerna info Executing command in 3 packages: "npm run print-name"
lerna info run Ran npm script 'print-name' in 'package-X' in X.Xs:
lerna info run Ran npm script 'print-name' in 'package-X' in X.Xs:
lerna info run Ran npm script 'print-name' in 'package-X' in X.Xs:
lerna success run Ran npm script 'print-name' in 3 packages in X.Xs:
lerna success - package-X
lerna success - package-X
lerna success - package-X
test-package-X
lerna notice cli v999.9.9-e2e.0
lerna info Executing command in 3 packages: "npm run print-name"
lerna info run Ran npm script 'print-name' in 'package-X' in X.Xs:
lerna info run Ran npm script 'print-name' in 'package-X' in X.Xs:
lerna info run Ran npm script 'print-name' in 'package-X' in X.Xs:
lerna success run Ran npm script 'print-name' in 3 packages in X.Xs:
lerna success - package-X
lerna success - package-X
lerna success - package-X
`);
`);
});
});

Expand Down
134 changes: 26 additions & 108 deletions e2e/tests/lerna-run/lerna-run-nx-include-dependencies.spec.ts
Expand Up @@ -91,23 +91,15 @@ describe("lerna-run-nx-include-dependencies", () => {
const output = await fixture.lerna("run print-name --scope package-3 -- --silent");

expect(output.combinedOutput).toMatchInlineSnapshot(`
> package-X:print-name --silent
> package-X@0.0.0 print-name
> echo test-package-X "--silent"
test-package-X --silent
> Lerna (powered by Nx) Successfully ran target print-name for project package-X
test-package-X
lerna notice cli v999.9.9-e2e.0
lerna verb rootPath /tmp/lerna-e2e/lerna-run-nx-include-dependencies/lerna-workspace
lerna notice filter including "package-X"
lerna info filter [ 'package-X' ]
lerna verb run nx.json was not found or is missing targetDefaults. Task dependencies will not be automatically included.
lerna info Executing command in 1 package: "npm run print-name --silent"
lerna info run Ran npm script 'print-name' in 'package-X' in X.Xs:
lerna success run Ran npm script 'print-name' in 1 package in X.Xs:
lerna success - package-X
`);
});
Expand All @@ -120,23 +112,15 @@ describe("lerna-run-nx-include-dependencies", () => {
const output = await fixture.lerna("run print-name --scope package-3 -- --silent");

expect(output.combinedOutput).toMatchInlineSnapshot(`
> package-X:print-name --silent
> package-X@0.0.0 print-name
> echo test-package-X "--silent"
test-package-X --silent
> Lerna (powered by Nx) Successfully ran target print-name for project package-X
test-package-X
lerna notice cli v999.9.9-e2e.0
lerna verb rootPath /tmp/lerna-e2e/lerna-run-nx-include-dependencies/lerna-workspace
lerna notice filter including "package-X"
lerna info filter [ 'package-X' ]
lerna verb run nx.json was not found or is missing targetDefaults. Task dependencies will not be automatically included.
lerna info Executing command in 1 package: "npm run print-name --silent"
lerna info run Ran npm script 'print-name' in 'package-X' in X.Xs:
lerna success run Ran npm script 'print-name' in 1 package in X.Xs:
lerna success - package-X
`);
});
Expand All @@ -157,42 +141,18 @@ describe("lerna-run-nx-include-dependencies", () => {

expect(output.combinedOutput).toMatchInlineSnapshot(`
> Lerna (powered by Nx) Running target print-name for project package-X and 2 task(s) it depends on
> package-X:print-name
> package-X@0.0.0 print-name
> echo test-package-X
test-package-X
> package-X:print-name
> package-X@0.0.0 print-name
> echo test-package-X
test-package-X
> package-X:print-name
> package-X@0.0.0 print-name
> echo test-package-X
test-package-X
> Lerna (powered by Nx) Successfully ran target print-name for project package-X
lerna notice cli v999.9.9-e2e.0
lerna verb rootPath /tmp/lerna-e2e/lerna-run-nx-include-dependencies/lerna-workspace
lerna notice filter including "package-X"
lerna info filter [ 'package-X' ]
lerna verb run nx.json with targetDefaults was found. Task dependencies will be automatically included.
lerna info Executing command in 1 package: "npm run print-name"
lerna info run Ran npm script 'print-name' in 'package-X' in X.Xs:
lerna success run Ran npm script 'print-name' in 1 package in X.Xs:
lerna success - package-X
`);
});
Expand All @@ -212,50 +172,33 @@ describe("lerna-run-nx-include-dependencies", () => {

expect(output.combinedOutput).toMatchInlineSnapshot(`
> Lerna (powered by Nx) Running target print-name for 3 project(s):
- package-X
- package-X
- package-X
> package-X:print-name
> package-X@0.0.0 print-name
> echo test-package-X
test-package-X
> package-X:print-name
> package-X@0.0.0 print-name
> echo test-package-X
test-package-X
> package-X:print-name
> package-X@0.0.0 print-name
> echo test-package-X
test-package-X
> Lerna (powered by Nx) Successfully ran target print-name for 3 projects
lerna notice cli v999.9.9-e2e.0
lerna verb rootPath /tmp/lerna-e2e/lerna-run-nx-include-dependencies/lerna-workspace
lerna notice filter including "package-X"
lerna notice filter including dependencies
lerna info filter [ 'package-X' ]
lerna verb run nx.json with targetDefaults was found. Task dependencies will be automatically included.
lerna info run Using the "include-dependencies" option when nx.json has targetDefaults defined will include both task dependencies detected by Nx and project dependencies detected by Lerna. See https://lerna.js.org/docs/recipes/using-lerna-powered-by-nx-to-run-tasks#--include-dependencies for details.
lerna info Executing command in 3 packages: "npm run print-name"
lerna info run Ran npm script 'print-name' in 'package-X' in X.Xs:
lerna info run Ran npm script 'print-name' in 'package-X' in X.Xs:
lerna info run Ran npm script 'print-name' in 'package-X' in X.Xs:
lerna success run Ran npm script 'print-name' in 3 packages in X.Xs:
lerna success - package-X
lerna success - package-X
lerna success - package-X
`);
});
Expand All @@ -275,44 +218,19 @@ describe("lerna-run-nx-include-dependencies", () => {

expect(output.combinedOutput).toMatchInlineSnapshot(`
> Lerna (powered by Nx) Running target print-name for project package-X and 2 task(s) it depends on
> package-X:print-name
> package-X@0.0.0 print-name
> echo test-package-X
test-package-X
> package-X:print-name
> package-X@0.0.0 print-name
> echo test-package-X
test-package-X
> package-X:print-name
> package-X@0.0.0 print-name
> echo test-package-X
test-package-X
> Lerna (powered by Nx) Successfully ran target print-name for project package-X
lerna notice cli v999.9.9-e2e.0
lerna verb rootPath /tmp/lerna-e2e/lerna-run-nx-include-dependencies/lerna-workspace
lerna notice filter including "package-X"
lerna notice filter excluding "package-X"
lerna info filter [ 'package-X', '!package-X' ]
lerna verb run nx.json with targetDefaults was found. Task dependencies will be automatically included.
lerna info run Using the "ignore" option when nx.json has targetDefaults defined will exclude only tasks that are not determined to be required by Nx. See https://lerna.js.org/docs/recipes/using-lerna-powered-by-nx-to-run-tasks#--ignore for details.
lerna info Executing command in 1 package: "npm run print-name"
lerna info run Ran npm script 'print-name' in 'package-X' in X.Xs:
lerna success run Ran npm script 'print-name' in 1 package in X.Xs:
lerna success - package-X
`);
});
Expand Down

0 comments on commit 1bb36dc

Please sign in to comment.