(args)
| 86 | } |
| 87 | |
| 88 | async execWorkspaces (args) { |
| 89 | await this.setWorkspaces() |
| 90 | const packageLockOnly = this.npm.config.get('package-lock-only') |
| 91 | const Arborist = require('@npmcli/arborist') |
| 92 | const arb = new Arborist({ |
| 93 | ...this.npm.flatOptions, |
| 94 | path: this.npm.prefix, |
| 95 | forceActual: !packageLockOnly, |
| 96 | }) |
| 97 | let tree |
| 98 | if (packageLockOnly) { |
| 99 | try { |
| 100 | tree = await arb.loadVirtual() |
| 101 | } catch (err) { |
| 102 | log.verbose('loadVirtual', err.stack) |
| 103 | throw this.usageError( |
| 104 | 'A package lock or shrinkwrap file is required in package-lock-only mode' |
| 105 | ) |
| 106 | } |
| 107 | } else { |
| 108 | tree = await arb.loadActual() |
| 109 | } |
| 110 | for (const path of this.workspacePaths) { |
| 111 | const wsTree = path === tree.root.path |
| 112 | ? tree // --includes-workspace-root |
| 113 | : await tree.querySelectorAll(`.workspace:path(${path})`).then(r => r[0]?.target) |
| 114 | if (wsTree) { |
| 115 | await this.#queryTree(wsTree, args[0]) |
| 116 | } |
| 117 | } |
| 118 | this.#output() |
| 119 | } |
| 120 | |
| 121 | #output () { |
| 122 | this.checkExpected(this.#response.length) |
nothing calls this directly
no test coverage detected