GithubHelp home page GithubHelp logo

anthrax3 / flow-typed Goto Github PK

View Code? Open in Web Editor NEW

This project forked from flow-typed/flow-typed

0.0 2.0 0.0 4.13 MB

A central repository for Flow library definitions

License: MIT License

Batchfile 0.01% JavaScript 99.99% Shell 0.01%

flow-typed's Introduction

Flow Logo

Travis npm

flow-typed is a repository of third-party library interface definitions for use with Flow.

You can grab definitions directly from this GitHub repo, or you can use the CLI (currently in beta) to install a libdef for a given library:

$ yarn global add flow-typed

$ cd /path/to/my/project
$ yarn install
$ flow-typed install [email protected]
'rxjs_v5.0.x.js' installed at /path/to/my/project/flow-typed/npm/rxjs_v5.0.xjs

Huh?

When you start a project with Flow, you likely want to use some third-party libraries that were not written with Flow. By default, Flow will just ignore these libraries leaving them untyped. As a result, Flow can't give errors if you accidentally mis-use the library (nor will it be able to auto-complete the library).

To address this, Flow supports library definitions which allow you to describe the interface of a module or library separate from the implementation of that module/library.

The flow-typed repo is a collection of high-quality library definitions, tests to ensure that definitions remain high quality, and tooling to make it as easy as possible to import them into your project.

All you have to do when you add one or more new dependencies to your project is run flow-typed install. This will search the libdef repo and download all the libdefs that are relevant for your project and install them for you. After that, simply check them in and be on your way!

Getting Started

Check out Importing And Using Type Definitions in the wiki. It will walk you through using typedefs installed through flow-typed, as well as writing and including your own.

FAQs

Before opening an issue, take a look at the FAQs. Chances are your question has already been answered! If not, don't hesitate to open an issue.

How Do I Contribute Library Definitions?

Just send a pull request! The wiki on Contributing Library Definitions details the format of new contributions. Contributions should follow the best practices outline on CONTRIBUTING.md.

Contributing to the CLI

Bugfixes and improvements to the core CLI are welcome. If you'd like to contribute a new feature, consider opening an issue first to discuss it.

flow-typed CLI

The flow-typed npm package provides a CLI that includes several commands for working with this repository. The full list of commands is available at CLI Commands & Flags.

flow-typed install [package-specification] [--ignoreDeps deps]

Installs libdefs from looking at your package.json.

If package-specification was specified, only that one libdef will be installed. If the --ignoreDeps flag was specified, the libdefs for the specified deps will be ignored. i.e: --ignoreDeps dev bundle peer.

flow-typed install [email protected]
flow-typed validate-defs

Verifies that all files under the /definitions/ directory are structured and named properly. It does not run tests, it only asserts that file and directory names match the expected conventions.

This command is run during CI.

flow-typed run-tests [optional-pattern]

For each libdef, find each test and run it with all compatible versions of Flow. If any errors arise that are not // $ExpectError, the test has failed.

Note that this command assumes that the /definitions/ directory is correctly structured. It should be run after running flow-typed validate-defs.

flow-typed update-cache [--debug]

By default flow-typed retrieves all available libdefs from its related upstream repository. To make this process more efficient, those libdefs are cached once on your local filesystem. Usually, the cache will automatically be updated after a short grace period during a libdef installation, but sometimes it is useful to do this update manually. Use this command if you want to download the most recent definitions into the cache for yourself.

Active Maintenance Team

Andrew Smith Georges-Antoine Assi Ville Saukkonen
@AndrewSouthpaw @GAntoine @villesau

flow-typed's People

Contributors

a-tokyo avatar andrewsouthpaw avatar ashoat avatar bassettsj avatar callumlocke avatar denizdogan avatar doberkofler avatar edwarddrapkin avatar gantoine avatar hansonw avatar inkdpixels avatar jamiebuilds avatar jarlakxen avatar jedwards1211 avatar jeffmo avatar kenany avatar loganbarnett avatar marudor avatar matthewwithanm avatar maxmalov avatar mrmurphy avatar mwalkerwells avatar nmote avatar pascalduez avatar relekang avatar saadq avatar stouf avatar turadg avatar villesau avatar wbinnssmith avatar

Watchers

 avatar  avatar

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.