How to use the @yarnpkg/cli.getPluginConfiguration function in @yarnpkg/cli

To help you get started, we’ve selected a few @yarnpkg/cli examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yarnpkg / berry / packages / yarnpkg-check / sources / cli.ts View on Github external
async execute() {
    const cwd = npath.toPortablePath(npath.resolve(this.cwd));

    const configuration = await Configuration.find(cwd, null, {strict: false});

    const allManifests = await findFiles(`**/package.json`, cwd);
    const allManifestFolders = allManifests.map(p => ppath.dirname(p));

    const allFiles = await findFiles(`**/*.{ts,tsx,js,jsx}`, cwd);

    const pluginConfiguration = getPluginConfiguration();

    const findStandaloneWorkspace = async (manifestCwd: PortablePath) => {
      const configuration = await Configuration.find(manifestCwd, pluginConfiguration, {strict: false, lookup: ProjectLookup.NONE});
      const {workspace} = await Project.find(configuration, manifestCwd);

      return workspace;
    };

    const findLockfileWorkspace = async (manifestCwd: PortablePath) => {
      const configuration = await Configuration.find(manifestCwd, pluginConfiguration, {strict: false});
      if (!configuration.projectCwd)
        return null;

      const {project} = await Project.find(configuration, configuration.projectCwd);
      const workspace = project.tryWorkspaceByCwd(manifestCwd);
      if (!workspace)

@yarnpkg/cli

BSD-2-Clause
Latest version published 5 days ago

Package Health Score

95 / 100
Full package analysis

Similar packages