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

tscomp

v1.0.0-beta.11

Published

Effortless buildtool for TypeScript projects

Downloads

76

Readme

tscomp

Create TypeScript projects with no build configuration. This tool is based upon Create React App

Getting Started

Installation

Install it globally:

yarn global add tscomp
npm install -g tscomp

Creating a project

First you must choose what kind of project you want to create, tscomp supports

  • browser: An app that should be run in a browser. tscomp will set up a development server, a production build process and unit tests.

  • server: An app that should be run in a Node server. tscomp will set up a development server, a watch build process, a production build process and unit tests.

  • lib: A library that can be consumed in other TypeScript or JavaScript projects. tscomp will set up a watch build process for development, a production build process and unit tests.

Now run

tscomp new <project-type> my-app
cd my-app

for example tscomp new browser my-app.

It will create a directory called my-app inside the dcurrent folder. Inside that directory, it will generate the initial project structure and install the neccecary dependecies.

The only configuration file that will be present in your project is the tsconfig.json file that configures TypeScript. This file is neccecary for your editor to correctly provide TypeScript servicecs such as type checking and code completions. After project creation you may modify it as you please.

Browser project

yarn start or npm start

Runs the app in development mode. Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits. You will see build errors in the console and the browser.

Big project?

Async typechecks can be enabled for changes to appear quicker. The downside is that errors will no longer be displayed in the browser.

Add asyncTypechecks: true to the tscomp object in your package.json or set the environment variable ASYNC_TYPECHECK to true.

yarn test or npm test

Runs the test watcher in interactive mode. By default, runs test related to files changed since the last commit.

Read more about testing in the Create React App README tscomp does of course support test files with .ts and .tsx file endings as well.

yarn build or npm run build

Builds the app for production to the build folder, or if you have changed your tsconfig.json, to the outDir specified in it. It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes. Your app is ready to be deployed!

Server project

yarn start or npm start

Runs the app in development mode.

The server will restart if you make edits. You will see build errors in the console.

yarn test or npm test

Runs the test watcher in interactive mode. By default, runs test related to files changed since the last commit.

Read more about testing in the Create React App README tscomp does of course support test files with .ts and .tsx file endings as well.

yarn watch or npm run watch

Builds the app to the build folder, or if you have changed your tsconfig.json, to the outDir specified in it. The files will be rebuilt if you make edits.

yarn build or npm run build

Builds the app for production to the build folder, or if you have changed your tsconfig.json, to the outDir specified in it.

Your app is ready to be deployed!

Library project

yarn test or npm test

Runs the test watcher in interactive mode. By default, runs test related to files changed since the last commit.

Read more about testing in the Create React App README tscomp does of course support test files with .ts and .tsx file endings as well.

yarn watch or npm run watch

Builds the library to the lib folder, or if you have changed your tsconfig.json, to the outDir specified in it. The files will be rebuilt if you make edits.

yarn build or npm run build

Builds the library for production to the lib folder, or if you have changed your tsconfig.json, to the outDir specified in it.

Your library is ready to be published!

Converting to a Custom Setup

If you’re a power user and you aren’t happy with the default configuration, you can “eject” from the tool and use it as a boilerplate generator.

Running npm run eject copies all the configuration files and the transitive dependencies (Webpack, Babel, TypeScript, etc) right into your project so you have full control over them. Commands like npm start and npm run build will still work, but they will point to the copied scripts so you can tweak them. At this point, you’re on your own.

Note: this is a one-way operation. Once you eject, you can’t go back!

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

License

tscomp is licensed under MIT terms.