Replies: 1 comment
-
You can use the import { Manifest } from '@yarnpkg/core';
const plugin = {
hooks: {
afterAllInstalled: async(project, options) => {
const manifest = await Manifest.find(project.cwd); // root package.json's information
console.log(manifest.raw.dependencies); // same as your package.json
console.log(manifest.dependencies); // after yarn parsing
},
}
} If you want to get the workspaces dependencies, import { Manifest } from '@yarnpkg/core';
import { PortablePath } from '@yarnpkg/fslib';
const manifest = await Manifest.find(`your/workspace/directory` as PortablePath); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I want to write a plugin to walk the dependency tree of a project and generate a special lock file for our platform dependencies,.. Im looking at using a
afterAllInstalled
hook to do this. However, looking through the API docs I can't seem to find the right APIs to walk the dependency tree of non-dev deps? Can someone give me a pointer or two please?Cheers
J
Beta Was this translation helpful? Give feedback.
All reactions