@travetto/transformer 2.0.3 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/util/declaration.ts +3 -3
- package/src/visitor.ts +2 -2
- package/test-support/util.ts +4 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/transformer",
|
|
3
3
|
"displayName": "Transformation",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.1",
|
|
5
5
|
"description": "Functionality for AST transformations, with transformer registration, and general utils",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"typescript",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"directory": "module/transformer"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@travetto/base": "^2.
|
|
28
|
+
"@travetto/base": "^2.1.1"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
package/src/util/declaration.ts
CHANGED
|
@@ -63,9 +63,9 @@ export class DeclarationUtil {
|
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* Get accessor pair based off of passing in one in
|
|
66
|
-
*
|
|
67
|
-
* @param node
|
|
68
|
-
* @returns
|
|
66
|
+
*
|
|
67
|
+
* @param node
|
|
68
|
+
* @returns
|
|
69
69
|
*/
|
|
70
70
|
static getAccessorPair(node: ts.GetAccessorDeclaration | ts.SetAccessorDeclaration) {
|
|
71
71
|
const acc = { getter: ts.isGetAccessorDeclaration(node) ? node : undefined, setter: ts.isSetAccessorDeclaration(node) ? node : undefined };
|
package/src/visitor.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ts from 'typescript';
|
|
2
|
-
import
|
|
2
|
+
import { createWriteStream } from 'fs';
|
|
3
3
|
|
|
4
4
|
import { ConsoleManager } from '@travetto/base/src/console';
|
|
5
5
|
import { AppCache } from '@travetto/boot';
|
|
@@ -85,7 +85,7 @@ export class VisitorFactory<S extends State = State> {
|
|
|
85
85
|
return (context: ts.TransformationContext) => (file: ts.SourceFile): ts.SourceFile => {
|
|
86
86
|
try {
|
|
87
87
|
const c = new console.Console({
|
|
88
|
-
stdout:
|
|
88
|
+
stdout: createWriteStream(AppCache.toEntryName(this.#logTarget), { flags: 'a' }),
|
|
89
89
|
inspectOptions: { depth: 4 },
|
|
90
90
|
});
|
|
91
91
|
|
package/test-support/util.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ts from 'typescript';
|
|
2
|
-
import
|
|
2
|
+
import { readFileSync } from 'fs';
|
|
3
3
|
|
|
4
4
|
import { FsUtil, ScanFs } from '@travetto/boot';
|
|
5
5
|
import { Util } from '@travetto/base';
|
|
@@ -7,9 +7,9 @@ import { Util } from '@travetto/base';
|
|
|
7
7
|
import { VisitorFactory, TransformerState, getAllTransformers } from '..';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Utils for testing
|
|
10
|
+
* Utils for testing transformers
|
|
11
11
|
*/
|
|
12
|
-
export class
|
|
12
|
+
export class TransformerTestUtil {
|
|
13
13
|
/**
|
|
14
14
|
* Compile a single file from a folder
|
|
15
15
|
*/
|
|
@@ -47,7 +47,7 @@ export class TranformerTestUtil {
|
|
|
47
47
|
|
|
48
48
|
await Util.wait('1s'); // Wait for file buffer to sync
|
|
49
49
|
try {
|
|
50
|
-
console.info(
|
|
50
|
+
console.info(readFileSync(log, 'utf8'));
|
|
51
51
|
} catch { }
|
|
52
52
|
|
|
53
53
|
await FsUtil.unlinkRecursive(log);
|