Skip to content

Commit b10d932

Browse files
committed
Absolute-ify paths in both places
1 parent 6702e65 commit b10d932

7 files changed

+34
-55
lines changed

src/compiler/program.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ namespace ts {
192192
traceEnabled
193193
};
194194

195-
const typeRoots = options.typeRoots || defaultTypeRoots;
195+
const typeRoots = options.typeRoots ||
196+
defaultTypeRoots.map(d => combinePaths(options.configFilePath ? getDirectoryPath(options.configFilePath) : host.getCurrentDirectory(), d));
196197
if (traceEnabled) {
197198
if (containingFile === undefined) {
198199
if (typeRoots === undefined) {

tests/baselines/reference/library-reference-11.trace.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
2-
"======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.ts', root directory 'node_modules/@types'. ========",
3-
"Resolving with primary search path 'node_modules/@types'",
4-
"File 'node_modules/@types/jquery/package.json' does not exist.",
5-
"File 'node_modules/@types/jquery/index.d.ts' does not exist.",
2+
"======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.ts', root directory '/node_modules/@types'. ========",
3+
"Resolving with primary search path '/node_modules/@types'",
4+
"File '/node_modules/@types/jquery/package.json' does not exist.",
5+
"File '/node_modules/@types/jquery/index.d.ts' does not exist.",
66
"Looking up in 'node_modules' folder, initial location '/a/b'",
77
"File '/a/b/node_modules/jquery.ts' does not exist.",
88
"File '/a/b/node_modules/jquery.d.ts' does not exist.",

tests/baselines/reference/library-reference-12.trace.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
2-
"======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.ts', root directory 'node_modules/@types'. ========",
3-
"Resolving with primary search path 'node_modules/@types'",
4-
"File 'node_modules/@types/jquery/package.json' does not exist.",
5-
"File 'node_modules/@types/jquery/index.d.ts' does not exist.",
2+
"======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.ts', root directory '/node_modules/@types'. ========",
3+
"Resolving with primary search path '/node_modules/@types'",
4+
"File '/node_modules/@types/jquery/package.json' does not exist.",
5+
"File '/node_modules/@types/jquery/index.d.ts' does not exist.",
66
"Looking up in 'node_modules' folder, initial location '/a/b'",
77
"File '/a/b/node_modules/jquery.ts' does not exist.",
88
"File '/a/b/node_modules/jquery.d.ts' does not exist.",

tests/baselines/reference/library-reference-3.trace.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
2-
"======== Resolving type reference directive 'jquery', containing file '/src/consumer.ts', root directory 'node_modules/@types'. ========",
3-
"Resolving with primary search path 'node_modules/@types'",
4-
"File 'node_modules/@types/jquery/package.json' does not exist.",
5-
"File 'node_modules/@types/jquery/index.d.ts' does not exist.",
2+
"======== Resolving type reference directive 'jquery', containing file '/src/consumer.ts', root directory '/src/node_modules/@types'. ========",
3+
"Resolving with primary search path '/src/node_modules/@types'",
4+
"File '/src/node_modules/@types/jquery/package.json' does not exist.",
5+
"File '/src/node_modules/@types/jquery/index.d.ts' does not exist.",
66
"Looking up in 'node_modules' folder, initial location '/src'",
77
"File '/src/node_modules/jquery.ts' does not exist.",
88
"File '/src/node_modules/jquery.d.ts' does not exist.",
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[
2-
"======== Resolving type reference directive 'alpha', containing file '/src/foo.ts', root directory 'node_modules/@types'. ========",
3-
"Resolving with primary search path 'node_modules/@types'",
4-
"File 'node_modules/@types/alpha/package.json' does not exist.",
5-
"File 'node_modules/@types/alpha/index.d.ts' exist - use it as a name resolution result.",
6-
"======== Type reference directive 'alpha' was successfully resolved to 'node_modules/@types/alpha/index.d.ts', primary: true. ========",
7-
"======== Resolving type reference directive 'alpha', containing file '/src/__inferred type names__.ts', root directory 'node_modules/@types'. ========",
8-
"Resolving with primary search path 'node_modules/@types'",
9-
"File 'node_modules/@types/alpha/package.json' does not exist.",
10-
"File 'node_modules/@types/alpha/index.d.ts' exist - use it as a name resolution result.",
11-
"======== Type reference directive 'alpha' was successfully resolved to 'node_modules/@types/alpha/index.d.ts', primary: true. ========"
2+
"======== Resolving type reference directive 'alpha', containing file '/src/foo.ts', root directory '/node_modules/@types'. ========",
3+
"Resolving with primary search path '/node_modules/@types'",
4+
"File '/node_modules/@types/alpha/package.json' does not exist.",
5+
"File '/node_modules/@types/alpha/index.d.ts' exist - use it as a name resolution result.",
6+
"======== Type reference directive 'alpha' was successfully resolved to '/node_modules/@types/alpha/index.d.ts', primary: true. ========",
7+
"======== Resolving type reference directive 'alpha', containing file '/src/__inferred type names__.ts', root directory '/node_modules/@types'. ========",
8+
"Resolving with primary search path '/node_modules/@types'",
9+
"File '/node_modules/@types/alpha/package.json' does not exist.",
10+
"File '/node_modules/@types/alpha/index.d.ts' exist - use it as a name resolution result.",
11+
"======== Type reference directive 'alpha' was successfully resolved to '/node_modules/@types/alpha/index.d.ts', primary: true. ========"
1212
]

tests/baselines/reference/library-reference-7.trace.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
2-
"======== Resolving type reference directive 'jquery', containing file '/src/consumer.ts', root directory 'node_modules/@types'. ========",
3-
"Resolving with primary search path 'node_modules/@types'",
4-
"File 'node_modules/@types/jquery/package.json' does not exist.",
5-
"File 'node_modules/@types/jquery/index.d.ts' does not exist.",
2+
"======== Resolving type reference directive 'jquery', containing file '/src/consumer.ts', root directory '/node_modules/@types'. ========",
3+
"Resolving with primary search path '/node_modules/@types'",
4+
"File '/node_modules/@types/jquery/package.json' does not exist.",
5+
"File '/node_modules/@types/jquery/index.d.ts' does not exist.",
66
"Looking up in 'node_modules' folder, initial location '/src'",
77
"File '/src/node_modules/jquery.ts' does not exist.",
88
"File '/src/node_modules/jquery.d.ts' does not exist.",
Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,12 @@
11
[
2-
"======== Resolving type reference directive 'jquery', containing file '/a.ts', root directory 'node_modules/@types'. ========",
3-
"Resolving with primary search path 'node_modules/@types'",
4-
"File 'node_modules/@types/jquery/package.json' does not exist.",
5-
"File 'node_modules/@types/jquery/index.d.ts' does not exist.",
6-
"Looking up in 'node_modules' folder, initial location '/'",
7-
"File '/node_modules/jquery.ts' does not exist.",
8-
"File '/node_modules/jquery.d.ts' does not exist.",
9-
"File '/node_modules/jquery/package.json' does not exist.",
10-
"File '/node_modules/jquery/index.ts' does not exist.",
11-
"File '/node_modules/jquery/index.d.ts' does not exist.",
12-
"File '/node_modules/@types/jquery.ts' does not exist.",
13-
"File '/node_modules/@types/jquery.d.ts' does not exist.",
2+
"======== Resolving type reference directive 'jquery', containing file '/a.ts', root directory '/node_modules/@types'. ========",
3+
"Resolving with primary search path '/node_modules/@types'",
144
"File '/node_modules/@types/jquery/package.json' does not exist.",
15-
"File '/node_modules/@types/jquery/index.ts' does not exist.",
165
"File '/node_modules/@types/jquery/index.d.ts' exist - use it as a name resolution result.",
17-
"======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: false. ========",
18-
"======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory 'node_modules/@types'. ========",
19-
"Resolving with primary search path 'node_modules/@types'",
20-
"File 'node_modules/@types/jquery/package.json' does not exist.",
21-
"File 'node_modules/@types/jquery/index.d.ts' does not exist.",
22-
"Looking up in 'node_modules' folder, initial location '/'",
23-
"File '/node_modules/jquery.ts' does not exist.",
24-
"File '/node_modules/jquery.d.ts' does not exist.",
25-
"File '/node_modules/jquery/package.json' does not exist.",
26-
"File '/node_modules/jquery/index.ts' does not exist.",
27-
"File '/node_modules/jquery/index.d.ts' does not exist.",
28-
"File '/node_modules/@types/jquery.ts' does not exist.",
29-
"File '/node_modules/@types/jquery.d.ts' does not exist.",
6+
"======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ========",
7+
"======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ========",
8+
"Resolving with primary search path '/node_modules/@types'",
309
"File '/node_modules/@types/jquery/package.json' does not exist.",
31-
"File '/node_modules/@types/jquery/index.ts' does not exist.",
3210
"File '/node_modules/@types/jquery/index.d.ts' exist - use it as a name resolution result.",
33-
"======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: false. ========"
11+
"======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ========"
3412
]

0 commit comments

Comments
 (0)