包详细信息

dtsm

vvakame106MIT1.1.0

TypeScript definition file (.d.ts) manager

自述文件

DTSM Circle CI Build status

The .d.ts manager

.d.ts is TypeScript definition file. DefinitelyTyped!

Install

$ npm install -g dtsm

dtsm depends on Node.js, npm and git command. please install git client.

Usage

# fetch from remote repository
$ dtsm fetch
fetching...
fetching https://github.com/DefinitelyTyped/DefinitelyTyped.git

# search .d.ts
$ dtsm search atom
Search results.

    atom/atom.d.ts
    dojo/dojox.atom.d.ts

# install .d.ts
$ dtsm install atom
atom/atom.d.ts #be0b6b
├── q/Q.d.ts
├── jquery/jquery.d.ts
├─┬ space-pen/space-pen.d.ts
│ └── jquery/jquery.d.ts
├─┬ emissary/emissary.d.ts
│ └── mixto/mixto.d.ts
├─┬ pathwatcher/pathwatcher.d.ts
│ ├── node/node.d.ts
│ └── q/Q.d.ts
├─┬ text-buffer/text-buffer.d.ts
│ ├─┬ emissary/emissary.d.ts
│ │ └── mixto/mixto.d.ts
│ └── q/Q.d.ts
└─┬ status-bar/status-bar.d.ts
  ├─┬ space-pen/space-pen.d.ts
  │ └── jquery/jquery.d.ts
  └─┬ text-buffer/text-buffer.d.ts
    ├─┬ emissary/emissary.d.ts
    │ └── mixto/mixto.d.ts
    └── q/Q.d.ts

$ tree typings
typings
├── atom
│   └── atom.d.ts
├── emissary
│   └── emissary.d.ts
├── jquery
│   └── jquery.d.ts
├── mixto
│   └── mixto.d.ts
├── node
│   └── node.d.ts
├── pathwatcher
│   └── pathwatcher.d.ts
├── q
│   └── Q.d.ts
├── space-pen
│   └── space-pen.d.ts
├── status-bar
│   └── status-bar.d.ts
└── text-buffer
    └── text-buffer.d.ts

10 directories, 10 files

# create dtsm.json and save dependencies
$ dtsm init
write to dtsm.json
{
  "repos": [
    {
      "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
      "ref": "master"
    }
  ],
  "path": "typings",
  "bundle": "typings/bundle.d.ts",
  "dependencies": {}
}

$ dtsm install --save atom
atom/atom.d.ts #be0b6b
├── q/Q.d.ts
├── jquery/jquery.d.ts
├─┬ space-pen/space-pen.d.ts
│ └── jquery/jquery.d.ts
├─┬ emissary/emissary.d.ts
│ └── mixto/mixto.d.ts
├─┬ pathwatcher/pathwatcher.d.ts
│ ├── node/node.d.ts
│ └── q/Q.d.ts
├─┬ text-buffer/text-buffer.d.ts
│ ├─┬ emissary/emissary.d.ts
│ │ └── mixto/mixto.d.ts
│ └── q/Q.d.ts
└─┬ status-bar/status-bar.d.ts
  ├─┬ space-pen/space-pen.d.ts
  │ └── jquery/jquery.d.ts
  └─┬ text-buffer/text-buffer.d.ts
    ├─┬ emissary/emissary.d.ts
    │ └── mixto/mixto.d.ts
    └── q/Q.d.ts

$ cat dtsm.json
{
  "repos": [
    {
      "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
      "ref": "master"
    }
  ],
  "path": "typings",
  "bundle": "typings/bundle.d.ts",
  "dependencies": {
    "atom/atom.d.ts": {
      "ref": "be0b6b394f77a59e192ad7cfec18078706e44db5"
    }
  }
}

$ rm -rf typings/

$ dtsm install
atom/atom.d.ts #be0b6b
├── q/Q.d.ts
├── jquery/jquery.d.ts
├─┬ space-pen/space-pen.d.ts
│ └── jquery/jquery.d.ts
├─┬ emissary/emissary.d.ts
│ └── mixto/mixto.d.ts
├─┬ pathwatcher/pathwatcher.d.ts
│ ├── node/node.d.ts
│ └── q/Q.d.ts
├─┬ text-buffer/text-buffer.d.ts
│ ├─┬ emissary/emissary.d.ts
│ │ └── mixto/mixto.d.ts
│ └── q/Q.d.ts
└─┬ status-bar/status-bar.d.ts
  ├─┬ space-pen/space-pen.d.ts
  │ └── jquery/jquery.d.ts
  └─┬ text-buffer/text-buffer.d.ts
    ├─┬ emissary/emissary.d.ts
    │ └── mixto/mixto.d.ts
    └── q/Q.d.ts

$ ls -la | grep typings
drwxr-xr-x  13 vvakame  wheel     442  3 27 00:31 typings

$ dtsm update --save
atom/atom.d.ts #0c2ee8
├── q/Q.d.ts
├── jquery/jquery.d.ts
├─┬ space-pen/space-pen.d.ts
│ └── jquery/jquery.d.ts
├─┬ emissary/emissary.d.ts
│ └── mixto/mixto.d.ts
├─┬ pathwatcher/pathwatcher.d.ts
│ ├── node/node.d.ts
│ └── q/Q.d.ts
├─┬ text-buffer/text-buffer.d.ts
│ ├─┬ emissary/emissary.d.ts
│ │ └── mixto/mixto.d.ts
│ └── q/Q.d.ts
└─┬ status-bar/status-bar.d.ts
  ├─┬ space-pen/space-pen.d.ts
  │ └── jquery/jquery.d.ts
  └─┬ text-buffer/text-buffer.d.ts
    ├─┬ emissary/emissary.d.ts
    │ └── mixto/mixto.d.ts
    └── q/Q.d.ts

Advanced usage

reference other repository

# search for another repository
$ dtsm --remote https://github.com/vvakame/gapidts.git search bigquery
Search results.

    test/valid/bigquery-v2-browser.d.ts
    test/valid/bigquery-v2-nodejs.d.ts

example

reference mixed repository

$ cat dtsm.json
{
  "repos": [
    {
      "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
      "ref": "master"
    },
    {
      "url": "https://github.com/vvakame/gapidts.git",
      "ref": "master"
    }
  ],
  "path": "typings",
  "bundle": "typings/bundle.d.ts",
  "dependencies": {
    "jquery/jquery.d.ts": {
      "ref": "0605ebbdbdd8183c70b4a14e1e34ecb3f2b446bf"
    },
    "gapidts/bigquery-v2-browser.d.ts": {
      "repo": "https://github.com/vvakame/gapidts.git",
      "ref": "4edbcca555936a931407d667f8687f175ecbd5ed",
      "path": "test/valid/bigquery-v2-browser.d.ts"
    }
  }
}

$ dtsm install
jquery/jquery.d.ts DefinitelyTyped/DefinitelyTyped#0605eb

gapidts/bigquery-v2-browser.d.ts vvakame/gapidts#4edbcc
└── gapidts/googleapis-browser-common.d.ts

example

Install with interactive filtering

If you use peco, you can install .d.ts file interactive.

$ dtsm search -i
$ dtsm install -i

dtsm install -i

Link to npm or bower bundled definitions

If other package manager's dependencies have a TypeScript definition files, dtsm can find it and add to bundle.d.ts.

$ cat package.json
{
  "name": "dtsm-sample",
  "version": "0.0.1",
  "dependencies": {
    "commandpost": "0.1.1"
  }
}
$ dtsm link --save
from npm dependencies
└─┬ commandpost
  └── node_modules/commandpost/commandpost.d.ts

If dtsm.json has link property, dtsm install exec link sub command implicitly.

$ cat package.json
{
  "name": "dtsm-sample",
  "version": "0.0.1",
  "dependencies": {
    "commandpost": "0.1.1"
  }
}
$ cat dtsm.json
{
  "repos": [
    {
      "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
      "ref": "master"
    }
  ],
  "path": "typings",
  "bundle": "typings/bundle.d.ts",
  "link": {
    "npm": {
      "include": true
    },
    "bower": {
      "include": true
    }
  },
  "dependencies": {}
}
$ dtsm install
install
from npm dependencies
└─┬ commandpost
  └── node_modules/commandpost/commandpost.d.ts

Change log

See CHANGELOG

Contributing

This package's author vvakame is not native english speaker. My first language is Japanese. If you are native english speaker. I wish received a pull request for document and anything.

TODO

  • write document
  • create pull request
    • generate self check todo list

更新日志

1.1.0 (2016-04-30)

Features

  • dtsm: add @internal annotation to pseudo private method(65e9321)
  • dtsm: remove reference from bundle when uninstall definitions(4d0a151d)

1.0.0 (2016-02-21)

Bug Fixes

  • ci: bump node.js version 0.12 to 0.4.x (22e511d)

0.13.0 (2015-11-09)

Features

  • dtsm: Add -S option as an alias of --save. by @pocke (bd4f1bb)

0.12.0 (2015-11-04)

Features

  • dtsm: DT repo move borisyankov to DT org (631481a)

0.11.0 (2015-09-23)

Features

  • dtsm: add workaround for Microsoft/TypeScript/issues/4667 (0c634eb)
  • dtsm: refactor to es6 style (af91f9d)
  • dtsm: update dependencies & switch to tsconfig.json oriented style (d7a25f5)

0.10.3 (2015-06-03)

Bug Fixes

  • dtsm: fix path generation for Windows (b614014, closes #12)

0.10.2 (2015-05-21)

Bug Fixes

  • dtsm: fix reference path lookup (dfe797d6, closes #10)

0.10.0 (2015-05-15)

Features

  • dtsm: implement link sub command refs #9 (4141749c)

0.9.2 (2015-05-07)

Bug Fixes

  • ci: fix for appveyor (0c94b909)
  • dtsm:
    • do not use ./bin/dtsm directly in specs, avoid test failed in Windows env (aea92275)
    • fix reference path generation in bundle.d.ts on windows (daedaca2, closes #6)

Features

  • deps: update dependencies, support typescript@1.5.0-beta (0a8a3c59)

0.9.1 (2015-04-02)

Bug Fixes

  • dtsm: add grunt setup to appveyor.yml (5b963bd6)

Features

  • dtsm:
    • challenge for windows support! update dependencies (44fb100e)
    • update node.js version in appveyor (83af71f5)
    • add appveyor.yml (b3603305)

0.9.0 (2015-03-27)

Features

  • dtsm: support default query in --interactive option (9b4be7bf)

0.8.2 (2015-03-23)

Features

0.8.1 (2015-03-13)

  • dtsm: update dependencies

0.8.0 (2015-03-05)

Bug Fixes

  • dtsm:
    • fix grunt test failed (90e382a9)
    • avoid twice tracking in uninstall method (b316cdbf)
    • fix output directory resolution (9fabbc) thanks @Tsuguya !

Features

  • dtsm: implement uninstall sub-command and Manager#uninstall method (7962a40e)

0.7.0 (2015-02-25)

Features

  • deps:
    • add archy to dependencies (1e8321da)
    • update dependencies and apply packagemanager-backend 0.5.0 (888b2270)
  • dtsm:
    • improve display dependency tree styling (1a374496)
    • implement resolveMissingDependency (15af730b)
    • improve install result displaying (001f348c)
    • add utils.padString function (e13ee8a1)

0.6.1 (2015-02-09)

Bug Fixes

  • dtsm: fix install from file is failed when dtsm.json are hand assembled (e0c7a9a9)

0.6.0 (2015-02-08)

Features

  • dtsm:
    • add dtsm refs sub-command (f2ea9773)
    • move feature of es6 polyfill main code to test code (c9938369)
    • add --ref option (0a541f21)

If you want to get definition files for older version tsc, exec dtsm --ref 1.3.0 install <libname>. If you know what ref-name accepted by dtsm, exec dtsm refs.

e.g. get definition files without union types!

$ dtsm refs
Branches:
     0.8
     0.9.1.1
     0.9.5
     1.0.1
     1.3.0
     def/node
     master
$ dtsm --ref 1.3.0 search promise
Search results.

    chai-as-promised/chai-as-promised.d.ts
    es6-promise/es6-promise.d.ts
    es6-promises/es6-promises.d.ts
    promise-pool/promise-pool.d.ts
    promises-a-plus/promises-a-plus.d.ts
    tspromise/tspromise.d.ts
$ dtsm --ref 1.3.0 install es6-promise
es6-promise/es6-promise.d.ts

0.5.0 (2015-02-08)

Features

  • deps: add grunt-conventional-changelog (6c30106a)
  • dtsm: add update sub command (d753cedf)

If you want to update dependencies revision, you can use dtsm update or dtsm update --save.

The general procedure.

$ dtsm update
...omitted...
$ npm run test
...omitted...
$ echo $?
0
$ dtsm update --save
$ git status -s
 M dtsm.json