How to use the @nrwl/workspace.addDepsToPackageJson 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
export function addDependencies(): Rule {
  return addDepsToPackageJson(
    {
      next: nextVersion,
      '@zeit/next-css': zeitNextCss,
      '@zeit/next-sass': zeitNextLess,
      '@zeit/next-less': zeitNextSass,
      '@zeit/next-stylus': zeitNextStylus
    },
    {}
  );
}
github nrwl / nx / packages / web / src / schematics / init / init.ts View on Github external
function addDependencies(): Rule {
  return addDepsToPackageJson(
    {
      'document-register-element': documentRegisterElementVersion
    },
    {
      '@nrwl/web': nxVersion
    }
  );
}
github nrwl / nx / packages / angular / src / schematics / init / init.ts View on Github external
'@angular/forms': angularVersion,
    '@angular/platform-browser': angularVersion,
    '@angular/platform-browser-dynamic': angularVersion,
    '@angular/router': angularVersion,
    'core-js': '^2.5.4',
    rxjs: rxjsVersion,
    'zone.js': '^0.9.1'
  };
  const devDeps = {
    '@angular/compiler-cli': angularVersion,
    '@angular/language-service': angularVersion,
    '@angular-devkit/build-angular': angularDevkitVersion,
    codelyzer: '~5.0.1'
  };

  return addDepsToPackageJson(deps, devDeps);
}
github nrwl / nx / packages / angular / src / schematics / ngrx / rules / add-ngrx-to-package-json.ts View on Github external
export function addNgRxToPackageJson(): Rule {
  return addDepsToPackageJson(
    {
      '@ngrx/store': ngrxVersion,
      '@ngrx/effects': ngrxVersion,
      '@ngrx/entity': ngrxVersion,
      '@ngrx/router-store': ngrxVersion
    },
    {
      '@ngrx/schematics': ngrxVersion,
      '@ngrx/store-devtools': ngrxVersion
    }
  );
}
github nrwl / nx / packages / express / src / schematics / init / init.ts View on Github external
function addDependencies(): Rule {
  return addDepsToPackageJson(
    {
      express: expressVersion
    },
    {
      '@types/express': expressTypingsVersion,
      '@nrwl/express': nxVersion
    }
  );
}
github nrwl / nx / packages / angular / src / schematics / init / init.ts View on Github external
export function addUnitTestRunner(
  options: Pick
): Rule {
  switch (options.unitTestRunner) {
    case UnitTestRunner.Karma:
      return schematic('karma', {});
    case UnitTestRunner.Jest:
      return chain([
        addDepsToPackageJson(
          {},
          {
            'jest-preset-angular': jestPresetAngularVersion
          }
        ),
        (host: Tree) => {
          const packageJson = readJsonInTree(host, 'package.json');
          if (packageJson.devDependencies['@nrwl/jest']) {
            return noop();
          }
          return externalSchematic(
            '@nrwl/jest',
            'init',
            {},
            {
              interactive: false
github nrwl / nx / packages / react / src / schematics / init / init.ts View on Github external
export function addDependencies(): Rule {
  return addDepsToPackageJson(
    {
      react: reactVersion,
      'react-dom': reactDomVersion
    },
    {
      '@nrwl/react': nxVersion,
      '@types/react': typesReactVersion,
      '@types/react-dom': typesReactDomVersion,
      '@testing-library/react': testingLibraryReactVersion
    }
  );
}
github nrwl / nx / packages / nest / src / schematics / init / init.ts View on Github external
export function addDependencies(): Rule {
  return addDepsToPackageJson(
    {
      '@nestjs/common': nestJsVersion,
      '@nestjs/core': nestJsVersion,
      '@nestjs/platform-express': nestJsVersion,
      'reflect-metadata': reflectMetadataVersion
    },
    {
      '@nestjs/schematics': nestJsSchematicsVersion,
      '@nestjs/testing': nestJsVersion,
      '@nrwl/nest': nxVersion
    }
  );
}
github nrwl / nx / packages / node / src / schematics / init / init.ts View on Github external
function addDependencies(): Rule {
  return addDepsToPackageJson(
    {},
    {
      '@nrwl/node': nxVersion
    }
  );
}