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 🙏

© 2024 – Pkg Stats / Ryan Hefner

every-ts

v2.0.2

Published

A CLI to build and bisect any version of TypeScript

Downloads

10

Readme

every-ts

npm node

$ npm install -g every-ts
$ every-ts

every-ts is a utility that can build any version of TypeScript. Yes, that's right, any version, any commit, even main, v1.0.3, or in between. (If it breaks, let me know!)

every-ts can also be used to bisect TypeScript, without needing to know anything about TypeScript's build process.

This repo works by making a "blobless" clone of TypeScript (to save time and space), switching to the desired version, and building it. The way to build TypeScript has changed over the years (even places which don't build with modern Node!), and every-ts knows how to build any of them.

Switching versions

To switch versions, use every-ts switch <rev>. This rev can be anything that git accepts. If <rev> isn't found, origin/<rev>, origin/release-<rev>, and v<rev> will also be tried. You may also pass in a -dev version, which will be resolved to the commit that generated that nightly build.

$ every-ts switch main                # Switches to `origin/main`
$ every-ts switch release-2.7         # Switches to `origin/release-2.7`
$ every-ts switch 1.8                 # Switches to `origin/release-1.8`
$ every-ts switch 1.8~100             # Switches 100 commits before `origin/release-1.8`
$ every-ts switch v1.1                # Switches the tag `v1.1`
$ every-ts switch 5.3.0-dev.20231001  # Switches to the 20231001 nightly build

Fetching new changes

To fetch the latest repo information, run every-ts fetch.

Running tsc

To invoke tsc, run every-ts tsc:

$ every-ts switch main
$ every-ts tsc
Version 5.3.0-dev
$ every-ts switch 1.8~100
$ every-ts tsc --version
Version 1.8.0
$ every-ts switch v1.1
$ every-ts tsc --version
message TS6029: Version 1.1.0.0

Alternatively, you can use every-ts exec to run commands in an environment with tsc on PATH:

$ every-ts switch main
$ every-ts exec tsc --version
Version 5.3.0-dev
$ every-ts exec tsc -p ./path/to/tsconfig.json

You can also link TypeScript into your package:

$ every-ts dir
/home/jake/every-ts/.data/TypeScript
$ npm link $(every-ts dir)

Using with VS Code

To get a working path to use with VS Code, run every-ts tsdk to get the option to add to settings.json:

$ every-ts tsdk
"typescript.tsdk": "/home/jabaile/work/every-ts/.data/TypeScript/lib"

Remember, you still need to use the "Select TypeScript Version" command to make this active. The setting itself is not enough.

Bisecting

every-ts wraps git bisect, building TypeScript automatically. To use it, run every-ts bisect just like you would git bisect:

$ every-ts bisect start
status: waiting for both good and bad commits
$ every-ts bisect bad 5.3.0-dev.20231001
status: waiting for good commit(s), bad commit known
$ every-ts bisect good v5.1.6
Bisecting: a merge base must be tested
[0aa49c152d37f97e16ad3d166701d0f7166a635e] Update package-lock.json
$ every-ts tsc --version
Version 5.1.0-dev
# Do something with `every-ts tsc`...
$ every-ts bisect good
$ every-ts bisect bad
$ every-ts bisect bad
# ...
$ every-ts bisect good
$ every-ts bisect bad
607d96f6dfc6dc557fa370d8ae86f5191608ec91 is the first bad commit
commit 607d96f6dfc6dc557fa370d8ae86f5191608ec91
Author: Jake Bailey <[email protected]>
Date:   Thu Aug 3 15:53:30 2023 -0700

    Improve performance of maybe stack in recursiveTypeRelatedTo (#55224)
$ every-ts bisect reset

bisect run is also supported. The executed command will have TypeScript's bin directory prepended to the path, so you can run tsc directly:

$ every-ts bisect start
status: waiting for both good and bad commits
$ every-ts bisect new v5.0.3
status: waiting for good commit(s), bad commit known
$ every-ts bisect old v4.9.4
Bisecting: a merge base must be tested
[0aa49c152d37f97e16ad3d166701d0f7166a635e] Update package-lock.json
$ every-ts bisect run tsc --version

For more info on git bisect, see the git docs.