Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@fmtk/ts-build

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fmtk/ts-build

Builds typescript packages

latest
npmnpm
Version
0.5.0
Version published
Maintainers
2
Created
Source

ts-build

Build several typescript projects in a monorepo together using Typescript's build mode and project references.

USAGE
  ts-build [ts-build-options] <folders...> [tsc-options...]

ARGUMENTS
  ts-build-options
    -d, --define name=value   Define a constant that will be inserted into the
                              build when ts-build is run.

    -e, --env    name1,name2  Copy the given environment variables to the build
                              constants file.

  folders
    A list of folders containing typescript packages. Each folder must either
    contain a package.json, or contain folders which contain package.json files.

  tsc-options
    Options to pass to tsc.


BUILD CONSTANTS

Build constants can be defined using the `-d` or `--define` options. The
argument for the option should be `key=value` format. The program will output
a file called `constants.build.json` in the root of each package, which can
be added to the gitignore.

The tool will collect all packages reachable in the first or second level of each folder specified and generate tsconfig.json files with appropriate references sections.

Examples

Given the following structure:

    packages/
        componentA/
            package.json
            tsconfig.json
        componentB/
            package.json
            tsconfig.json
        componentC/
            package.json
            tsconfig.json

    apps/
        api/
            package.json
            tsconfig.json
        tool/
            package.json

A useful command line could be:

$ ts-build package/ apps/api -w

This will create tsconfig.build.ts files in componentA, componentB, componentC and apps/api using project references discovered from the respective package.json files, and also in the root with references to all reached packages. It will then run tsc -b tsconfig.build.json and passing any options supplied.

FAQs

Package last updated on 09 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts