Skip to content

Checking that you can compile one or multiple of your typescript projects

License

Notifications You must be signed in to change notification settings

matis-dk/ts-compile-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typescript compile checker

NPM! PRs welcome! Downloads License

Description

Managing a microservice architecture with multiple shared Typescript types quickly become cumbersome, if the compiler isn't watching the involed sub-projects.

This package solves those issues by:

  1. Recursively searching for tsconfig.json files in a specified directory
  2. Installing package.json dependencies
  3. Running the tsc compiler located in node_modules/.bin/tsc for each sub-project.

Usage

CLI

Npx

npx ts-compile-checker

Docker

docker run --rm -it -v $(pwd):/src:rw mkenney/npm:latest npx ts-compile-checker

Package.json script

{
  "dependencies": {
    "ts-compile-check": "^1.0.3",
  },
  "scripts": {
    "ts-compile-check": "node ts-compile-checker",
  }
}

Install and run

yarn add ts-compile-checker && yarn ts-compile-checker

Github Action

on: push
name: TS compilation check
jobs:
  checker:
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
      - run: npx ts-compile-checker
        working-directory: ./

Demo

Usage

drawing

Github Action

drawing

Options

Flag Type Description
--help, -h Boolean Display this usage guide.
--skip, -s Boolean Skipping the installation process.
--include, -i Array Pass your own set of project paths. This will skip the search process.
--exclude, -e Array Excluding a set of project paths.
--options, -o Array Override the default options ["--noEmit", "--pretty"] passed to the tsc compiler for each sub-project
--cwd, -c String Current working directory that the search process should be based on. Default directory is ..

License

This project is licensed under the terms of the MIT license. See the LICENSE file.

About

Checking that you can compile one or multiple of your typescript projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published