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

typescript-assistant

v0.70.2

Published

Combines and integrates professional Typescript tools into your project

Downloads

535

Readme

Introduction

While you write TypeScript code, you want it to compile, tests to succeed, code coverage to be upheld and the code should conform to formatting and linting rules. There are already great tools that help you do this. But running them manually can be time-consuming.

In order to be more productive, we ended up creating TypeScript Assistant, that takes care of running the right tools at the right time.

  • Before commit: Check formatting and linting
  • Before push: Compile, run unit test and check coverage
  • After pull: Update packages

It also adds npm scripts to:

  • Fix formatting and linting (npm run fix)
  • Release to npm (npm run release)
  • Run all tools on save in the background (npm run assist)
  • Open code coverage (npm run coverage-show)
  • Run continuous integration (npm run ci)
  • Clean (npm run clean)

Read about the philosophy behind TypeScript Assistant on our blog.

Getting started

You can try TypeScript Assistant on a new project by running

git init && npm init && npm install typescript-assistant --save-dev -E && ./node_modules/.bin/tsa init

On existing TypeScript projects, you can just run

npm install typescript-assistant && npm dedupe && ./node_modules/.bin/tsa init

TypeScript Assistant will not overwrite any configuration you already have.

Configuration

Not everything is configurable in TypeScript Assistant.

  • /dist contains artifacts that get distributed in a release. It is excluded from source control.
  • /build contains build output and temporary artifacts. It is excluded from source control.
  • /test contains (unit)tests written in mocha

TypeScript Assistant enforces \n as end-of-line on every platform. It does not have a configuration file of is own, it lets the underlying tools use their own configuration files. tsa init prepares these files as follows:

  • .editorconfig - End-of-line and tab size set to 2 spaces
  • .gitattributes - End-of-line
  • .gitignore - Exclude non-source files
  • .npmignore - Configure what gets packaged, only /dist and README.md
  • package.json - Adds scripts for git hooks and tasks provided by TypeScript Assistant. Also contains configuration for nyc (code coverage)
  • src/tsconfig.json - Strict TypeScript configuration for sources. Output is written to /dist
  • tsconfig.json - Lenient TypeScript configuration for unit tests, does not write output. (tests run fine using ts-node)
  • tsfmt.json - End-of-line and tab size
  • tslint.json - Contains the linting rules you prefer. By default it is set to inherit from the AFAS Software rules shipped by TypeScript Assistant. It can be modified to suit your needs
  • tslint.editor.json - Extends tslint.json and disables some rules to make your IDE (vscode/webstorm) easier to work with.

The folder /src is assumed to contain source files, but this can be modified by changing the tsconfig.json files and the nyc section in package.json. All configuration files can be changed as needed.

If you are creating a browser package, you can get inspiration from maquette on how you can put browser bundles in the dist folder using TypeScript Assistant. See the dist task in the package.json.

NOTE

When typescript-assistant cannot find some of its dependencies, it may be required to run npm dedupe which makes sure all required dependencies will be located directly under node_modules of your project

Contributing

We would love to discuss the best practices that TypeScript Assistant is meant to support. To start a discussion you may open an issue. We do not intend to make TypeScript Assistant ultimately flexible to support everyone's needs, but pull requests for improvements are welcome.