hongbo-miao / levitate

A tool for helping to understand APIs exported and consumed by NPM packages (or any TypeScript code).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🔮 Levitate

npm version npm downloads CI prettier TypeScript

A tool for helping to understand APIs exported and consumed by NPM packages (or any TypeScript code).

Usage

Compare exports of different package versions

# Compare exports of different versions of a package
npx @grafana/levitate compare \
    --prev @grafana/ui@8.2.5 \
    --current @grafana/ui@canary

List imports

# List the imports used by a program
npx @grafana/levitate list-imports \
    --path <PATH-TO-A-PACKAGE>/module.ts \
    --filters "@common/pages" "@grafana/data" \
    --verbose

List exports

# List the exports of a compiled package
npx @grafana/levitate list-exports \
    --path <PATH-TO-A-PACKAGE>/index.d.ts

Check compatibility between a module and a package

To check the compatibility of code using a specific version of a package (e.g.: @grafana/data@9.0.0) against another version of the same package (e.g. @grafana/data@9.0.5).

# Check if the current module.ts usage of @grafana/data is
# compatible with the latest version of it
npx @grafana/levitate is-compatible \
    --path <PATH-TO-A-PACKAGE>/module.ts \
    -- target "@grafana/data@latest"

Contributing

If you are interested in contributing to the Levitate project please read the Contributing guide.

About

A tool for helping to understand APIs exported and consumed by NPM packages (or any TypeScript code).

License:Apache License 2.0


Languages

Language:TypeScript 94.6%Language:JavaScript 5.4%