How to use the @schematics/angular/utility/dependencies.NodeDependencyType.Default function in @schematics/angular

To help you get started, we’ve selected a few @schematics/angular 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 cyrilletuzi / angular-async-local-storage / projects / ngx-pwa / local-storage / schematics / utility / dependency.ts View on Github external
/* Set lib version depending on Angular version */
    let packageVersion = packageVersionLatest;

    /* Throw on unsupported versions */
    if (angularMajorVersion >= 2 && angularMajorVersion <= 5) {
      throw new SchematicsException('Angular versions < 6 are no longer supported.');
    }
    /* Manage LTS versions */
    if (angularMajorVersion === 6 || angularMajorVersion === 7) {
      packageVersion = packageVersionLTS;
    }

    addPackageJsonDependency(host, {
      /* Default = prod dependency */
      type: NodeDependencyType.Default,
      name: packageName,
      version: packageVersion,
      /* Angular CLI will have pre-installed the package to get the schematics,
       * so we need to overwrite to install the good versions */
      overwrite: true,
    });

    return host;

  };
}
github DevExpress / devextreme-schematics / src / add-layout / index_spec.ts View on Github external
it('should set static flag', async () => {
    removePackageJsonDependency(appTree, '@angular/core');
    addPackageJsonDependency(appTree, {
      type: NodeDependencyType.Default,
      name: '@angular/core',
      version: '7.0.0'
    });

    const runner = new SchematicTestRunner('schematics', collectionPath);
    const tree = await runner.runSchematicAsync('add-layout', options, appTree).toPromise();
    const navigationMenu = tree.readContent(
      '/src/app/shared/components/side-navigation-menu/side-navigation-menu.component.ts');

    expect(navigationMenu).toContain('@ViewChild(DxTreeViewComponent)');
  });
github mattlewis92 / angular-calendar / projects / angular-calendar / schematics / ng-add / index.ts View on Github external
function nodeDependencyFactory(
  packageName: string,
  version: string
): NodeDependency {
  return {
    type: NodeDependencyType.Default,
    name: packageName,
    version,
    overwrite: true
  };
}
github maciejtreder / ng-toolkit / schematics / init / src / utils / new-app / index.ts View on Github external
return (tree: Tree) => {
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Default,
            name: '@nguniversal/express-engine',
            version: '^6.0.0'
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Default,
            name: '@nguniversal/module-map-ngfactory-loader',
            version: '^6.0.0'
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Default,
            name: 'typescript-collections',
            version: '^1.3.2'
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Dev,
            name: 'cp-cli',
            version: '^1.1.0'
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Dev,
            name: 'cpy-cli',
            version: '^1.0.1'
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Default,
            name: 'decompress',
github angular / universal / modules / hapi-engine / schematics / install / index.ts View on Github external
type: NodeDependencyType.Default,
      name: '@nguniversal/hapi-engine',
      version: '^0.0.0-PLACEHOLDER',
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Default,
      name: '@hapi/hapi',
      version: 'HAPI_VERSION',
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Dev,
      name: '@types/hapi__hapi',
      version: '^18.2.5',
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Default,
      name: '@hapi/inert',
      version: '^5.2.0',
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Dev,
      name: '@types/hapi__inert',
      version: '^5.2.0',
    });

    return host;
  };
}
github ngx-meta / rules / libs / schematics / ng-add / index.ts View on Github external
return (host: Tree, context: SchematicContext) => {
    let uiLibs: NodeDependency[] = [];
    const core: NodeDependency[] = [
      {type: NodeDependencyType.Default, version: '^7.0.0', name: '@ngx-metaui/rules'},
      {type: NodeDependencyType.Default, version: '1.6.36', name: 'big-integer'},
      {type: NodeDependencyType.Default, version: '1.3.0', name: 'object-hash'},
      {type: NodeDependencyType.Default, version: '^0.11.4', name: 'object-path'},
      {type: NodeDependencyType.Default, version: '^1.0.0', name: 'primeicons'},
      {type: NodeDependencyType.Default, version: '7.0.0-beta.1', name: 'primeng'},
      {type: NodeDependencyType.Default, version: '1.3.2', name: 'typescript-collections'},
      {type: NodeDependencyType.Default, version: '1.3.6', name: 'quill'},
      {type: NodeDependencyType.Default, version: '4.7.0', name: 'font-awesome'},
      {type: NodeDependencyType.Dev, version: '^1.0.2', name: 'watch'}
    ];

    if (options.uiLib === 'prime-ng') {
      uiLibs = [
        {type: NodeDependencyType.Default, version: '^7.0.0', name: '@ngx-metaui/primeng-rules'},
        {type: NodeDependencyType.Default, version: '7.0.0-beta.1', name: 'primeng'},
        {type: NodeDependencyType.Default, version: '1.3.6', name: 'quill'},
github FortAwesome / angular-fontawesome / projects / schematics / src / ng-add / index.ts View on Github external
(tree: Tree, context: SchematicContext) => {
      addPackageJsonDependency(tree, {
        type: NodeDependencyType.Default,
        name: '@fortawesome/fontawesome-svg-core',
        version: svgCoreVersion,
      });

      addPackageJsonDependency(tree, {
        type: NodeDependencyType.Default,
        name: '@fortawesome/angular-fontawesome',
        version: angularFontawesomeVersion,
      });

      const iconPackages = options.iconPackages != null ? options.iconPackages : ['free-solid'];
      for (const pack of iconPackages) {
        addPackageJsonDependency(tree, {
          type: NodeDependencyType.Default,
          name: `@fortawesome/${pack}-svg-icons`,
          version: iconPackVersion,
github angular / universal / modules / hapi-engine / schematics / install / index.ts View on Github external
return (host: Tree, context: SchematicContext) => {
    if (!options.skipInstall) {
      context.addTask(new NodePackageInstallTask());
    }
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Default,
      name: '@nguniversal/hapi-engine',
      version: '^0.0.0-PLACEHOLDER',
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Default,
      name: '@hapi/hapi',
      version: 'HAPI_VERSION',
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Dev,
      name: '@types/hapi__hapi',
      version: '^18.2.5',
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Default,
      name: '@hapi/inert',
github SAP / cloud-commerce-spartacus-storefront / projects / schematics / src / add-spartacus / index.ts View on Github external
version: '^4.1.0',
        name: '@ng-bootstrap/ng-bootstrap',
      },
      {
        type: NodeDependencyType.Default,
        version: '^2.13.2',
        name: '@ng-select/ng-select',
      },

      {
        type: NodeDependencyType.Default,
        version: ngrxVersion,
        name: '@ngrx/store',
      },
      {
        type: NodeDependencyType.Default,
        version: ngrxVersion,
        name: '@ngrx/effects',
      },
      {
        type: NodeDependencyType.Default,
        version: ngrxVersion,
        name: '@ngrx/router-store',
      },

      {
        type: NodeDependencyType.Default,
        version: '^4.2.1',
        name: 'bootstrap',
      },
      { type: NodeDependencyType.Default, version: '^15.0.6', name: 'i18next' },
      {
github nestjs / ng-universal / schematics / install / index.ts View on Github external
type: NodeDependencyType.Default,
      name: 'reflect-metadata',
      version: '^0.1.13'
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Default,
      name: '@nestjs/platform-express',
      version: '^6.0.0'
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Default,
      name: '@nguniversal/express-engine',
      version: '^8.0.0'
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Default,
      name: '@nguniversal/module-map-ngfactory-loader',
      version: '^8.0.0'
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Dev,
      name: 'ts-loader',
      version: '^5.2.0'
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Dev,
      name: 'wait-on',
      version: '^3.2.0'
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Dev,
      name: 'webpack-cli',