TypeScript related dependencies and libraries to setup/scaffold typical build/lint/format/test pipeline and CI/CD pipeline using babel, jest, prettier, tslint and semantic-release. Meant to be added as dev dependency.
Last updated 13 days ago by zaripych-bot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ts-deps 
SYNC missed versions from official npm registry.


Travis Build Status

dev dependency for your simple TypeScript projects


npm add ts-deps --save-dev
npx ts-deps init

The init command will scaffold config files for your project. The typical output would be:


Following packages already included for you:

The init command can be run on an existing project, it will change your package.json and remove superfluous dev dependencies.

Building your code

All the source code should be located in src directory. Extensions for the code should be .ts or .js. You can add // @ts-check in the beginning of .js files to make TypeScript check those files as well.

For a Web app, please consider using create-react-app, however, .tsx and .jsx extensions are still allowed, but not well-tested.

npm build

The code will be transformed by Babel and put into lib folder. In addition to that .json and .d.ts files are copied over as well.


If declarations are required, we can generate them by running:

npm run declarations

This will use tsconfig.declarations.json config to write declarations to the same lib folder as transformed .js or .ts files.

Checking your code

To run all builds and compilation checks we can use the check command which is automatically executed by husky on push.

npm run check

The build and other commands listed below are included into check.

So, to check your code for Type Script errors we can run:

npm run type-check


npm run lint


Current configuration supports aliases. Sometimes we need to be able to alias a path to a module in order to require it by that alias name like so:

import { db } from '@shared'

The above becomes possible with aliases. The setup of aliases is tedious and requires multiple configuration changes that span across Babel, TypeScript and Jest.

With ts-deps it should be as simple as creating a ts-deps.config.js file at the root of your project and executing ts-deps patch to patch tsconfig.json:

module.exports = {
  aliases: {
    '@core-lib': './src/shared/core-lib',
    '@feature-1': './src/shared/features/feature-1',

In the above example, in order to reference files within core-lib directory we can just use:

import Module from '@core-lib'

That saves us from having to backward slash to that directory if we have a module in feature-1 directory that requires it.


The library supports two categories of tests: unit-tests and integration-tests.

Unit tests should be located within __tests__ directory anywhere under src directory. Deep nesting is supported. Every test should have .test. suffix. This is to ensure that the tests can also have test-only related helper files that can be required by the test but not included into result of build.

Integration tests should be located within ./src/__integration-tests__ at the root. Similarly, every test should have .test. suffix.

Integration and unit tests can be ran separately. If integration tests generate any coverage information we can combine it with unit tests using combine-coverage script.

npm run test --coverage
npm run integration --coverage
npm run combine-coverage


To use semantic-release for release process we could run:

npm run release

To setup follow the link at the top and follow the steps in documentation. With current config we only need to declare environment variables to make semantic-release push changes to GitHub Releases, git repo and npm.

export GH_TOKEN=
export NPM_TOKEN=

Happy coding!

Current Tags

  • 0.4.1-alpha.1                                ...           alpha (a month ago)
  • 0.3.0-master.2                                ...           dev (6 months ago)
  • 0.5.0                                ...           latest (13 days ago)

25 Versions

  • 0.5.0                                ...           13 days ago
  • 0.4.4                                ...           25 days ago
  • 0.4.3                                ...           a month ago
  • 0.4.2                                ...           a month ago
  • 0.4.1                                ...           a month ago
  • 0.4.1-alpha.1                                ...           a month ago
  • 0.4.0                                ...           2 months ago
  • 0.3.7                                ...           4 months ago
  • 0.3.6                                ...           5 months ago
  • 0.3.5                                ...           5 months ago
  • 0.3.4                                ...           5 months ago
  • 0.3.3                                ...           5 months ago
  • 0.3.2                                ...           6 months ago
  • 0.3.1                                ...           6 months ago
  • 0.3.0                                ...           6 months ago
  • 0.3.0-master.2                                ...           6 months ago
  • 0.3.0-master.1                                ...           6 months ago
  • 0.2.5                                ...           6 months ago
  • 0.2.4                                ...           6 months ago
  • 0.2.3                                ...           7 months ago
  • 0.2.2                                ...           7 months ago
  • 0.2.1                                ...           7 months ago
  • 0.2.0                                ...           7 months ago
  • 0.1.0                                ...           7 months ago
  • 0.0.1                                ...           7 months ago
Today 0
This Week 0
This Month 42
Last Day 0
Last Week 25
Last Month 89
Dev Dependencies (4)
Dependents (0)

Copyright 2014 - 2017 © taobao.org |