How to use the @nrwl/workspace.updateWorkspace function in @nrwl/workspace

To help you get started, weโ€™ve selected a few @nrwl/workspace 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 nrwl / nx / packages / next / src / schematics / init / init.ts View on Github external
function setDefault(): Rule {
  return updateWorkspace(workspace => {
    // Set workspace default collection to 'react' if not already set.
    workspace.extensions.cli = workspace.extensions.cli || {};
    const defaultCollection: string =
      workspace.extensions.cli &&
      ((workspace.extensions.cli as JsonObject).defaultCollection as string);

    if (!defaultCollection || defaultCollection === '@nrwl/workspace') {
      (workspace.extensions.cli as JsonObject).defaultCollection = '@nrwl/next';
    }
  });
}
github nrwl / nx / packages / storybook / src / schematics / configuration / configuration.ts View on Github external
function addStorybookTask(projectName: string, uiFramework: string): Rule {
  return updateWorkspace(workspace => {
    const projectConfig = workspace.projects.get(projectName);
    projectConfig.targets.set('storybook', {
      builder: '@nrwl/storybook:storybook',
      options: {
        uiFramework,
        port: 4400,
        config: {
          configFolder: `${projectConfig.root}/.storybook`
        }
      },
      configurations: {
        ci: {
          quiet: true
        }
      }
    });
github bennymeg / nx-electron / src / schematics / init / init.ts View on Github external
function setDefault(): Rule {
  return updateWorkspace(workspace => {
    workspace.extensions.cli = workspace.extensions.cli || {};

    const defaultCollection: string =
      workspace.extensions.cli &&
      ((workspace.extensions.cli as JsonObject).defaultCollection as string);

    if (!defaultCollection || defaultCollection === '@nrwl/workspace') {
      (workspace.extensions.cli as JsonObject).defaultCollection = 'nx-electron';
    }
  });
}
github nrwl / nx / packages / nest / src / schematics / init / init.ts View on Github external
function setDefault(): Rule {
  return updateWorkspace(workspace => {
    workspace.extensions.cli = workspace.extensions.cli || {};

    const defaultCollection: string =
      workspace.extensions.cli &&
      ((workspace.extensions.cli as JsonObject).defaultCollection as string);

    if (!defaultCollection || defaultCollection === '@nrwl/workspace') {
      (workspace.extensions.cli as JsonObject).defaultCollection = '@nrwl/nest';
    }
  });
}
github nrwl / nx / packages / angular / src / schematics / init / init.ts View on Github external
export function setDefaults(options: Schema): Rule {
  return updateWorkspace(workspace => {
    workspace.extensions.schematics = workspace.extensions.schematics || {};

    workspace.extensions.schematics['@nrwl/angular:application'] =
      workspace.extensions.schematics['@nrwl/angular:application'] || {};
    workspace.extensions.schematics[
      '@nrwl/angular:application'
    ].unitTestRunner =
      workspace.extensions.schematics['@nrwl/angular:application']
        .unitTestRunner || options.unitTestRunner;
    workspace.extensions.schematics['@nrwl/angular:application'].e2eTestRunner =
      workspace.extensions.schematics['@nrwl/angular:application']
        .e2eTestRunner || options.e2eTestRunner;

    workspace.extensions.schematics['@nrwl/angular:library'] =
      workspace.extensions.schematics['@nrwl/angular:library'] || {};
    workspace.extensions.schematics['@nrwl/angular:library'].unitTestRunner =
github nrwl / nx / packages / express / src / schematics / init / init.ts View on Github external
function setDefault(): Rule {
  return updateWorkspace(workspace => {
    workspace.extensions.cli = workspace.extensions.cli || {};

    const defaultCollection: string =
      workspace.extensions.cli &&
      ((workspace.extensions.cli as JsonObject).defaultCollection as string);

    if (!defaultCollection || defaultCollection === '@nrwl/workspace') {
      (workspace.extensions.cli as JsonObject).defaultCollection =
        '@nrwl/express';
    }
  });
}
github nrwl / nx / packages / angular / src / schematics / application / application.ts View on Github external
return chain([
    host => {
      if (host.read(`${e2eProjectRoot}/src/app.e2e-spec.ts`)) {
        host.delete(`${e2eProjectRoot}/src/app.e2e-spec.ts`);
      }
      if (host.read(`${e2eProjectRoot}/src/app.po.ts`)) {
        host.delete(`${e2eProjectRoot}/src/app.po.ts`);
      }
      if (host.read(`${e2eProjectRoot}/protractor.conf.js`)) {
        host.delete(`${e2eProjectRoot}/protractor.conf.js`);
      }
      if (host.read(`${e2eProjectRoot}/tsconfig.json`)) {
        host.delete(`${e2eProjectRoot}/tsconfig.json`);
      }
    },
    updateWorkspace(workspace => {
      workspace.projects.get(options.name).targets.delete('e2e');
    })
  ]);
}
github nrwl / nx / packages / web / src / schematics / init / init.ts View on Github external
function setDefault(): Rule {
  return updateWorkspace(workspace => {
    workspace.extensions.cli = workspace.extensions.cli || {};

    const defaultCollection: string =
      workspace.extensions.cli &&
      ((workspace.extensions.cli as JsonObject).defaultCollection as string);

    if (!defaultCollection || defaultCollection === '@nrwl/workspace') {
      (workspace.extensions.cli as JsonObject).defaultCollection = '@nrwl/web';
    }
  });
}