How to use the bolt.workspaceAdd 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 / add.ts View on Github external
deps: packages.map(toDependency),
      type: depType
    });
  } else if (scope.kind === ScopeType.ALL) {
    // bolt ws add isn't implemented yet, do bolt w for each workspace
    const workspaces = await getWorkspaces();
    for (const w of workspaces) {
      await workspaceAdd({
        pkgName: w.name,
        deps: packages.map(toDependency),
        type: depType
      });
    }
  } else if (scope.kind === ScopeType.SELECT) {
    for (const w of scope.workspaces) {
      await workspaceAdd({
        pkgName: w.name,
        deps: packages.map(toDependency),
        type: depType
      });
    }
  }
}