@yarnpkg/plugin-essentials 3.2.3 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -234,7 +234,7 @@ AddCommand.usage = clipanion_1.Command.Usage({
234
234
 
235
235
  If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
236
236
 
237
- - \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
237
+ - \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
238
238
 
239
239
  - \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
240
240
 
@@ -91,7 +91,7 @@ DedupeCommand.usage = clipanion_1.Command.Usage({
91
91
 
92
92
  If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
93
93
 
94
- - \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
94
+ - \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
95
95
 
96
96
  - \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
97
97
 
@@ -276,7 +276,7 @@ YarnCommand.usage = clipanion_1.Command.Usage({
276
276
 
277
277
  If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
278
278
 
279
- - \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
279
+ - \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
280
280
 
281
281
  - \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
282
282
  `,
@@ -114,7 +114,7 @@ RemoveCommand.usage = clipanion_1.Command.Usage({
114
114
 
115
115
  If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
116
116
 
117
- - \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
117
+ - \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
118
118
 
119
119
  - \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
120
120
 
@@ -252,7 +252,7 @@ UpCommand.usage = clipanion_1.Command.Usage({
252
252
 
253
253
  If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
254
254
 
255
- - \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
255
+ - \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
256
256
 
257
257
  - \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
258
258
 
@@ -18,10 +18,7 @@ class WorkspaceCommand extends cli_1.BaseCommand {
18
18
  if (!cwdWorkspace)
19
19
  throw new cli_1.WorkspaceRequiredError(project.cwd, this.context.cwd);
20
20
  const candidates = project.workspaces;
21
- const candidatesByName = new Map(candidates.map((workspace) => {
22
- const ident = core_2.structUtils.convertToIdent(workspace.locator);
23
- return [core_2.structUtils.stringifyIdent(ident), workspace];
24
- }));
21
+ const candidatesByName = new Map(candidates.map(workspace => [core_2.structUtils.stringifyIdent(workspace.locator), workspace]));
25
22
  const workspace = candidatesByName.get(this.workspaceName);
26
23
  if (workspace === undefined) {
27
24
  const otherNames = Array.from(candidatesByName.keys()).sort();
@@ -5,6 +5,7 @@ export default class WorkspacesListCommand extends BaseCommand {
5
5
  static usage: Usage;
6
6
  since: string | boolean | undefined;
7
7
  recursive: boolean;
8
+ noPrivate: boolean | undefined;
8
9
  verbose: boolean;
9
10
  json: boolean;
10
11
  execute(): Promise<1 | 0>;
@@ -15,6 +15,9 @@ class WorkspacesListCommand extends cli_1.BaseCommand {
15
15
  this.recursive = clipanion_1.Option.Boolean(`-R,--recursive`, false, {
16
16
  description: `Find packages via dependencies/devDependencies instead of using the workspaces field`,
17
17
  });
18
+ this.noPrivate = clipanion_1.Option.Boolean(`--no-private`, {
19
+ description: `Exclude workspaces that have the private field set to true`,
20
+ });
18
21
  this.verbose = clipanion_1.Option.Boolean(`-v,--verbose`, false, {
19
22
  description: `Also return the cross-dependencies between workspaces`,
20
23
  });
@@ -40,6 +43,8 @@ class WorkspacesListCommand extends cli_1.BaseCommand {
40
43
  workspaces.add(dependent);
41
44
  for (const workspace of workspaces) {
42
45
  const { manifest } = workspace;
46
+ if (manifest.private && this.noPrivate)
47
+ continue;
43
48
  let extra;
44
49
  if (this.verbose) {
45
50
  const workspaceDependencies = new Set();
@@ -93,6 +98,8 @@ WorkspacesListCommand.usage = clipanion_1.Command.Usage({
93
98
 
94
99
  - If \`-R,--recursive\` is set, Yarn will find workspaces to run the command on by recursively evaluating \`dependencies\` and \`devDependencies\` fields, instead of looking at the \`workspaces\` fields.
95
100
 
101
+ - If \`--no-private\` is set, Yarn will not list any workspaces that have the \`private\` field set to \`true\`.
102
+
96
103
  - If both the \`-v,--verbose\` and \`--json\` options are set, Yarn will also return the cross-dependencies between each workspaces (useful when you wish to automatically generate Buck / Bazel rules).
97
104
  `,
98
105
  });
@@ -93,7 +93,7 @@ async function dedupe(project, { strategy, patterns, cache, report }) {
93
93
  const algorithm = DEDUPE_ALGORITHMS[strategy];
94
94
  const dedupePromises = await algorithm(project, patterns, { resolver, resolveOptions, fetcher, fetchOptions });
95
95
  const progress = core_1.Report.progressViaCounter(dedupePromises.length);
96
- report.reportProgress(progress);
96
+ await report.reportProgress(progress);
97
97
  let dedupedPackageCount = 0;
98
98
  await Promise.all(dedupePromises.map(dedupePromise => dedupePromise
99
99
  .then(dedupe => {
@@ -109,7 +109,7 @@ async function findProjectDescriptors(ident, { project, target }) {
109
109
  if (target === Target.PEER) {
110
110
  const peerDescriptor = workspace.manifest.peerDependencies.get(ident.identHash);
111
111
  if (peerDescriptor !== undefined) {
112
- getDescriptorEntry(peerDescriptor).locators.push(workspace.locator);
112
+ getDescriptorEntry(peerDescriptor).locators.push(workspace.anchoredLocator);
113
113
  }
114
114
  }
115
115
  else {
@@ -117,18 +117,18 @@ async function findProjectDescriptors(ident, { project, target }) {
117
117
  const developmentDescriptor = workspace.manifest.devDependencies.get(ident.identHash);
118
118
  if (target === Target.DEVELOPMENT) {
119
119
  if (developmentDescriptor !== undefined) {
120
- getDescriptorEntry(developmentDescriptor).locators.push(workspace.locator);
120
+ getDescriptorEntry(developmentDescriptor).locators.push(workspace.anchoredLocator);
121
121
  }
122
122
  else if (regularDescriptor !== undefined) {
123
- getDescriptorEntry(regularDescriptor).locators.push(workspace.locator);
123
+ getDescriptorEntry(regularDescriptor).locators.push(workspace.anchoredLocator);
124
124
  }
125
125
  }
126
126
  else {
127
127
  if (regularDescriptor !== undefined) {
128
- getDescriptorEntry(regularDescriptor).locators.push(workspace.locator);
128
+ getDescriptorEntry(regularDescriptor).locators.push(workspace.anchoredLocator);
129
129
  }
130
130
  else if (developmentDescriptor !== undefined) {
131
- getDescriptorEntry(developmentDescriptor).locators.push(workspace.locator);
131
+ getDescriptorEntry(developmentDescriptor).locators.push(workspace.anchoredLocator);
132
132
  }
133
133
  }
134
134
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@yarnpkg/plugin-essentials",
3
- "version": "3.2.3",
3
+ "version": "3.3.0",
4
4
  "license": "BSD-2-Clause",
5
5
  "main": "./lib/index.js",
6
6
  "dependencies": {
7
- "@yarnpkg/fslib": "^2.8.0",
7
+ "@yarnpkg/fslib": "^2.9.0",
8
8
  "@yarnpkg/json-proxy": "^2.1.1",
9
9
  "@yarnpkg/parsers": "^2.5.1",
10
10
  "ci-info": "^3.2.0",
@@ -17,18 +17,18 @@
17
17
  "typanion": "^3.3.0"
18
18
  },
19
19
  "peerDependencies": {
20
- "@yarnpkg/cli": "^3.2.4",
21
- "@yarnpkg/core": "^3.2.5",
22
- "@yarnpkg/plugin-git": "^2.6.2"
20
+ "@yarnpkg/cli": "^3.3.0",
21
+ "@yarnpkg/core": "^3.3.0",
22
+ "@yarnpkg/plugin-git": "^2.6.3"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/lodash": "^4.14.136",
26
26
  "@types/micromatch": "^4.0.1",
27
27
  "@types/semver": "^7.1.0",
28
28
  "@types/treeify": "^1.0.0",
29
- "@yarnpkg/cli": "^3.2.4",
30
- "@yarnpkg/core": "^3.2.5",
31
- "@yarnpkg/plugin-git": "^2.6.2"
29
+ "@yarnpkg/cli": "^3.3.0",
30
+ "@yarnpkg/core": "^3.3.0",
31
+ "@yarnpkg/plugin-git": "^2.6.3"
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",