1
+ import {
2
+ dedent ,
3
+ } from "../../_namespaces/Utils" ;
4
+ import {
5
+ jsonToReadableText ,
6
+ } from "../helpers" ;
7
+ import {
8
+ libContent ,
9
+ } from "../helpers/contents" ;
1
10
import {
2
11
getFsConentsForNode10ResultAtTypesPackageJson ,
3
12
getFsContentsForNode10Result ,
@@ -7,9 +16,15 @@ import {
7
16
import {
8
17
verifyTsc ,
9
18
} from "../helpers/tsc" ;
19
+ import {
20
+ verifyTscWatch ,
21
+ } from "../helpers/tscWatch" ;
10
22
import {
11
23
loadProjectFromFiles ,
12
24
} from "../helpers/vfs" ;
25
+ import {
26
+ createWatchedSystem ,
27
+ } from "../helpers/virtualFileSystemWithWatch" ;
13
28
14
29
describe ( "unittests:: tsc:: moduleResolution::" , ( ) => {
15
30
verifyTsc ( {
@@ -69,4 +84,147 @@ describe("unittests:: tsc:: moduleResolution::", () => {
69
84
} ,
70
85
] ,
71
86
} ) ;
87
+
88
+ verifyTscWatch ( {
89
+ scenario : "moduleResolution" ,
90
+ subScenario : "pnpm style layout" ,
91
+ sys : ( ) =>
92
+ createWatchedSystem ( {
93
+
94
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] /node_modules/@component-type-checker/button/src/index.ts" :
dedent `
95
+ export interface Button {
96
+ a: number;
97
+ b: number;
98
+ }
99
+ export function createButton(): Button {
100
+ return {
101
+ a: 0,
102
+ b: 1,
103
+ };
104
+ }
105
+ ` ,
106
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] /node_modules/@component-type-checker/button/package.json" :
jsonToReadableText ( {
107
+ name : "@component-type-checker/button" ,
108
+ version : "0.0.1" ,
109
+ main : "./src/index.ts" ,
110
+ } ) ,
111
+
112
+
113
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] /node_modules/@component-type-checker/button/src/index.ts" :
dedent `
114
+ export interface Button {
115
+ a: number;
116
+ c: number;
117
+ }
118
+ export function createButton(): Button {
119
+ return {
120
+ a: 0,
121
+ c: 2,
122
+ };
123
+ }
124
+ ` ,
125
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] /node_modules/@component-type-checker/button/package.json" :
jsonToReadableText ( {
126
+ name : "@component-type-checker/button" ,
127
+ version : "0.0.2" ,
128
+ main : "./src/index.ts" ,
129
+ } ) ,
130
+
131
+
132
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] _@[email protected] /node_modules/@component-type-checker/button" :
{
133
+ symLink :
"/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] /node_modules/@component-type-checker/button" ,
134
+ } ,
135
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] _@[email protected] /node_modules/@component-type-checker/components/src/index.ts" :
dedent `
136
+ export { createButton, Button } from "@component-type-checker/button";
137
+ ` ,
138
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] _@[email protected] /node_modules/@component-type-checker/components/package.json" :
jsonToReadableText ( {
139
+ name : "@component-type-checker/components" ,
140
+ version : "0.0.1" ,
141
+ main : "./src/index.ts" ,
142
+ peerDependencies : {
143
+ "@component-type-checker/button" : "*" ,
144
+ } ,
145
+ devDependencies : {
146
+ "@component-type-checker/button" : "0.0.2" ,
147
+ } ,
148
+ } ) ,
149
+
150
+
151
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] _@[email protected] /node_modules/@component-type-checker/button" :
{
152
+ symLink :
"/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] /node_modules/@component-type-checker/button" ,
153
+ } ,
154
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] _@[email protected] /node_modules/@component-type-checker/components/src/index.ts" :
dedent `
155
+ export { createButton, Button } from "@component-type-checker/button";
156
+ ` ,
157
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] _@[email protected] /node_modules/@component-type-checker/components/package.json" :
jsonToReadableText ( {
158
+ name : "@component-type-checker/components" ,
159
+ version : "0.0.1" ,
160
+ main : "./src/index.ts" ,
161
+ peerDependencies : {
162
+ "@component-type-checker/button" : "*" ,
163
+ } ,
164
+ devDependencies : {
165
+ "@component-type-checker/button" : "0.0.2" ,
166
+ } ,
167
+ } ) ,
168
+
169
+
170
+ "/home/src/projects/component-type-checker/packages/sdk/src/index.ts" : dedent `
171
+ export { Button, createButton } from "@component-type-checker/components";
172
+ export const VERSION = "0.0.2";
173
+ ` ,
174
+ "/home/src/projects/component-type-checker/packages/sdk/package.json" : jsonToReadableText ( {
175
+ name : "@component-type-checker/sdk1" ,
176
+ version : "0.0.2" ,
177
+ main : "./src/index.ts" ,
178
+ dependencies : {
179
+ "@component-type-checker/components" : "0.0.1" ,
180
+ "@component-type-checker/button" : "0.0.1" ,
181
+ } ,
182
+ } ) ,
183
+ "/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/button" : {
184
+ symLink :
"/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] /node_modules/@component-type-checker/button" ,
185
+ } ,
186
+ "/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/components" : {
187
+ symLink :
"/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] _@[email protected] /node_modules/@component-type-checker/components" ,
188
+ } ,
189
+
190
+
191
+ "/home/src/projects/component-type-checker/packages/app/src/app.tsx" : dedent `
192
+ import { VERSION } from "@component-type-checker/sdk";
193
+ import { Button } from "@component-type-checker/components";
194
+ import { createButton } from "@component-type-checker/button";
195
+ const button: Button = createButton();
196
+ ` ,
197
+ "/home/src/projects/component-type-checker/packages/app/package.json" : jsonToReadableText ( {
198
+ name : "app" ,
199
+ version : "1.0.0" ,
200
+ dependencies : {
201
+ "@component-type-checker/button" : "0.0.2" ,
202
+ "@component-type-checker/components" : "0.0.1" ,
203
+ "@component-type-checker/sdk" : "0.0.2" ,
204
+ } ,
205
+ } ) ,
206
+ "/home/src/projects/component-type-checker/packages/app/tsconfig.json" : jsonToReadableText ( {
207
+ compilerOptions : {
208
+ target : "es5" ,
209
+ module : "esnext" ,
210
+ lib : [ "ES5" ] ,
211
+ moduleResolution : "node" ,
212
+ baseUrl : "." ,
213
+ outDir : "dist" ,
214
+ } ,
215
+ include : [ "src" ] ,
216
+ } ) ,
217
+ "/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/button" : {
218
+ symLink :
"/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] /node_modules/@component-type-checker/button" ,
219
+ } ,
220
+ "/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/components" : {
221
+ symLink :
"/home/src/projects/component-type-checker/node_modules/.pnpm/@[email protected] _@[email protected] /node_modules/@component-type-checker/components" ,
222
+ } ,
223
+ "/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/sdk" : {
224
+ symLink : "/home/src/projects/component-type-checker/packages/sdk" ,
225
+ } ,
226
+ "/a/lib/lib.es5.d.ts" : libContent ,
227
+ } , { currentDirectory : "/home/src/projects/component-type-checker/packages/app" } ) ,
228
+ commandLineArgs : [ "--traceResolution" , "--explainFiles" ] ,
229
+ } ) ;
72
230
} ) ;
0 commit comments