How to use get-workspaces - 1 common examples

To help you get started, we’ve selected a few get-workspaces 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 keystonejs / keystone / website / gatsby-config.js View on Github external
async function getPackagePlugins() {
  const rootDir = path.resolve(__dirname, '..');
  const docSections = fs.readdirSync(`${rootDir}/docs/`).filter(dir => {
    const fullDir = path.join(`${rootDir}/docs/`, dir);
    return fs.existsSync(fullDir) && fs.lstatSync(fullDir).isDirectory();
  });

  const workspaces = await getWorkspaces({ cwd: rootDir });

  return [
    ...docSections.map(name => ({
      resolve: 'gatsby-source-filesystem',
      options: { name, path: `${rootDir}/docs/${name}/` },
    })),
    ...workspaces
      .filter(({ config }) => !config.private)
      .filter(({ dir }) => fs.existsSync(dir))
      .filter(({ dir }) => !dir.includes('arch'))
      .map(({ dir, config }) => ({
        resolve: 'gatsby-source-filesystem',
        options: {
          // This `name` will show up as `sourceInstanceName` on a node's "parent"
          // See `gatsby-node.js` for where it's used.
          name: config.name,

get-workspaces

Get workspaces for yarn workspaces, bolt workspaces, or the root package for building repo-agnostic tools

MIT
Latest version published 5 months ago

Package Health Score

65 / 100
Full package analysis

Popular get-workspaces functions

Similar packages