How to use the bolt.projectRemove function in bolt

To help you get started, we’ve selected a few bolt 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 wwselleck / bolt-interactive / src / prompts / commands / remove.ts View on Github external
export default async function runRemovePrompt() {
  const scope = await runScopeSelectPrompt();
  const packagesInput = await runPackagesInputPrompt({
    message: 'What package(s) to remove?'
  });

  const packages: string[] = packagesInput.split(" ");

  if (scope.type === ScopeType.PROJECT) {
    await projectRemove({
      deps: packages
    });
  } else if (scope.type === ScopeType.ALL) {
    await workspacesRemove({
      deps: packages,
      filterOpts: {}
    });
  } else if (scope.type === ScopeType.SELECT) {
    for (const w of scope.workspaces) {
      await workspaceRemove({
        pkgName: w.name,
        deps: packages
      });
    }
  }
}