Skip to content
Rubén Díaz edited this page Jun 14, 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. Parameter

  6. PropertyDeclaration

  7. Decorator

  8. ObjectLiteralExpression

  9. ArrayLiteralExpression

  10. PropertyAssignment

  11. CallExpression

  12. VariableAssignment

  13. Body (only merges variable declarations with same identifier)

  14. FunctionDeclaration

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