Skip to content
Rubén Díaz edited this page Jun 13, 2017 · 16 revisions

TypeScript Merger

TS-Merger is a tool designed to parse and merge a base and a patch file into one single file depending on the merge strategy defined.

Currently, the merger supports the following nodes:

  1. ImportDeclaration

  2. ClassDeclaration

  3. Constructor

  4. MethodDeclaration

  5. PropertyDeclaration

  6. Decorator

  7. ObjectLiteralExpression

  8. ArrayLiteralExpression

  9. PropertyAssignment

  10. CallExpression

  11. VariableAssignment

  12. Body (partially)

Requirements

  1. Node 6.9.2 or higher

  2. Webpack

    npm install -g webpack

Optional requirements

  1. ts-node

    npm install -g ts-node
  2. yarn

    npm install -g yarn

Usage

The TS Merger can be launched in two ways depending the file you want to launch:

  1. Launching the TS code directly

    ts-node src\index.ts <<MERGE_STRATEGY>> <<BASE_FILE_PATH>> <<PATCH_FILE_PATH>>
  2. From compiled JS file resultant from webpack:

    node dist\tsmerger.js <<MERGE_STRATEGY>> <<BASE_FILE_PATH>> <<PATCH_FILE_PATH>>

Being MERGE_STRATEGY true or false to override or not

Overview

Development

Clone this wiki locally