How to use the tsd.Query function in tsd

To help you get started, we’ve selected a few tsd examples, based on popular ways it is used in public projects.

github DefinitelyTyped / grunt-tsd / lib / runner.js View on Github external
return api.readConfig(options.config, true).then(function () {
			var opts = tsd.Options.fromJSON(options.opts);
			opts.overwriteFiles = true;
			opts.resolveDependencies = true;
			opts.saveToConfig = true;

			if (options.latest) {
				var query = new tsd.Query();
				api.context.config.getInstalled().forEach(function (inst) {
					var def = tsd.Def.getFrom(inst.path);
					query.addNamePattern(def.project + '/' + def.name);
				});
				query.versionMatcher = new tsd.VersionMatcher('latest');

				return api.select(query, opts).then(function (selection) {
					return api.install(selection, opts);
				});
			}
			return api.reinstall(opts);
		});
	}
github teambition / teambition-mobile-web / tools / gulp / tsd.js View on Github external
return co(function * () {
    let npmDependency = require(path.join(process.cwd(), 'package.json'))

    delete npmDependency.dependencies['zone.js']

    let dependencies = ['ionic'].concat(
      Object.keys(npmDependency.dependencies)
    )

    let query = new Tsd.Query()
    dependencies.forEach(function (dependency) {
      query.addNamePattern(dependency)
    })

    let options = new Tsd.Options()
    options.resolveDependencies = true
    options.overwriteFiles = true
    options.saveBundle = true

    yield tsdApi.readConfig()
    let selection = yield tsdApi.select(query, options)
    let installResult = yield tsdApi.install(selection, options)
    let written = Object.keys(installResult.written.dict)
    let removed = Object.keys(installResult.removed.dict)
    let skipped = Object.keys(installResult.skipped.dict)
github FlexSearch / FlexSearch / srcjs / gulp / tsd.js View on Github external
gulp.task('tsd:install', function () {
    var bower = require(path.join(process.cwd(), 'bower.json'));

    var dependencies = [].concat(
      Object.keys(bower.dependencies),
      Object.keys(bower.devDependencies)
    );

    var query = new tsd.Query();
    dependencies.forEach(function (dependency) {
      query.addNamePattern(dependency);
    });

    var options = new tsd.Options();
    options.resolveDependencies = true;
    options.overwriteFiles = true;
    options.saveBundle = true;

    return tsdApi.readConfig()
      .then(function () {
        return tsdApi.select(query, options);
      })
      .then(function (selection) {
        return tsdApi.install(selection, options);
      })
github Swiip / generator-gulp-angular / app / templates / gulp / tsd.js View on Github external
gulp.task('tsd:install', function () {
  var bower = require(path.join(process.cwd(), 'bower.json'));

  var dependencies = [].concat(
    Object.keys(bower.dependencies),
    Object.keys(bower.devDependencies)
  );

  var query = new tsd.Query();
  dependencies.forEach(function (dependency) {
    query.addNamePattern(dependency);
  });
  query.addNamePattern('karma-jasmine');

  var options = new tsd.Options();
  options.resolveDependencies = true;
  options.overwriteFiles = true;
  options.saveBundle = true;

  return tsdApi.readConfig()
    .then(function () {
      return tsdApi.select(query, options);
    })
    .then(function (selection) {
      return tsdApi.install(selection, options);
github moznion / gulp-tsd / lib / tsd.js View on Github external
return api.readConfig(setting.config, true).then(function () {
            var opts     = tsd.Options.fromJSON(setting.opts);
            var isLatest = setting.latest;
            var query;

            opts.saveBundle = true;
            opts.overwriteFiles = true;
            opts.resolveDependencies = true;

            logger.log('latest:', isLatest);
            logger.log('running...');
            if (isLatest) {
                opts.saveToConfig = true;
                query = new tsd.Query();
                api.context.config.getInstalled().forEach(function (inst) {
                    var def = tsd.Def.getFrom(inst.path);
                    query.addNamePattern(def.project + '/' + def.name);
                });
                query.versionMatcher = new tsd.VersionMatcher('latest');

                return api.select(query, opts).then(function (selection) {
                    return api.install(selection, opts);
                });
            }
            return api.reinstall(opts);
        });
    }
github angular-starter-kit / starter-kit / gulp / typings.js View on Github external
gulp.task('tsd', function() {
  var bower = require(path.join(process.cwd(), 'bower.json'));

  var dependencies = [].concat(
    Object.keys(bower.dependencies),
    Object.keys(bower.devDependencies)
  );

  var query = new tsd.Query();
  dependencies.forEach(function(dependency) {
    query.addNamePattern(dependency);
  });

  var options = new tsd.Options();
  options.resolveDependencies = true;
  options.overwriteFiles = true;
  options.saveBundle = true;
  options.saveToConfig = true;

  return tsdApi.readConfig()
    .then(function() {
      return tsdApi.select(query, options);
    })
    .then(function(selection) {
      return tsdApi.install(selection, options);

tsd

Check TypeScript type definitions

MIT
Latest version published 10 days ago

Package Health Score

86 / 100
Full package analysis

Similar packages