* Expect that if a dependency is listed under "dependencies", it is not also * listed under "devDependencies". If it is, this will log an error, and cause * the constraint to fail. * * @param {Workspace} workspace - The workspace to check.
(workspace)
| 109 | * @param {Workspace} workspace - The workspace to check. |
| 110 | */ |
| 111 | function expectWorkspaceDependencies(workspace) { |
| 112 | workspace.pkg.dependencies.forEach((dependency) => { |
| 113 | // `workspace.pkg` does not have a `devDependencies` field, so we need to |
| 114 | // check the `manifest` instead. |
| 115 | const isDependency = Boolean( |
| 116 | workspace.manifest.dependencies?.[dependency.ident], |
| 117 | ); |
| 118 | const isDevDependency = Boolean( |
| 119 | workspace.manifest.devDependencies?.[dependency.ident], |
| 120 | ); |
| 121 | |
| 122 | if (isDependency && isDevDependency) { |
| 123 | workspace.unset(`devDependencies.${dependency.ident}`); |
| 124 | } |
| 125 | }); |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Expect that the workspace has a README.md file, and that it is a non-empty |
no outgoing calls
no test coverage detected
searching dependent graphs…