Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Shipping TypeScript to npm

Shipping TypeScript to npm

How we shipped @azure/cosmos in a way that everyone can happily consume it from npm. Presented at TypeScript NYC meetup on Feb 26th 2019

Steve Faulkner

February 26, 2019
Tweet

More Decks by Steve Faulkner

Other Decks in Programming

Transcript

  1. Read/Write JSON Massive scale+perf No schema SQL API Everything indexed

    by default! Tune-able consistency JavaScript stored procedures
  2. lib

  3. // In tests! import { Agent } from “http” let

    opts : ClientOptions = { agent: new Agent() }
  4. export const Color = { Red: "Red" as “Red", Green:

    "Green" as "Green" }; const green: Color = Color.Green const red: Color = “Red”
  5. typescript(esm) -> esm rollup(esm) -> umd apiExtractor(index.d.ts) Don’t use “lib”

    esModuleInterop: true Mirror @types interfaces Don’t use enums Have a TS consumer tests