# ts-compile-checker

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

Latest version **1.0.19** (published 2021-03-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install ts-compile-checker
pnpm add ts-compile-checker
yarn add ts-compile-checker
bun add ts-compile-checker
```

Provides the command `ts-compile-checker`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.19 |
| Published | 2021-03-05 |
| First published | 2021-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 24.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mathias Piletti |
| Maintainers | matis-dk |
| Keywords | typescript, tsc, cli, github, action, compile, microservices, ci |

## Links

- npm: https://www.npmjs.com/package/ts-compile-checker
- Homepage: https://github.com/matis-dk/ts-compile-checker
- npm.io page: https://npm.io/package/ts-compile-checker

## Dependencies (11)

- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [ts-node](https://npm.io/package/ts-node.md) ^8.10.2
- [fast-glob](https://npm.io/package/fast-glob.md) ^3.2.5
- [typescript](https://npm.io/package/typescript.md) ^3.9.7
- [@types/node](https://npm.io/package/@types/node.md) ^14.14.22
- [@actions/core](https://npm.io/package/@actions/core.md) ^1.2.6
- [command-line-args](https://npm.io/package/command-line-args.md) ^5.1.1
- [command-line-docs](https://npm.io/package/command-line-docs.md) ^0.0.6
- [command-line-usage](https://npm.io/package/command-line-usage.md) ^6.1.1
- [@types/command-line-args](https://npm.io/package/@types/command-line-args.md) ^5.0.0
- [@types/command-line-usage](https://npm.io/package/@types/command-line-usage.md) ^5.0.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.19 (latest) — 2021-03-05
- 1.0.18 — 2021-03-05
- 1.0.17 — 2021-01-28
- 1.0.16 — 2021-01-27
- 1.0.15 — 2021-01-27
- 1.0.14 — 2021-01-27
- 1.0.13 — 2021-01-27
- 1.0.12 — 2021-01-27
- 1.0.11 — 2021-01-27
- 1.0.10 — 2021-01-27
- 1.0.9 — 2021-01-27
- 1.0.8 — 2021-01-26
- 1.0.7 — 2021-01-26
- 1.0.6 — 2021-01-26
- 1.0.5 — 2021-01-25
- … 5 more at https://npm.io/package/ts-compile-checker/versions

## README

<h1 align="center">
 Typescript compile checker
</h1>

[![NPM!](https://img.shields.io/npm/v/ts-compile-checker)](https://www.npmjs.com/package/ts-compile-checker)
[![PRs welcome!](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/matis-dk/ts-compile-checker/pulls)
[![Downloads](https://img.shields.io/npm/dm/ts-compile-checker)](https://www.npmjs.com/package/ts-compile-checker)
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/matis-dk/ts-compile-checker/blob/master/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

<img src="./assets/usages.gif" alt="drawing" width="600" style="border-radius: 2px"/>

#### Github Action

<img src="./assets/github-action.png" alt="drawing" width="600" style="border-radius: 2px"/>

## 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](LICENSE) file.

---
_Source: https://npm.io/package/ts-compile-checker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
