@travetto/compiler 2.0.1 → 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 +4 -4
- package/src/host.ts +3 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/compiler",
|
|
3
3
|
"displayName": "Compiler",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.1",
|
|
5
5
|
"description": "Node-integration of Typescript Compiler with advanced functionality for detecting changes in classes and methods.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tsc",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"directory": "module/compiler"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@travetto/base": "^2.
|
|
33
|
-
"@travetto/transformer": "^2.
|
|
34
|
-
"@travetto/watch": "^2.
|
|
32
|
+
"@travetto/base": "^2.1.1",
|
|
33
|
+
"@travetto/transformer": "^2.1.1",
|
|
34
|
+
"@travetto/watch": "^2.1.1"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
package/src/host.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ts from 'typescript';
|
|
2
|
-
import
|
|
2
|
+
import { readFileSync } from 'fs';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
|
|
5
5
|
import { PathUtil, AppCache } from '@travetto/boot';
|
|
@@ -21,7 +21,7 @@ export class SourceHost implements ts.CompilerHost {
|
|
|
21
21
|
|
|
22
22
|
#trackFile(filename: string, content: string) {
|
|
23
23
|
this.contents.set(filename, content);
|
|
24
|
-
this.#hashes.set(filename, SystemUtil.naiveHash(
|
|
24
|
+
this.#hashes.set(filename, SystemUtil.naiveHash(readFileSync(filename, 'utf8'))); // Get og content for hashing
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
getCanonicalFileName = (f: string) => f;
|
|
@@ -103,7 +103,7 @@ export class SourceHost implements ts.CompilerHost {
|
|
|
103
103
|
* See if a file's hash code has changed
|
|
104
104
|
*/
|
|
105
105
|
hashChanged(filename: string, content?: string) {
|
|
106
|
-
content ??=
|
|
106
|
+
content ??= readFileSync(filename, 'utf8');
|
|
107
107
|
// Let's see if they are really different
|
|
108
108
|
const hash = SystemUtil.naiveHash(content);
|
|
109
109
|
if (hash === this.#hashes.get(filename)) {
|