GithubHelp home page GithubHelp logo

registry's Introduction

Typings

NPM version NPM downloads Build status Gitter

The TypeScript Definition Manager.

Deprecation Notice: Regarding [email protected]

For users doing typings install dt~<package> --global and receiving errors.

Starting from TypeScript 2.0, users can install typings using npm install @types/<package>. These typings are coming from DefinitelyTyped. In the future, we hope redirects will be enabled to support existing maintainers to contribute effectively to NPM's @types as they did to typings/registry.

Typings on DefinitelyTyped have also moved to the external module format supported by TypeScript. This finally solved the real problem that Typings was trying to solve! It also means it will cause errors such as:

> typings install dt~angular --global 

typings ERR! message Attempted to compile "angular" as a global module,
but it looks like an external module. You'll need to remove the global option to continue.

To resolve this, we recommend moving to TypeScript 2.0's official aquisition method (npm install @types/angular). You can also drop the --global flag from typings, though some definitions on DefinitelyTyped may not work with the Typings approach because of new TypeScript features (namely UMD namespaces).

This project will remain operational for the foreseeable future, but is effectively deprecated. New projects should use @types from NPM.

Quick Start

# Install Typings CLI utility.
npm install typings --global

# Search for definitions.
typings search tape

# Find a definition by name.
typings search --name react

# If you use the package as a module:
# Install non-global typings (defaults to "npm" source, configurable through `defaultSource` in `.typingsrc`).
typings install debug --save

# If you use the package through `<script>`, it is part of the environment, or
# the module typings are not yet available, try searching and installing with `--global`:
typings install dt~mocha --global --save

# If you need a specific commit from github.
typings install d3=github:DefinitelyTyped/DefinitelyTyped/d3/d3.d.ts#1c05872e7811235f43780b8b596bfd26fe8e7760 --global --save

# Search and install by version.
typings info env~node --versions
typings install [email protected] --global --save

# Install typings from a particular source (use `<source>~<name>` or `--source <source>`).
typings install env~atom --global --save
typings install bluebird --source npm --save

# Use `typings/index.d.ts` (in `tsconfig.json` or as a `///` reference).
cat typings/index.d.ts

Usage

Typings is the simple way to manage and install TypeScript definitions. It uses typings.json, which can resolve to the Typings Registry, GitHub, NPM, Bower, HTTP and local files. Packages can use type definitions from various sources and different versions, knowing they will never conflict for users.

typings install debug --save

The public registry is maintained by the community, and is used to resolve official type definitions for JavaScript packages.

Read More

Sources

  • npm - dependencies from NPM
  • github - dependencies directly from GitHub (E.g. Duo, JSPM)
  • bitbucket - dependencies directly from Bitbucket
  • jspm: - dependencies from installed JSPM packages with typings distributed. Requires [email protected]+.
  • bower - dependencies from Bower
  • common - "standard" libraries without a known "source"
  • shared - shared library functionality
  • lib - shared environment functionality (mirror of shared) (--global)
  • env - environments (E.g. atom, electron) (--global)
  • global - global (window.<var>) libraries (--global)
  • dt - typings from DefinitelyTyped (usually --global)

Contributing

# Installation
# Fork this repo (https://github.com/typings/typings)
# Clone the fork (E.g. `https://github.com/<your_username>/typings.git`)
cd typings

# Install modules
npm install

# Build
npm run build

# Test
npm run test

License

MIT

registry's People

Contributors

adaball avatar asvetliakov avatar blakeembrey avatar bossqone avatar caselit avatar demurgos avatar effervescentia avatar eseliger avatar fank avatar felixfbecker avatar giedriusgrabauskas avatar goenning avatar greenkeeperio-bot avatar j-oliveras avatar jessezhang91 avatar jgoz avatar jkeylu avatar joewashear007 avatar louy avatar lukephills avatar mxl avatar nickzelei avatar patrickjs avatar protectator avatar rapropos avatar samvloeberghs avatar somaticit avatar tkqubo avatar unional avatar zaytsevvla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

registry's Issues

Should definitions that make it into the registry have tests?

I realised that the definitions in the registry had no sign of tests that I could see.

Whilst the tests in Definitely Typed are not your classic unit tests per se and actually just test that compilation of code is possible with the definitions available they are useful to have in place to catch any breaking changes people might introduce. This was necessary since DT is a giant repo which contains all the definitions and this does not apply to Typings. That said, is there a desire/need for some kind of testing around the typings that end up in the registry?

If so, what would make sense / be useful in Typings-land?

Create a bot that auto-links registry PRs

  • Link to the project (homepage in typings.json, issues, source code, etc.)
  • Link to the definition in its current form (specific SHA)
  • Expose additional information - for ambient, global interfaces/modules/etc found, etc.

Port toolings type file with higher priority?

Propose to port tools such as gulp, mocha, jasmine, chai, etc over to typings first.

Currently, without porting them over, typings i -D ... would cause unnecessary compile error because browser.d.ts and main.d.ts include dev dependencies just like regular dependencies.

So tsc will fail with error such as:

typings/browser/ambient/gulp/gulp.d.ts(10,35): error TS2307: Cannot find module 'orchestrator'.
typings/browser/ambient/gulp/gulp.d.ts(50,31): error TS2503: Cannot find namespace 'NodeJS'.
typings/browser/ambient/gulp/gulp.d.ts(60,66): error TS2503: Cannot find namespace 'NodeJS'.
typings/browser/ambient/gulp/gulp.d.ts(67,68): error TS2503: Cannot find namespace 'NodeJS'.
typings/browser/ambient/gulp/gulp.d.ts(75,85): error TS2503: Cannot find namespace 'NodeJS'.
typings/browser/ambient/gulp/gulp.d.ts(83,87): error TS2503: Cannot find namespace 'NodeJS'.
typings/browser/ambient/gulp/gulp.d.ts(95,80): error TS2503: Cannot find namespace 'NodeJS'.
typings/browser/ambient/gulp/gulp.d.ts(104,56): error TS2503: Cannot find namespace 'NodeJS'.

because of typings i -D gulp --ambient, while without that it is building fine.

installing multiple dependencies does not work

Hi,

Trying to install multiple dependencies at the same time doesn't seem to work:
typings install jquery foundation-sites --save --ambient

only installs the first, jquery

You probably now that already, just checking :)

Grtz

contribution guide

Hi,

Is there a contribution guide available? I want to merge some projects but don't really have the time to find out how at the moment.

Good job on the project!
Grtz

Add `exists` field to registry entries

This flag will point to the semver version(s) when the typings were included in the package itself. If the user is between these versions, we can print a warning for them in tooling.

Expand registry entry details

From typings/typings#49, the registry should support extra information. Currently this is defined in the schema: https://github.com/typings/registry/blob/master/schema.json. New support should look like:

{
  "versions": {
    "2.0.0": [
      "github:foo/bar#commitish",
      {
        "compiler": "1.5.2", // Maybe it should specify the range or just imply greater than? E.g. "> 1.5.2".
        "location": "github:foo/bar-legacy#commitish",
        "description": "This is a legacy definition..."
      }
    ]
  }
}

Good time to think about other fields that might eventually need to be added too.

Typings for ES7

Would be nice to get some typings for features in ES7 and late stages of other proposed language extensions.

Thanks.

Difference between ambient and npm folders ?

Hi @blakeembrey ,

I have just finished a typed-electron module that support currently 2 versions

{
  "versions": {
    "0.35.4": "github:koalabz/typed-electron/electron.d.ts#c597a7362eb4605ad737217a19b701d4cf2bc80a",
    "0.36.0": "github:koalabz/typed-electron/electron.d.ts#2689b1648190d6921496a3f94c0d4e1ecae2ef1f"
  }
}

but i don't understand where i need to create the electron.json file. In ambient or npmfolder ?

Compile a list of example repo

For each common module shape:

  • one function (e.g. domready)
  • immutable utility (e.g. lodash)
  • utility + function (e.g. jquery)
  • utility + class (e.g. bluebird), identical to class with static?
  • multiple subpath modules (e.g. core-js, material-ui, ext-js)
  • sub-modules (e.g. node), any better name?

All suggestion welcome!

This will be added as docs/examples.md later.

How to fix bluebird.d.ts Duplicate identifier 'Promise' error?

When I run tsc -d on my project that use bluebird (i.e. installing typed file with typings install bluebird --ambient), I run into this:

typings/browser/ambient/bluebird/bluebird.d.ts(21,15): error TS2300: Duplicate identifier 'Promise'.
typings/browser/ambient/bluebird/bluebird.d.ts(637,16): error TS2300: Duplicate identifier 'Promise'.

The corresponding lines:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/ffceea9dd124d277c4597c7bd12930666ec074c5/bluebird/bluebird.d.ts#L19
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/ffceea9dd124d277c4597c7bd12930666ec074c5/bluebird/bluebird.d.ts#L629

What should I do to:

  • fix it
  • move it to typings/registry

test fails on windows

Hey, love the project so far. I have tracked down an issues on windows with the test command.

Details

  • The output of git diff --name-status HEAD~1 is A npm/sentiment.json.
  • The test tries to split apart npm/sentiment using the file system separator, which in window is \
  • So the split never happens, cause the test script fail

Fixes

  • This line seemed to be the issue. Replacing it with var sep = "/" makes it work.

Add registry entry to CLI tool

This should reduce friction that little bit more to adding to the registry. Something like typings register [email protected] --scope npm --src github:typings/typed-foobar, which will open a PR on behalf of the user.

Documentation

I often see PR's which have an ambient or old declarations.
So the idea was about adding an contribution guide with following infos:

  • What is the difference between typings definitions in tds and typings
  • Some example of how a typings looks like (prefered for newbies)
    • Export a function
    • Export a class
    • Export an object
    • ...
  • How the folder structure of an typing should looks like
  • What is the difference between the folder (npm and global) folder in the registry repo

@typings/registry What do you think?

installing foundation-sites gives error

Hello,

So i've tried to install the foundation-sites typings I've added recently into a project.
It gives me this error, and I don't quite understand it :)

C:\Users\svloeberghs\Documents\angular2-webpack-starter>typings install foundation-sites
? Found typings for foundation-sites in multiple registries Ambient
Installing [email protected] (Ambient)...

typings ERR! message Attempted to compile "foundation-sites" as a dependency, but it contains ambient modules ("Foundation"). Did you w
ant to specify "--ambient" instead?

typings ERR! cwd C:\Users\svloeberghs\Documents\angular2-webpack-starter
typings ERR! system Windows_NT 6.1.7601
typings ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\svloeberghs\\AppData\\Roaming\\npm\\node_modules\\typings\\dist\
\bin\\typings-install.js" "foundation-sites"
typings ERR! node -v v4.2.1
typings ERR! typings -v 0.5.1

typings ERR! If you need help, you may report this error at:
typings ERR!   <https://github.com/typings/typings/issues>

I did specify ambient in the choice it gave me.
Any thoughts on this?

Grtz

Typings for Firebase

Not sure where to submit this, since TSD is being deprecated. But it looks like the DT typings for Firebase are a little outdated.

Some of the methods return promises now.

Typings for json-api-store

Would like to use the json-api-store library from typescript. I'll take a stab at creating one, but it's not clear how to do that yet.

Maintainers

If you're interested in helping out to merge type definitions, please let me know ๐Ÿ˜„ I'd love to add some collaborators to the registry to merge definitions and offer helpful advice.

We passed 100 typings for NPM alone!

I think it's pretty cool. How long will it take to get to 200, 1000, 2000? Can it surpass DefinitelyTyped (that'll definitely help for future proofing with some things upcoming in TypeScript)? Just wanted to make this so people have visibility into progress so far. I'll be closing it right after ๐Ÿ˜„

Reference: https://api.typings.org/search?source=npm

Run tests on changed files only

Currently the test suite is being run on all files, every PR/check in. It would be faster for it to run on only the changes compared to master.

Tooling for creating typed-typings repos

While I really like the idea behind typed-typings, I fear it's going to be really painful to get contributions without some tooling.

Current pain points:

  • A lot of boilerplate in typings repos
    • Ideally, I should be able to take a .d.ts that's been written & used in one of my projects, and "push" it to typed-typings with minimal effort
    • A Yeoman generator, or similar tool, might be able to streamline that?
  • Managing the typed-typings org (adding contributors), seems like it'll be annoying, particularly since most potential contributions are one-off

multiple versions of same package in same repo

Is it possible to put multiple versions of the same package definitions in one repository without having to use tags/branches/commits.

Something like using folders and github:louy/typed-package/v0.1.0#COMMIT.

Test Suite for Writing Typings

Relevant information for anyone writing Typings definitions and wanting to execute tests.

I saw @unional has been installing definitions into themselves as part of the dev dependencies, but there's actually a simpler way - use typings bundle. I implemented this while testing https://github.com/typed-typings/npm-batch, and I combined it with ts-node to create a simple test suite of both the runtime and compile time since ts-node will crash on compiler errors.

Relevant implementation: https://github.com/typed-typings/npm-batch/blob/master/package.json

I'll keep this open for anyone that needs guidance on implementing Typings.

Unable to connect to "https://api.typings.org/search?name=debug&ambient=false"

Hi,

I am migrating from TSD to Typings and following instructions:
I have installed it with npm globally.

When I run typings install debug --save I get an error message

typings ERR! message Unable to connect to "https://api.typings.org/search?name=debug&ambient=false"
typings ERR! caused by getaddrinfo ENOTFOUND api.typings.org api.typings.org:443

typings ERR! cwd /Users/leblanc/www/projectX
typings ERR! system Darwin 15.3.0
typings ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/typings/dist/bin/typings-install.js" "debug" "--save"
typings ERR! node -v v5.3.0
typings ERR! typings -v 0.6.6
typings ERR! code EUNAVAILABLE

typings ERR! If you need help, you may report this error at:
typings ERR!   <https://github.com/typings/typings/issues

I am able to install typings however I noticed my IDE (Code or Sublime3) not picking them up like it did with TSD.
So I wondered if that install is required for that. But then it runs into an error.
Does anyone have an idea?

cucumber

The type def in DefinitelyTyped is out of date. Need a new one!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.