-
Notifications
You must be signed in to change notification settings - Fork 14
Home
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 AST node types:
-
ImportDeclaration
-
ClassDeclaration
-
Constructor
-
MethodDeclaration
-
Parameter
-
PropertyDeclaration
-
Decorator
-
ObjectLiteralExpression
-
ArrayLiteralExpression
-
PropertyAssignment
-
CallExpression
-
VariableAssignment
-
Body (only merges variable declarations with same identifier)
-
FunctionDeclaration
The TS Merger can be launched in two ways depending the file you want to launch:
-
Launching the TS code directly
ts-node src\index.ts -f -b <<BASE_FILE_PATH>> -p <<PATCH_FILE_PATH>> -o <<OUTPUT_FILE_PATH>> -e <<ENCODING>>
ts-node src\index.ts -b <<BASE_FILE_PATH>> -p <<PATCH_FILE_PATH>> -e <<ENCODING>>
ts-node src\index.ts -f -b <<BASE_FILE_PATH>> -p <<PATCH_FILE_PATH>>
-
From compiled JS file resultant from webpack:
node dist\tsmerger.js -f -b <<BASE_FILE_PATH>> -p <<PATCH_FILE_PATH>> -o <<OUTPUT_FILE_PATH>> -e <<ENCODING>>
node dist\tsmerger.js -b <<BASE_FILE_PATH>> -p <<PATCH_FILE_PATH>> -e <<ENCODING>>
node dist\tsmerger.js -f -b <<BASE_FILE_PATH>> -p <<PATCH_FILE_PATH>>
-
To set patchOverride to true just use the
-f
flag -
If not
-o
or-e
flags are used, no output file will be generated and UTF-8 encoding will be used.