Skip to content

Commit c928e9e

Browse files
author
Ruben Diaz
committed
ReadME updated
1 parent 6165c96 commit c928e9e

File tree

2 files changed

+45
-6
lines changed

2 files changed

+45
-6
lines changed

README.md

+44-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# TS-Merger
2-
TypeScript Merger for Angular-Cli
2+
Generic TypeScript Merger
33

44
[![build status](https://travis-ci.org/oasp/ts-merger.svg?branch=master)](https://travis-ci.org/oasp/ts-merger)
55

@@ -30,6 +30,37 @@ let mergedCode: string = tsm.merge(patchOverrides, 'path/to/base/file', 'path/to
3030

3131
This will not write an resultant file and will use UITF-8 as encoding.
3232

33+
## Features
34+
35+
The merger allows merging of this node kinds:
36+
37+
- ImportDeclaration
38+
- ClassDeclaration
39+
- Decorator
40+
- FunctionDeclaration
41+
- MethodDeclaration
42+
- Parameter
43+
- BodyMethod
44+
- PropertyAssignment
45+
- PropertyDeclaration
46+
- Constructor
47+
- ArrayLiteralExpression
48+
- ObjectLiteralExpression
49+
- CallExpression
50+
51+
This version allows merging of TypeScript files that follow this structure:
52+
53+
- Array of imports
54+
- Array of functions
55+
- Array of variables
56+
- A class with same name at base and patch
57+
58+
ImportDeclaration's must follow the format:
59+
60+
```javascript
61+
import { a } from 'b';
62+
```
63+
3364
##Examples
3465

3566
**Base file**
@@ -65,8 +96,8 @@ class Example1 {
6596
**Resultant merged code WITH FALSE PATCHOVERRIDES**
6697

6798
```javascript
68-
import a from 'b';
69-
import c from 'd';
99+
import { a } from 'b';
100+
import { c } from 'd';
70101
import { f, h } from 'g';
71102

72103
class Example1 {
@@ -84,8 +115,8 @@ class Example1 {
84115
**Resultant merged code WITH TRUE PATCHOVERRIDES**
85116

86117
```javascript
87-
import a from 'b';
88-
import c from 'd';
118+
import { a } from 'b';
119+
import { c } from 'd';
89120
import { f, h } from 'g';
90121

91122
class Example1 {
@@ -99,3 +130,11 @@ class Example1 {
99130
anotherMethod(){}
100131
}
101132
```
133+
134+
## Future version
135+
136+
Next releases will include merge support for:
137+
138+
- InteraceDeclaration
139+
- TypeScript files with more than one class
140+
- Support for simple ImportClauses (import a from 'b';)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@oasp/ts-merger",
3-
"version": "1.0.7",
3+
"version": "1.0.9",
44
"description": "2-way TypeScript Merger",
55
"author": {
66
"name": "Capgemini",

0 commit comments

Comments
 (0)