@@ -260,25 +260,28 @@ export class ProjectPrincipal {
260
260
261
261
const { imports, ...rest } = _getImportsAndExports ( sourceFile , resolve , typeChecker , { ...options , skipExports } ) ;
262
262
263
- const { internal, resolved, specifiers, unresolved, external } = imports ;
263
+ const { internal, resolved : _resolved , specifiers : _specifiers , unresolved : _unresolved , external } = imports ;
264
264
265
- const unresolvedImports = new Set < UnresolvedImport > ( ) ;
265
+ // Post-processing (1)
266
+ const specifiers = new Set < string > ( ) ;
267
+ const resolved = new Set < string > ( ) ;
268
+ const unresolved = new Set < UnresolvedImport > ( ) ;
266
269
267
- for ( const [ specifier , specifierFilePath ] of specifiers ) {
270
+ for ( const [ specifier , specifierFilePath ] of _specifiers ) {
268
271
const packageName = getPackageNameFromModuleSpecifier ( specifier ) ;
269
272
if ( packageName && isInternalWorkspace ( packageName ) ) {
270
273
external . add ( packageName ) ;
271
274
const principal = getPrincipalByFilePath ( specifierFilePath ) ;
272
- if ( principal && ! isGitIgnored ( specifierFilePath ) ) principal . addNonEntryPath ( specifierFilePath ) ;
275
+ if ( principal && ! isGitIgnored ( specifierFilePath ) ) specifiers . add ( specifierFilePath ) ;
273
276
}
274
277
}
275
278
276
- for ( const filePath of resolved ) {
279
+ for ( const filePath of _resolved ) {
277
280
const isIgnored = isGitIgnored ( filePath ) ;
278
- if ( ! isIgnored ) this . addEntryPath ( filePath , { skipExportsAnalysis : true } ) ;
281
+ if ( ! isIgnored ) resolved . add ( filePath ) ;
279
282
}
280
283
281
- for ( const unresolvedImport of unresolved ) {
284
+ for ( const unresolvedImport of _unresolved ) {
282
285
const { specifier } = unresolvedImport ;
283
286
284
287
// Ignore Deno style http import specifiers
@@ -295,14 +298,12 @@ export class ProjectPrincipal {
295
298
if ( ! isIgnored ) {
296
299
const ext = extname ( sanitizedSpecifier ) ;
297
300
const hasIgnoredExtension = FOREIGN_FILE_EXTENSIONS . has ( ext ) ;
298
- if ( ! ext || ( ext !== '.json' && ! hasIgnoredExtension ) ) {
299
- unresolvedImports . add ( unresolvedImport ) ;
300
- }
301
+ if ( ! ext || ( ext !== '.json' && ! hasIgnoredExtension ) ) unresolved . add ( unresolvedImport ) ;
301
302
}
302
303
}
303
304
}
304
305
305
- return { imports : { internal, unresolved : unresolvedImports , external } , ...rest } ;
306
+ return { imports : { internal, external , specifiers , resolved , unresolved } , ...rest } ;
306
307
}
307
308
308
309
invalidateFile ( filePath : string ) {
0 commit comments