npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@rnx-kit/tools-typescript

v0.1.1

Published

EXPERIMENTAL - USE WITH CAUTION - tools-typescript

Downloads

109

Readme

@rnx-kit/tools-typescript

Build npm version

🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧

THIS TOOL IS EXPERIMENTAL — USE WITH CAUTION

🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧

A package that helps with building typescript, particularly for react-native. It leverages the @rnx-kit/typescript-service package to build using the language service rather than using the compiler directly. This allows for custom resolution strategies (among other things). The compilation and type-checking are still done by typescript but this drives some convenient custom configurations.

In particular the buildTypeScript command can do things like:

  • multiplex a build in a directory, to build for multiple react-native platforms at the same time. The files will be split such that the minimal build can be performed.
  • detect which react-native platforms should be built based on rnx-kit bundle configs or react-native.config.js settings.
  • successfully build with the module suffixes without throwing up a ton of bogus unresolved reference errors.
  • share caches where possible to speed up compilations within the same node process.

Motivation

The current story for building typescript for react-native is sub-par, and typescript itself is particularly restrictive with module resolution. This addresses the ability to build react-native better right now, but also creates a framework for experimenting with different resolvers.

Things to do

  • Look at watch mode behavior, add invalidation for caching layers
  • Look at routing host creation in metro-plugin-typescript through here
  • Evaluate alternative resolvers

Installation

yarn add @rnx-kit/tools-typescript --dev

or if you're using npm

npm add --save-dev @rnx-kit/tools-typescript

Usage

| Category | Type Name | Description | | -------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | types | AsyncThrottler | Interface for capping the max number of async operations that happen at any given time. This allows for multiple AsyncWriter instances to be used in parallel while still limiting the max number of concurrent operations | | types | AsyncWriter | Interface for handling async file writing. There is a synchronous write function then a finish function that will wait for all writes to complete | | types | BuildOptions | Options that control how the buildTypeScript command should be configured | | types | PlatformInfo | Information about each available platform | | types | Reporter | Interface for reporting logging and timing information |

| Category | Function | Description | | --------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | build | buildTypeScript(options) | Execute a build (or just typechecking) for the given package. This can be configured with standard typescript options, but can also be directed to split builds to build and type-check multiple platforms as efficiently as possible. | | files | createAsyncThrottler(maxActive, rebalanceAt) | Creates an AsyncThrottler that can be used to limit the number of concurrent operations that happen at any given time. | | files | createAsyncWriter(root, throttler, reporter) | Create an AsyncWriter that can be used to write files asynchronously and wait on the results | | host | openProject(context) | Open a typescript project for the given context. Can handle react-native specific projects and will share cache information where possible given the configuration | | platforms | loadPkgPlatformInfo(pkgRoot, manifest, platformOverride) | Load platform info for available platforms for a given package | | platforms | parseSourceFileDetails(file, ignoreSuffix) | Take a file path and return the base file name, the platform extension if one exists, and the file extension. | | reporter | createReporter(name, logging, tracing) | Create a reporter that can log, time, and report errors |