Generates package:js Javascript interop facades for arbitrary TypeScript libraries
TypeScript JavaScript
Switch branches/tags
Clone or download
jacob314 Fix crash generating facades for loasd. Fix bug in how we handle Type…
…Predicates. Add test for TypePredicates case.

BUG=
R=matanl@google.com

Review URL: https://codereview.chromium.org//2434903002 .
Latest commit f8a4779 Oct 19, 2016

README.md

Build Status

Generates package:js Javascript interop facades for arbitrary TypeScript libraries.

Installation

  • Install Node.js
    • We depend on Node.js so that we can analyze TypeScript files using the TypeScript language services package. This ensures we parse d.ts consistently with other tools.
  • Execute npm install -g dart_js_facade_gen to install.

Usage

Basic

dart_js_facade_gen <input d.ts file> Dart interop facade file is written to stdout.

Advanced

dart_js_facade_gen --destination=<destination-dir> --basePath=<input d.ts file directory> <input d.ts file> <input d.ts file> ...

Example

dart_js_facade_gen --destination=/usr/foo/tmp/chartjs/lib --basePath=/usr/foo/git/DefinitelyTyped/chartjs /usr/foo/git/DefinitelyTyped/chartjs/chart.d.ts

Development

  • The Dart SDK must be available to run end to end tests.

Gulp tasks

  • gulp watch executes the unit tests in watch mode (use gulp test.unit for a single run),
  • gulp test.check-format checks the source code formatting using clang-format,
  • gulp test runs unit tests, e2e tests and checks the source code formatting.

Publish

  • npm run prepublish
  • npm publish