How to use the @schematics/angular/utility/dependencies.NodeDependencyType.Dev 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 angular / universal / modules / express-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/express-engine',
      version: '^0.0.0-PLACEHOLDER',
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Default,
      name: 'express',
      version: 'EXPRESS_VERSION',
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Dev,
      name: '@types/express',
      version: 'EXPRESS_TYPES_VERSION',
    });

    return host;
  };
}
github SAP / cloud-commerce-spartacus-storefront / projects / schematics / src / add-ssr / index.ts View on Github external
type: NodeDependencyType.Default,
        version: angularVersion || '~8.2.5',
        name: '@angular/platform-server',
      },
      {
        type: NodeDependencyType.Default,
        version: '^8.1.1',
        name: '@nguniversal/express-engine',
      },
      {
        type: NodeDependencyType.Dev,
        version: '^5.3.2',
        name: 'ts-loader',
      },
      {
        type: NodeDependencyType.Dev,
        version: '^3.3.2',
        name: 'webpack-cli',
      },
    ];

    dependencies.forEach(dependency => {
      addPackageJsonDependency(tree, dependency);
      context.logger.log(
        'info',
        `✅️ Added '${dependency.name}' into ${dependency.type}`
      );
    });

    return tree;
  };
}
github maciejtreder / ng-toolkit / schematics / serverless / src / index.ts View on Github external
rules.push((tree: Tree) => {
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Dev,
            name: 'ts-loader',
            version: '4.2.0',
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Dev,
            name: 'webpack-cli',
            version: '2.1.2'
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Default,
            name: 'cors',
            version: '~2.8.4'
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Default,
            name: 'cp-cli',
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',
      version: '^5.2.0',
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Dev,
      name: '@types/hapi__inert',
      version: '^5.2.0',
    });

    return host;
  };
github angular / universal / modules / hapi-engine / schematics / install / index.ts View on Github external
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 DevExpress / devextreme-schematics / src / install / index.ts View on Github external
function addDevExtremeDependency(host: Tree, options: any) {
  addPackageJsonDependency(host, {
    type: NodeDependencyType.Default,
    name: 'devextreme',
    version: options.dxversion || latestVersions['devextreme']
  });
  addPackageJsonDependency(host, {
    type: NodeDependencyType.Default,
    name: 'devextreme-angular',
    version: options.dxversion || latestVersions['devextreme-angular']
  });
  addPackageJsonDependency(host, {
    type: NodeDependencyType.Dev,
    name: 'devextreme-cli',
    version: latestVersions['devextreme-cli']
  });
  addPackageJsonDependency(host, {
    type: NodeDependencyType.Dev,
    name: 'devextreme-themebuilder',
    version: options.dxversion || latestVersions['devextreme']
  });

  return host;
}
github maciejtreder / ng-toolkit / schematics / init / src / ng-new / index.ts View on Github external
type: NodeDependencyType.Default,
            name: '@angular/cdk',
            version: '^6.0.0'
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Default,
            name: '@angular/material',
            version: '^6.0.0'
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Default,
            name: 'webpack-cli',
            version: '2.1.2'
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Dev,
            name: 'ts-loader',
            version: '4.2.0'
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Default,
            name: '@ngx-translate/core',
            version: '^10.0.1'
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Default,
            name: '@ngx-translate/http-loader',
            version: '^3.0.1'
        });
        return tree;
    });
    rules.push((tree: Tree) => {
github maciejtreder / ng-toolkit / schematics / firebug / src / index.ts View on Github external
return (tree: Tree) => {
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Dev,
            name: 'node-wget',
            version: '^0.4.2'
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Dev,
            name: 'decompress',
            version: '^4.2.0'
        });
        addDependencyToPackageJson(tree, options, {
            type: NodeDependencyType.Dev,
            name: 'decompress-targz',
            version: '^4.1.1'
        });
        return tree;
    }
}
github nestjs / ng-universal / schematics / install / index.ts View on Github external
type: NodeDependencyType.Dev,
      name: 'wait-on',
      version: '^3.2.0'
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Dev,
      name: 'webpack-cli',
      version: '^3.1.0'
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Dev,
      name: 'rimraf',
      version: '^2.6.3'
    });
    addPackageJsonDependency(host, {
      type: NodeDependencyType.Dev,
      name: 'nodemon',
      version: '^1.18.11'
    });

    const pkgPath = '/package.json';
    const buffer = host.read(pkgPath);
    if (buffer === null) {
      throw new SchematicsException('Could not find package.json');
    }

    const pkg = JSON.parse(buffer.toString());
    pkg.scripts['serve'] = 'node serve-script';
    pkg.scripts['compile:server'] =
      'webpack --config webpack.server.config.js --progress --colors';
    pkg.scripts['serve:ssr'] = `node dist/server`;
    pkg.scripts['build:ssr'] =