MCPcopy Create free account
hub / github.com/MetaMask/rpc-errors / expectWorkspaceDependencies

Function expectWorkspaceDependencies

yarn.config.cjs:111–126  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

109 * @param {Workspace} workspace - The workspace to check.
110 */
111function 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

Callers 1

constraintsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…