sgb-io / fta

Rust-based static analysis for TypeScript projects

Home Page:https://ftaproject.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Needs distribution strategy

sgb-io opened this issue · comments

I need to decide how to distribute fta so that it can be consumed!

Ideally, we want minimal prerequisites and to aim for maximum performance.
The primary use case is calling it from CI. It should also support some basic configuration options, such as a threshold for making CI fail.

I also have hopes of publishing it as a Rust library (the same as swc), but that is definitely a lower priority.

For reference, it looks like swc has a binding npm package that calls binaries based on arch/platforms - https://github.com/swc-project/swc/blob/main/node-swc/src/binding.js

The thinking here is that this tool is primarily useful as a one-hit binary call in CI or local dev. Exposing it as an npm module makes a lot of sense and is conveinient - ideally, we don't want to require Rust or other dependencies to get the essential value out of fta.

There might also be value in exposing a Node API so that the output can be programmatically addressed, but this is not the first priority.

To publish:

  • An npm package named "@fta/cli" (or similar). This should include pre-built binaries.
  • Follow swc's lead for the list of binaries to support - include in the npm package:
    • Mac (Apple Silicon)
    • Mac (x64)
    • Linux (x86_64)
    • Linux (aarch64)
    • Linux (armv7)
    • Alpine Linux (? - requires additional dep for swc)
    • Android (aarch64)
    • Windows (win32-x64)
    • Windows (ia32)
  • A GitHub action that calls @fta/cli

Out of scope for now, but could pursue in the future:

  • Publishing the Rust crate / a Rust lib (but, publishing the basic crate might be neccessary or appropriate)
  • An npm package that exposes a Node API that allows Node.js programmatic interaction with fta

The list of targets is reduced but releasing the binary is solved.

Outstanding question: where to hold the npm module? Would be nice if this repo was a monorepo; this complicates the publishing though: binaries are currently published to the github release and that's it.

The alternative is a separate repo that contains pre-built binaries, I think?