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

tsbs

v0.1.0

Published

TypeScript Build System

Downloads

4

Readme

TSBS, the TypeScript Build System

This project was inspired by FAKE (F# Make). I wanted a way to create arbitrary build tasks that would run pure TypeScript (or JavaScript), rather than relying on NPM's garbage package.json scripts. Gulp comes close to what I want, but specifying and running dependencies (tasks that depend on other tasks) is unintuitive, creating "soft dependency task groups"[1] can't be done (easily) without a third-party package, and the piping is difficult to reason about.

With that said, this project is not meant to compete with any other build system. There may be identical or even better tools out there. It's just meant to scratch my own itch and perhaps be useful to other developers.

[1] "soft dependency" task group: a group of tasks that don't depend on each other, but do depend on all previously specified tasks, and further tasks depend on every task in the "soft dependency". For example, consider this group of tasks:

[
    "Clean",
    ["Build:Client", "Build:Server"],
    "Publish"
]

The tasks "Build:Client" and "Build:Server" are soft dependencies. Running "Build:Client" would run "Clean" => "Build:Client" but wouldn't run "Build:Server" at all. However, running task "Publish" would run "Clean" => "Build:Client" => "Build:Server" => "Publish".

Usage

This is an alpha project at the moment; the intended usage looks something like this:

import { Task } from "tsbs";

Task.create("Clean", () => {
    // Tool should have a built-in way to clean directories
})

Task.create("Restore", () => {
    // Tool should have a built-in way to restore packages via NPM or Yarn
})

Task.create("Build:Client", () => {
    // Tool should have a built-in way to run NPM scripts, webpack, or any executable
})

Task.create("Build:Server", () => {
    // Tool should have a built-in way to run NPM scripts, webpack, or any executable
})

// The dependency list will run "Build:Client" and "Build:Server" before running "Build". Since those
// two tasks will build the application, this one doesn't need to do anything.
Task.create("Build", Task.doNothing);

// Task "All" is just an alias for task "Build"
Task.create("All", Task.doNothing);

Task.create("Test", () => {
    // Tool should have a built-in way to run NPM scripts, webpack, or any executable
})

Task.create("Publish", () => {
    // Tool should have a built-in way to run NPM/Yarn publish
})

// Export tasks and their dependencies
export const Tasks = [
    // Dependency is as follows:
    // Task "Clean" has no dependencies
    // Task "Restore" depends on task "Clean" and will run that first
    // Tasks "Build:Client" and "Build:Server" do not depend on each other, but do depend on "Restore" (and its dependencies)
    // Tasks "Build" and "All" depend on both "Build:Client" and "Build:Server"
    Task.dependencies([
        "Clean", 
        "Restore",
        ["Build:Client", "Build:Server"],
        ["Build", "All"]
    ]),

    // Dependencies build on the ones already specified.
    // Task "Build" depends on everything configured previously.
    // Task "Publish" depends on task "Build" (but not task "All").
    Task.dependencies([
        "Build",
        "Publish"
    ]),
    
    // Again, building on the dependencies already specified.
    // Here we add "Clean" as a direct dependency of "Build".
    // At this point if we ran "Build", the task order would be:
    // "Clean"
    // |> "Restore"
    // |> "Build:Client" && "Build:Server"
    // |> "Clean"
    // |> "Build"
    Task.dependencies([
        "Clean",
        "Build"
    ])
]

// Export the default task. This will run if no task is specified. 
export default "All"