diff --git a/internal/checker/checker_test.go b/internal/checker/checker_test.go index 2acdbb62da..c5029ecbc9 100644 --- a/internal/checker/checker_test.go +++ b/internal/checker/checker_test.go @@ -36,7 +36,7 @@ foo.bar;` fs = bundled.WrapFS(fs) cd := "/" - host := compiler.NewCompilerHost(cd, fs, bundled.LibPath(), nil) + host := compiler.NewCompilerHost(cd, fs, bundled.LibPath(), nil, nil) parsed, errors := tsoptions.GetParsedCommandLineOfConfigFile("/tsconfig.json", &core.CompilerOptions{}, host, nil) assert.Equal(t, len(errors), 0, "Expected no errors in parsed command line") @@ -70,7 +70,7 @@ func TestCheckSrcCompiler(t *testing.T) { rootPath := tspath.CombinePaths(tspath.NormalizeSlashes(repo.TypeScriptSubmodulePath), "src", "compiler") - host := compiler.NewCompilerHost(rootPath, fs, bundled.LibPath(), nil) + host := compiler.NewCompilerHost(rootPath, fs, bundled.LibPath(), nil, nil) parsed, errors := tsoptions.GetParsedCommandLineOfConfigFile(tspath.CombinePaths(rootPath, "tsconfig.json"), &core.CompilerOptions{}, host, nil) assert.Equal(t, len(errors), 0, "Expected no errors in parsed command line") p := compiler.NewProgram(compiler.ProgramOptions{ @@ -87,7 +87,7 @@ func BenchmarkNewChecker(b *testing.B) { rootPath := tspath.CombinePaths(tspath.NormalizeSlashes(repo.TypeScriptSubmodulePath), "src", "compiler") - host := compiler.NewCompilerHost(rootPath, fs, bundled.LibPath(), nil) + host := compiler.NewCompilerHost(rootPath, fs, bundled.LibPath(), nil, nil) parsed, errors := tsoptions.GetParsedCommandLineOfConfigFile(tspath.CombinePaths(rootPath, "tsconfig.json"), &core.CompilerOptions{}, host, nil) assert.Equal(b, len(errors), 0, "Expected no errors in parsed command line") p := compiler.NewProgram(compiler.ProgramOptions{ diff --git a/internal/compiler/fileloader.go b/internal/compiler/fileloader.go index fbb96adf93..1d8a8a4919 100644 --- a/internal/compiler/fileloader.go +++ b/internal/compiler/fileloader.go @@ -15,6 +15,12 @@ import ( "github.com/microsoft/typescript-go/internal/tspath" ) +type libResolution struct { + libraryName string + resolution *module.ResolvedModule + trace []string +} + type fileLoader struct { opts ProgramOptions resolver *module.Resolver @@ -35,7 +41,7 @@ type fileLoader struct { dtsDirectories collections.Set[tspath.Path] pathForLibFileCache collections.SyncMap[string, string] - pathForLibFileResolutions collections.SyncMap[tspath.Path, module.ModeAwareCache[*module.ResolvedModule]] + pathForLibFileResolutions collections.SyncMap[tspath.Path, *libResolution] } type processedFiles struct { @@ -200,15 +206,20 @@ func processAllProgramFiles( } } - loader.pathForLibFileResolutions.Range(func(key tspath.Path, value module.ModeAwareCache[*module.ResolvedModule]) bool { - resolvedModules[key] = value - for _, resolvedModule := range value { - for _, diag := range resolvedModule.ResolutionDiagnostics { - fileLoadDiagnostics.Add(diag) - } + keys := slices.Collect(loader.pathForLibFileResolutions.Keys()) + slices.Sort(keys) + for _, key := range keys { + value, _ := loader.pathForLibFileResolutions.Load(key) + resolvedModules[key] = module.ModeAwareCache[*module.ResolvedModule]{ + module.ModeAwareCacheKey{Name: value.libraryName, Mode: core.ModuleKindCommonJS}: value.resolution, } - return true - }) + for _, trace := range value.trace { + opts.Host.Trace(trace) + } + for _, diag := range value.resolution.ResolutionDiagnostics { + fileLoadDiagnostics.Add(diag) + } + } return processedFiles{ resolver: loader.resolver, @@ -255,6 +266,7 @@ func (p *fileLoader) addAutomaticTypeDirectiveTasks() { func (p *fileLoader) resolveAutomaticTypeDirectives(containingFileName string) ( toParse []resolvedRef, typeResolutionsInFile module.ModeAwareCache[*module.ResolvedTypeReferenceDirective], + typeResolutionsTrace []string, ) { automaticTypeDirectiveNames := module.GetAutomaticTypeDirectiveNames(p.opts.Config.CompilerOptions(), p.opts.Host) if len(automaticTypeDirectiveNames) != 0 { @@ -262,8 +274,9 @@ func (p *fileLoader) resolveAutomaticTypeDirectives(containingFileName string) ( typeResolutionsInFile = make(module.ModeAwareCache[*module.ResolvedTypeReferenceDirective], len(automaticTypeDirectiveNames)) for _, name := range automaticTypeDirectiveNames { resolutionMode := core.ModuleKindNodeNext - resolved := p.resolver.ResolveTypeReferenceDirective(name, containingFileName, resolutionMode, nil) + resolved, trace := p.resolver.ResolveTypeReferenceDirective(name, containingFileName, resolutionMode, nil) typeResolutionsInFile[module.ModeAwareCacheKey{Name: name, Mode: resolutionMode}] = resolved + typeResolutionsTrace = append(typeResolutionsTrace, trace...) if resolved.IsResolved() { toParse = append(toParse, resolvedRef{ fileName: resolved.ResolvedFileName, @@ -273,7 +286,7 @@ func (p *fileLoader) resolveAutomaticTypeDirectives(containingFileName string) ( } } } - return toParse, typeResolutionsInFile + return toParse, typeResolutionsInFile, typeResolutionsTrace } func (p *fileLoader) addProjectReferenceTasks(singleThreaded bool) { @@ -393,11 +406,13 @@ func (p *fileLoader) resolveTypeReferenceDirectives(t *parseTask) { meta := t.metadata typeResolutionsInFile := make(module.ModeAwareCache[*module.ResolvedTypeReferenceDirective], len(file.TypeReferenceDirectives)) + var typeResolutionsTrace []string for _, ref := range file.TypeReferenceDirectives { redirect := p.projectReferenceFileMapper.getRedirectForResolution(file) resolutionMode := getModeForTypeReferenceDirectiveInFile(ref, file, meta, module.GetCompilerOptionsWithRedirect(p.opts.Config.CompilerOptions(), redirect)) - resolved := p.resolver.ResolveTypeReferenceDirective(ref.FileName, file.FileName(), resolutionMode, redirect) + resolved, trace := p.resolver.ResolveTypeReferenceDirective(ref.FileName, file.FileName(), resolutionMode, redirect) typeResolutionsInFile[module.ModeAwareCacheKey{Name: ref.FileName, Mode: resolutionMode}] = resolved + typeResolutionsTrace = append(typeResolutionsTrace, trace...) if resolved.IsResolved() { t.addSubTask(resolvedRef{ @@ -410,6 +425,7 @@ func (p *fileLoader) resolveTypeReferenceDirectives(t *parseTask) { } t.typeResolutionsInFile = typeResolutionsInFile + t.typeResolutionsTrace = typeResolutionsTrace } const externalHelpersModuleNameText = "tslib" // TODO(jakebailey): dedupe @@ -455,6 +471,7 @@ func (p *fileLoader) resolveImportsAndModuleAugmentations(t *parseTask) { if len(moduleNames) != 0 { resolutionsInFile := make(module.ModeAwareCache[*module.ResolvedModule], len(moduleNames)) + var resolutionsTrace []string for index, entry := range moduleNames { moduleName := entry.Text() @@ -463,8 +480,9 @@ func (p *fileLoader) resolveImportsAndModuleAugmentations(t *parseTask) { } mode := getModeForUsageLocation(file.FileName(), meta, entry, optionsForFile) - resolvedModule := p.resolver.ResolveModuleName(moduleName, file.FileName(), mode, redirect) + resolvedModule, trace := p.resolver.ResolveModuleName(moduleName, file.FileName(), mode, redirect) resolutionsInFile[module.ModeAwareCacheKey{Name: moduleName, Mode: mode}] = resolvedModule + resolutionsTrace = append(resolutionsTrace, trace...) if !resolvedModule.IsResolved() { continue @@ -501,6 +519,7 @@ func (p *fileLoader) resolveImportsAndModuleAugmentations(t *parseTask) { } t.resolutionsInFile = resolutionsInFile + t.resolutionsTrace = resolutionsTrace } } @@ -526,11 +545,13 @@ func (p *fileLoader) pathForLibFile(name string) string { if p.opts.Config.CompilerOptions().LibReplacement.IsTrue() { libraryName := getLibraryNameFromLibFileName(name) resolveFrom := getInferredLibraryNameResolveFrom(p.opts.Config.CompilerOptions(), p.opts.Host.GetCurrentDirectory(), name) - resolution := p.resolver.ResolveModuleName(libraryName, resolveFrom, core.ModuleKindCommonJS, nil) + resolution, trace := p.resolver.ResolveModuleName(libraryName, resolveFrom, core.ModuleKindCommonJS, nil) if resolution.IsResolved() { path = resolution.ResolvedFileName - p.pathForLibFileResolutions.LoadOrStore(p.toPath(resolveFrom), module.ModeAwareCache[*module.ResolvedModule]{ - module.ModeAwareCacheKey{Name: libraryName, Mode: core.ModuleKindCommonJS}: resolution, + p.pathForLibFileResolutions.LoadOrStore(p.toPath(resolveFrom), &libResolution{ + libraryName: libraryName, + resolution: resolution, + trace: trace, }) } } diff --git a/internal/compiler/filesparser.go b/internal/compiler/filesparser.go index de3f2994c3..36ce3910b5 100644 --- a/internal/compiler/filesparser.go +++ b/internal/compiler/filesparser.go @@ -25,7 +25,9 @@ type parseTask struct { metadata ast.SourceFileMetaData resolutionsInFile module.ModeAwareCache[*module.ResolvedModule] + resolutionsTrace []string typeResolutionsInFile module.ModeAwareCache[*module.ResolvedTypeReferenceDirective] + typeResolutionsTrace []string resolutionDiagnostics []*ast.Diagnostic importHelpersImportSpecifier *ast.Node jsxRuntimeImportSpecifier *jsxRuntimeImportSpecifier @@ -98,8 +100,9 @@ func (t *parseTask) redirect(loader *fileLoader, fileName string) { } func (t *parseTask) loadAutomaticTypeDirectives(loader *fileLoader) { - toParseTypeRefs, typeResolutionsInFile := loader.resolveAutomaticTypeDirectives(t.normalizedFilePath) + toParseTypeRefs, typeResolutionsInFile, typeResolutionsTrace := loader.resolveAutomaticTypeDirectives(t.normalizedFilePath) t.typeResolutionsInFile = typeResolutionsInFile + t.typeResolutionsTrace = typeResolutionsTrace for _, typeResolution := range toParseTypeRefs { t.addSubTask(typeResolution, false) } @@ -193,7 +196,7 @@ func (w *filesParser) start(loader *fileLoader, tasks []*parseTask, depth int, i } } -func (w *filesParser) collect(loader *fileLoader, tasks []*parseTask, iterate func(*parseTask)) []tspath.Path { +func (w *filesParser) collect(loader *fileLoader, tasks []*parseTask, iterate func(*parseTask)) { // Mark all tasks we saw as external after the fact. w.tasksByFileName.Range(func(key string, value *queuedParseTask) bool { if value.fromExternalLibrary { @@ -201,22 +204,24 @@ func (w *filesParser) collect(loader *fileLoader, tasks []*parseTask, iterate fu } return true }) - return w.collectWorker(loader, tasks, iterate, collections.Set[*parseTask]{}) + w.collectWorker(loader, tasks, iterate, collections.Set[*parseTask]{}) } -func (w *filesParser) collectWorker(loader *fileLoader, tasks []*parseTask, iterate func(*parseTask), seen collections.Set[*parseTask]) []tspath.Path { - var results []tspath.Path +func (w *filesParser) collectWorker(loader *fileLoader, tasks []*parseTask, iterate func(*parseTask), seen collections.Set[*parseTask]) { for _, task := range tasks { // ensure we only walk each task once - if !task.loaded || seen.Has(task) { + if !task.loaded || !seen.AddIfAbsent(task) { continue } - seen.Add(task) + for _, trace := range task.typeResolutionsTrace { + loader.opts.Host.Trace(trace) + } + for _, trace := range task.resolutionsTrace { + loader.opts.Host.Trace(trace) + } if subTasks := task.subTasks; len(subTasks) > 0 { w.collectWorker(loader, subTasks, iterate, seen) } iterate(task) - results = append(results, loader.toPath(task.FileName())) } - return results } diff --git a/internal/compiler/host.go b/internal/compiler/host.go index d4968bd760..9221e59b45 100644 --- a/internal/compiler/host.go +++ b/internal/compiler/host.go @@ -30,6 +30,7 @@ type compilerHost struct { defaultLibraryPath string extendedConfigCache *collections.SyncMap[tspath.Path, *tsoptions.ExtendedConfigCacheEntry] extendedConfigCacheOnce sync.Once + trace func(msg string) } func NewCachedFSCompilerHost( @@ -37,8 +38,9 @@ func NewCachedFSCompilerHost( fs vfs.FS, defaultLibraryPath string, extendedConfigCache *collections.SyncMap[tspath.Path, *tsoptions.ExtendedConfigCacheEntry], + trace func(msg string), ) CompilerHost { - return NewCompilerHost(currentDirectory, cachedvfs.From(fs), defaultLibraryPath, extendedConfigCache) + return NewCompilerHost(currentDirectory, cachedvfs.From(fs), defaultLibraryPath, extendedConfigCache, trace) } func NewCompilerHost( @@ -46,12 +48,17 @@ func NewCompilerHost( fs vfs.FS, defaultLibraryPath string, extendedConfigCache *collections.SyncMap[tspath.Path, *tsoptions.ExtendedConfigCacheEntry], + trace func(msg string), ) CompilerHost { + if trace == nil { + trace = func(msg string) {} + } return &compilerHost{ currentDirectory: currentDirectory, fs: fs, defaultLibraryPath: defaultLibraryPath, extendedConfigCache: extendedConfigCache, + trace: trace, } } @@ -68,7 +75,7 @@ func (h *compilerHost) GetCurrentDirectory() string { } func (h *compilerHost) Trace(msg string) { - //!!! TODO: implement + h.trace(msg) } func (h *compilerHost) GetSourceFile(opts ast.SourceFileParseOptions) *ast.SourceFile { diff --git a/internal/compiler/program_test.go b/internal/compiler/program_test.go index e6350e8375..7c23992fdf 100644 --- a/internal/compiler/program_test.go +++ b/internal/compiler/program_test.go @@ -1,4 +1,4 @@ -package compiler +package compiler_test import ( "path/filepath" @@ -7,6 +7,7 @@ import ( "testing" "github.com/microsoft/typescript-go/internal/bundled" + "github.com/microsoft/typescript-go/internal/compiler" "github.com/microsoft/typescript-go/internal/core" "github.com/microsoft/typescript-go/internal/repo" "github.com/microsoft/typescript-go/internal/tsoptions" @@ -233,14 +234,14 @@ func TestProgram(t *testing.T) { opts := core.CompilerOptions{Target: testCase.target} - program := NewProgram(ProgramOptions{ + program := compiler.NewProgram(compiler.ProgramOptions{ Config: &tsoptions.ParsedCommandLine{ ParsedConfig: &core.ParsedOptions{ FileNames: []string{"c:/dev/src/index.ts"}, CompilerOptions: &opts, }, }, - Host: NewCompilerHost("c:/dev/src", fs, bundled.LibPath(), nil), + Host: compiler.NewCompilerHost("c:/dev/src", fs, bundled.LibPath(), nil, nil), }) actualFiles := []string{} @@ -270,18 +271,18 @@ func BenchmarkNewProgram(b *testing.B) { } opts := core.CompilerOptions{Target: testCase.target} - programOpts := ProgramOptions{ + programOpts := compiler.ProgramOptions{ Config: &tsoptions.ParsedCommandLine{ ParsedConfig: &core.ParsedOptions{ FileNames: []string{"c:/dev/src/index.ts"}, CompilerOptions: &opts, }, }, - Host: NewCompilerHost("c:/dev/src", fs, bundled.LibPath(), nil), + Host: compiler.NewCompilerHost("c:/dev/src", fs, bundled.LibPath(), nil, nil), } for b.Loop() { - NewProgram(programOpts) + compiler.NewProgram(programOpts) } }) } @@ -294,18 +295,18 @@ func BenchmarkNewProgram(b *testing.B) { fs := osvfs.FS() fs = bundled.WrapFS(fs) - host := NewCompilerHost(rootPath, fs, bundled.LibPath(), nil) + host := compiler.NewCompilerHost(rootPath, fs, bundled.LibPath(), nil, nil) parsed, errors := tsoptions.GetParsedCommandLineOfConfigFile(tspath.CombinePaths(rootPath, "tsconfig.json"), nil, host, nil) assert.Equal(b, len(errors), 0, "Expected no errors in parsed command line") - opts := ProgramOptions{ + opts := compiler.ProgramOptions{ Config: parsed, Host: host, } for b.Loop() { - NewProgram(opts) + compiler.NewProgram(opts) } }) } diff --git a/internal/compiler/projectreferencedtsfakinghost.go b/internal/compiler/projectreferencedtsfakinghost.go index 9c03e8414f..3bac411dad 100644 --- a/internal/compiler/projectreferencedtsfakinghost.go +++ b/internal/compiler/projectreferencedtsfakinghost.go @@ -41,11 +41,6 @@ func (h *projectReferenceDtsFakingHost) GetCurrentDirectory() string { return h.host.GetCurrentDirectory() } -// Trace implements module.ResolutionHost. -func (h *projectReferenceDtsFakingHost) Trace(msg string) { - h.host.Trace(msg) -} - type projectReferenceDtsFakingVfs struct { projectReferenceFileMapper *projectReferenceFileMapper dtsDirectories collections.Set[tspath.Path] diff --git a/internal/execute/tsc.go b/internal/execute/tsc.go index af97431c32..8d486f7604 100644 --- a/internal/execute/tsc.go +++ b/internal/execute/tsc.go @@ -223,6 +223,12 @@ func findConfigFile(searchPath string, fileExists func(string) bool, configName return result } +func getTraceFromSys(sys System) func(msg string) { + return func(msg string) { + fmt.Fprintln(sys.Writer(), msg) + } +} + func performIncrementalCompilation( sys System, config *tsoptions.ParsedCommandLine, @@ -231,7 +237,7 @@ func performIncrementalCompilation( configTime time.Duration, testing bool, ) CommandLineResult { - host := compiler.NewCachedFSCompilerHost(sys.GetCurrentDirectory(), sys.FS(), sys.DefaultLibraryPath(), extendedConfigCache) + host := compiler.NewCachedFSCompilerHost(sys.GetCurrentDirectory(), sys.FS(), sys.DefaultLibraryPath(), extendedConfigCache, getTraceFromSys(sys)) buildInfoReadStart := sys.Now() oldProgram := incremental.ReadBuildInfoProgram(config, incremental.NewBuildInfoReader(host)) buildInfoReadTime := sys.Now().Sub(buildInfoReadStart) @@ -270,7 +276,7 @@ func performCompilation( extendedConfigCache *collections.SyncMap[tspath.Path, *tsoptions.ExtendedConfigCacheEntry], configTime time.Duration, ) CommandLineResult { - host := compiler.NewCachedFSCompilerHost(sys.GetCurrentDirectory(), sys.FS(), sys.DefaultLibraryPath(), extendedConfigCache) + host := compiler.NewCachedFSCompilerHost(sys.GetCurrentDirectory(), sys.FS(), sys.DefaultLibraryPath(), extendedConfigCache, getTraceFromSys(sys)) // todo: cache, statistics, tracing parseStart := sys.Now() program := compiler.NewProgram(compiler.ProgramOptions{ diff --git a/internal/execute/watcher.go b/internal/execute/watcher.go index 223bdc73fc..9190a599f1 100644 --- a/internal/execute/watcher.go +++ b/internal/execute/watcher.go @@ -42,7 +42,7 @@ func createWatcher(sys System, configParseResult *tsoptions.ParsedCommandLine, r } func (w *Watcher) start() { - w.host = compiler.NewCompilerHost(w.sys.GetCurrentDirectory(), w.sys.FS(), w.sys.DefaultLibraryPath(), nil) + w.host = compiler.NewCompilerHost(w.sys.GetCurrentDirectory(), w.sys.FS(), w.sys.DefaultLibraryPath(), nil, getTraceFromSys(w.sys)) w.program = incremental.ReadBuildInfoProgram(w.options, incremental.NewBuildInfoReader(w.host)) if !w.testing { @@ -109,7 +109,7 @@ func (w *Watcher) hasErrorsInTsConfig() bool { w.configModified = true } w.options = configParseResult - w.host = compiler.NewCompilerHost(w.sys.GetCurrentDirectory(), w.sys.FS(), w.sys.DefaultLibraryPath(), &extendedConfigCache) + w.host = compiler.NewCompilerHost(w.sys.GetCurrentDirectory(), w.sys.FS(), w.sys.DefaultLibraryPath(), &extendedConfigCache, getTraceFromSys(w.sys)) } return false } diff --git a/internal/module/resolver.go b/internal/module/resolver.go index 6071d8535a..45f8a8523c 100644 --- a/internal/module/resolver.go +++ b/internal/module/resolver.go @@ -40,8 +40,26 @@ func unresolved() *resolved { type resolutionKindSpecificLoader = func(extensions extensions, candidate string, onlyRecordFailures bool) *resolved +type tracer struct { + traces []string +} + +func (t *tracer) write(msg string) { + if t != nil { + t.traces = append(t.traces, msg) + } +} + +func (t *tracer) getTraces() []string { + if t != nil { + return t.traces + } + return nil +} + type resolutionState struct { resolver *Resolver + tracer *tracer // request fields name string @@ -69,12 +87,14 @@ func newResolutionState( compilerOptions *core.CompilerOptions, redirectedReference ResolvedProjectReference, resolver *Resolver, + traceBuilder *tracer, ) *resolutionState { state := &resolutionState{ name: name, containingDirectory: containingDirectory, compilerOptions: GetCompilerOptionsWithRedirect(compilerOptions, redirectedReference), resolver: resolver, + tracer: traceBuilder, } if isTypeReferenceDirective { @@ -139,8 +159,11 @@ func NewResolver( } } -func (r *Resolver) traceEnabled() bool { - return r.compilerOptions.TraceResolution == core.TSTrue +func (r *Resolver) newTraceBuilder() *tracer { + if r.compilerOptions.TraceResolution == core.TSTrue { + return &tracer{} + } + return nil } func (r *Resolver) GetPackageScopeForPath(directory string) *packagejson.InfoCacheEntry { @@ -160,9 +183,9 @@ func (r *Resolver) GetPackageJsonScopeIfApplicable(path string) *packagejson.Inf return nil } -func (r *Resolver) traceResolutionUsingProjectReference(redirectedReference ResolvedProjectReference) { +func (r *tracer) traceResolutionUsingProjectReference(redirectedReference ResolvedProjectReference) { if redirectedReference != nil && redirectedReference.CompilerOptions() != nil { - r.host.Trace(diagnostics.Using_compiler_options_of_project_reference_redirect_0.Format(redirectedReference.ConfigName())) + r.write(diagnostics.Using_compiler_options_of_project_reference_redirect_0.Format(redirectedReference.ConfigName())) } } @@ -171,73 +194,73 @@ func (r *Resolver) ResolveTypeReferenceDirective( containingFile string, resolutionMode core.ResolutionMode, redirectedReference ResolvedProjectReference, -) *ResolvedTypeReferenceDirective { - traceEnabled := r.traceEnabled() +) (*ResolvedTypeReferenceDirective, []string) { + traceBuilder := r.newTraceBuilder() compilerOptions := GetCompilerOptionsWithRedirect(r.compilerOptions, redirectedReference) containingDirectory := tspath.GetDirectoryPath(containingFile) typeRoots, fromConfig := compilerOptions.GetEffectiveTypeRoots(r.host.GetCurrentDirectory()) - if traceEnabled { - r.host.Trace(diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_2.Format(typeReferenceDirectiveName, containingFile, strings.Join(typeRoots, ","))) - r.traceResolutionUsingProjectReference(redirectedReference) + if traceBuilder != nil { + traceBuilder.write(diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_2.Format(typeReferenceDirectiveName, containingFile, strings.Join(typeRoots, ","))) + traceBuilder.traceResolutionUsingProjectReference(redirectedReference) } - state := newResolutionState(typeReferenceDirectiveName, containingDirectory, true /*isTypeReferenceDirective*/, resolutionMode, compilerOptions, redirectedReference, r) + state := newResolutionState(typeReferenceDirectiveName, containingDirectory, true /*isTypeReferenceDirective*/, resolutionMode, compilerOptions, redirectedReference, r, traceBuilder) result := state.resolveTypeReferenceDirective(typeRoots, fromConfig, strings.HasSuffix(containingFile, InferredTypesContainingFile)) - if traceEnabled { - r.traceTypeReferenceDirectiveResult(typeReferenceDirectiveName, result) + if traceBuilder != nil { + traceBuilder.traceTypeReferenceDirectiveResult(typeReferenceDirectiveName, result) } - return result + return result, traceBuilder.getTraces() } -func (r *Resolver) ResolveModuleName(moduleName string, containingFile string, resolutionMode core.ResolutionMode, redirectedReference ResolvedProjectReference) *ResolvedModule { - traceEnabled := r.traceEnabled() +func (r *Resolver) ResolveModuleName(moduleName string, containingFile string, resolutionMode core.ResolutionMode, redirectedReference ResolvedProjectReference) (*ResolvedModule, []string) { + traceBuilder := r.newTraceBuilder() compilerOptions := GetCompilerOptionsWithRedirect(r.compilerOptions, redirectedReference) - if traceEnabled { - r.host.Trace(diagnostics.Resolving_module_0_from_1.Format(moduleName, containingFile)) - r.traceResolutionUsingProjectReference(redirectedReference) + if traceBuilder != nil { + traceBuilder.write(diagnostics.Resolving_module_0_from_1.Format(moduleName, containingFile)) + traceBuilder.traceResolutionUsingProjectReference(redirectedReference) } containingDirectory := tspath.GetDirectoryPath(containingFile) moduleResolution := compilerOptions.ModuleResolution if moduleResolution == core.ModuleResolutionKindUnknown { moduleResolution = compilerOptions.GetModuleResolutionKind() - if traceEnabled { - r.host.Trace(diagnostics.Module_resolution_kind_is_not_specified_using_0.Format(moduleResolution.String())) + if traceBuilder != nil { + traceBuilder.write(diagnostics.Module_resolution_kind_is_not_specified_using_0.Format(moduleResolution.String())) } } else { - if traceEnabled { - r.host.Trace(diagnostics.Explicitly_specified_module_resolution_kind_Colon_0.Format(moduleResolution.String())) + if traceBuilder != nil { + traceBuilder.write(diagnostics.Explicitly_specified_module_resolution_kind_Colon_0.Format(moduleResolution.String())) } } var result *ResolvedModule switch moduleResolution { case core.ModuleResolutionKindNode16, core.ModuleResolutionKindNodeNext, core.ModuleResolutionKindBundler: - state := newResolutionState(moduleName, containingDirectory, false /*isTypeReferenceDirective*/, resolutionMode, compilerOptions, redirectedReference, r) + state := newResolutionState(moduleName, containingDirectory, false /*isTypeReferenceDirective*/, resolutionMode, compilerOptions, redirectedReference, r, traceBuilder) result = state.resolveNodeLike() default: panic(fmt.Sprintf("Unexpected moduleResolution: %d", moduleResolution)) } - if traceEnabled { + if traceBuilder != nil { if result.IsResolved() { if result.PackageId.Name != "" { - r.host.Trace(diagnostics.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2.Format(moduleName, result.ResolvedFileName, result.PackageId.String())) + traceBuilder.write(diagnostics.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2.Format(moduleName, result.ResolvedFileName, result.PackageId.String())) } else { - r.host.Trace(diagnostics.Module_name_0_was_successfully_resolved_to_1.Format(moduleName, result.ResolvedFileName)) + traceBuilder.write(diagnostics.Module_name_0_was_successfully_resolved_to_1.Format(moduleName, result.ResolvedFileName)) } } else { - r.host.Trace(diagnostics.Module_name_0_was_not_resolved.Format(moduleName)) + traceBuilder.write(diagnostics.Module_name_0_was_not_resolved.Format(moduleName)) } } - return r.tryResolveFromTypingsLocation(moduleName, containingDirectory, result) + return r.tryResolveFromTypingsLocation(moduleName, containingDirectory, result, traceBuilder), traceBuilder.getTraces() } -func (r *Resolver) tryResolveFromTypingsLocation(moduleName string, containingDirectory string, originalResult *ResolvedModule) *ResolvedModule { +func (r *Resolver) tryResolveFromTypingsLocation(moduleName string, containingDirectory string, originalResult *ResolvedModule, traceBuilder *tracer) *ResolvedModule { if r.typingsLocation == "" || tspath.IsExternalModuleNameRelative(moduleName) || (originalResult.ResolvedFileName != "" && tspath.ExtensionIsOneOf(originalResult.Extension, tspath.SupportedTSExtensionsWithJsonFlat)) { @@ -252,9 +275,10 @@ func (r *Resolver) tryResolveFromTypingsLocation(moduleName string, containingDi r.compilerOptions, nil, // redirectedReference, r, + traceBuilder, ) - if r.traceEnabled() { - r.host.Trace(diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2.Format(r.projectName, moduleName, r.typingsLocation)) + if traceBuilder != nil { + traceBuilder.write(diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2.Format(r.projectName, moduleName, r.typingsLocation)) } globalResolved := state.loadModuleFromImmediateNodeModulesDirectory(extensionsDeclaration, r.typingsLocation, false) if globalResolved == nil { @@ -269,24 +293,24 @@ func (r *Resolver) tryResolveFromTypingsLocation(moduleName string, containingDi func (r *Resolver) resolveConfig(moduleName string, containingFile string) *ResolvedModule { containingDirectory := tspath.GetDirectoryPath(containingFile) - state := newResolutionState(moduleName, containingDirectory, false /*isTypeReferenceDirective*/, core.ModuleKindCommonJS, r.compilerOptions, nil, r) + state := newResolutionState(moduleName, containingDirectory, false /*isTypeReferenceDirective*/, core.ModuleKindCommonJS, r.compilerOptions, nil, r, nil) state.isConfigLookup = true state.extensions = extensionsJson return state.resolveNodeLike() } -func (r *Resolver) traceTypeReferenceDirectiveResult(typeReferenceDirectiveName string, result *ResolvedTypeReferenceDirective) { +func (r *tracer) traceTypeReferenceDirectiveResult(typeReferenceDirectiveName string, result *ResolvedTypeReferenceDirective) { if !result.IsResolved() { - r.host.Trace(diagnostics.Type_reference_directive_0_was_not_resolved.Format(typeReferenceDirectiveName)) + r.write(diagnostics.Type_reference_directive_0_was_not_resolved.Format(typeReferenceDirectiveName)) } else if result.PackageId.Name != "" { - r.host.Trace(diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3.Format( + r.write(diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3.Format( typeReferenceDirectiveName, result.ResolvedFileName, result.PackageId.String(), result.Primary, )) } else { - r.host.Trace(diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2.Format( + r.write(diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2.Format( typeReferenceDirectiveName, result.ResolvedFileName, result.Primary, @@ -297,14 +321,14 @@ func (r *Resolver) traceTypeReferenceDirectiveResult(typeReferenceDirectiveName func (r *resolutionState) resolveTypeReferenceDirective(typeRoots []string, fromConfig bool, fromInferredTypesContainingFile bool) *ResolvedTypeReferenceDirective { // Primary lookup if len(typeRoots) > 0 { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Resolving_with_primary_search_path_0.Format(strings.Join(typeRoots, ", "))) + if r.tracer != nil { + r.tracer.write(diagnostics.Resolving_with_primary_search_path_0.Format(strings.Join(typeRoots, ", "))) } for _, typeRoot := range typeRoots { candidate := r.getCandidateFromTypeRoot(typeRoot) directoryExists := r.resolver.host.FS().DirectoryExists(candidate) - if !directoryExists && r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(typeRoot)) + if !directoryExists && r.tracer != nil { + r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(typeRoot)) } if fromConfig { // Custom typeRoots resolve as file or directory just like we do modules @@ -320,15 +344,15 @@ func (r *resolutionState) resolveTypeReferenceDirective(typeRoots []string, from return r.createResolvedTypeReferenceDirective(resolvedFromDirectory, true /*primary*/) } } - } else if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths.Format()) + } else if r.tracer != nil { + r.tracer.write(diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths.Format()) } // Secondary lookup var resolved *resolved if !fromConfig || !fromInferredTypesContainingFile { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Looking_up_in_node_modules_folder_initial_location_0.Format(r.containingDirectory)) + if r.tracer != nil { + r.tracer.write(diagnostics.Looking_up_in_node_modules_folder_initial_location_0.Format(r.containingDirectory)) } if !tspath.IsExternalModuleNameRelative(r.name) { resolved = r.loadModuleFromNearestNodeModulesDirectory(false /*typesScopeOnly*/) @@ -336,8 +360,8 @@ func (r *resolutionState) resolveTypeReferenceDirective(typeRoots []string, from candidate := normalizePathForCJSResolution(r.containingDirectory, r.name) resolved = r.nodeLoadModuleByRelativeName(extensionsDeclaration, candidate, false /*onlyRecordFailures*/, true /*considerPackageJson*/) } - } else if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder.Format()) + } else if r.tracer != nil { + r.tracer.write(diagnostics.Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder.Format()) } return r.createResolvedTypeReferenceDirective(resolved, false /*primary*/) } @@ -352,8 +376,8 @@ func (r *resolutionState) getCandidateFromTypeRoot(typeRoot string) string { func (r *resolutionState) mangleScopedPackageName(name string) string { mangled := MangleScopedPackageName(name) - if r.resolver.traceEnabled() && mangled != name { - r.resolver.host.Trace(diagnostics.Scoped_package_detected_looking_in_0.Format(mangled)) + if r.tracer != nil && mangled != name { + r.tracer.write(diagnostics.Scoped_package_detected_looking_in_0.Format(mangled)) } return mangled } @@ -373,12 +397,12 @@ func (r *resolutionState) getPackageScopeForPath(directory string) *packagejson. } func (r *resolutionState) resolveNodeLike() *ResolvedModule { - if r.resolver.traceEnabled() { + if r.tracer != nil { conditions := strings.Join(core.Map(r.conditions, func(c string) string { return `'` + c + `'` }), ", ") if r.esmMode { - r.resolver.host.Trace(diagnostics.Resolving_in_0_mode_with_conditions_1.Format("ESM", conditions)) + r.tracer.write(diagnostics.Resolving_in_0_mode_with_conditions_1.Format("ESM", conditions)) } else { - r.resolver.host.Trace(diagnostics.Resolving_in_0_mode_with_conditions_1.Format("CJS", conditions)) + r.tracer.write(diagnostics.Resolving_in_0_mode_with_conditions_1.Format("CJS", conditions)) } } result := r.resolveNodeLikeWorker() @@ -391,8 +415,8 @@ func (r *resolutionState) resolveNodeLike() *ResolvedModule { result.IsExternalLibraryImport && !extensionIsOk(extensionsTypeScript|extensionsDeclaration, result.Extension) && slices.Contains(r.conditions, "import") { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update.Format()) + if r.tracer != nil { + r.tracer.write(diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update.Format()) } r.features = r.features & ^NodeResolutionFeaturesExports r.extensions = r.extensions & (extensionsTypeScript | extensionsDeclaration) @@ -422,13 +446,13 @@ func (r *resolutionState) resolveNodeLikeWorker() *ResolvedModule { } } if strings.Contains(r.name, ":") { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1.Format(r.name, r.extensions.String())) + if r.tracer != nil { + r.tracer.write(diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1.Format(r.name, r.extensions.String())) } return r.createResolvedModule(nil, false) } - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1.Format(r.name, r.extensions.String())) + if r.tracer != nil { + r.tracer.write(diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1.Format(r.name, r.extensions.String())) } if resolved := r.loadModuleFromNearestNodeModulesDirectory(false /*typesScopeOnly*/); !resolved.shouldContinueSearching() { return r.createResolvedModuleHandlingSymlink(resolved) @@ -499,24 +523,24 @@ func (r *resolutionState) loadModuleFromSelfNameReference() *resolved { func (r *resolutionState) loadModuleFromImports() *resolved { if r.name == "#" || strings.HasPrefix(r.name, "#/") { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions.Format(r.name)) + if r.tracer != nil { + r.tracer.write(diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions.Format(r.name)) } return continueSearching() } directoryPath := tspath.GetNormalizedAbsolutePath(r.containingDirectory, r.resolver.host.GetCurrentDirectory()) scope := r.getPackageScopeForPath(directoryPath) if !scope.Exists() { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve.Format(directoryPath)) + if r.tracer != nil { + r.tracer.write(diagnostics.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve.Format(directoryPath)) } return continueSearching() } if scope.Contents.Imports.Type != packagejson.JSONValueTypeObject { // !!! Old compiler only checks for undefined, but then assumes `imports` is an object if present. // Maybe should have a new diagnostic for imports of an invalid type. Also, array should be handled? - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_package_json_scope_0_has_no_imports_defined.Format(scope.PackageDirectory)) + if r.tracer != nil { + r.tracer.write(diagnostics.X_package_json_scope_0_has_no_imports_defined.Format(scope.PackageDirectory)) } return continueSearching() } @@ -525,8 +549,8 @@ func (r *resolutionState) loadModuleFromImports() *resolved { return result } - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1.Format(r.name, scope.PackageDirectory)) + if r.tracer != nil { + r.tracer.write(diagnostics.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1.Format(r.name, scope.PackageDirectory)) } return continueSearching() } @@ -558,8 +582,8 @@ func (r *resolutionState) loadModuleFromExports(packageInfo *packagejson.InfoCac } } - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1.Format(subpath, packageInfo.PackageDirectory)) + if r.tracer != nil { + r.tracer.write(diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1.Format(subpath, packageInfo.PackageDirectory)) } return continueSearching() } @@ -610,8 +634,8 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio case packagejson.JSONValueTypeString: targetString, _ := target.Value.(string) if !isPattern && len(subpath) > 0 && !strings.HasSuffix(targetString, "/") { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) + if r.tracer != nil { + r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) } return continueSearching() } @@ -621,9 +645,9 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio if isPattern { combinedLookup = strings.ReplaceAll(targetString, "*", subpath) } - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Using_0_subpath_1_with_target_2.Format("imports", key, combinedLookup)) - r.resolver.host.Trace(diagnostics.Resolving_module_0_from_1.Format(combinedLookup, scope.PackageDirectory+"/")) + if r.tracer != nil { + r.tracer.write(diagnostics.Using_0_subpath_1_with_target_2.Format("imports", key, combinedLookup)) + r.tracer.write(diagnostics.Resolving_module_0_from_1.Format(combinedLookup, scope.PackageDirectory+"/")) } name, containingDirectory := r.name, r.containingDirectory r.name, r.containingDirectory = combinedLookup, scope.PackageDirectory+"/" @@ -641,8 +665,8 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio } return continueSearching() } - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) + if r.tracer != nil { + r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) } return continueSearching() } @@ -654,8 +678,8 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio } partsAfterFirst := parts[1:] if slices.Contains(partsAfterFirst, "..") || slices.Contains(partsAfterFirst, ".") || slices.Contains(partsAfterFirst, "node_modules") { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) + if r.tracer != nil { + r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) } return continueSearching() } @@ -664,20 +688,20 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio // to be in the business of validating everyone's import and export map correctness. subpathParts := tspath.GetPathComponents(subpath, "") if slices.Contains(subpathParts, "..") || slices.Contains(subpathParts, ".") || slices.Contains(subpathParts, "node_modules") { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) + if r.tracer != nil { + r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) } return continueSearching() } - if r.resolver.traceEnabled() { + if r.tracer != nil { var messageTarget string if isPattern { messageTarget = strings.ReplaceAll(targetString, "*", subpath) } else { messageTarget = targetString + subpath } - r.resolver.host.Trace(diagnostics.Using_0_subpath_1_with_target_2.Format(core.IfElse(isImports, "imports", "exports"), key, messageTarget)) + r.tracer.write(diagnostics.Using_0_subpath_1_with_target_2.Format(core.IfElse(isImports, "imports", "exports"), key, messageTarget)) } var finalPath string if isPattern { @@ -695,40 +719,40 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio return continueSearching() case packagejson.JSONValueTypeObject: - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Entering_conditional_exports.Format()) + if r.tracer != nil { + r.tracer.write(diagnostics.Entering_conditional_exports.Format()) } for condition := range target.AsObject().Keys() { if r.conditionMatches(condition) { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Matched_0_condition_1.Format(core.IfElse(isImports, "imports", "exports"), condition)) + if r.tracer != nil { + r.tracer.write(diagnostics.Matched_0_condition_1.Format(core.IfElse(isImports, "imports", "exports"), condition)) } subTarget, _ := target.AsObject().Get(condition) if result := r.loadModuleFromTargetExportOrImport(extensions, moduleName, scope, isImports, subTarget, subpath, isPattern, key); !result.shouldContinueSearching() { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Resolved_under_condition_0.Format(condition)) + if r.tracer != nil { + r.tracer.write(diagnostics.Resolved_under_condition_0.Format(condition)) } - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Exiting_conditional_exports.Format()) + if r.tracer != nil { + r.tracer.write(diagnostics.Exiting_conditional_exports.Format()) } return result - } else if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Failed_to_resolve_under_condition_0.Format(condition)) + } else if r.tracer != nil { + r.tracer.write(diagnostics.Failed_to_resolve_under_condition_0.Format(condition)) } } else { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Saw_non_matching_condition_0.Format(condition)) + if r.tracer != nil { + r.tracer.write(diagnostics.Saw_non_matching_condition_0.Format(condition)) } } } - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Exiting_conditional_exports.Format()) + if r.tracer != nil { + r.tracer.write(diagnostics.Exiting_conditional_exports.Format()) } return continueSearching() case packagejson.JSONValueTypeArray: if len(target.AsArray()) == 0 { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) + if r.tracer != nil { + r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) } return continueSearching() } @@ -739,14 +763,14 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio } case packagejson.JSONValueTypeNull: - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_package_json_scope_0_explicitly_maps_specifier_1_to_null.Format(scope.PackageDirectory, moduleName)) + if r.tracer != nil { + r.tracer.write(diagnostics.X_package_json_scope_0_explicitly_maps_specifier_1_to_null.Format(scope.PackageDirectory, moduleName)) } return continueSearching() } - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) + if r.tracer != nil { + r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) } return continueSearching() } @@ -865,8 +889,8 @@ func (r *resolutionState) loadModuleFromNearestNodeModulesDirectory(typesScopeOn secondaryExtensions := r.extensions & ^(extensionsTypeScript | extensionsDeclaration) // (1) if priorityExtensions != 0 { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0.Format(priorityExtensions.String())) + if r.tracer != nil { + r.tracer.write(diagnostics.Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0.Format(priorityExtensions.String())) } if result := r.loadModuleFromNearestNodeModulesDirectoryWorker(priorityExtensions, mode, typesScopeOnly); !result.shouldContinueSearching() { return result @@ -874,8 +898,8 @@ func (r *resolutionState) loadModuleFromNearestNodeModulesDirectory(typesScopeOn } // (2) if secondaryExtensions != 0 && !typesScopeOnly { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0.Format(secondaryExtensions.String())) + if r.tracer != nil { + r.tracer.write(diagnostics.Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0.Format(secondaryExtensions.String())) } return r.loadModuleFromNearestNodeModulesDirectoryWorker(secondaryExtensions, mode, typesScopeOnly) } @@ -900,8 +924,8 @@ func (r *resolutionState) loadModuleFromNearestNodeModulesDirectoryWorker(ext ex func (r *resolutionState) loadModuleFromImmediateNodeModulesDirectory(extensions extensions, directory string, typesScopeOnly bool) *resolved { nodeModulesFolder := tspath.CombinePaths(directory, "node_modules") nodeModulesFolderExists := r.resolver.host.FS().DirectoryExists(nodeModulesFolder) - if !nodeModulesFolderExists && r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(nodeModulesFolder)) + if !nodeModulesFolderExists && r.tracer != nil { + r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(nodeModulesFolder)) } if !typesScopeOnly { @@ -913,8 +937,8 @@ func (r *resolutionState) loadModuleFromImmediateNodeModulesDirectory(extensions if extensions&extensionsDeclaration != 0 { nodeModulesAtTypes := tspath.CombinePaths(nodeModulesFolder, "@types") nodeModulesAtTypesExists := nodeModulesFolderExists && r.resolver.host.FS().DirectoryExists(nodeModulesAtTypes) - if !nodeModulesAtTypesExists && r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(nodeModulesAtTypes)) + if !nodeModulesAtTypesExists && r.tracer != nil { + r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(nodeModulesAtTypes)) } return r.loadModuleFromSpecificNodeModulesDirectory(extensionsDeclaration, r.mangleScopedPackageName(r.name), nodeModulesAtTypes, nodeModulesAtTypesExists) } @@ -990,8 +1014,8 @@ func (r *resolutionState) loadModuleFromSpecificNodeModulesDirectory(ext extensi if rest != "" { versionPaths := packageInfo.Contents.GetVersionPaths(r.getTraceFunc()) if versionPaths.Exists() { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2.Format(versionPaths.Version, core.Version(), rest)) + if r.tracer != nil { + r.tracer.write(diagnostics.X_package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2.Format(versionPaths.Version, core.Version(), rest)) } packageDirectoryExists := nodeModulesDirectoryExists && r.resolver.host.FS().DirectoryExists(packageDirectory) pathPatterns := TryParsePatterns(versionPaths.GetPaths()) @@ -1086,8 +1110,8 @@ func (r *resolutionState) tryLoadModuleUsingOptionalResolutionSettings() *resolv func (r *resolutionState) tryLoadModuleUsingPathsIfEligible() *resolved { if r.compilerOptions.Paths.Size() > 0 && !tspath.PathIsRelative(r.name) { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0.Format(r.name)) + if r.tracer != nil { + r.tracer.write(diagnostics.X_paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0.Format(r.name)) } } else { return continueSearching() @@ -1110,14 +1134,14 @@ func (r *resolutionState) tryLoadModuleUsingPathsIfEligible() *resolved { func (r *resolutionState) tryLoadModuleUsingPaths(extensions extensions, moduleName string, containingDirectory string, paths *collections.OrderedMap[string, []string], pathPatterns *ParsedPatterns, loader resolutionKindSpecificLoader, onlyRecordFailures bool) *resolved { if matchedPattern := MatchPatternOrExact(pathPatterns, moduleName); matchedPattern.IsValid() { matchedStar := matchedPattern.MatchedText(moduleName) - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Module_name_0_matched_pattern_1.Format(moduleName, matchedPattern.Text)) + if r.tracer != nil { + r.tracer.write(diagnostics.Module_name_0_matched_pattern_1.Format(moduleName, matchedPattern.Text)) } for _, subst := range paths.GetOrZero(matchedPattern.Text) { path := strings.Replace(subst, "*", matchedStar, 1) candidate := tspath.NormalizePath(tspath.CombinePaths(containingDirectory, path)) - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Trying_substitution_0_candidate_module_location_Colon_1.Format(subst, path)) + if r.tracer != nil { + r.tracer.write(diagnostics.Trying_substitution_0_candidate_module_location_Colon_1.Format(subst, path)) } // A path mapping may have an extension if extension := tspath.TryGetExtensionFromPath(subst); extension != "" { @@ -1137,15 +1161,15 @@ func (r *resolutionState) tryLoadModuleUsingPaths(extensions extensions, moduleN } func (r *resolutionState) nodeLoadModuleByRelativeName(extensions extensions, candidate string, onlyRecordFailures bool, considerPackageJson bool) *resolved { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1.Format(candidate, extensions.String())) + if r.tracer != nil { + r.tracer.write(diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1.Format(candidate, extensions.String())) } if !tspath.HasTrailingDirectorySeparator(candidate) { if !onlyRecordFailures { parentOfCandidate := tspath.GetDirectoryPath(candidate) if !r.resolver.host.FS().DirectoryExists(parentOfCandidate) { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(parentOfCandidate)) + if r.tracer != nil { + r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(parentOfCandidate)) } onlyRecordFailures = true } @@ -1163,8 +1187,8 @@ func (r *resolutionState) nodeLoadModuleByRelativeName(extensions extensions, ca if !onlyRecordFailures { candidateExists := r.resolver.host.FS().DirectoryExists(candidate) if !candidateExists { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(candidate)) + if r.tracer != nil { + r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(candidate)) } onlyRecordFailures = true } @@ -1205,8 +1229,8 @@ func (r *resolutionState) loadModuleFromFileNoImplicitExtensions(extensions exte } extension := candidate[len(extensionless):] - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.File_name_0_has_a_1_extension_stripping_it.Format(candidate, extension)) + if r.tracer != nil { + r.tracer.write(diagnostics.File_name_0_has_a_1_extension_stripping_it.Format(candidate, extension)) } return r.tryAddingExtensions(extensionless, extensions, extension, onlyRecordFailures) } @@ -1359,12 +1383,12 @@ func (r *resolutionState) tryFile(fileName string, onlyRecordFailures bool) (str func (r *resolutionState) tryFileLookup(fileName string, onlyRecordFailures bool) bool { if !onlyRecordFailures { if r.resolver.host.FS().FileExists(fileName) { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.File_0_exists_use_it_as_a_name_resolution_result.Format(fileName)) + if r.tracer != nil { + r.tracer.write(diagnostics.File_0_exists_use_it_as_a_name_resolution_result.Format(fileName)) } return true - } else if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.File_0_does_not_exist.Format(fileName)) + } else if r.tracer != nil { + r.tracer.write(diagnostics.File_0_does_not_exist.Format(fileName)) } } r.failedLookupLocations = append(r.failedLookupLocations, fileName) @@ -1435,8 +1459,8 @@ func (r *resolutionState) loadNodeModuleFromDirectoryWorker(ext extensions, cand } else { moduleName = tspath.GetRelativePathFromDirectory(candidate, indexPath, tspath.ComparePathsOptions{}) } - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2.Format(versionPaths.Version, core.Version(), moduleName)) + if r.tracer != nil { + r.tracer.write(diagnostics.X_package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2.Format(versionPaths.Version, core.Version(), moduleName)) } pathPatterns := TryParsePatterns(versionPaths.GetPaths()) if result := r.tryLoadModuleUsingPaths(ext, moduleName, candidate, versionPaths.GetPaths(), pathPatterns, loader, onlyRecordFailuresForPackageFile); !result.shouldContinueSearching() { @@ -1523,8 +1547,8 @@ func (r *resolutionState) getPackageJsonInfo(packageDirectory string, onlyRecord if existing := r.resolver.packageJsonInfoCache.Get(packageJsonPath); existing != nil { if existing.Contents != nil { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.File_0_exists_according_to_earlier_cached_lookups.Format(packageJsonPath)) + if r.tracer != nil { + r.tracer.write(diagnostics.File_0_exists_according_to_earlier_cached_lookups.Format(packageJsonPath)) } r.affectingLocations = append(r.affectingLocations, packageJsonPath) if existing.PackageDirectory == packageDirectory { @@ -1537,8 +1561,8 @@ func (r *resolutionState) getPackageJsonInfo(packageDirectory string, onlyRecord Contents: existing.Contents, } } else { - if existing.DirectoryExists && r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups.Format(packageJsonPath)) + if existing.DirectoryExists && r.tracer != nil { + r.tracer.write(diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups.Format(packageJsonPath)) } r.failedLookupLocations = append(r.failedLookupLocations, packageJsonPath) return nil @@ -1550,8 +1574,8 @@ func (r *resolutionState) getPackageJsonInfo(packageDirectory string, onlyRecord // Ignore error contents, _ := r.resolver.host.FS().ReadFile(packageJsonPath) packageJsonContent, _ := packagejson.Parse([]byte(contents)) - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Found_package_json_at_0.Format(packageJsonPath)) + if r.tracer != nil { + r.tracer.write(diagnostics.Found_package_json_at_0.Format(packageJsonPath)) } result := &packagejson.InfoCacheEntry{ PackageDirectory: packageDirectory, @@ -1566,8 +1590,8 @@ func (r *resolutionState) getPackageJsonInfo(packageDirectory string, onlyRecord r.affectingLocations = append(r.affectingLocations, packageJsonPath) return result } else { - if directoryExists && r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.File_0_does_not_exist.Format(packageJsonPath)) + if directoryExists && r.tracer != nil { + r.tracer.write(diagnostics.File_0_does_not_exist.Format(packageJsonPath)) } if !r.resolver.packageJsonInfoCache.IsReadonly { r.resolver.packageJsonInfoCache.Set(packageJsonPath, &packagejson.InfoCacheEntry{ @@ -1607,8 +1631,8 @@ func (r *resolutionState) readPackageJsonPeerDependencies(packageJsonInfo *packa if !ok || len(peerDependencies.Value) == 0 { return "" } - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_package_json_has_a_peerDependencies_field.Message()) + if r.tracer != nil { + r.tracer.write(diagnostics.X_package_json_has_a_peerDependencies_field.Message()) } packageDirectory := r.realPath(packageJsonInfo.PackageDirectory) nodeModules := packageDirectory[:strings.LastIndex(packageDirectory, "/node_modules")+len("/node_modules")] + "/" @@ -1621,11 +1645,11 @@ func (r *resolutionState) readPackageJsonPeerDependencies(packageJsonInfo *packa builder.WriteString(name) builder.WriteString("@") builder.WriteString(version) - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Found_peerDependency_0_with_1_version.Format(name, version)) + if r.tracer != nil { + r.tracer.write(diagnostics.Found_peerDependency_0_with_1_version.Format(name, version)) } - } else if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Failed_to_find_peerDependency_0.Format(name)) + } else if r.tracer != nil { + r.tracer.write(diagnostics.Failed_to_find_peerDependency_0.Format(name)) } } return builder.String() @@ -1633,8 +1657,8 @@ func (r *resolutionState) readPackageJsonPeerDependencies(packageJsonInfo *packa func (r *resolutionState) realPath(path string) string { rp := tspath.NormalizePath(r.resolver.host.FS().Realpath(path)) - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Resolving_real_path_for_0_result_1.Format(path, rp)) + if r.tracer != nil { + r.tracer.write(diagnostics.Resolving_real_path_for_0_result_1.Format(path, rp)) } return rp } @@ -1644,12 +1668,12 @@ func (r *resolutionState) validatePackageJSONField(fieldName string, field packa if field.IsValid() { return true } - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2.Format(fieldName, field.ExpectedJSONType(), field.ActualJSONType())) + if r.tracer != nil { + r.tracer.write(diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2.Format(fieldName, field.ExpectedJSONType(), field.ActualJSONType())) } } - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_package_json_does_not_have_a_0_field.Format(fieldName)) + if r.tracer != nil { + r.tracer.write(diagnostics.X_package_json_does_not_have_a_0_field.Format(fieldName)) } return false } @@ -1659,14 +1683,14 @@ func (r *resolutionState) getPackageJSONPathField(fieldName string, field *packa return "", false } if field.Value == "" { - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_package_json_had_a_falsy_0_field.Format(fieldName)) + if r.tracer != nil { + r.tracer.write(diagnostics.X_package_json_had_a_falsy_0_field.Format(fieldName)) } return "", false } path := tspath.NormalizePath(tspath.CombinePaths(directory, field.Value)) - if r.resolver.traceEnabled() { - r.resolver.host.Trace(diagnostics.X_package_json_has_0_field_1_that_references_2.Format(fieldName, field.Value, path)) + if r.tracer != nil { + r.tracer.write(diagnostics.X_package_json_has_0_field_1_that_references_2.Format(fieldName, field.Value, path)) } return path, true } @@ -1688,8 +1712,8 @@ func (r *resolutionState) conditionMatches(condition string) bool { } func (r *resolutionState) getTraceFunc() func(string) { - if r.resolver.traceEnabled() { - return r.resolver.host.Trace + if r.tracer != nil { + return r.tracer.write } return nil } diff --git a/internal/module/resolver_test.go b/internal/module/resolver_test.go index 1c5456d635..eb777c8e33 100644 --- a/internal/module/resolver_test.go +++ b/internal/module/resolver_test.go @@ -265,7 +265,7 @@ func doCall(t *testing.T, resolver *module.Resolver, call functionCall, skipLoca errorMessageArgs := []any{call.args.Name, call.args.ContainingFile} if call.call == "resolveModuleName" { - resolved := resolver.ResolveModuleName(call.args.Name, call.args.ContainingFile, core.ModuleKind(call.args.ResolutionMode), redirectedReference) + resolved, _ := resolver.ResolveModuleName(call.args.Name, call.args.ContainingFile, core.ModuleKind(call.args.ResolutionMode), redirectedReference) assert.Check(t, resolved != nil, "ResolveModuleName should not return nil", errorMessageArgs) if expectedResolvedModule, ok := call.returnValue["resolvedModule"].(map[string]any); ok { assert.Check(t, resolved.IsResolved(), errorMessageArgs) @@ -277,7 +277,7 @@ func doCall(t *testing.T, resolver *module.Resolver, call functionCall, skipLoca assert.Check(t, !resolved.IsResolved(), errorMessageArgs) } } else { - resolved := resolver.ResolveTypeReferenceDirective(call.args.Name, call.args.ContainingFile, core.ModuleKind(call.args.ResolutionMode), redirectedReference) + resolved, _ := resolver.ResolveTypeReferenceDirective(call.args.Name, call.args.ContainingFile, core.ModuleKind(call.args.ResolutionMode), redirectedReference) assert.Check(t, resolved != nil, "ResolveTypeReferenceDirective should not return nil", errorMessageArgs) if expectedResolvedTypeReferenceDirective, ok := call.returnValue["resolvedTypeReferenceDirective"].(map[string]any); ok { assert.Check(t, resolved.IsResolved(), errorMessageArgs) diff --git a/internal/module/types.go b/internal/module/types.go index f3c78cc715..7dbc899f31 100644 --- a/internal/module/types.go +++ b/internal/module/types.go @@ -14,7 +14,6 @@ import ( type ResolutionHost interface { FS() vfs.FS GetCurrentDirectory() string - Trace(msg string) } type ModeAwareCacheKey struct { diff --git a/internal/project/ata.go b/internal/project/ata.go index c457a62b80..659bec2e99 100644 --- a/internal/project/ata.go +++ b/internal/project/ata.go @@ -565,7 +565,7 @@ func (ti *TypingsInstaller) ensureTypingsLocationExists(p *Project) { } func (ti *TypingsInstaller) typingToFileName(resolver *module.Resolver, packageName string) string { - result := resolver.ResolveModuleName(packageName, tspath.CombinePaths(ti.TypingsLocation, "index.d.ts"), core.ModuleKindNone, nil) + result, _ := resolver.ResolveModuleName(packageName, tspath.CombinePaths(ti.TypingsLocation, "index.d.ts"), core.ModuleKindNone, nil) return result.ResolvedFileName } diff --git a/internal/testrunner/compiler_runner.go b/internal/testrunner/compiler_runner.go index 9b1891d081..c145fd5dda 100644 --- a/internal/testrunner/compiler_runner.go +++ b/internal/testrunner/compiler_runner.go @@ -192,6 +192,7 @@ func (r *CompilerBaselineRunner) runSingleConfigTest(t *testing.T, testName stri compilerTest.verifySourceMapOutput(t, r.testSuitName, r.isSubmodule) compilerTest.verifySourceMapRecord(t, r.testSuitName, r.isSubmodule) compilerTest.verifyTypesAndSymbols(t, r.testSuitName, r.isSubmodule) + compilerTest.verifyModuleResolution(t, r.testSuitName, r.isSubmodule) // !!! Verify all baselines compilerTest.verifyUnionOrdering(t) @@ -510,6 +511,21 @@ func (c *compilerTest) verifyTypesAndSymbols(t *testing.T, suiteName string, isS ) } +func (c *compilerTest) verifyModuleResolution(t *testing.T, suiteName string, isSubmodule bool) { + if !c.options.TraceResolution.IsTrue() { + return + } + + t.Run("module resolution", func(t *testing.T) { + defer testutil.RecoverAndFail(t, "Panic on creating module resolution baseline for test "+c.filename) + tsbaseline.DoModuleResolutionBaseline(t, c.configuredName, c.result.Trace, baseline.Options{ + Subfolder: suiteName, + IsSubmodule: isSubmodule, + SkipDiffWithOld: true, + }) + }) +} + func createHarnessTestFile(unit *testUnit, currentDirectory string) *harnessutil.TestFile { return &harnessutil.TestFile{ UnitName: tspath.GetNormalizedAbsolutePath(unit.name, currentDirectory), diff --git a/internal/testutil/baseline/baseline.go b/internal/testutil/baseline/baseline.go index dcaa21e19d..372d0b0018 100644 --- a/internal/testutil/baseline/baseline.go +++ b/internal/testutil/baseline/baseline.go @@ -23,6 +23,7 @@ type Options struct { IsSubmodule bool IsSubmoduleAccepted bool DiffFixupOld func(string) string + SkipDiffWithOld bool } const NoContent = "" @@ -42,7 +43,7 @@ func Run(t *testing.T, fileName string, actual string, opts Options) { writeComparison(t, actual, localPath, referencePath, false) } - if !opts.IsSubmodule { + if !opts.IsSubmodule || opts.SkipDiffWithOld { // Not a submodule, no diffs. return } diff --git a/internal/testutil/harnessutil/harnessutil.go b/internal/testutil/harnessutil/harnessutil.go index 0d0db4dec9..e63992e113 100644 --- a/internal/testutil/harnessutil/harnessutil.go +++ b/internal/testutil/harnessutil/harnessutil.go @@ -221,6 +221,7 @@ func CompileFilesEx( Errors: errors, }, harnessOptions) result.Symlinks = symlinks + result.Trace = host.tracer.String() result.Repeat = func(testConfig TestConfiguration) *CompilationResult { newHarnessOptions := *harnessOptions newCompilerOptions := compilerOptions.Clone() @@ -460,6 +461,7 @@ func getOptionValue(t *testing.T, option *tsoptions.CommandLineOption, value str type cachedCompilerHost struct { compiler.CompilerHost + tracer *strings.Builder } var sourceFileCache collections.SyncMap[SourceFileCacheKey, *ast.SourceFile] @@ -500,9 +502,14 @@ func (h *cachedCompilerHost) GetSourceFile(opts ast.SourceFileParseOptions) *ast return result } -func createCompilerHost(fs vfs.FS, defaultLibraryPath string, currentDirectory string) compiler.CompilerHost { +func createCompilerHost(fs vfs.FS, defaultLibraryPath string, currentDirectory string) *cachedCompilerHost { + var tracer strings.Builder + trace := func(msg string) { + fmt.Fprintln(&tracer, msg) + } return &cachedCompilerHost{ - CompilerHost: compiler.NewCompilerHost(currentDirectory, fs, defaultLibraryPath, nil), + CompilerHost: compiler.NewCompilerHost(currentDirectory, fs, defaultLibraryPath, nil, trace), + tracer: &tracer, } } @@ -598,6 +605,7 @@ type CompilationResult struct { outputs []*TestFile inputs []*TestFile inputsAndOutputs collections.OrderedMap[string, *CompilationOutput] + Trace string } type CompilationOutput struct { diff --git a/internal/testutil/tsbaseline/module_resolution_baseline.go b/internal/testutil/tsbaseline/module_resolution_baseline.go new file mode 100644 index 0000000000..c2a4a74201 --- /dev/null +++ b/internal/testutil/tsbaseline/module_resolution_baseline.go @@ -0,0 +1,18 @@ +package tsbaseline + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/testutil/baseline" +) + +func DoModuleResolutionBaseline(t *testing.T, baselinePath string, trace string, opts baseline.Options) { + baselinePath = tsExtension.ReplaceAllString(baselinePath, ".trace.json") + var errorBaseline string + if trace != "" { + errorBaseline = trace + } else { + errorBaseline = baseline.NoContent + } + baseline.Run(t, baselinePath, errorBaseline, opts) +} diff --git a/testdata/baselines/reference/submodule/compiler/allowJsCrossMonorepoPackage.trace.json b/testdata/baselines/reference/submodule/compiler/allowJsCrossMonorepoPackage.trace.json new file mode 100644 index 0000000000..5ddc5147cd --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/allowJsCrossMonorepoPackage.trace.json @@ -0,0 +1,78 @@ +======== Resolving module 'shared' from '/packages/main/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Found 'package.json' at '/packages/main/package.json'. +Loading module 'shared' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/packages/main/node_modules/shared/package.json'. +Using 'exports' subpath '.' with target './index.js'. +File name '/packages/main/node_modules/shared/index.js' has a '.js' extension - stripping it. +File '/packages/main/node_modules/shared/index.ts' does not exist. +File '/packages/main/node_modules/shared/index.tsx' does not exist. +File '/packages/main/node_modules/shared/index.d.ts' does not exist. +Directory '/packages/main/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/packages/node_modules' does not exist, skipping all lookups in it. +Directory '/packages/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/shared.ts' does not exist. +File '/node_modules/shared.tsx' does not exist. +File '/node_modules/shared.d.ts' does not exist. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/packages/main/node_modules/shared/package.json' exists according to earlier cached lookups. +Using 'exports' subpath '.' with target './index.js'. +File name '/packages/main/node_modules/shared/index.js' has a '.js' extension - stripping it. +File '/packages/main/node_modules/shared/index.js' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/packages/main/node_modules/shared/index.js', result '/packages/shared/index.js'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/packages/main/package.json' exists according to earlier cached lookups. +Loading module 'shared' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/packages/main/node_modules/shared/package.json' exists according to earlier cached lookups. +File '/packages/main/node_modules/shared.ts' does not exist. +File '/packages/main/node_modules/shared.tsx' does not exist. +File '/packages/main/node_modules/shared.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' does not have a 'main' field. +File '/packages/main/node_modules/shared/index.ts' does not exist. +File '/packages/main/node_modules/shared/index.tsx' does not exist. +File '/packages/main/node_modules/shared/index.d.ts' does not exist. +Directory '/packages/main/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/packages/node_modules' does not exist, skipping all lookups in it. +Directory '/packages/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/shared.ts' does not exist. +File '/node_modules/shared.tsx' does not exist. +File '/node_modules/shared.d.ts' does not exist. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Module name 'shared' was successfully resolved to '/packages/shared/index.js' with Package ID 'shared@1.0.0'. ======== +======== Resolving module './utils.js' from '/packages/shared/index.js'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/packages/shared/utils.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/packages/shared/utils.js' has a '.js' extension - stripping it. +File '/packages/shared/utils.ts' does not exist. +File '/packages/shared/utils.tsx' does not exist. +File '/packages/shared/utils.d.ts' does not exist. +File '/packages/shared/utils.js' exists - use it as a name resolution result. +======== Module name './utils.js' was successfully resolved to '/packages/shared/utils.js'. ======== +======== Resolving module 'pkg' from '/packages/shared/utils.js'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Found 'package.json' at '/packages/shared/package.json'. +Loading module 'pkg' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/packages/shared/node_modules' does not exist, skipping all lookups in it. +Directory '/packages/shared/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/packages/node_modules' does not exist, skipping all lookups in it. +Directory '/packages/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/pkg/package.json' does not exist. +File '/node_modules/pkg.ts' does not exist. +File '/node_modules/pkg.tsx' does not exist. +File '/node_modules/pkg.d.ts' does not exist. +File '/node_modules/pkg/index.ts' does not exist. +File '/node_modules/pkg/index.tsx' does not exist. +File '/node_modules/pkg/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/pkg/index.d.ts', result '/node_modules/pkg/index.d.ts'. +======== Module name 'pkg' was successfully resolved to '/node_modules/pkg/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/cachedModuleResolution1.trace.json b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution1.trace.json new file mode 100644 index 0000000000..a28869c97b --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution1.trace.json @@ -0,0 +1,38 @@ +======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/d/e/package.json' does not exist. +File '/a/b/c/d/package.json' does not exist. +File '/a/b/c/package.json' does not exist according to earlier cached lookups. +File '/a/b/package.json' does not exist according to earlier cached lookups. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/e/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +File '/a/b/node_modules/foo.ts' does not exist. +File '/a/b/node_modules/foo.tsx' does not exist. +File '/a/b/node_modules/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/a/b/node_modules/foo.d.ts', result '/a/b/node_modules/foo.d.ts'. +======== Module name 'foo' was successfully resolved to '/a/b/node_modules/foo.d.ts'. ======== +======== Resolving module 'foo' from '/a/b/c/lib.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/package.json' does not exist. +File '/a/b/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +File '/a/b/node_modules/foo.ts' does not exist. +File '/a/b/node_modules/foo.tsx' does not exist. +File '/a/b/node_modules/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/a/b/node_modules/foo.d.ts', result '/a/b/node_modules/foo.d.ts'. +======== Module name 'foo' was successfully resolved to '/a/b/node_modules/foo.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/cachedModuleResolution2.trace.json b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution2.trace.json new file mode 100644 index 0000000000..83f20ce293 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution2.trace.json @@ -0,0 +1,38 @@ +======== Resolving module 'foo' from '/a/b/c/lib.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/package.json' does not exist according to earlier cached lookups. +File '/a/b/package.json' does not exist according to earlier cached lookups. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +File '/a/b/node_modules/foo.ts' does not exist. +File '/a/b/node_modules/foo.tsx' does not exist. +File '/a/b/node_modules/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/a/b/node_modules/foo.d.ts', result '/a/b/node_modules/foo.d.ts'. +======== Module name 'foo' was successfully resolved to '/a/b/node_modules/foo.d.ts'. ======== +======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/d/e/package.json' does not exist. +File '/a/b/c/d/package.json' does not exist. +File '/a/b/c/package.json' does not exist. +File '/a/b/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/e/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +File '/a/b/node_modules/foo.ts' does not exist. +File '/a/b/node_modules/foo.tsx' does not exist. +File '/a/b/node_modules/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/a/b/node_modules/foo.d.ts', result '/a/b/node_modules/foo.d.ts'. +======== Module name 'foo' was successfully resolved to '/a/b/node_modules/foo.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/cachedModuleResolution3.trace.json b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution3.trace.json new file mode 100644 index 0000000000..cf2d0cfbaa --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution3.trace.json @@ -0,0 +1,54 @@ +======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/d/e/package.json' does not exist. +File '/a/b/c/d/package.json' does not exist. +File '/a/b/c/package.json' does not exist according to earlier cached lookups. +File '/a/b/package.json' does not exist according to earlier cached lookups. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/e/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'foo' was not resolved. ======== +======== Resolving module 'foo' from '/a/b/c/lib.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/package.json' does not exist. +File '/a/b/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'foo' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/cachedModuleResolution4.trace.json b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution4.trace.json new file mode 100644 index 0000000000..ce95b62ea7 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution4.trace.json @@ -0,0 +1,54 @@ +======== Resolving module 'foo' from '/a/b/c/lib.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/package.json' does not exist according to earlier cached lookups. +File '/a/b/package.json' does not exist according to earlier cached lookups. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'foo' was not resolved. ======== +======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/d/e/package.json' does not exist. +File '/a/b/c/d/package.json' does not exist. +File '/a/b/c/package.json' does not exist. +File '/a/b/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/e/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'foo' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/cachedModuleResolution5.trace.json b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution5.trace.json new file mode 100644 index 0000000000..e05c3cf00d --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution5.trace.json @@ -0,0 +1,35 @@ +======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/d/e/package.json' does not exist. +File '/a/b/c/d/package.json' does not exist. +File '/a/b/c/package.json' does not exist. +File '/a/b/package.json' does not exist according to earlier cached lookups. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/e/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +File '/a/b/node_modules/foo.ts' does not exist. +File '/a/b/node_modules/foo.tsx' does not exist. +File '/a/b/node_modules/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/a/b/node_modules/foo.d.ts', result '/a/b/node_modules/foo.d.ts'. +======== Module name 'foo' was successfully resolved to '/a/b/node_modules/foo.d.ts'. ======== +======== Resolving module 'foo' from '/a/b/lib.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/a/b/node_modules/foo.ts' does not exist. +File '/a/b/node_modules/foo.tsx' does not exist. +File '/a/b/node_modules/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/a/b/node_modules/foo.d.ts', result '/a/b/node_modules/foo.d.ts'. +======== Module name 'foo' was successfully resolved to '/a/b/node_modules/foo.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/cachedModuleResolution6.trace.json b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution6.trace.json new file mode 100644 index 0000000000..cf2d0cfbaa --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution6.trace.json @@ -0,0 +1,54 @@ +======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/d/e/package.json' does not exist. +File '/a/b/c/d/package.json' does not exist. +File '/a/b/c/package.json' does not exist according to earlier cached lookups. +File '/a/b/package.json' does not exist according to earlier cached lookups. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/e/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'foo' was not resolved. ======== +======== Resolving module 'foo' from '/a/b/c/lib.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/package.json' does not exist. +File '/a/b/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'foo' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/cachedModuleResolution7.trace.json b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution7.trace.json new file mode 100644 index 0000000000..ce95b62ea7 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution7.trace.json @@ -0,0 +1,54 @@ +======== Resolving module 'foo' from '/a/b/c/lib.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/package.json' does not exist according to earlier cached lookups. +File '/a/b/package.json' does not exist according to earlier cached lookups. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'foo' was not resolved. ======== +======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/d/e/package.json' does not exist. +File '/a/b/c/d/package.json' does not exist. +File '/a/b/c/package.json' does not exist. +File '/a/b/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/e/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'foo' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/cachedModuleResolution8.trace.json b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution8.trace.json new file mode 100644 index 0000000000..cf2d0cfbaa --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution8.trace.json @@ -0,0 +1,54 @@ +======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/d/e/package.json' does not exist. +File '/a/b/c/d/package.json' does not exist. +File '/a/b/c/package.json' does not exist according to earlier cached lookups. +File '/a/b/package.json' does not exist according to earlier cached lookups. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/e/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'foo' was not resolved. ======== +======== Resolving module 'foo' from '/a/b/c/lib.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/package.json' does not exist. +File '/a/b/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'foo' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/cachedModuleResolution9.trace.json b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution9.trace.json new file mode 100644 index 0000000000..ce95b62ea7 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/cachedModuleResolution9.trace.json @@ -0,0 +1,54 @@ +======== Resolving module 'foo' from '/a/b/c/lib.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/package.json' does not exist according to earlier cached lookups. +File '/a/b/package.json' does not exist according to earlier cached lookups. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'foo' was not resolved. ======== +======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/c/d/e/package.json' does not exist. +File '/a/b/c/d/package.json' does not exist. +File '/a/b/c/package.json' does not exist. +File '/a/b/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/e/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'foo' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/duplicatePackage_relativeImportWithinPackage.trace.json b/testdata/baselines/reference/submodule/compiler/duplicatePackage_relativeImportWithinPackage.trace.json new file mode 100644 index 0000000000..da9dd1306f --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/duplicatePackage_relativeImportWithinPackage.trace.json @@ -0,0 +1,61 @@ +======== Resolving module 'foo/use' from '/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'foo/use' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/foo/package.json'. +'package.json' does not have a 'typesVersions' field. +File '/node_modules/foo/use.ts' does not exist. +File '/node_modules/foo/use.tsx' does not exist. +File '/node_modules/foo/use.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/foo/use.d.ts', result '/node_modules/foo/use.d.ts'. +======== Module name 'foo/use' was successfully resolved to '/node_modules/foo/use.d.ts' with Package ID 'foo@1.2.3'. ======== +======== Resolving module 'a' from '/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'a' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/a/package.json' does not exist. +File '/node_modules/a.ts' does not exist. +File '/node_modules/a.tsx' does not exist. +File '/node_modules/a.d.ts' does not exist. +File '/node_modules/a/index.ts' does not exist. +File '/node_modules/a/index.tsx' does not exist. +File '/node_modules/a/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/a/index.d.ts', result '/node_modules/a/index.d.ts'. +======== Module name 'a' was successfully resolved to '/node_modules/a/index.d.ts'. ======== +======== Resolving module './index' from '/node_modules/foo/use.d.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/node_modules/foo/index', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/node_modules/foo/index.ts' does not exist. +File '/node_modules/foo/index.tsx' does not exist. +File '/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +File '/node_modules/foo/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'peerDependencies' field. +======== Module name './index' was successfully resolved to '/node_modules/foo/index.d.ts' with Package ID 'foo@1.2.3'. ======== +======== Resolving module 'foo' from '/node_modules/a/index.d.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/node_modules/a/package.json' does not exist according to earlier cached lookups. +File '/node_modules/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/a/node_modules/foo/package.json'. +File '/node_modules/a/node_modules/foo.ts' does not exist. +File '/node_modules/a/node_modules/foo.tsx' does not exist. +File '/node_modules/a/node_modules/foo.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' does not have a 'main' field. +File '/node_modules/a/node_modules/foo/index.ts' does not exist. +File '/node_modules/a/node_modules/foo/index.tsx' does not exist. +File '/node_modules/a/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/a/node_modules/foo/index.d.ts', result '/node_modules/a/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/node_modules/a/node_modules/foo/index.d.ts' with Package ID 'foo@1.2.3'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/duplicatePackage_relativeImportWithinPackage_scoped.trace.json b/testdata/baselines/reference/submodule/compiler/duplicatePackage_relativeImportWithinPackage_scoped.trace.json new file mode 100644 index 0000000000..c6dc4bf056 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/duplicatePackage_relativeImportWithinPackage_scoped.trace.json @@ -0,0 +1,61 @@ +======== Resolving module '@foo/bar/use' from '/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module '@foo/bar/use' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/@foo/bar/package.json'. +'package.json' does not have a 'typesVersions' field. +File '/node_modules/@foo/bar/use.ts' does not exist. +File '/node_modules/@foo/bar/use.tsx' does not exist. +File '/node_modules/@foo/bar/use.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/@foo/bar/use.d.ts', result '/node_modules/@foo/bar/use.d.ts'. +======== Module name '@foo/bar/use' was successfully resolved to '/node_modules/@foo/bar/use.d.ts' with Package ID '@foo/bar@1.2.3'. ======== +======== Resolving module 'a' from '/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'a' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/a/package.json' does not exist. +File '/node_modules/a.ts' does not exist. +File '/node_modules/a.tsx' does not exist. +File '/node_modules/a.d.ts' does not exist. +File '/node_modules/a/index.ts' does not exist. +File '/node_modules/a/index.tsx' does not exist. +File '/node_modules/a/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/a/index.d.ts', result '/node_modules/a/index.d.ts'. +======== Module name 'a' was successfully resolved to '/node_modules/a/index.d.ts'. ======== +======== Resolving module './index' from '/node_modules/@foo/bar/use.d.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/node_modules/@foo/bar/index', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/node_modules/@foo/bar/index.ts' does not exist. +File '/node_modules/@foo/bar/index.tsx' does not exist. +File '/node_modules/@foo/bar/index.d.ts' exists - use it as a name resolution result. +File '/node_modules/@foo/bar/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'peerDependencies' field. +======== Module name './index' was successfully resolved to '/node_modules/@foo/bar/index.d.ts' with Package ID '@foo/bar@1.2.3'. ======== +======== Resolving module '@foo/bar' from '/node_modules/a/index.d.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/node_modules/a/package.json' does not exist according to earlier cached lookups. +File '/node_modules/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@foo/bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/a/node_modules/@foo/bar/package.json'. +File '/node_modules/a/node_modules/@foo/bar.ts' does not exist. +File '/node_modules/a/node_modules/@foo/bar.tsx' does not exist. +File '/node_modules/a/node_modules/@foo/bar.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' does not have a 'main' field. +File '/node_modules/a/node_modules/@foo/bar/index.ts' does not exist. +File '/node_modules/a/node_modules/@foo/bar/index.tsx' does not exist. +File '/node_modules/a/node_modules/@foo/bar/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/a/node_modules/@foo/bar/index.d.ts', result '/node_modules/a/node_modules/@foo/bar/index.d.ts'. +======== Module name '@foo/bar' was successfully resolved to '/node_modules/a/node_modules/@foo/bar/index.d.ts' with Package ID '@foo/bar@1.2.3'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/importWithTrailingSlash.trace.json b/testdata/baselines/reference/submodule/compiler/importWithTrailingSlash.trace.json new file mode 100644 index 0000000000..d6bbd94cff --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/importWithTrailingSlash.trace.json @@ -0,0 +1,28 @@ +======== Resolving module '.' from '/a/test.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/a/', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/a/index.ts' exists - use it as a name resolution result. +======== Module name '.' was successfully resolved to '/a/index.ts'. ======== +======== Resolving module './' from '/a/test.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/a/', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/a/index.ts' exists - use it as a name resolution result. +======== Module name './' was successfully resolved to '/a/index.ts'. ======== +======== Resolving module '..' from '/a/b/test.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/a/', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/a/package.json' does not exist. +File '/a/index.ts' exists - use it as a name resolution result. +======== Module name '..' was successfully resolved to '/a/index.ts'. ======== +======== Resolving module '../' from '/a/b/test.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/a/', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/a/index.ts' exists - use it as a name resolution result. +======== Module name '../' was successfully resolved to '/a/index.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/importWithTrailingSlash_noResolve.trace.json b/testdata/baselines/reference/submodule/compiler/importWithTrailingSlash_noResolve.trace.json new file mode 100644 index 0000000000..86124dfb52 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/importWithTrailingSlash_noResolve.trace.json @@ -0,0 +1,6 @@ +======== Resolving module './foo/' from '/a.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/foo/', target file types: TypeScript, JavaScript, Declaration, JSON. +Directory '/foo/' does not exist, skipping all lookups in it. +======== Module name './foo/' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/libTypeScriptOverrideSimple.trace.json b/testdata/baselines/reference/submodule/compiler/libTypeScriptOverrideSimple.trace.json new file mode 100644 index 0000000000..b6e01e49bd --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/libTypeScriptOverrideSimple.trace.json @@ -0,0 +1,19 @@ +======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/.src/node_modules' does not exist, skipping all lookups in it. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-dom' +File '/node_modules/@typescript/lib-dom/package.json' does not exist. +File '/node_modules/@typescript/lib-dom.ts' does not exist. +File '/node_modules/@typescript/lib-dom.tsx' does not exist. +File '/node_modules/@typescript/lib-dom.d.ts' does not exist. +File '/node_modules/@typescript/lib-dom/index.ts' does not exist. +File '/node_modules/@typescript/lib-dom/index.tsx' does not exist. +File '/node_modules/@typescript/lib-dom/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@typescript/lib-dom/index.d.ts', result '/node_modules/@typescript/lib-dom/index.d.ts'. +======== Module name '@typescript/lib-dom' was successfully resolved to '/node_modules/@typescript/lib-dom/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/libTypeScriptOverrideSimpleConfig.trace.json b/testdata/baselines/reference/submodule/compiler/libTypeScriptOverrideSimpleConfig.trace.json new file mode 100644 index 0000000000..baff5c90f6 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/libTypeScriptOverrideSimpleConfig.trace.json @@ -0,0 +1,16 @@ +======== Resolving module '@typescript/lib-dom' from '/somepath/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/somepath/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/somepath/node_modules/@typescript/lib-dom/package.json' does not exist. +File '/somepath/node_modules/@typescript/lib-dom.ts' does not exist. +File '/somepath/node_modules/@typescript/lib-dom.tsx' does not exist. +File '/somepath/node_modules/@typescript/lib-dom.d.ts' does not exist. +File '/somepath/node_modules/@typescript/lib-dom/index.ts' does not exist. +File '/somepath/node_modules/@typescript/lib-dom/index.tsx' does not exist. +File '/somepath/node_modules/@typescript/lib-dom/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/somepath/node_modules/@typescript/lib-dom/index.d.ts', result '/somepath/node_modules/@typescript/lib-dom/index.d.ts'. +======== Module name '@typescript/lib-dom' was successfully resolved to '/somepath/node_modules/@typescript/lib-dom/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/libTypeScriptSubfileResolving.trace.json b/testdata/baselines/reference/submodule/compiler/libTypeScriptSubfileResolving.trace.json new file mode 100644 index 0000000000..379a5108ef --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/libTypeScriptSubfileResolving.trace.json @@ -0,0 +1,35 @@ +======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/.src/node_modules' does not exist, skipping all lookups in it. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-dom' +File '/node_modules/@typescript/lib-dom/package.json' does not exist. +File '/node_modules/@typescript/lib-dom.ts' does not exist. +File '/node_modules/@typescript/lib-dom.tsx' does not exist. +File '/node_modules/@typescript/lib-dom.d.ts' does not exist. +File '/node_modules/@typescript/lib-dom/index.ts' does not exist. +File '/node_modules/@typescript/lib-dom/index.tsx' does not exist. +File '/node_modules/@typescript/lib-dom/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@typescript/lib-dom/index.d.ts', result '/node_modules/@typescript/lib-dom/index.d.ts'. +======== Module name '@typescript/lib-dom' was successfully resolved to '/node_modules/@typescript/lib-dom/index.d.ts'. ======== +======== Resolving module '@typescript/lib-dom/iterable' from '/.src/__lib_node_modules_lookup_lib.dom.iterable.d.ts__.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@typescript/lib-dom/iterable' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/.src/node_modules' does not exist, skipping all lookups in it. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-dom/iterable' +File '/node_modules/@typescript/lib-dom/package.json' does not exist according to earlier cached lookups. +File '/node_modules/@typescript/lib-dom/iterable.ts' does not exist. +File '/node_modules/@typescript/lib-dom/iterable.tsx' does not exist. +File '/node_modules/@typescript/lib-dom/iterable.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@typescript/lib-dom/iterable.d.ts', result '/node_modules/@typescript/lib-dom/iterable.d.ts'. +======== Module name '@typescript/lib-dom/iterable' was successfully resolved to '/node_modules/@typescript/lib-dom/iterable.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/libTypeScriptSubfileResolvingConfig.trace.json b/testdata/baselines/reference/submodule/compiler/libTypeScriptSubfileResolvingConfig.trace.json new file mode 100644 index 0000000000..e0a53d77b0 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/libTypeScriptSubfileResolvingConfig.trace.json @@ -0,0 +1,29 @@ +======== Resolving module '@typescript/lib-dom' from '/somepath/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/somepath/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/somepath/node_modules/@typescript/lib-dom/package.json' does not exist. +File '/somepath/node_modules/@typescript/lib-dom.ts' does not exist. +File '/somepath/node_modules/@typescript/lib-dom.tsx' does not exist. +File '/somepath/node_modules/@typescript/lib-dom.d.ts' does not exist. +File '/somepath/node_modules/@typescript/lib-dom/index.ts' does not exist. +File '/somepath/node_modules/@typescript/lib-dom/index.tsx' does not exist. +File '/somepath/node_modules/@typescript/lib-dom/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/somepath/node_modules/@typescript/lib-dom/index.d.ts', result '/somepath/node_modules/@typescript/lib-dom/index.d.ts'. +======== Module name '@typescript/lib-dom' was successfully resolved to '/somepath/node_modules/@typescript/lib-dom/index.d.ts'. ======== +======== Resolving module '@typescript/lib-dom/iterable' from '/somepath/__lib_node_modules_lookup_lib.dom.iterable.d.ts__.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/somepath/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@typescript/lib-dom/iterable' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/somepath/node_modules/@typescript/lib-dom/package.json' does not exist according to earlier cached lookups. +File '/somepath/node_modules/@typescript/lib-dom/iterable.ts' does not exist. +File '/somepath/node_modules/@typescript/lib-dom/iterable.tsx' does not exist. +File '/somepath/node_modules/@typescript/lib-dom/iterable.d.ts' exists - use it as a name resolution result. +Resolving real path for '/somepath/node_modules/@typescript/lib-dom/iterable.d.ts', result '/somepath/node_modules/@typescript/lib-dom/iterable.d.ts'. +======== Module name '@typescript/lib-dom/iterable' was successfully resolved to '/somepath/node_modules/@typescript/lib-dom/iterable.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.trace.json b/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.trace.json new file mode 100644 index 0000000000..00b638eedf --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.trace.json @@ -0,0 +1,21 @@ +======== Resolving module 'shortid' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'shortid' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/shortid/package.json' does not exist. +File '/node_modules/shortid.ts' does not exist. +File '/node_modules/shortid.tsx' does not exist. +File '/node_modules/shortid.d.ts' does not exist. +File '/node_modules/shortid/index.ts' does not exist. +File '/node_modules/shortid/index.tsx' does not exist. +File '/node_modules/shortid/index.d.ts' does not exist. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/node_modules/shortid/package.json' does not exist according to earlier cached lookups. +File '/node_modules/shortid.js' does not exist. +File '/node_modules/shortid.jsx' does not exist. +File '/node_modules/shortid/index.js' exists - use it as a name resolution result. +Resolving real path for '/node_modules/shortid/index.js', result '/node_modules/shortid/index.js'. +======== Module name 'shortid' was successfully resolved to '/node_modules/shortid/index.js'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/modulePreserve2.trace.json b/testdata/baselines/reference/submodule/compiler/modulePreserve2.trace.json new file mode 100644 index 0000000000..fdcda0f245 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/modulePreserve2.trace.json @@ -0,0 +1,36 @@ +======== Resolving module 'dep' from '/main.js'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist. +Loading module 'dep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/dep/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './import.mjs'. +File name '/node_modules/dep/import.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/dep/import.mts' does not exist. +File '/node_modules/dep/import.d.mts' exists - use it as a name resolution result. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/node_modules/dep/import.d.mts', result '/node_modules/dep/import.d.mts'. +======== Module name 'dep' was successfully resolved to '/node_modules/dep/import.d.mts'. ======== +======== Resolving module 'dep' from '/main.js'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'dep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/dep/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'import'. +Matched 'exports' condition 'require'. +Using 'exports' subpath '.' with target './require.js'. +File name '/node_modules/dep/require.js' has a '.js' extension - stripping it. +File '/node_modules/dep/require.ts' does not exist. +File '/node_modules/dep/require.tsx' does not exist. +File '/node_modules/dep/require.d.ts' exists - use it as a name resolution result. +Resolved under condition 'require'. +Exiting conditional exports. +Resolving real path for '/node_modules/dep/require.d.ts', result '/node_modules/dep/require.d.ts'. +======== Module name 'dep' was successfully resolved to '/node_modules/dep/require.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/modulePreserve3.trace.json b/testdata/baselines/reference/submodule/compiler/modulePreserve3.trace.json new file mode 100644 index 0000000000..baaaff51cd --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/modulePreserve3.trace.json @@ -0,0 +1,24 @@ +======== Resolving module 'react/jsx-runtime' from '/index.tsx'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist. +Loading module 'react/jsx-runtime' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/@types/react/package.json' does not exist according to earlier cached lookups. +File '/node_modules/@types/react/jsx-runtime.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/react/jsx-runtime.d.ts', result '/node_modules/@types/react/jsx-runtime.d.ts'. +======== Module name 'react/jsx-runtime' was successfully resolved to '/node_modules/@types/react/jsx-runtime.d.ts'. ======== +======== Resolving type reference directive 'react', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/@types/react/package.json' does not exist. +File '/node_modules/@types/react/index.d.ts' does not exist. +Looking up in 'node_modules' folder, initial location '/.src'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/.src/node_modules' does not exist, skipping all lookups in it. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/react.d.ts' does not exist. +File '/node_modules/@types/react/package.json' does not exist according to earlier cached lookups. +File '/node_modules/@types/react.d.ts' does not exist. +File '/node_modules/@types/react/index.d.ts' does not exist. +======== Type reference directive 'react' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionAsTypeReferenceDirective.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionAsTypeReferenceDirective.trace.json new file mode 100644 index 0000000000..1014303d44 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionAsTypeReferenceDirective.trace.json @@ -0,0 +1,11 @@ +======== Resolving module 'phaser' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'phaser' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'phaser' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionAsTypeReferenceDirectiveAmbient.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionAsTypeReferenceDirectiveAmbient.trace.json new file mode 100644 index 0000000000..1014303d44 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionAsTypeReferenceDirectiveAmbient.trace.json @@ -0,0 +1,11 @@ +======== Resolving module 'phaser' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'phaser' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'phaser' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionAsTypeReferenceDirectiveScoped.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionAsTypeReferenceDirectiveScoped.trace.json new file mode 100644 index 0000000000..2b59104e4c --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionAsTypeReferenceDirectiveScoped.trace.json @@ -0,0 +1,72 @@ +======== Resolving module '@scoped/typescache' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module '@scoped/typescache' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'scoped__typescache' +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name '@scoped/typescache' was not resolved. ======== +======== Resolving module '@mangled/typescache' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@mangled/typescache' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'mangled__typescache' +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name '@mangled/typescache' was not resolved. ======== +======== Resolving module '@scoped/nodemodulescache' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@scoped/nodemodulescache' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'scoped__nodemodulescache' +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name '@scoped/nodemodulescache' was not resolved. ======== +======== Resolving module '@mangled/nodemodulescache' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@mangled/nodemodulescache' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'mangled__nodemodulescache' +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name '@mangled/nodemodulescache' was not resolved. ======== +======== Resolving module '@scoped/attypescache' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@scoped/attypescache' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'scoped__attypescache' +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name '@scoped/attypescache' was not resolved. ======== +======== Resolving module '@mangled/attypescache' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@mangled/attypescache' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'mangled__attypescache' +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name '@mangled/attypescache' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionPackageIdWithRelativeAndAbsolutePath.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionPackageIdWithRelativeAndAbsolutePath.trace.json new file mode 100644 index 0000000000..bedfe22207 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionPackageIdWithRelativeAndAbsolutePath.trace.json @@ -0,0 +1,80 @@ +======== Resolving module 'anotherLib' from '/project/src/app.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'anotherLib'. +File '/project/src/package.json' does not exist. +File '/project/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'anotherLib' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/project/src/node_modules' does not exist, skipping all lookups in it. +Directory '/project/src/node_modules/@types' does not exist, skipping all lookups in it. +File '/project/node_modules/anotherLib/package.json' does not exist. +File '/project/node_modules/anotherLib.ts' does not exist. +File '/project/node_modules/anotherLib.tsx' does not exist. +File '/project/node_modules/anotherLib.d.ts' does not exist. +File '/project/node_modules/anotherLib/index.ts' does not exist. +File '/project/node_modules/anotherLib/index.tsx' does not exist. +File '/project/node_modules/anotherLib/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/project/node_modules/anotherLib/index.d.ts', result '/project/node_modules/anotherLib/index.d.ts'. +======== Module name 'anotherLib' was successfully resolved to '/project/node_modules/anotherLib/index.d.ts'. ======== +======== Resolving module '@shared/lib/app' from '/project/src/app.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '@shared/lib/app'. +Module name '@shared/lib/app', matched pattern '@shared/*'. +Trying substitution '../shared/*', candidate module location: '../shared/lib/app'. +Loading module as file / folder, candidate module location '/shared/lib/app', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/shared/lib/app.ts' does not exist. +File '/shared/lib/app.tsx' does not exist. +File '/shared/lib/app.d.ts' exists - use it as a name resolution result. +======== Module name '@shared/lib/app' was successfully resolved to '/shared/lib/app.d.ts'. ======== +======== Resolving module 'troublesome-lib/lib/Compactable' from '/project/node_modules/anotherLib/index.d.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'troublesome-lib/lib/Compactable'. +File '/project/node_modules/anotherLib/package.json' does not exist according to earlier cached lookups. +File '/project/node_modules/package.json' does not exist according to earlier cached lookups. +File '/project/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'troublesome-lib/lib/Compactable' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/project/node_modules/anotherLib/node_modules' does not exist, skipping all lookups in it. +Directory '/project/node_modules/anotherLib/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/project/node_modules/troublesome-lib/package.json'. +'package.json' does not have a 'typesVersions' field. +File '/project/node_modules/troublesome-lib/lib/Compactable.ts' does not exist. +File '/project/node_modules/troublesome-lib/lib/Compactable.tsx' does not exist. +File '/project/node_modules/troublesome-lib/lib/Compactable.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/project/node_modules/troublesome-lib/lib/Compactable.d.ts', result '/project/node_modules/troublesome-lib/lib/Compactable.d.ts'. +======== Module name 'troublesome-lib/lib/Compactable' was successfully resolved to '/project/node_modules/troublesome-lib/lib/Compactable.d.ts' with Package ID 'troublesome-lib@1.17.1'. ======== +======== Resolving module './Option' from '/project/node_modules/troublesome-lib/lib/Compactable.d.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/project/node_modules/troublesome-lib/lib/Option', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/node_modules/troublesome-lib/lib/Option.ts' does not exist. +File '/project/node_modules/troublesome-lib/lib/Option.tsx' does not exist. +File '/project/node_modules/troublesome-lib/lib/Option.d.ts' exists - use it as a name resolution result. +File '/project/node_modules/troublesome-lib/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'peerDependencies' field. +======== Module name './Option' was successfully resolved to '/project/node_modules/troublesome-lib/lib/Option.d.ts' with Package ID 'troublesome-lib@1.17.1'. ======== +======== Resolving module 'troublesome-lib/lib/Option' from '/shared/lib/app.d.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'troublesome-lib/lib/Option'. +File '/shared/lib/package.json' does not exist. +File '/shared/package.json' does not exist. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'troublesome-lib/lib/Option' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/shared/lib/node_modules' does not exist, skipping all lookups in it. +Directory '/shared/lib/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/shared/node_modules/troublesome-lib/package.json'. +'package.json' does not have a 'typesVersions' field. +File '/shared/node_modules/troublesome-lib/lib/Option.ts' does not exist. +File '/shared/node_modules/troublesome-lib/lib/Option.tsx' does not exist. +File '/shared/node_modules/troublesome-lib/lib/Option.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/shared/node_modules/troublesome-lib/lib/Option.d.ts', result '/shared/node_modules/troublesome-lib/lib/Option.d.ts'. +======== Module name 'troublesome-lib/lib/Option' was successfully resolved to '/shared/node_modules/troublesome-lib/lib/Option.d.ts' with Package ID 'troublesome-lib@1.17.1'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported.trace.json new file mode 100644 index 0000000000..31c2c229d2 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported.trace.json @@ -0,0 +1,26 @@ +======== Resolving module './tsx' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/tsx', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/tsx.ts' does not exist. +File '/tsx.tsx' exists - use it as a name resolution result. +======== Module name './tsx' was successfully resolved to '/tsx.tsx'. ======== +======== Resolving module './jsx' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/jsx', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/jsx.ts' does not exist. +File '/jsx.tsx' does not exist. +File '/jsx.d.ts' does not exist. +File '/jsx.js' does not exist. +File '/jsx.jsx' exists - use it as a name resolution result. +======== Module name './jsx' was successfully resolved to '/jsx.jsx'. ======== +======== Resolving module './js' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/js', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/js.ts' does not exist. +File '/js.tsx' does not exist. +File '/js.d.ts' does not exist. +File '/js.js' exists - use it as a name resolution result. +======== Module name './js' was successfully resolved to '/js.js'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.trace.json new file mode 100644 index 0000000000..e200b3fbe2 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.trace.json @@ -0,0 +1,10 @@ +======== Resolving module './jsx' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/jsx', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/jsx.ts' does not exist. +File '/jsx.tsx' does not exist. +File '/jsx.d.ts' does not exist. +File '/jsx.js' does not exist. +File '/jsx.jsx' exists - use it as a name resolution result. +======== Module name './jsx' was successfully resolved to '/jsx.jsx'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported3.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported3.trace.json new file mode 100644 index 0000000000..e200b3fbe2 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported3.trace.json @@ -0,0 +1,10 @@ +======== Resolving module './jsx' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/jsx', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/jsx.ts' does not exist. +File '/jsx.tsx' does not exist. +File '/jsx.d.ts' does not exist. +File '/jsx.js' does not exist. +File '/jsx.jsx' exists - use it as a name resolution result. +======== Module name './jsx' was successfully resolved to '/jsx.jsx'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_unexpected.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_unexpected.trace.json new file mode 100644 index 0000000000..0f988ca942 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_unexpected.trace.json @@ -0,0 +1,45 @@ +======== Resolving module 'normalize.css' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'normalize.css' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/normalize.css/package.json'. +File name '/node_modules/normalize.css' has a '.css' extension - stripping it. +File '/node_modules/normalize.d.css.ts' does not exist. +File '/node_modules/normalize.css.ts' does not exist. +File '/node_modules/normalize.css.tsx' does not exist. +File '/node_modules/normalize.css.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'normalize.css' that references '/node_modules/normalize.css/normalize.css'. +File name '/node_modules/normalize.css/normalize.css' has a '.css' extension - stripping it. +File '/node_modules/normalize.css/normalize.d.css.ts' does not exist. +Loading module as file / folder, candidate module location '/node_modules/normalize.css/normalize.css', target file types: TypeScript, Declaration. +File name '/node_modules/normalize.css/normalize.css' has a '.css' extension - stripping it. +File '/node_modules/normalize.css/normalize.d.css.ts' does not exist. +File '/node_modules/normalize.css/normalize.css.ts' does not exist. +File '/node_modules/normalize.css/normalize.css.tsx' does not exist. +File '/node_modules/normalize.css/normalize.css.d.ts' does not exist. +Directory '/node_modules/normalize.css/normalize.css' does not exist, skipping all lookups in it. +File '/node_modules/normalize.css/index.ts' does not exist. +File '/node_modules/normalize.css/index.tsx' does not exist. +File '/node_modules/normalize.css/index.d.ts' does not exist. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +File name '/node_modules/@types/normalize.css' has a '.css' extension - stripping it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/node_modules/normalize.css/package.json' exists according to earlier cached lookups. +File name '/node_modules/normalize.css' has a '.css' extension - stripping it. +File '/node_modules/normalize.css.js' does not exist. +File '/node_modules/normalize.css.jsx' does not exist. +'package.json' has 'main' field 'normalize.css' that references '/node_modules/normalize.css/normalize.css'. +File name '/node_modules/normalize.css/normalize.css' has a '.css' extension - stripping it. +Loading module as file / folder, candidate module location '/node_modules/normalize.css/normalize.css', target file types: JavaScript, JSON. +File name '/node_modules/normalize.css/normalize.css' has a '.css' extension - stripping it. +File '/node_modules/normalize.css/normalize.css.js' does not exist. +File '/node_modules/normalize.css/normalize.css.jsx' does not exist. +Directory '/node_modules/normalize.css/normalize.css' does not exist, skipping all lookups in it. +File '/node_modules/normalize.css/index.js' does not exist. +File '/node_modules/normalize.css/index.jsx' does not exist. +======== Module name 'normalize.css' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_unexpected2.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_unexpected2.trace.json new file mode 100644 index 0000000000..73cb649747 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_unexpected2.trace.json @@ -0,0 +1,38 @@ +======== Resolving module 'foo' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/foo/package.json'. +File '/node_modules/foo.ts' does not exist. +File '/node_modules/foo.tsx' does not exist. +File '/node_modules/foo.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'foo.js' that references '/node_modules/foo/foo.js'. +File name '/node_modules/foo/foo.js' has a '.js' extension - stripping it. +File '/node_modules/foo/foo.ts' does not exist. +File '/node_modules/foo/foo.tsx' does not exist. +File '/node_modules/foo/foo.d.ts' does not exist. +Loading module as file / folder, candidate module location '/node_modules/foo/foo.js', target file types: TypeScript, Declaration. +File name '/node_modules/foo/foo.js' has a '.js' extension - stripping it. +File '/node_modules/foo/foo.ts' does not exist. +File '/node_modules/foo/foo.tsx' does not exist. +File '/node_modules/foo/foo.d.ts' does not exist. +File '/node_modules/foo/foo.js.ts' does not exist. +File '/node_modules/foo/foo.js.tsx' does not exist. +File '/node_modules/foo/foo.js.d.ts' does not exist. +Directory '/node_modules/foo/foo.js' does not exist, skipping all lookups in it. +File '/node_modules/foo/index.ts' does not exist. +File '/node_modules/foo/index.tsx' does not exist. +File '/node_modules/foo/index.d.ts' does not exist. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/node_modules/foo/package.json' exists according to earlier cached lookups. +File '/node_modules/foo.js' does not exist. +File '/node_modules/foo.jsx' does not exist. +'package.json' does not have a 'main' field. +File '/node_modules/foo/index.js' does not exist. +File '/node_modules/foo/index.jsx' does not exist. +======== Module name 'foo' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_withAmbientPresent.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_withAmbientPresent.trace.json new file mode 100644 index 0000000000..40cd512bdd --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_withAmbientPresent.trace.json @@ -0,0 +1,21 @@ +======== Resolving module 'js' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/js/package.json' does not exist. +File '/node_modules/js.ts' does not exist. +File '/node_modules/js.tsx' does not exist. +File '/node_modules/js.d.ts' does not exist. +File '/node_modules/js/index.ts' does not exist. +File '/node_modules/js/index.tsx' does not exist. +File '/node_modules/js/index.d.ts' does not exist. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/node_modules/js/package.json' does not exist according to earlier cached lookups. +File '/node_modules/js.js' does not exist. +File '/node_modules/js.jsx' does not exist. +File '/node_modules/js/index.js' exists - use it as a name resolution result. +Resolving real path for '/node_modules/js/index.js', result '/node_modules/js/index.js'. +======== Module name 'js' was successfully resolved to '/node_modules/js/index.js'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_withPaths.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_withPaths.trace.json new file mode 100644 index 0000000000..313e5dc896 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_withPaths.trace.json @@ -0,0 +1,44 @@ +======== Resolving module 'foo/test.js' from '/test.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +'paths' option is specified, looking for a pattern to match module name 'foo/test.js'. +Module name 'foo/test.js', matched pattern 'foo/*'. +Trying substitution 'node_modules/foo/lib/*', candidate module location: 'node_modules/foo/lib/test.js'. +Loading module as file / folder, candidate module location '/node_modules/foo/lib/test.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/node_modules/foo/lib/test.js' has a '.js' extension - stripping it. +File '/node_modules/foo/lib/test.ts' does not exist. +File '/node_modules/foo/lib/test.tsx' does not exist. +File '/node_modules/foo/lib/test.d.ts' exists - use it as a name resolution result. +File '/node_modules/foo/package.json' does not exist. +Resolving real path for '/node_modules/foo/lib/test.d.ts', result '/node_modules/foo/lib/test.d.ts'. +======== Module name 'foo/test.js' was successfully resolved to '/node_modules/foo/lib/test.d.ts'. ======== +======== Resolving module 'foo/test' from '/test.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +'paths' option is specified, looking for a pattern to match module name 'foo/test'. +Module name 'foo/test', matched pattern 'foo/*'. +Trying substitution 'node_modules/foo/lib/*', candidate module location: 'node_modules/foo/lib/test'. +Loading module as file / folder, candidate module location '/node_modules/foo/lib/test', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/node_modules/foo/lib/test.ts' does not exist. +File '/node_modules/foo/lib/test.tsx' does not exist. +File '/node_modules/foo/lib/test.d.ts' exists - use it as a name resolution result. +File '/node_modules/foo/package.json' does not exist according to earlier cached lookups. +Resolving real path for '/node_modules/foo/lib/test.d.ts', result '/node_modules/foo/lib/test.d.ts'. +======== Module name 'foo/test' was successfully resolved to '/node_modules/foo/lib/test.d.ts'. ======== +======== Resolving module './relative.js' from '/test.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/relative.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/relative.js' has a '.js' extension - stripping it. +File '/relative.ts' does not exist. +File '/relative.tsx' does not exist. +File '/relative.d.ts' exists - use it as a name resolution result. +======== Module name './relative.js' was successfully resolved to '/relative.d.ts'. ======== +======== Resolving module './relative' from '/test.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/relative', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/relative.ts' does not exist. +File '/relative.tsx' does not exist. +File '/relative.d.ts' exists - use it as a name resolution result. +======== Module name './relative' was successfully resolved to '/relative.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithRequireAndImport.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithRequireAndImport.trace.json new file mode 100644 index 0000000000..97ef80bade --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithRequireAndImport.trace.json @@ -0,0 +1,6 @@ +======== Resolving module './other' from '/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/other', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/other.ts' exists - use it as a name resolution result. +======== Module name './other' was successfully resolved to '/other.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_empty.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_empty.trace.json new file mode 100644 index 0000000000..12c67c71be --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_empty.trace.json @@ -0,0 +1,6 @@ +======== Resolving module './foo' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/foo.ts' exists - use it as a name resolution result. +======== Module name './foo' was successfully resolved to '/foo.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_notSpecified.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_notSpecified.trace.json new file mode 100644 index 0000000000..12c67c71be --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_notSpecified.trace.json @@ -0,0 +1,6 @@ +======== Resolving module './foo' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/foo.ts' exists - use it as a name resolution result. +======== Module name './foo' was successfully resolved to '/foo.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one.trace.json new file mode 100644 index 0000000000..bbef3f7e73 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one.trace.json @@ -0,0 +1,6 @@ +======== Resolving module './foo' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/foo.ios.ts' exists - use it as a name resolution result. +======== Module name './foo' was successfully resolved to '/foo.ios.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_oneBlank.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_oneBlank.trace.json new file mode 100644 index 0000000000..12c67c71be --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_oneBlank.trace.json @@ -0,0 +1,6 @@ +======== Resolving module './foo' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/foo.ts' exists - use it as a name resolution result. +======== Module name './foo' was successfully resolved to '/foo.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_oneNotFound.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_oneNotFound.trace.json new file mode 100644 index 0000000000..7c6529e6a9 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_oneNotFound.trace.json @@ -0,0 +1,11 @@ +======== Resolving module './foo' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/foo.ios.ts' does not exist. +File '/foo.ios.tsx' does not exist. +File '/foo.ios.d.ts' does not exist. +File '/foo.ios.js' does not exist. +File '/foo.ios.jsx' does not exist. +Directory '/foo' does not exist, skipping all lookups in it. +======== Module name './foo' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_dirModuleWithIndex.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_dirModuleWithIndex.trace.json new file mode 100644 index 0000000000..f8e9732928 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_dirModuleWithIndex.trace.json @@ -0,0 +1,12 @@ +======== Resolving module './foo' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/foo.ios.ts' does not exist. +File '/foo.ios.tsx' does not exist. +File '/foo.ios.d.ts' does not exist. +File '/foo.ios.js' does not exist. +File '/foo.ios.jsx' does not exist. +File '/foo/package.json' does not exist. +File '/foo/index.ios.ts' exists - use it as a name resolution result. +======== Module name './foo' was successfully resolved to '/foo/index.ios.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModule.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModule.trace.json new file mode 100644 index 0000000000..fc40eb09fd --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModule.trace.json @@ -0,0 +1,15 @@ +======== Resolving module 'some-library' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'some-library' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/some-library/package.json' does not exist. +File '/node_modules/some-library.ios.ts' does not exist. +File '/node_modules/some-library.ios.tsx' does not exist. +File '/node_modules/some-library.ios.d.ts' does not exist. +File '/node_modules/some-library/index.ios.ts' does not exist. +File '/node_modules/some-library/index.ios.tsx' does not exist. +File '/node_modules/some-library/index.ios.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/some-library/index.ios.d.ts', result '/node_modules/some-library/index.ios.d.ts'. +======== Module name 'some-library' was successfully resolved to '/node_modules/some-library/index.ios.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModulePath.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModulePath.trace.json new file mode 100644 index 0000000000..ea9a1c0669 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModulePath.trace.json @@ -0,0 +1,12 @@ +======== Resolving module 'some-library/foo' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'some-library/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/some-library/package.json' does not exist. +File '/node_modules/some-library/foo.ios.ts' does not exist. +File '/node_modules/some-library/foo.ios.tsx' does not exist. +File '/node_modules/some-library/foo.ios.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/some-library/foo.ios.d.ts', result '/node_modules/some-library/foo.ios.d.ts'. +======== Module name 'some-library/foo' was successfully resolved to '/node_modules/some-library/foo.ios.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModule_withPaths.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModule_withPaths.trace.json new file mode 100644 index 0000000000..ec7572e66e --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModule_withPaths.trace.json @@ -0,0 +1,45 @@ +======== Resolving module 'some-library' from '/test.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'some-library'. +Module name 'some-library', matched pattern 'some-library'. +Trying substitution 'node_modules/some-library/lib', candidate module location: 'node_modules/some-library/lib'. +Loading module as file / folder, candidate module location '/node_modules/some-library/lib', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/node_modules/some-library/lib.ios.ts' does not exist. +File '/node_modules/some-library/lib.ios.tsx' does not exist. +File '/node_modules/some-library/lib.ios.d.ts' does not exist. +File '/node_modules/some-library/lib.ios.js' does not exist. +File '/node_modules/some-library/lib.ios.jsx' does not exist. +File '/node_modules/some-library/lib/package.json' does not exist. +File '/node_modules/some-library/lib/index.ios.ts' does not exist. +File '/node_modules/some-library/lib/index.ios.tsx' does not exist. +File '/node_modules/some-library/lib/index.ios.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/some-library/lib/index.ios.d.ts', result '/node_modules/some-library/lib/index.ios.d.ts'. +======== Module name 'some-library' was successfully resolved to '/node_modules/some-library/lib/index.ios.d.ts'. ======== +======== Resolving module 'some-library/index' from '/test.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'some-library/index'. +Module name 'some-library/index', matched pattern 'some-library/*'. +Trying substitution 'node_modules/some-library/lib/*', candidate module location: 'node_modules/some-library/lib/index'. +Loading module as file / folder, candidate module location '/node_modules/some-library/lib/index', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/node_modules/some-library/lib/index.ios.ts' does not exist. +File '/node_modules/some-library/lib/index.ios.tsx' does not exist. +File '/node_modules/some-library/lib/index.ios.d.ts' exists - use it as a name resolution result. +File '/node_modules/some-library/package.json' does not exist. +Resolving real path for '/node_modules/some-library/lib/index.ios.d.ts', result '/node_modules/some-library/lib/index.ios.d.ts'. +======== Module name 'some-library/index' was successfully resolved to '/node_modules/some-library/lib/index.ios.d.ts'. ======== +======== Resolving module 'some-library/index.js' from '/test.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'some-library/index.js'. +Module name 'some-library/index.js', matched pattern 'some-library/*'. +Trying substitution 'node_modules/some-library/lib/*', candidate module location: 'node_modules/some-library/lib/index.js'. +Loading module as file / folder, candidate module location '/node_modules/some-library/lib/index.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/node_modules/some-library/lib/index.js' has a '.js' extension - stripping it. +File '/node_modules/some-library/lib/index.ios.ts' does not exist. +File '/node_modules/some-library/lib/index.ios.tsx' does not exist. +File '/node_modules/some-library/lib/index.ios.d.ts' exists - use it as a name resolution result. +File '/node_modules/some-library/package.json' does not exist according to earlier cached lookups. +Resolving real path for '/node_modules/some-library/lib/index.ios.d.ts', result '/node_modules/some-library/lib/index.ios.d.ts'. +======== Module name 'some-library/index.js' was successfully resolved to '/node_modules/some-library/lib/index.ios.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalTSModule.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalTSModule.trace.json new file mode 100644 index 0000000000..a468e7dde0 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalTSModule.trace.json @@ -0,0 +1,13 @@ +======== Resolving module 'some-library' from '/test.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'some-library' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/some-library/package.json' does not exist. +File '/node_modules/some-library.ios.ts' does not exist. +File '/node_modules/some-library.ios.tsx' does not exist. +File '/node_modules/some-library.ios.d.ts' does not exist. +File '/node_modules/some-library/index.ios.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/some-library/index.ios.ts', result '/node_modules/some-library/index.ios.ts'. +======== Module name 'some-library' was successfully resolved to '/node_modules/some-library/index.ios.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.trace.json new file mode 100644 index 0000000000..60619ae53c --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.trace.json @@ -0,0 +1,10 @@ +======== Resolving module './foo.js' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/foo.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/foo.js' has a '.js' extension - stripping it. +File '/foo.ios.ts' does not exist. +File '/foo.ios.tsx' does not exist. +File '/foo.ios.d.ts' does not exist. +File '/foo.ios.js' exists - use it as a name resolution result. +======== Module name './foo.js' was successfully resolved to '/foo.ios.js'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsonModule.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsonModule.trace.json new file mode 100644 index 0000000000..fd456e1ae6 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsonModule.trace.json @@ -0,0 +1,8 @@ +======== Resolving module './foo.json' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/foo.json', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/foo.json' has a '.json' extension - stripping it. +File '/foo.d.json.ios.ts' does not exist. +File '/foo.ios.json' exists - use it as a name resolution result. +======== Module name './foo.json' was successfully resolved to '/foo.ios.json'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank1.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank1.trace.json new file mode 100644 index 0000000000..721a88d1e6 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank1.trace.json @@ -0,0 +1,6 @@ +======== Resolving module './foo' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/foo-ios.ts' exists - use it as a name resolution result. +======== Module name './foo' was successfully resolved to '/foo-ios.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank2.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank2.trace.json new file mode 100644 index 0000000000..f6e7ec2000 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank2.trace.json @@ -0,0 +1,7 @@ +======== Resolving module './foo' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/foo-ios.ts' does not exist. +File '/foo__native.ts' exists - use it as a name resolution result. +======== Module name './foo' was successfully resolved to '/foo__native.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank3.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank3.trace.json new file mode 100644 index 0000000000..82b0a57168 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank3.trace.json @@ -0,0 +1,8 @@ +======== Resolving module './foo' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/foo-ios.ts' does not exist. +File '/foo__native.ts' does not exist. +File '/foo.ts' exists - use it as a name resolution result. +======== Module name './foo' was successfully resolved to '/foo.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank4.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank4.trace.json new file mode 100644 index 0000000000..3239f2986b --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank4.trace.json @@ -0,0 +1,21 @@ +======== Resolving module './foo' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/foo-ios.ts' does not exist. +File '/foo__native.ts' does not exist. +File '/foo.ts' does not exist. +File '/foo-ios.tsx' does not exist. +File '/foo__native.tsx' does not exist. +File '/foo.tsx' does not exist. +File '/foo-ios.d.ts' does not exist. +File '/foo__native.d.ts' does not exist. +File '/foo.d.ts' does not exist. +File '/foo-ios.js' does not exist. +File '/foo__native.js' does not exist. +File '/foo.js' does not exist. +File '/foo-ios.jsx' does not exist. +File '/foo__native.jsx' does not exist. +File '/foo.jsx' does not exist. +Directory '/foo' does not exist, skipping all lookups in it. +======== Module name './foo' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks.trace.json new file mode 100644 index 0000000000..63e69508e4 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks.trace.json @@ -0,0 +1,43 @@ +======== Resolving module './library-a' from '/src/app.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/src/library-a', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/src/library-a.ts' does not exist. +File '/src/library-a.tsx' does not exist. +File '/src/library-a.d.ts' does not exist. +File '/src/library-a.js' does not exist. +File '/src/library-a.jsx' does not exist. +File '/src/library-a/package.json' does not exist. +File '/src/library-a/index.ts' exists - use it as a name resolution result. +======== Module name './library-a' was successfully resolved to '/src/library-a/index.ts'. ======== +======== Resolving module './library-b' from '/src/app.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/src/library-b', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/src/library-b.ts' does not exist. +File '/src/library-b.tsx' does not exist. +File '/src/library-b.d.ts' does not exist. +File '/src/library-b.js' does not exist. +File '/src/library-b.jsx' does not exist. +File '/src/library-b/package.json' does not exist. +File '/src/library-b/index.ts' exists - use it as a name resolution result. +======== Module name './library-b' was successfully resolved to '/src/library-b/index.ts'. ======== +======== Resolving module 'library-a' from '/src/library-b/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/src/library-b/package.json' does not exist according to earlier cached lookups. +File '/src/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'library-a' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/src/library-b/node_modules' does not exist, skipping all lookups in it. +Directory '/src/library-b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/src/node_modules' does not exist, skipping all lookups in it. +Directory '/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/src/library-b/node_modules' does not exist, skipping all lookups in it. +Directory '/src/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'library-a' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks_notInNodeModules.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks_notInNodeModules.trace.json new file mode 100644 index 0000000000..9ba9957f76 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks_notInNodeModules.trace.json @@ -0,0 +1,12 @@ +======== Resolving module './shared/abc' from '/src/app.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/src/shared/abc', target file types: TypeScript, JavaScript, Declaration, JSON. +Directory '/src/shared' does not exist, skipping all lookups in it. +======== Module name './shared/abc' was not resolved. ======== +======== Resolving module './shared2/abc' from '/src/app.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/src/shared2/abc', target file types: TypeScript, JavaScript, Declaration, JSON. +Directory '/src/shared2' does not exist, skipping all lookups in it. +======== Module name './shared2/abc' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks_preserveSymlinks.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks_preserveSymlinks.trace.json new file mode 100644 index 0000000000..9b672ff4f7 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks_preserveSymlinks.trace.json @@ -0,0 +1,47 @@ +======== Resolving type reference directive 'linked', containing file '/app/app.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/app'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +File '/app/node_modules/linked.d.ts' does not exist. +Directory '/app/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'linked' was not resolved. ======== +======== Resolving module 'linked' from '/app/app.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/app/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'linked' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/app/node_modules/linked.ts' does not exist. +File '/app/node_modules/linked.tsx' does not exist. +File '/app/node_modules/linked.d.ts' does not exist. +Directory '/app/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/app/node_modules/linked.js' does not exist. +File '/app/node_modules/linked.jsx' does not exist. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'linked' was not resolved. ======== +======== Resolving module 'linked2' from '/app/app.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/app/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'linked2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/app/node_modules/linked2.ts' does not exist. +File '/app/node_modules/linked2.tsx' does not exist. +File '/app/node_modules/linked2.d.ts' does not exist. +Directory '/app/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/app/node_modules/linked2.js' does not exist. +File '/app/node_modules/linked2.jsx' does not exist. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'linked2' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks_referenceTypes.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks_referenceTypes.trace.json new file mode 100644 index 0000000000..737c432621 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks_referenceTypes.trace.json @@ -0,0 +1,34 @@ +======== Resolving type reference directive 'library-a', containing file '/app.ts', root directory ''. ======== +Root directory cannot be determined, skipping primary search paths. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +File '/node_modules/library-a.d.ts' does not exist. +File '/node_modules/@types/library-a/package.json' does not exist. +File '/node_modules/@types/library-a.d.ts' does not exist. +File '/node_modules/@types/library-a/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/library-a/index.d.ts', result '/node_modules/@types/library-a/index.d.ts'. +======== Type reference directive 'library-a' was successfully resolved to '/node_modules/@types/library-a/index.d.ts', primary: false. ======== +======== Resolving type reference directive 'library-b', containing file '/app.ts', root directory ''. ======== +Root directory cannot be determined, skipping primary search paths. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +File '/node_modules/library-b.d.ts' does not exist. +File '/node_modules/@types/library-b/package.json' does not exist. +File '/node_modules/@types/library-b.d.ts' does not exist. +File '/node_modules/@types/library-b/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/library-b/index.d.ts', result '/node_modules/@types/library-b/index.d.ts'. +======== Type reference directive 'library-b' was successfully resolved to '/node_modules/@types/library-b/index.d.ts', primary: false. ======== +======== Resolving type reference directive 'library-a', containing file '/node_modules/@types/library-b/index.d.ts', root directory ''. ======== +Root directory cannot be determined, skipping primary search paths. +Looking up in 'node_modules' folder, initial location '/node_modules/@types/library-b'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/node_modules/@types/library-b/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types/library-b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules/@types/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/library-a.d.ts' does not exist. +File '/node_modules/@types/library-a/package.json' does not exist according to earlier cached lookups. +File '/node_modules/@types/library-a.d.ts' does not exist. +File '/node_modules/@types/library-a/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/library-a/index.d.ts', result '/node_modules/@types/library-a/index.d.ts'. +======== Type reference directive 'library-a' was successfully resolved to '/node_modules/@types/library-a/index.d.ts', primary: false. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks_withOutDir.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks_withOutDir.trace.json new file mode 100644 index 0000000000..63e69508e4 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSymlinks_withOutDir.trace.json @@ -0,0 +1,43 @@ +======== Resolving module './library-a' from '/src/app.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/src/library-a', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/src/library-a.ts' does not exist. +File '/src/library-a.tsx' does not exist. +File '/src/library-a.d.ts' does not exist. +File '/src/library-a.js' does not exist. +File '/src/library-a.jsx' does not exist. +File '/src/library-a/package.json' does not exist. +File '/src/library-a/index.ts' exists - use it as a name resolution result. +======== Module name './library-a' was successfully resolved to '/src/library-a/index.ts'. ======== +======== Resolving module './library-b' from '/src/app.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/src/library-b', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/src/library-b.ts' does not exist. +File '/src/library-b.tsx' does not exist. +File '/src/library-b.d.ts' does not exist. +File '/src/library-b.js' does not exist. +File '/src/library-b.jsx' does not exist. +File '/src/library-b/package.json' does not exist. +File '/src/library-b/index.ts' exists - use it as a name resolution result. +======== Module name './library-b' was successfully resolved to '/src/library-b/index.ts'. ======== +======== Resolving module 'library-a' from '/src/library-b/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/src/library-b/package.json' does not exist according to earlier cached lookups. +File '/src/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'library-a' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/src/library-b/node_modules' does not exist, skipping all lookups in it. +Directory '/src/library-b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/src/node_modules' does not exist, skipping all lookups in it. +Directory '/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/src/library-b/node_modules' does not exist, skipping all lookups in it. +Directory '/src/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'library-a' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_notAtPackageRoot.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_notAtPackageRoot.trace.json new file mode 100644 index 0000000000..17a4409849 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_notAtPackageRoot.trace.json @@ -0,0 +1,17 @@ +======== Resolving module 'foo/bar' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'foo/bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/foo/bar/package.json'. +Found 'package.json' at '/node_modules/foo/package.json'. +File '/node_modules/foo/bar.ts' does not exist. +File '/node_modules/foo/bar.tsx' does not exist. +File '/node_modules/foo/bar.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'types.d.ts' that references '/node_modules/foo/bar/types.d.ts'. +File '/node_modules/foo/bar/types.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/foo/bar/types.d.ts', result '/node_modules/foo/bar/types.d.ts'. +======== Module name 'foo/bar' was successfully resolved to '/node_modules/foo/bar/types.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_notAtPackageRoot_fakeScopedPackage.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_notAtPackageRoot_fakeScopedPackage.trace.json new file mode 100644 index 0000000000..6897fece16 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_notAtPackageRoot_fakeScopedPackage.trace.json @@ -0,0 +1,17 @@ +======== Resolving module 'foo/@bar' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'foo/@bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/foo/@bar/package.json'. +Found 'package.json' at '/node_modules/foo/package.json'. +File '/node_modules/foo/@bar.ts' does not exist. +File '/node_modules/foo/@bar.tsx' does not exist. +File '/node_modules/foo/@bar.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'types.d.ts' that references '/node_modules/foo/@bar/types.d.ts'. +File '/node_modules/foo/@bar/types.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/foo/@bar/types.d.ts', result '/node_modules/foo/@bar/types.d.ts'. +======== Module name 'foo/@bar' was successfully resolved to '/node_modules/foo/@bar/types.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_scopedPackage.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_scopedPackage.trace.json new file mode 100644 index 0000000000..5b793be6a6 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_scopedPackage.trace.json @@ -0,0 +1,16 @@ +======== Resolving module '@foo/bar' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module '@foo/bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/@foo/bar/package.json'. +File '/node_modules/@foo/bar.ts' does not exist. +File '/node_modules/@foo/bar.tsx' does not exist. +File '/node_modules/@foo/bar.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'types.d.ts' that references '/node_modules/@foo/bar/types.d.ts'. +File '/node_modules/@foo/bar/types.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@foo/bar/types.d.ts', result '/node_modules/@foo/bar/types.d.ts'. +======== Module name '@foo/bar' was successfully resolved to '/node_modules/@foo/bar/types.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_yesAtPackageRoot.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_yesAtPackageRoot.trace.json new file mode 100644 index 0000000000..ce3bed3bad --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_yesAtPackageRoot.trace.json @@ -0,0 +1,25 @@ +======== Resolving module 'foo/bar' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'foo/bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/foo/bar/package.json' does not exist. +Found 'package.json' at '/node_modules/foo/package.json'. +'package.json' does not have a 'typesVersions' field. +File '/node_modules/foo/bar.ts' does not exist. +File '/node_modules/foo/bar.tsx' does not exist. +File '/node_modules/foo/bar.d.ts' does not exist. +File '/node_modules/foo/bar/index.ts' does not exist. +File '/node_modules/foo/bar/index.tsx' does not exist. +File '/node_modules/foo/bar/index.d.ts' does not exist. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/node_modules/foo/bar/package.json' does not exist according to earlier cached lookups. +File '/node_modules/foo/package.json' exists according to earlier cached lookups. +File '/node_modules/foo/bar.js' does not exist. +File '/node_modules/foo/bar.jsx' does not exist. +File '/node_modules/foo/bar/index.js' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/foo/bar/index.js', result '/node_modules/foo/bar/index.js'. +======== Module name 'foo/bar' was successfully resolved to '/node_modules/foo/bar/index.js' with Package ID 'foo@1.2.3'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_yesAtPackageRoot_fakeScopedPackage.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_yesAtPackageRoot_fakeScopedPackage.trace.json new file mode 100644 index 0000000000..555d66b09b --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_yesAtPackageRoot_fakeScopedPackage.trace.json @@ -0,0 +1,25 @@ +======== Resolving module 'foo/@bar' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'foo/@bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/foo/@bar/package.json' does not exist. +Found 'package.json' at '/node_modules/foo/package.json'. +'package.json' does not have a 'typesVersions' field. +File '/node_modules/foo/@bar.ts' does not exist. +File '/node_modules/foo/@bar.tsx' does not exist. +File '/node_modules/foo/@bar.d.ts' does not exist. +File '/node_modules/foo/@bar/index.ts' does not exist. +File '/node_modules/foo/@bar/index.tsx' does not exist. +File '/node_modules/foo/@bar/index.d.ts' does not exist. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/node_modules/foo/@bar/package.json' does not exist according to earlier cached lookups. +File '/node_modules/foo/package.json' exists according to earlier cached lookups. +File '/node_modules/foo/@bar.js' does not exist. +File '/node_modules/foo/@bar.jsx' does not exist. +File '/node_modules/foo/@bar/index.js' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/foo/@bar/index.js', result '/node_modules/foo/@bar/index.js'. +======== Module name 'foo/@bar' was successfully resolved to '/node_modules/foo/@bar/index.js' with Package ID 'foo@1.2.3'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_yesAtPackageRoot_mainFieldInSubDirectory.trace.json b/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_yesAtPackageRoot_mainFieldInSubDirectory.trace.json new file mode 100644 index 0000000000..eeba5d48f4 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_packageJson_yesAtPackageRoot_mainFieldInSubDirectory.trace.json @@ -0,0 +1,21 @@ +======== Resolving module 'foo' from '/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/foo/package.json'. +File '/node_modules/foo.ts' does not exist. +File '/node_modules/foo.tsx' does not exist. +File '/node_modules/foo.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'src/index.js' that references '/node_modules/foo/src/index.js'. +File name '/node_modules/foo/src/index.js' has a '.js' extension - stripping it. +File '/node_modules/foo/src/index.ts' does not exist. +File '/node_modules/foo/src/index.tsx' does not exist. +File '/node_modules/foo/src/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/foo/src/index.d.ts', result '/node_modules/foo/src/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/node_modules/foo/src/index.d.ts' with Package ID 'foo@1.2.3'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/nodeColonModuleResolution.trace.json b/testdata/baselines/reference/submodule/compiler/nodeColonModuleResolution.trace.json new file mode 100644 index 0000000000..35964aaeba --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/nodeColonModuleResolution.trace.json @@ -0,0 +1,39 @@ +======== Resolving module 'ph' from '/a/b/node_modules/@types/node/ph.d.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. +File '/a/b/node_modules/@types/package.json' does not exist according to earlier cached lookups. +File '/a/b/node_modules/package.json' does not exist according to earlier cached lookups. +File '/a/b/package.json' does not exist according to earlier cached lookups. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'ph' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/node_modules/@types/node/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types/node/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types/node_modules/@types' does not exist, skipping all lookups in it. +File '/a/b/node_modules/ph.ts' does not exist. +File '/a/b/node_modules/ph.tsx' does not exist. +File '/a/b/node_modules/ph.d.ts' does not exist. +File '/a/b/node_modules/@types/ph.d.ts' does not exist. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/a/b/node_modules/@types/node/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types/node_modules' does not exist, skipping all lookups in it. +File '/a/b/node_modules/ph.js' does not exist. +File '/a/b/node_modules/ph.jsx' does not exist. +Directory '/a/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'ph' was not resolved. ======== +======== Resolving module 'node:ph' from '/a/b/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/a/b/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist. +Skipping module 'node:ph' that looks like an absolute URI, target file types: TypeScript, JavaScript, Declaration, JSON. +======== Module name 'node:ph' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/nodeColonModuleResolution2.trace.json b/testdata/baselines/reference/submodule/compiler/nodeColonModuleResolution2.trace.json new file mode 100644 index 0000000000..bdd4cc8534 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/nodeColonModuleResolution2.trace.json @@ -0,0 +1,18 @@ +======== Resolving module 'fake:thing' from '/a/b/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'fake:thing'. +Module name 'fake:thing', matched pattern 'fake:thing'. +Trying substitution './node_modules/fake/thing', candidate module location: './node_modules/fake/thing'. +Loading module as file / folder, candidate module location '/a/b/node_modules/fake/thing', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/a/b/node_modules/fake/thing.ts' does not exist. +File '/a/b/node_modules/fake/thing.tsx' does not exist. +File '/a/b/node_modules/fake/thing.d.ts' does not exist. +File '/a/b/node_modules/fake/thing.js' does not exist. +File '/a/b/node_modules/fake/thing.jsx' does not exist. +File '/a/b/node_modules/fake/thing/package.json' does not exist. +File '/a/b/node_modules/fake/thing/index.ts' does not exist. +File '/a/b/node_modules/fake/thing/index.tsx' does not exist. +File '/a/b/node_modules/fake/thing/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/a/b/node_modules/fake/thing/index.d.ts', result '/a/b/node_modules/fake/thing/index.d.ts'. +======== Module name 'fake:thing' was successfully resolved to '/a/b/node_modules/fake/thing/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextModuleResolution1.trace.json b/testdata/baselines/reference/submodule/compiler/nodeNextModuleResolution1.trace.json new file mode 100644 index 0000000000..ce51ceaa4f --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/nodeNextModuleResolution1.trace.json @@ -0,0 +1,24 @@ +======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ======== +Explicitly specified module resolution kind: 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/a/b/c/d/e/package.json' exists according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/e/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'foo' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextModuleResolution2.trace.json b/testdata/baselines/reference/submodule/compiler/nodeNextModuleResolution2.trace.json new file mode 100644 index 0000000000..6e2c914491 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/nodeNextModuleResolution2.trace.json @@ -0,0 +1,24 @@ +======== Resolving module 'foo' from '/a/b/c/d/e/app.mts'. ======== +Explicitly specified module resolution kind: 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/a/b/c/d/e/package.json' does not exist. +File '/a/b/c/d/package.json' does not exist. +File '/a/b/c/package.json' does not exist. +File '/a/b/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/e/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/d/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/c/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/a/node_modules/foo/package.json'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/a/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/a/node_modules/foo/index.d.ts', result '/a/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/a/node_modules/foo/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution3_node.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution3_node.trace.json new file mode 100644 index 0000000000..bf3d568b76 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution3_node.trace.json @@ -0,0 +1,44 @@ +======== Resolving module 'folder2/file2' from 'c:/root/folder1/file1.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File 'c:/root/folder1/package.json' does not exist. +File 'c:/root/package.json' does not exist according to earlier cached lookups. +File 'c:/package.json' does not exist according to earlier cached lookups. +Loading module 'folder2/file2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory 'c:/root/folder1/node_modules' does not exist, skipping all lookups in it. +Directory 'c:/root/folder1/node_modules/@types' does not exist, skipping all lookups in it. +Directory 'c:/root/node_modules' does not exist, skipping all lookups in it. +Directory 'c:/root/node_modules/@types' does not exist, skipping all lookups in it. +Directory 'c:/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory 'c:/root/folder1/node_modules' does not exist, skipping all lookups in it. +Directory 'c:/root/node_modules' does not exist, skipping all lookups in it. +======== Module name 'folder2/file2' was not resolved. ======== +======== Resolving module './file3' from 'c:/root/folder2/file2.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location 'c:/root/folder2/file3', target file types: TypeScript, JavaScript, Declaration, JSON. +File 'c:/root/folder2/file3.ts' exists - use it as a name resolution result. +======== Module name './file3' was successfully resolved to 'c:/root/folder2/file3.ts'. ======== +======== Resolving module 'file4' from 'c:/root/folder2/file2.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File 'c:/root/folder2/package.json' does not exist. +File 'c:/root/package.json' does not exist. +File 'c:/package.json' does not exist according to earlier cached lookups. +Loading module 'file4' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory 'c:/root/folder2/node_modules' does not exist, skipping all lookups in it. +Directory 'c:/root/folder2/node_modules/@types' does not exist, skipping all lookups in it. +Directory 'c:/root/node_modules' does not exist, skipping all lookups in it. +Directory 'c:/root/node_modules/@types' does not exist, skipping all lookups in it. +File 'c:/node_modules/file4/package.json' does not exist according to earlier cached lookups. +File 'c:/node_modules/file4.ts' does not exist. +File 'c:/node_modules/file4.tsx' does not exist. +File 'c:/node_modules/file4.d.ts' does not exist. +File 'c:/node_modules/file4/index.ts' does not exist. +File 'c:/node_modules/file4/index.tsx' does not exist. +File 'c:/node_modules/file4/index.d.ts' exists - use it as a name resolution result. +Resolving real path for 'c:/node_modules/file4/index.d.ts', result 'c:/node_modules/file4/index.d.ts'. +======== Module name 'file4' was successfully resolved to 'c:/node_modules/file4/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution4_node.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution4_node.trace.json new file mode 100644 index 0000000000..3be9961801 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution4_node.trace.json @@ -0,0 +1,44 @@ +======== Resolving module 'folder2/file2' from 'c:/root/folder1/file1.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File 'c:/root/folder1/package.json' does not exist. +File 'c:/root/package.json' does not exist according to earlier cached lookups. +File 'c:/package.json' does not exist according to earlier cached lookups. +Loading module 'folder2/file2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory 'c:/root/folder1/node_modules' does not exist, skipping all lookups in it. +Directory 'c:/root/folder1/node_modules/@types' does not exist, skipping all lookups in it. +Directory 'c:/root/node_modules' does not exist, skipping all lookups in it. +Directory 'c:/root/node_modules/@types' does not exist, skipping all lookups in it. +Directory 'c:/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory 'c:/root/folder1/node_modules' does not exist, skipping all lookups in it. +Directory 'c:/root/node_modules' does not exist, skipping all lookups in it. +======== Module name 'folder2/file2' was not resolved. ======== +======== Resolving module './file3' from 'c:/root/folder2/file2.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location 'c:/root/folder2/file3', target file types: TypeScript, JavaScript, Declaration, JSON. +File 'c:/root/folder2/file3.ts' exists - use it as a name resolution result. +======== Module name './file3' was successfully resolved to 'c:/root/folder2/file3.ts'. ======== +======== Resolving module 'file4' from 'c:/root/folder2/file2.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File 'c:/root/folder2/package.json' does not exist. +File 'c:/root/package.json' does not exist. +File 'c:/package.json' does not exist. +Loading module 'file4' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory 'c:/root/folder2/node_modules' does not exist, skipping all lookups in it. +Directory 'c:/root/folder2/node_modules/@types' does not exist, skipping all lookups in it. +Directory 'c:/root/node_modules' does not exist, skipping all lookups in it. +Directory 'c:/root/node_modules/@types' does not exist, skipping all lookups in it. +File 'c:/node_modules/file4/package.json' does not exist. +File 'c:/node_modules/file4.ts' does not exist. +File 'c:/node_modules/file4.tsx' does not exist. +File 'c:/node_modules/file4.d.ts' does not exist. +File 'c:/node_modules/file4/index.ts' does not exist. +File 'c:/node_modules/file4/index.tsx' does not exist. +File 'c:/node_modules/file4/index.d.ts' exists - use it as a name resolution result. +Resolving real path for 'c:/node_modules/file4/index.d.ts', result 'c:/node_modules/file4/index.d.ts'. +======== Module name 'file4' was successfully resolved to 'c:/node_modules/file4/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution5_node.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution5_node.trace.json new file mode 100644 index 0000000000..baa2b61635 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution5_node.trace.json @@ -0,0 +1,70 @@ +======== Resolving module 'folder2/file1' from 'c:/root/folder1/file1.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'folder2/file1'. +Module name 'folder2/file1', matched pattern '*'. +Trying substitution '*', candidate module location: 'folder2/file1'. +Loading module as file / folder, candidate module location 'c:/root/folder2/file1', target file types: TypeScript, JavaScript, Declaration, JSON. +File 'c:/root/folder2/file1.ts' exists - use it as a name resolution result. +======== Module name 'folder2/file1' was successfully resolved to 'c:/root/folder2/file1.ts'. ======== +======== Resolving module 'folder3/file2' from 'c:/root/folder1/file1.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'folder3/file2'. +Module name 'folder3/file2', matched pattern '*'. +Trying substitution '*', candidate module location: 'folder3/file2'. +Loading module as file / folder, candidate module location 'c:/root/folder3/file2', target file types: TypeScript, JavaScript, Declaration, JSON. +Trying substitution 'generated/*', candidate module location: 'generated/folder3/file2'. +Loading module as file / folder, candidate module location 'c:/root/generated/folder3/file2', target file types: TypeScript, JavaScript, Declaration, JSON. +File 'c:/root/generated/folder3/file2.ts' exists - use it as a name resolution result. +======== Module name 'folder3/file2' was successfully resolved to 'c:/root/generated/folder3/file2.ts'. ======== +======== Resolving module 'components/file3' from 'c:/root/folder1/file1.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'components/file3'. +Module name 'components/file3', matched pattern 'components/*'. +Trying substitution 'shared/components/*', candidate module location: 'shared/components/file3'. +Loading module as file / folder, candidate module location 'c:/root/shared/components/file3', target file types: TypeScript, JavaScript, Declaration, JSON. +File 'c:/root/shared/components/file3.ts' does not exist. +File 'c:/root/shared/components/file3.tsx' does not exist. +File 'c:/root/shared/components/file3.d.ts' does not exist. +File 'c:/root/shared/components/file3.js' does not exist. +File 'c:/root/shared/components/file3.jsx' does not exist. +File 'c:/root/shared/components/file3/package.json' does not exist. +File 'c:/root/shared/components/file3/index.ts' does not exist. +File 'c:/root/shared/components/file3/index.tsx' does not exist. +File 'c:/root/shared/components/file3/index.d.ts' exists - use it as a name resolution result. +======== Module name 'components/file3' was successfully resolved to 'c:/root/shared/components/file3/index.d.ts'. ======== +======== Resolving module 'file4' from 'c:/root/folder1/file1.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'file4'. +Module name 'file4', matched pattern '*'. +Trying substitution '*', candidate module location: 'file4'. +Loading module as file / folder, candidate module location 'c:/root/file4', target file types: TypeScript, JavaScript, Declaration, JSON. +File 'c:/root/file4.ts' does not exist. +File 'c:/root/file4.tsx' does not exist. +File 'c:/root/file4.d.ts' does not exist. +File 'c:/root/file4.js' does not exist. +File 'c:/root/file4.jsx' does not exist. +Directory 'c:/root/file4' does not exist, skipping all lookups in it. +Trying substitution 'generated/*', candidate module location: 'generated/file4'. +Loading module as file / folder, candidate module location 'c:/root/generated/file4', target file types: TypeScript, JavaScript, Declaration, JSON. +File 'c:/root/generated/file4.ts' does not exist. +File 'c:/root/generated/file4.tsx' does not exist. +File 'c:/root/generated/file4.d.ts' does not exist. +File 'c:/root/generated/file4.js' does not exist. +File 'c:/root/generated/file4.jsx' does not exist. +Directory 'c:/root/generated/file4' does not exist, skipping all lookups in it. +File 'c:/root/folder1/package.json' does not exist. +File 'c:/root/package.json' does not exist. +File 'c:/package.json' does not exist. +Loading module 'file4' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory 'c:/root/folder1/node_modules' does not exist, skipping all lookups in it. +Directory 'c:/root/folder1/node_modules/@types' does not exist, skipping all lookups in it. +Directory 'c:/root/node_modules' does not exist, skipping all lookups in it. +Directory 'c:/root/node_modules/@types' does not exist, skipping all lookups in it. +File 'c:/node_modules/file4.ts' exists - use it as a name resolution result. +Resolving real path for 'c:/node_modules/file4.ts', result 'c:/node_modules/file4.ts'. +======== Module name 'file4' was successfully resolved to 'c:/node_modules/file4.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution6_node.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution6_node.trace.json new file mode 100644 index 0000000000..a6b771ebbf --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution6_node.trace.json @@ -0,0 +1,6 @@ +======== Resolving module './project/file3' from 'c:/root/src/file1.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location 'c:/root/src/project/file3', target file types: TypeScript, JavaScript, Declaration, JSON. +Directory 'c:/root/src/project' does not exist, skipping all lookups in it. +======== Module name './project/file3' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution7_node.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution7_node.trace.json new file mode 100644 index 0000000000..d337abb7ff --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution7_node.trace.json @@ -0,0 +1,41 @@ +======== Resolving module './project/file2' from 'c:/root/src/file1.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location 'c:/root/src/project/file2', target file types: TypeScript, JavaScript, Declaration, JSON. +Directory 'c:/root/src/project' does not exist, skipping all lookups in it. +======== Module name './project/file2' was not resolved. ======== +======== Resolving module 'module3' from 'c:/root/src/file1.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'module3'. +Module name 'module3', matched pattern '*'. +Trying substitution '*', candidate module location: 'module3'. +Loading module as file / folder, candidate module location 'c:/root/src/module3', target file types: TypeScript, JavaScript, Declaration, JSON. +File 'c:/root/src/module3.ts' does not exist. +File 'c:/root/src/module3.tsx' does not exist. +File 'c:/root/src/module3.d.ts' does not exist. +File 'c:/root/src/module3.js' does not exist. +File 'c:/root/src/module3.jsx' does not exist. +Directory 'c:/root/src/module3' does not exist, skipping all lookups in it. +Trying substitution 'c:/shared/*', candidate module location: 'c:/shared/module3'. +Loading module as file / folder, candidate module location 'c:/shared/module3', target file types: TypeScript, JavaScript, Declaration, JSON. +File 'c:/shared/module3.ts' does not exist. +File 'c:/shared/module3.tsx' does not exist. +File 'c:/shared/module3.d.ts' does not exist. +File 'c:/shared/module3.js' does not exist. +File 'c:/shared/module3.jsx' does not exist. +Directory 'c:/shared/module3' does not exist, skipping all lookups in it. +File 'c:/root/src/package.json' does not exist. +File 'c:/root/package.json' does not exist. +File 'c:/package.json' does not exist. +Loading module 'module3' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory 'c:/root/src/node_modules' does not exist, skipping all lookups in it. +Directory 'c:/root/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory 'c:/root/node_modules' does not exist, skipping all lookups in it. +Directory 'c:/root/node_modules/@types' does not exist, skipping all lookups in it. +File 'c:/node_modules/module3.ts' does not exist. +File 'c:/node_modules/module3.tsx' does not exist. +File 'c:/node_modules/module3.d.ts' exists - use it as a name resolution result. +Resolving real path for 'c:/node_modules/module3.d.ts', result 'c:/node_modules/module3.d.ts'. +======== Module name 'module3' was successfully resolved to 'c:/node_modules/module3.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution8_node.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution8_node.trace.json new file mode 100644 index 0000000000..db03ff8304 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution8_node.trace.json @@ -0,0 +1,8 @@ +======== Resolving module '@speedy/folder1/testing' from 'c:/root/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '@speedy/folder1/testing'. +Module name '@speedy/folder1/testing', matched pattern '@speedy/*/testing'. +Trying substitution '*/dist/index.ts', candidate module location: 'folder1/dist/index.ts'. +File 'c:/root/folder1/dist/index.ts' exists - use it as a name resolution result. +======== Module name '@speedy/folder1/testing' was successfully resolved to 'c:/root/folder1/dist/index.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot.trace.json new file mode 100644 index 0000000000..9bd8d21bcc --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot.trace.json @@ -0,0 +1,21 @@ +======== Resolving module '/foo' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '/foo'. +Module name '/foo', matched pattern '/*'. +Trying substitution './src/*', candidate module location: './src/foo'. +Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/foo.ts' exists - use it as a name resolution result. +======== Module name '/foo' was successfully resolved to '/root/src/foo.ts'. ======== +======== Resolving module '/bar' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '/bar'. +Module name '/bar', matched pattern '/*'. +Trying substitution './src/*', candidate module location: './src/bar'. +Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/bar.ts' does not exist. +File '/root/src/bar.tsx' does not exist. +File '/root/src/bar.d.ts' does not exist. +File '/root/src/bar.js' exists - use it as a name resolution result. +======== Module name '/bar' was successfully resolved to '/root/src/bar.js'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_differentRootTypes.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_differentRootTypes.trace.json new file mode 100644 index 0000000000..c38dde916c --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_differentRootTypes.trace.json @@ -0,0 +1,189 @@ +======== Resolving module '/foo' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '/foo'. +Module name '/foo', matched pattern '/*'. +Trying substitution './src/*', candidate module location: './src/foo'. +Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/foo.ts' exists - use it as a name resolution result. +======== Module name '/foo' was successfully resolved to '/root/src/foo.ts'. ======== +======== Resolving module '/bar' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '/bar'. +Module name '/bar', matched pattern '/*'. +Trying substitution './src/*', candidate module location: './src/bar'. +Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/bar.ts' does not exist. +File '/root/src/bar.tsx' does not exist. +File '/root/src/bar.d.ts' does not exist. +File '/root/src/bar.js' exists - use it as a name resolution result. +======== Module name '/bar' was successfully resolved to '/root/src/bar.js'. ======== +======== Resolving module 'c:/foo' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'c:/foo'. +Module name 'c:/foo', matched pattern 'c:/*'. +Trying substitution './src/*', candidate module location: './src/foo'. +Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/foo.ts' exists - use it as a name resolution result. +======== Module name 'c:/foo' was successfully resolved to '/root/src/foo.ts'. ======== +======== Resolving module 'c:/bar' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'c:/bar'. +Module name 'c:/bar', matched pattern 'c:/*'. +Trying substitution './src/*', candidate module location: './src/bar'. +Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/bar.ts' does not exist. +File '/root/src/bar.tsx' does not exist. +File '/root/src/bar.d.ts' does not exist. +File '/root/src/bar.js' exists - use it as a name resolution result. +======== Module name 'c:/bar' was successfully resolved to '/root/src/bar.js'. ======== +======== Resolving module 'c:\foo' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'c:\foo'. +Module name 'c:\foo', matched pattern 'c:\*'. +Trying substitution './src/*', candidate module location: './src/foo'. +Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/foo.ts' exists - use it as a name resolution result. +======== Module name 'c:\foo' was successfully resolved to '/root/src/foo.ts'. ======== +======== Resolving module 'c:\bar' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'c:\bar'. +Module name 'c:\bar', matched pattern 'c:\*'. +Trying substitution './src/*', candidate module location: './src/bar'. +Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/bar.ts' does not exist. +File '/root/src/bar.tsx' does not exist. +File '/root/src/bar.d.ts' does not exist. +File '/root/src/bar.js' exists - use it as a name resolution result. +======== Module name 'c:\bar' was successfully resolved to '/root/src/bar.js'. ======== +======== Resolving module '//server/foo' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '//server/foo'. +Module name '//server/foo', matched pattern '//server/*'. +Trying substitution './src/*', candidate module location: './src/foo'. +Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/foo.ts' exists - use it as a name resolution result. +======== Module name '//server/foo' was successfully resolved to '/root/src/foo.ts'. ======== +======== Resolving module '//server/bar' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '//server/bar'. +Module name '//server/bar', matched pattern '//server/*'. +Trying substitution './src/*', candidate module location: './src/bar'. +Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/bar.ts' does not exist. +File '/root/src/bar.tsx' does not exist. +File '/root/src/bar.d.ts' does not exist. +File '/root/src/bar.js' exists - use it as a name resolution result. +======== Module name '//server/bar' was successfully resolved to '/root/src/bar.js'. ======== +======== Resolving module '\\server\foo' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '\\server\foo'. +Module name '\\server\foo', matched pattern '\\server\*'. +Trying substitution './src/*', candidate module location: './src/foo'. +Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/foo.ts' exists - use it as a name resolution result. +======== Module name '\\server\foo' was successfully resolved to '/root/src/foo.ts'. ======== +======== Resolving module '\\server\bar' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '\\server\bar'. +Module name '\\server\bar', matched pattern '\\server\*'. +Trying substitution './src/*', candidate module location: './src/bar'. +Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/bar.ts' does not exist. +File '/root/src/bar.tsx' does not exist. +File '/root/src/bar.d.ts' does not exist. +File '/root/src/bar.js' exists - use it as a name resolution result. +======== Module name '\\server\bar' was successfully resolved to '/root/src/bar.js'. ======== +======== Resolving module 'file:///foo' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'file:///foo'. +Module name 'file:///foo', matched pattern 'file:///*'. +Trying substitution './src/*', candidate module location: './src/foo'. +Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/foo.ts' exists - use it as a name resolution result. +======== Module name 'file:///foo' was successfully resolved to '/root/src/foo.ts'. ======== +======== Resolving module 'file:///bar' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'file:///bar'. +Module name 'file:///bar', matched pattern 'file:///*'. +Trying substitution './src/*', candidate module location: './src/bar'. +Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/bar.ts' does not exist. +File '/root/src/bar.tsx' does not exist. +File '/root/src/bar.d.ts' does not exist. +File '/root/src/bar.js' exists - use it as a name resolution result. +======== Module name 'file:///bar' was successfully resolved to '/root/src/bar.js'. ======== +======== Resolving module 'file://c:/foo' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'file://c:/foo'. +Module name 'file://c:/foo', matched pattern 'file://c:/*'. +Trying substitution './src/*', candidate module location: './src/foo'. +Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/foo.ts' exists - use it as a name resolution result. +======== Module name 'file://c:/foo' was successfully resolved to '/root/src/foo.ts'. ======== +======== Resolving module 'file://c:/bar' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'file://c:/bar'. +Module name 'file://c:/bar', matched pattern 'file://c:/*'. +Trying substitution './src/*', candidate module location: './src/bar'. +Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/bar.ts' does not exist. +File '/root/src/bar.tsx' does not exist. +File '/root/src/bar.d.ts' does not exist. +File '/root/src/bar.js' exists - use it as a name resolution result. +======== Module name 'file://c:/bar' was successfully resolved to '/root/src/bar.js'. ======== +======== Resolving module 'file://server/foo' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'file://server/foo'. +Module name 'file://server/foo', matched pattern 'file://server/*'. +Trying substitution './src/*', candidate module location: './src/foo'. +Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/foo.ts' exists - use it as a name resolution result. +======== Module name 'file://server/foo' was successfully resolved to '/root/src/foo.ts'. ======== +======== Resolving module 'file://server/bar' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'file://server/bar'. +Module name 'file://server/bar', matched pattern 'file://server/*'. +Trying substitution './src/*', candidate module location: './src/bar'. +Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/bar.ts' does not exist. +File '/root/src/bar.tsx' does not exist. +File '/root/src/bar.d.ts' does not exist. +File '/root/src/bar.js' exists - use it as a name resolution result. +======== Module name 'file://server/bar' was successfully resolved to '/root/src/bar.js'. ======== +======== Resolving module 'http://server/foo' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'http://server/foo'. +Module name 'http://server/foo', matched pattern 'http://server/*'. +Trying substitution './src/*', candidate module location: './src/foo'. +Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/foo.ts' exists - use it as a name resolution result. +======== Module name 'http://server/foo' was successfully resolved to '/root/src/foo.ts'. ======== +======== Resolving module 'http://server/bar' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'http://server/bar'. +Module name 'http://server/bar', matched pattern 'http://server/*'. +Trying substitution './src/*', candidate module location: './src/bar'. +Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/bar.ts' does not exist. +File '/root/src/bar.tsx' does not exist. +File '/root/src/bar.d.ts' does not exist. +File '/root/src/bar.js' exists - use it as a name resolution result. +======== Module name 'http://server/bar' was successfully resolved to '/root/src/bar.js'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_multipleAliases.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_multipleAliases.trace.json new file mode 100644 index 0000000000..04ef899b76 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_multipleAliases.trace.json @@ -0,0 +1,21 @@ +======== Resolving module '/import/foo' from '/root/src/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '/import/foo'. +Module name '/import/foo', matched pattern '/import/*'. +Trying substitution './import/*', candidate module location: './import/foo'. +Loading module as file / folder, candidate module location '/root/import/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/import/foo.ts' exists - use it as a name resolution result. +======== Module name '/import/foo' was successfully resolved to '/root/import/foo.ts'. ======== +======== Resolving module '/client/bar' from '/root/src/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '/client/bar'. +Module name '/client/bar', matched pattern '/client/*'. +Trying substitution './client/*', candidate module location: './client/bar'. +Loading module as file / folder, candidate module location '/root/client/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/client/bar.ts' does not exist. +File '/root/client/bar.tsx' does not exist. +File '/root/client/bar.d.ts' does not exist. +File '/root/client/bar.js' exists - use it as a name resolution result. +======== Module name '/client/bar' was successfully resolved to '/root/client/bar.js'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.trace.json new file mode 100644 index 0000000000..4f68837ad7 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.trace.json @@ -0,0 +1,23 @@ +======== Resolving module '/foo' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '/foo'. +Module name '/foo', matched pattern '/*'. +Trying substitution './src/*', candidate module location: './src/foo'. +Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/foo.ts' exists - use it as a name resolution result. +======== Module name '/foo' was successfully resolved to '/foo.ts'. ======== +======== Resolving module '/bar' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '/bar'. +Module name '/bar', matched pattern '/*'. +Trying substitution './src/*', candidate module location: './src/bar'. +Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +Loading module as file / folder, candidate module location '/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/bar.ts' does not exist. +File '/bar.tsx' does not exist. +File '/bar.d.ts' does not exist. +File '/bar.js' exists - use it as a name resolution result. +======== Module name '/bar' was successfully resolved to '/bar.js'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot.trace.json new file mode 100644 index 0000000000..950910be01 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot.trace.json @@ -0,0 +1,21 @@ +======== Resolving module '/foo' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '/foo'. +Module name '/foo', matched pattern '*'. +Trying substitution './src/*', candidate module location: './src//foo'. +Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/foo.ts' exists - use it as a name resolution result. +======== Module name '/foo' was successfully resolved to '/root/src/foo.ts'. ======== +======== Resolving module '/bar' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '/bar'. +Module name '/bar', matched pattern '*'. +Trying substitution './src/*', candidate module location: './src//bar'. +Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/root/src/bar.ts' does not exist. +File '/root/src/bar.tsx' does not exist. +File '/root/src/bar.d.ts' does not exist. +File '/root/src/bar.js' exists - use it as a name resolution result. +======== Module name '/bar' was successfully resolved to '/root/src/bar.js'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.trace.json new file mode 100644 index 0000000000..610a3b617f --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.trace.json @@ -0,0 +1,23 @@ +======== Resolving module '/foo' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '/foo'. +Module name '/foo', matched pattern '*'. +Trying substitution './src/*', candidate module location: './src//foo'. +Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/foo.ts' exists - use it as a name resolution result. +======== Module name '/foo' was successfully resolved to '/foo.ts'. ======== +======== Resolving module '/bar' from '/root/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '/bar'. +Module name '/bar', matched pattern '*'. +Trying substitution './src/*', candidate module location: './src//bar'. +Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +Loading module as file / folder, candidate module location '/bar', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/bar.ts' does not exist. +File '/bar.tsx' does not exist. +File '/bar.d.ts' does not exist. +File '/bar.js' exists - use it as a name resolution result. +======== Module name '/bar' was successfully resolved to '/bar.js'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension.trace.json new file mode 100644 index 0000000000..e06bc1c1c9 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension.trace.json @@ -0,0 +1,16 @@ +======== Resolving module 'foo' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'foo'. +Module name 'foo', matched pattern 'foo'. +Trying substitution 'foo/foo.ts', candidate module location: 'foo/foo.ts'. +File '/foo/foo.ts' exists - use it as a name resolution result. +======== Module name 'foo' was successfully resolved to '/foo/foo.ts'. ======== +======== Resolving module 'bar' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'bar'. +Module name 'bar', matched pattern 'bar'. +Trying substitution 'bar/bar.js', candidate module location: 'bar/bar.js'. +File '/bar/bar.js' exists - use it as a name resolution result. +======== Module name 'bar' was successfully resolved to '/bar/bar.js'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtensionInName.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtensionInName.trace.json new file mode 100644 index 0000000000..72b6bea942 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtensionInName.trace.json @@ -0,0 +1,46 @@ +======== Resolving module 'zone.js' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'zone.js'. +Module name 'zone.js', matched pattern '*'. +Trying substitution 'foo/*', candidate module location: 'foo/zone.js'. +Loading module as file / folder, candidate module location '/foo/zone.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/foo/zone.js' has a '.js' extension - stripping it. +File '/foo/zone.ts' does not exist. +File '/foo/zone.tsx' does not exist. +File '/foo/zone.d.ts' does not exist. +File '/foo/zone.js' does not exist. +File '/foo/zone.jsx' does not exist. +File '/foo/zone.js.ts' does not exist. +File '/foo/zone.js.tsx' does not exist. +File '/foo/zone.js.d.ts' does not exist. +File '/foo/zone.js.js' does not exist. +File '/foo/zone.js.jsx' does not exist. +File '/foo/zone.js/package.json' does not exist. +File '/foo/zone.js/index.ts' does not exist. +File '/foo/zone.js/index.tsx' does not exist. +File '/foo/zone.js/index.d.ts' exists - use it as a name resolution result. +======== Module name 'zone.js' was successfully resolved to '/foo/zone.js/index.d.ts'. ======== +======== Resolving module 'zone.tsx' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'zone.tsx'. +Module name 'zone.tsx', matched pattern '*'. +Trying substitution 'foo/*', candidate module location: 'foo/zone.tsx'. +Loading module as file / folder, candidate module location '/foo/zone.tsx', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/foo/zone.tsx' has a '.tsx' extension - stripping it. +File '/foo/zone.tsx' does not exist. +File '/foo/zone.ts' does not exist. +File '/foo/zone.d.ts' does not exist. +File '/foo/zone.jsx' does not exist. +File '/foo/zone.js' does not exist. +File '/foo/zone.tsx.ts' does not exist. +File '/foo/zone.tsx.tsx' does not exist. +File '/foo/zone.tsx.d.ts' does not exist. +File '/foo/zone.tsx.js' does not exist. +File '/foo/zone.tsx.jsx' does not exist. +File '/foo/zone.tsx/package.json' does not exist. +File '/foo/zone.tsx/index.ts' does not exist. +File '/foo/zone.tsx/index.tsx' does not exist. +File '/foo/zone.tsx/index.d.ts' exists - use it as a name resolution result. +======== Module name 'zone.tsx' was successfully resolved to '/foo/zone.tsx/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.trace.json new file mode 100644 index 0000000000..1eeb6b8fee --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.trace.json @@ -0,0 +1,15 @@ +======== Resolving module 'foo/bar/foobar.js' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'foo/bar/foobar.js'. +Module name 'foo/bar/foobar.js', matched pattern '*'. +Trying substitution 'node_modules/*', candidate module location: 'node_modules/foo/bar/foobar.js'. +Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/node_modules/foo/bar/foobar.js' has a '.js' extension - stripping it. +File '/node_modules/foo/bar/foobar.ts' does not exist. +File '/node_modules/foo/bar/foobar.tsx' does not exist. +File '/node_modules/foo/bar/foobar.d.ts' does not exist. +File '/node_modules/foo/bar/foobar.js' exists - use it as a name resolution result. +File '/node_modules/foo/package.json' does not exist. +Resolving real path for '/node_modules/foo/bar/foobar.js', result '/node_modules/foo/bar/foobar.js'. +======== Module name 'foo/bar/foobar.js' was successfully resolved to '/node_modules/foo/bar/foobar.js'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_failedLookup.trace.json b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_failedLookup.trace.json new file mode 100644 index 0000000000..7be5ad8451 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_failedLookup.trace.json @@ -0,0 +1,17 @@ +======== Resolving module 'foo' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'foo'. +Module name 'foo', matched pattern 'foo'. +Trying substitution 'foo/foo.ts', candidate module location: 'foo/foo.ts'. +File '/foo/foo.ts' does not exist. +Loading module as file / folder, candidate module location '/foo/foo.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/foo/foo.ts' has a '.ts' extension - stripping it. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'foo' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathsValidation4.trace.json b/testdata/baselines/reference/submodule/compiler/pathsValidation4.trace.json new file mode 100644 index 0000000000..3e08aef365 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathsValidation4.trace.json @@ -0,0 +1,20 @@ +======== Resolving module 'someModule' from '/.src/src/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'someModule'. +File '/.src/src/package.json' does not exist. +File '/.src/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'someModule' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/.src/src/node_modules' does not exist, skipping all lookups in it. +Directory '/.src/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/.src/node_modules' does not exist, skipping all lookups in it. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/.src/src/node_modules' does not exist, skipping all lookups in it. +Directory '/.src/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'someModule' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/pathsValidation5.trace.json b/testdata/baselines/reference/submodule/compiler/pathsValidation5.trace.json new file mode 100644 index 0000000000..3e08aef365 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathsValidation5.trace.json @@ -0,0 +1,20 @@ +======== Resolving module 'someModule' from '/.src/src/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'someModule'. +File '/.src/src/package.json' does not exist. +File '/.src/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'someModule' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/.src/src/node_modules' does not exist, skipping all lookups in it. +Directory '/.src/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/.src/node_modules' does not exist, skipping all lookups in it. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/.src/src/node_modules' does not exist, skipping all lookups in it. +Directory '/.src/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'someModule' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.trace.json b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.trace.json new file mode 100644 index 0000000000..e5848389ef --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.trace.json @@ -0,0 +1,39 @@ +======== Resolving module 'react/jsx-runtime' from '/.src/file.tsx'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'react/jsx-runtime' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/@types/react/package.json' exists according to earlier cached lookups. +File '/.src/node_modules/@types/react/jsx-runtime.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/.src/node_modules/@types/react/jsx-runtime.d.ts', result '/.src/node_modules/@types/react/jsx-runtime.d.ts'. +======== Module name 'react/jsx-runtime' was successfully resolved to '/.src/node_modules/@types/react/jsx-runtime.d.ts' with Package ID '@types/react@0.0.1'. ======== +======== Resolving module './' from '/.src/node_modules/@types/react/jsx-runtime.d.ts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Loading module as file / folder, candidate module location '/.src/node_modules/@types/react/', target file types: TypeScript, JavaScript, Declaration. +File '/.src/node_modules/@types/react/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/.src/node_modules/@types/react/index.d.ts'. +File '/.src/node_modules/@types/react/index.d.ts' exists - use it as a name resolution result. +======== Module name './' was successfully resolved to '/.src/node_modules/@types/react/index.d.ts'. ======== +======== Resolving module './' from '/.src/node_modules/@types/react/jsx-dev-runtime.d.ts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Loading module as file / folder, candidate module location '/.src/node_modules/@types/react/', target file types: TypeScript, JavaScript, Declaration. +File '/.src/node_modules/@types/react/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/.src/node_modules/@types/react/index.d.ts'. +File '/.src/node_modules/@types/react/index.d.ts' exists - use it as a name resolution result. +======== Module name './' was successfully resolved to '/.src/node_modules/@types/react/index.d.ts'. ======== +======== Resolving type reference directive 'react', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. +Found 'package.json' at '/.src/node_modules/@types/react/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/.src/node_modules/@types/react/index.d.ts'. +File '/.src/node_modules/@types/react/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/@types/react/index.d.ts', result '/.src/node_modules/@types/react/index.d.ts'. +======== Type reference directive 'react' was successfully resolved to '/.src/node_modules/@types/react/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNextEsm.trace.json b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNextEsm.trace.json new file mode 100644 index 0000000000..046195fc86 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNextEsm.trace.json @@ -0,0 +1,40 @@ +======== Resolving module 'react/jsx-runtime' from '/.src/file.tsx'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'react/jsx-runtime' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/@types/react/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './*' with target './jsx-runtime.js'. +File name '/.src/node_modules/@types/react/jsx-runtime.js' has a '.js' extension - stripping it. +File '/.src/node_modules/@types/react/jsx-runtime.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/.src/node_modules/@types/react/jsx-runtime.d.ts', result '/.src/node_modules/@types/react/jsx-runtime.d.ts'. +======== Module name 'react/jsx-runtime' was successfully resolved to '/.src/node_modules/@types/react/jsx-runtime.d.ts' with Package ID '@types/react@0.0.1'. ======== +======== Resolving module './' from '/.src/node_modules/@types/react/jsx-runtime.d.ts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Loading module as file / folder, candidate module location '/.src/node_modules/@types/react/', target file types: TypeScript, JavaScript, Declaration. +File '/.src/node_modules/@types/react/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/.src/node_modules/@types/react/index.d.ts'. +File '/.src/node_modules/@types/react/index.d.ts' exists - use it as a name resolution result. +======== Module name './' was successfully resolved to '/.src/node_modules/@types/react/index.d.ts'. ======== +======== Resolving module './' from '/.src/node_modules/@types/react/jsx-dev-runtime.d.ts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Loading module as file / folder, candidate module location '/.src/node_modules/@types/react/', target file types: TypeScript, JavaScript, Declaration. +File '/.src/node_modules/@types/react/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/.src/node_modules/@types/react/index.d.ts'. +File '/.src/node_modules/@types/react/index.d.ts' exists - use it as a name resolution result. +======== Module name './' was successfully resolved to '/.src/node_modules/@types/react/index.d.ts'. ======== +======== Resolving type reference directive 'react', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. +Found 'package.json' at '/.src/node_modules/@types/react/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/.src/node_modules/@types/react/index.d.ts'. +File '/.src/node_modules/@types/react/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/@types/react/index.d.ts', result '/.src/node_modules/@types/react/index.d.ts'. +======== Type reference directive 'react' was successfully resolved to '/.src/node_modules/@types/react/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModuleAndPathMapping.trace.json b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModuleAndPathMapping.trace.json new file mode 100644 index 0000000000..79637e8ac9 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModuleAndPathMapping.trace.json @@ -0,0 +1,34 @@ +======== Resolving module 'foo/bar/foobar.json' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'foo/bar/foobar.json'. +Module name 'foo/bar/foobar.json', matched pattern '*'. +Trying substitution 'node_modules/*', candidate module location: 'node_modules/foo/bar/foobar.json'. +Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.json', target file types: TypeScript, JavaScript, Declaration. +File name '/node_modules/foo/bar/foobar.json' has a '.json' extension - stripping it. +File '/node_modules/foo/bar/foobar.d.json.ts' does not exist. +File '/node_modules/foo/bar/foobar.json.ts' does not exist. +File '/node_modules/foo/bar/foobar.json.tsx' does not exist. +File '/node_modules/foo/bar/foobar.json.d.ts' does not exist. +File '/node_modules/foo/bar/foobar.json.js' does not exist. +File '/node_modules/foo/bar/foobar.json.jsx' does not exist. +Directory '/node_modules/foo/bar/foobar.json' does not exist, skipping all lookups in it. +Trying substitution 'src/types', candidate module location: 'src/types'. +Loading module as file / folder, candidate module location '/src/types', target file types: TypeScript, JavaScript, Declaration. +File '/package.json' does not exist. +Loading module 'foo/bar/foobar.json' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/foo/package.json' does not exist. +File name '/node_modules/foo/bar/foobar.json' has a '.json' extension - stripping it. +File '/node_modules/foo/bar/foobar.d.json.ts' does not exist. +File '/node_modules/foo/bar/foobar.json.ts' does not exist. +File '/node_modules/foo/bar/foobar.json.tsx' does not exist. +File '/node_modules/foo/bar/foobar.json.d.ts' does not exist. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +File name '/node_modules/@types/foo/bar/foobar.json' has a '.json' extension - stripping it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/foo/package.json' does not exist according to earlier cached lookups. +File name '/node_modules/foo/bar/foobar.json' has a '.json' extension - stripping it. +File '/node_modules/foo/bar/foobar.json.js' does not exist. +File '/node_modules/foo/bar/foobar.json.jsx' does not exist. +======== Module name 'foo/bar/foobar.json' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/requireOfJsonFile_PathMapping.trace.json b/testdata/baselines/reference/submodule/compiler/requireOfJsonFile_PathMapping.trace.json new file mode 100644 index 0000000000..1c02ac1083 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/requireOfJsonFile_PathMapping.trace.json @@ -0,0 +1,13 @@ +======== Resolving module 'foo/bar/foobar.json' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'foo/bar/foobar.json'. +Module name 'foo/bar/foobar.json', matched pattern '*'. +Trying substitution 'node_modules/*', candidate module location: 'node_modules/foo/bar/foobar.json'. +Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.json', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/node_modules/foo/bar/foobar.json' has a '.json' extension - stripping it. +File '/node_modules/foo/bar/foobar.d.json.ts' does not exist. +File '/node_modules/foo/bar/foobar.json' exists - use it as a name resolution result. +File '/node_modules/foo/package.json' does not exist. +Resolving real path for '/node_modules/foo/bar/foobar.json', result '/node_modules/foo/bar/foobar.json'. +======== Module name 'foo/bar/foobar.json' was successfully resolved to '/node_modules/foo/bar/foobar.json'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectiveScopedPackageCustomTypeRoot.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectiveScopedPackageCustomTypeRoot.trace.json new file mode 100644 index 0000000000..068e6916b8 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectiveScopedPackageCustomTypeRoot.trace.json @@ -0,0 +1,19 @@ +======== Resolving type reference directive '@scoped', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +File '/node_modules/@types/@scoped/package.json' does not exist. +File '/node_modules/@types/@scoped/index.d.ts' does not exist. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +File '/node_modules/@scoped/package.json' does not exist. +File '/node_modules/@scoped.d.ts' does not exist. +File '/node_modules/@scoped/index.d.ts' does not exist. +File '/node_modules/@types/@scoped/package.json' does not exist according to earlier cached lookups. +File '/node_modules/@types/@scoped.d.ts' does not exist. +File '/node_modules/@types/@scoped/index.d.ts' does not exist. +======== Type reference directive '@scoped' was not resolved. ======== +======== Resolving type reference directive 'mangled__attypescache', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +File '/node_modules/@types/mangled__attypescache/package.json' does not exist. +File '/node_modules/@types/mangled__attypescache/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/mangled__attypescache/index.d.ts', result '/node_modules/@types/mangled__attypescache/index.d.ts'. +======== Type reference directive 'mangled__attypescache' was successfully resolved to '/node_modules/@types/mangled__attypescache/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives1.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives1.trace.json new file mode 100644 index 0000000000..1e674dc278 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives1.trace.json @@ -0,0 +1,8 @@ +======== Resolving type reference directive 'lib', containing file '/app.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'lib' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives10.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives10.trace.json new file mode 100644 index 0000000000..7f17b6b7cb --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives10.trace.json @@ -0,0 +1,16 @@ +======== Resolving type reference directive 'lib', containing file '/app.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'lib' was not resolved. ======== +======== Resolving module './ref' from '/app.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/ref', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/ref.ts' does not exist. +File '/ref.tsx' does not exist. +File '/ref.d.ts' exists - use it as a name resolution result. +======== Module name './ref' was successfully resolved to '/ref.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives11.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives11.trace.json new file mode 100644 index 0000000000..6031ac457f --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives11.trace.json @@ -0,0 +1,6 @@ +======== Resolving module './mod1' from '/mod2.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/mod1', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/mod1.ts' exists - use it as a name resolution result. +======== Module name './mod1' was successfully resolved to '/mod1.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives12.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives12.trace.json new file mode 100644 index 0000000000..9c52ca7fa3 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives12.trace.json @@ -0,0 +1,32 @@ +======== Resolving module './main' from '/mod2.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/main', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/main.ts' exists - use it as a name resolution result. +======== Module name './main' was successfully resolved to '/main.ts'. ======== +======== Resolving module './mod1' from '/mod2.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/mod1', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/mod1.ts' exists - use it as a name resolution result. +======== Module name './mod1' was successfully resolved to '/mod1.ts'. ======== +======== Resolving type reference directive 'lib', containing file '/mod1.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'lib' was not resolved. ======== +======== Resolving module './main' from '/mod1.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/main', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/main.ts' exists - use it as a name resolution result. +======== Module name './main' was successfully resolved to '/main.ts'. ======== +======== Resolving module './main' from '/mod1.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/main', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/main.ts' exists - use it as a name resolution result. +======== Module name './main' was successfully resolved to '/main.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.trace.json new file mode 100644 index 0000000000..7f17b6b7cb --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.trace.json @@ -0,0 +1,16 @@ +======== Resolving type reference directive 'lib', containing file '/app.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'lib' was not resolved. ======== +======== Resolving module './ref' from '/app.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/ref', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/ref.ts' does not exist. +File '/ref.tsx' does not exist. +File '/ref.d.ts' exists - use it as a name resolution result. +======== Module name './ref' was successfully resolved to '/ref.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives3.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives3.trace.json new file mode 100644 index 0000000000..1e674dc278 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives3.trace.json @@ -0,0 +1,8 @@ +======== Resolving type reference directive 'lib', containing file '/app.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'lib' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives4.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives4.trace.json new file mode 100644 index 0000000000..1e674dc278 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives4.trace.json @@ -0,0 +1,8 @@ +======== Resolving type reference directive 'lib', containing file '/app.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'lib' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.trace.json new file mode 100644 index 0000000000..7f17b6b7cb --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.trace.json @@ -0,0 +1,16 @@ +======== Resolving type reference directive 'lib', containing file '/app.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'lib' was not resolved. ======== +======== Resolving module './ref' from '/app.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/ref', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/ref.ts' does not exist. +File '/ref.tsx' does not exist. +File '/ref.d.ts' exists - use it as a name resolution result. +======== Module name './ref' was successfully resolved to '/ref.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.trace.json new file mode 100644 index 0000000000..1e674dc278 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.trace.json @@ -0,0 +1,8 @@ +======== Resolving type reference directive 'lib', containing file '/app.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'lib' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives7.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives7.trace.json new file mode 100644 index 0000000000..1e674dc278 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives7.trace.json @@ -0,0 +1,8 @@ +======== Resolving type reference directive 'lib', containing file '/app.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'lib' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives8.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives8.trace.json new file mode 100644 index 0000000000..6031ac457f --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives8.trace.json @@ -0,0 +1,6 @@ +======== Resolving module './mod1' from '/mod2.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/mod1', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/mod1.ts' exists - use it as a name resolution result. +======== Module name './mod1' was successfully resolved to '/mod1.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.trace.json new file mode 100644 index 0000000000..9c52ca7fa3 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.trace.json @@ -0,0 +1,32 @@ +======== Resolving module './main' from '/mod2.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/main', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/main.ts' exists - use it as a name resolution result. +======== Module name './main' was successfully resolved to '/main.ts'. ======== +======== Resolving module './mod1' from '/mod2.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/mod1', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/mod1.ts' exists - use it as a name resolution result. +======== Module name './mod1' was successfully resolved to '/mod1.ts'. ======== +======== Resolving type reference directive 'lib', containing file '/mod1.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'lib' was not resolved. ======== +======== Resolving module './main' from '/mod1.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/main', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/main.ts' exists - use it as a name resolution result. +======== Module name './main' was successfully resolved to '/main.ts'. ======== +======== Resolving module './main' from '/mod1.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/main', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/main.ts' exists - use it as a name resolution result. +======== Module name './main' was successfully resolved to '/main.ts'. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.trace.json b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.trace.json new file mode 100644 index 0000000000..2651c0d11f --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.trace.json @@ -0,0 +1,97 @@ +======== Resolving module 'xyz' from '/foo/bar/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/foo/bar/package.json' does not exist. +File '/foo/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'xyz' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/foo/bar/node_modules' does not exist, skipping all lookups in it. +Directory '/foo/bar/node_modules/@types' does not exist, skipping all lookups in it. +File '/foo/node_modules/xyz.ts' does not exist. +File '/foo/node_modules/xyz.tsx' does not exist. +File '/foo/node_modules/xyz.d.ts' does not exist. +File '/foo/node_modules/@types/xyz.d.ts' does not exist. +File '/node_modules/xyz.ts' does not exist. +File '/node_modules/xyz.tsx' does not exist. +File '/node_modules/xyz.d.ts' does not exist. +File '/node_modules/@types/xyz.d.ts' does not exist. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/foo/bar/node_modules' does not exist, skipping all lookups in it. +File '/foo/node_modules/xyz.js' does not exist. +File '/foo/node_modules/xyz.jsx' does not exist. +File '/node_modules/xyz.js' does not exist. +File '/node_modules/xyz.jsx' does not exist. +======== Module name 'xyz' was not resolved. ======== +======== Resolving module 'pdq' from '/foo/bar/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/foo/bar/package.json' does not exist according to earlier cached lookups. +File '/foo/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'pdq' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/foo/bar/node_modules' does not exist, skipping all lookups in it. +Directory '/foo/bar/node_modules/@types' does not exist, skipping all lookups in it. +File '/foo/node_modules/pdq.ts' does not exist. +File '/foo/node_modules/pdq.tsx' does not exist. +File '/foo/node_modules/pdq.d.ts' does not exist. +File '/foo/node_modules/@types/pdq.d.ts' does not exist. +File '/node_modules/pdq.ts' does not exist. +File '/node_modules/pdq.tsx' does not exist. +File '/node_modules/pdq.d.ts' does not exist. +File '/node_modules/@types/pdq.d.ts' does not exist. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/foo/bar/node_modules' does not exist, skipping all lookups in it. +File '/foo/node_modules/pdq.js' does not exist. +File '/foo/node_modules/pdq.jsx' does not exist. +File '/node_modules/pdq.js' does not exist. +File '/node_modules/pdq.jsx' does not exist. +======== Module name 'pdq' was not resolved. ======== +======== Resolving module 'abc' from '/foo/bar/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/foo/bar/package.json' does not exist according to earlier cached lookups. +File '/foo/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'abc' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/foo/bar/node_modules' does not exist, skipping all lookups in it. +Directory '/foo/bar/node_modules/@types' does not exist, skipping all lookups in it. +File '/foo/node_modules/abc.ts' does not exist. +File '/foo/node_modules/abc.tsx' does not exist. +File '/foo/node_modules/abc.d.ts' does not exist. +File '/foo/node_modules/@types/abc.d.ts' does not exist. +File '/node_modules/abc.ts' does not exist. +File '/node_modules/abc.tsx' does not exist. +File '/node_modules/abc.d.ts' does not exist. +File '/node_modules/@types/abc.d.ts' does not exist. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/foo/bar/node_modules' does not exist, skipping all lookups in it. +File '/foo/node_modules/abc.js' does not exist. +File '/foo/node_modules/abc.jsx' does not exist. +File '/node_modules/abc.js' does not exist. +File '/node_modules/abc.jsx' does not exist. +======== Module name 'abc' was not resolved. ======== +======== Resolving type reference directive 'grumpy', containing file '/foo/bar/__inferred type names__.ts', root directory '/foo/bar/node_modules/@types,/foo/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/foo/bar/node_modules/@types, /foo/node_modules/@types, /node_modules/@types'. +Directory '/foo/bar/node_modules/@types' does not exist, skipping all lookups in it. +File '/foo/node_modules/@types/grumpy/package.json' does not exist. +File '/foo/node_modules/@types/grumpy/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/foo/node_modules/@types/grumpy/index.d.ts', result '/foo/node_modules/@types/grumpy/index.d.ts'. +======== Type reference directive 'grumpy' was successfully resolved to '/foo/node_modules/@types/grumpy/index.d.ts', primary: true. ======== +======== Resolving type reference directive 'sneezy', containing file '/foo/bar/__inferred type names__.ts', root directory '/foo/bar/node_modules/@types,/foo/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/foo/bar/node_modules/@types, /foo/node_modules/@types, /node_modules/@types'. +Directory '/foo/bar/node_modules/@types' does not exist, skipping all lookups in it. +File '/foo/node_modules/@types/sneezy/package.json' does not exist. +File '/foo/node_modules/@types/sneezy/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/foo/node_modules/@types/sneezy/index.d.ts', result '/foo/node_modules/@types/sneezy/index.d.ts'. +======== Type reference directive 'sneezy' was successfully resolved to '/foo/node_modules/@types/sneezy/index.d.ts', primary: true. ======== +======== Resolving type reference directive 'dopey', containing file '/foo/bar/__inferred type names__.ts', root directory '/foo/bar/node_modules/@types,/foo/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/foo/bar/node_modules/@types, /foo/node_modules/@types, /node_modules/@types'. +Directory '/foo/bar/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/foo/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/@types/dopey/package.json' does not exist. +File '/node_modules/@types/dopey/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/dopey/index.d.ts', result '/node_modules/@types/dopey/index.d.ts'. +======== Type reference directive 'dopey' was successfully resolved to '/node_modules/@types/dopey/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.trace.json b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.trace.json new file mode 100644 index 0000000000..8fd6c9f25a --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.trace.json @@ -0,0 +1,25 @@ +======== Resolving module 'xyz' from '/src/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/src/package.json' does not exist. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'xyz' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/src/node_modules' does not exist, skipping all lookups in it. +Directory '/src/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/xyz.ts' does not exist. +File '/node_modules/xyz.tsx' does not exist. +File '/node_modules/xyz.d.ts' does not exist. +File '/node_modules/@types/xyz.d.ts' does not exist. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/src/node_modules' does not exist, skipping all lookups in it. +File '/node_modules/xyz.js' does not exist. +File '/node_modules/xyz.jsx' does not exist. +======== Module name 'xyz' was not resolved. ======== +======== Resolving type reference directive 'foo', containing file '/src/__inferred type names__.ts', root directory '/src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/src/node_modules/@types, /node_modules/@types'. +Directory '/src/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/@types/foo/package.json' does not exist. +File '/node_modules/@types/foo/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/foo/index.d.ts', result '/node_modules/@types/foo/index.d.ts'. +======== Type reference directive 'foo' was successfully resolved to '/node_modules/@types/foo/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=esnext).trace.json b/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=esnext).trace.json new file mode 100644 index 0000000000..da55e998b5 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=esnext).trace.json @@ -0,0 +1,20 @@ +======== Resolving module 'conditions' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist. +Loading module 'conditions' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/conditions/package.json'. +Entering conditional exports. +Saw non-matching condition 'node'. +Matched 'exports' condition 'default'. +Using 'exports' subpath '.' with target './index.web.js'. +File name '/node_modules/conditions/index.web.js' has a '.js' extension - stripping it. +File '/node_modules/conditions/index.web.ts' does not exist. +File '/node_modules/conditions/index.web.tsx' does not exist. +File '/node_modules/conditions/index.web.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'default'. +Exiting conditional exports. +Resolving real path for '/node_modules/conditions/index.web.d.ts', result '/node_modules/conditions/index.web.d.ts'. +======== Module name 'conditions' was successfully resolved to '/node_modules/conditions/index.web.d.ts' with Package ID 'conditions@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=preserve).trace.json b/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=preserve).trace.json new file mode 100644 index 0000000000..da55e998b5 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=preserve).trace.json @@ -0,0 +1,20 @@ +======== Resolving module 'conditions' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist. +Loading module 'conditions' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/conditions/package.json'. +Entering conditional exports. +Saw non-matching condition 'node'. +Matched 'exports' condition 'default'. +Using 'exports' subpath '.' with target './index.web.js'. +File name '/node_modules/conditions/index.web.js' has a '.js' extension - stripping it. +File '/node_modules/conditions/index.web.ts' does not exist. +File '/node_modules/conditions/index.web.tsx' does not exist. +File '/node_modules/conditions/index.web.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'default'. +Exiting conditional exports. +Resolving real path for '/node_modules/conditions/index.web.d.ts', result '/node_modules/conditions/index.web.d.ts'. +======== Module name 'conditions' was successfully resolved to '/node_modules/conditions/index.web.d.ts' with Package ID 'conditions@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=node18,moduleresolution=bundler).trace.json b/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=node18,moduleresolution=bundler).trace.json new file mode 100644 index 0000000000..b295dae88c --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=node18,moduleresolution=bundler).trace.json @@ -0,0 +1,19 @@ +======== Resolving module '../lib' from '/app/test.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/lib', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/lib.ts' does not exist. +File '/lib.tsx' does not exist. +File '/lib.d.ts' does not exist. +File '/lib.js' does not exist. +File '/lib.jsx' does not exist. +Found 'package.json' at '/lib/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field './cjs/index.js' that references '/lib/cjs/index.js'. +File name '/lib/cjs/index.js' has a '.js' extension - stripping it. +File '/lib/cjs/index.ts' does not exist. +File '/lib/cjs/index.tsx' does not exist. +File '/lib/cjs/index.d.ts' exists - use it as a name resolution result. +======== Module name '../lib' was successfully resolved to '/lib/cjs/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=node18,moduleresolution=nodenext).trace.json b/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=node18,moduleresolution=nodenext).trace.json new file mode 100644 index 0000000000..6fb3a0bc62 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=node18,moduleresolution=nodenext).trace.json @@ -0,0 +1,19 @@ +======== Resolving module '../lib' from '/app/test.ts'. ======== +Explicitly specified module resolution kind: 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Loading module as file / folder, candidate module location '/lib', target file types: TypeScript, JavaScript, Declaration. +File '/lib.ts' does not exist. +File '/lib.tsx' does not exist. +File '/lib.d.ts' does not exist. +File '/lib.js' does not exist. +File '/lib.jsx' does not exist. +Found 'package.json' at '/lib/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field './cjs/index.js' that references '/lib/cjs/index.js'. +File name '/lib/cjs/index.js' has a '.js' extension - stripping it. +File '/lib/cjs/index.ts' does not exist. +File '/lib/cjs/index.tsx' does not exist. +File '/lib/cjs/index.d.ts' exists - use it as a name resolution result. +======== Module name '../lib' was successfully resolved to '/lib/cjs/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=nodenext,moduleresolution=bundler).trace.json b/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=nodenext,moduleresolution=bundler).trace.json new file mode 100644 index 0000000000..b295dae88c --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=nodenext,moduleresolution=bundler).trace.json @@ -0,0 +1,19 @@ +======== Resolving module '../lib' from '/app/test.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/lib', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/lib.ts' does not exist. +File '/lib.tsx' does not exist. +File '/lib.d.ts' does not exist. +File '/lib.js' does not exist. +File '/lib.jsx' does not exist. +Found 'package.json' at '/lib/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field './cjs/index.js' that references '/lib/cjs/index.js'. +File name '/lib/cjs/index.js' has a '.js' extension - stripping it. +File '/lib/cjs/index.ts' does not exist. +File '/lib/cjs/index.tsx' does not exist. +File '/lib/cjs/index.d.ts' exists - use it as a name resolution result. +======== Module name '../lib' was successfully resolved to '/lib/cjs/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json b/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json new file mode 100644 index 0000000000..6fb3a0bc62 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json @@ -0,0 +1,19 @@ +======== Resolving module '../lib' from '/app/test.ts'. ======== +Explicitly specified module resolution kind: 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Loading module as file / folder, candidate module location '/lib', target file types: TypeScript, JavaScript, Declaration. +File '/lib.ts' does not exist. +File '/lib.tsx' does not exist. +File '/lib.d.ts' does not exist. +File '/lib.js' does not exist. +File '/lib.jsx' does not exist. +Found 'package.json' at '/lib/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field './cjs/index.js' that references '/lib/cjs/index.js'. +File name '/lib/cjs/index.js' has a '.js' extension - stripping it. +File '/lib/cjs/index.ts' does not exist. +File '/lib/cjs/index.tsx' does not exist. +File '/lib/cjs/index.d.ts' exists - use it as a name resolution result. +======== Module name '../lib' was successfully resolved to '/lib/cjs/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerImportTsExtensions(allowimportingtsextensions=false,noemit=false).trace.json b/testdata/baselines/reference/submodule/conformance/bundlerImportTsExtensions(allowimportingtsextensions=false,noemit=false).trace.json new file mode 100644 index 0000000000..226fcdbbe3 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerImportTsExtensions(allowimportingtsextensions=false,noemit=false).trace.json @@ -0,0 +1,128 @@ +======== Resolving module './a' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.js' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.js' has a '.js' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.js' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.ts' has a '.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.ts' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './b' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.js' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.js' has a '.js' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.js' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.ts' has a '.ts' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.ts' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.d.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.d.ts' has a '.d.ts' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.d.ts' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.d.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.d.ts' has a '.d.ts' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.d.ts' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './c.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/c.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/c.ts' has a '.ts' extension - stripping it. +File '/project/c.ts' exists - use it as a name resolution result. +======== Module name './c.ts' was successfully resolved to '/project/c.ts'. ======== +======== Resolving module './c.tsx' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/c.tsx', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/c.tsx' has a '.tsx' extension - stripping it. +File '/project/c.tsx' exists - use it as a name resolution result. +======== Module name './c.tsx' was successfully resolved to '/project/c.tsx'. ======== +======== Resolving module './d' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/d', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/d.ts' does not exist. +File '/project/d.tsx' does not exist. +File '/project/d.d.ts' does not exist. +File '/project/d.js' does not exist. +File '/project/d.jsx' does not exist. +File '/project/d/package.json' does not exist. +File '/project/d/index.ts' exists - use it as a name resolution result. +======== Module name './d' was successfully resolved to '/project/d/index.ts'. ======== +======== Resolving module './d/index' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/d/index', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/d/index.ts' exists - use it as a name resolution result. +======== Module name './d/index' was successfully resolved to '/project/d/index.ts'. ======== +======== Resolving module './d/index.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/d/index.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/d/index.ts' has a '.ts' extension - stripping it. +File '/project/d/index.ts' exists - use it as a name resolution result. +======== Module name './d/index.ts' was successfully resolved to '/project/d/index.ts'. ======== +======== Resolving module './e' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/e', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/e.ts' exists - use it as a name resolution result. +======== Module name './e' was successfully resolved to '/project/e.ts'. ======== +======== Resolving module './e.txt' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/e.txt', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/e.txt' has a '.txt' extension - stripping it. +File '/project/e.d.txt.ts' does not exist. +File '/project/e.txt.ts' exists - use it as a name resolution result. +======== Module name './e.txt' was successfully resolved to '/project/e.txt.ts'. ======== +======== Resolving module './a.ts' from '/project/types.d.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.ts' has a '.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.ts' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.d.ts' from '/project/types.d.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.d.ts' has a '.d.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.d.ts' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.d.ts' from '/project/types.d.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.d.ts' has a '.d.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.d.ts' was successfully resolved to '/project/a.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerImportTsExtensions(allowimportingtsextensions=false,noemit=true).trace.json b/testdata/baselines/reference/submodule/conformance/bundlerImportTsExtensions(allowimportingtsextensions=false,noemit=true).trace.json new file mode 100644 index 0000000000..226fcdbbe3 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerImportTsExtensions(allowimportingtsextensions=false,noemit=true).trace.json @@ -0,0 +1,128 @@ +======== Resolving module './a' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.js' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.js' has a '.js' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.js' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.ts' has a '.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.ts' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './b' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.js' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.js' has a '.js' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.js' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.ts' has a '.ts' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.ts' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.d.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.d.ts' has a '.d.ts' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.d.ts' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.d.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.d.ts' has a '.d.ts' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.d.ts' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './c.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/c.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/c.ts' has a '.ts' extension - stripping it. +File '/project/c.ts' exists - use it as a name resolution result. +======== Module name './c.ts' was successfully resolved to '/project/c.ts'. ======== +======== Resolving module './c.tsx' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/c.tsx', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/c.tsx' has a '.tsx' extension - stripping it. +File '/project/c.tsx' exists - use it as a name resolution result. +======== Module name './c.tsx' was successfully resolved to '/project/c.tsx'. ======== +======== Resolving module './d' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/d', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/d.ts' does not exist. +File '/project/d.tsx' does not exist. +File '/project/d.d.ts' does not exist. +File '/project/d.js' does not exist. +File '/project/d.jsx' does not exist. +File '/project/d/package.json' does not exist. +File '/project/d/index.ts' exists - use it as a name resolution result. +======== Module name './d' was successfully resolved to '/project/d/index.ts'. ======== +======== Resolving module './d/index' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/d/index', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/d/index.ts' exists - use it as a name resolution result. +======== Module name './d/index' was successfully resolved to '/project/d/index.ts'. ======== +======== Resolving module './d/index.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/d/index.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/d/index.ts' has a '.ts' extension - stripping it. +File '/project/d/index.ts' exists - use it as a name resolution result. +======== Module name './d/index.ts' was successfully resolved to '/project/d/index.ts'. ======== +======== Resolving module './e' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/e', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/e.ts' exists - use it as a name resolution result. +======== Module name './e' was successfully resolved to '/project/e.ts'. ======== +======== Resolving module './e.txt' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/e.txt', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/e.txt' has a '.txt' extension - stripping it. +File '/project/e.d.txt.ts' does not exist. +File '/project/e.txt.ts' exists - use it as a name resolution result. +======== Module name './e.txt' was successfully resolved to '/project/e.txt.ts'. ======== +======== Resolving module './a.ts' from '/project/types.d.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.ts' has a '.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.ts' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.d.ts' from '/project/types.d.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.d.ts' has a '.d.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.d.ts' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.d.ts' from '/project/types.d.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.d.ts' has a '.d.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.d.ts' was successfully resolved to '/project/a.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerImportTsExtensions(allowimportingtsextensions=true,noemit=false).trace.json b/testdata/baselines/reference/submodule/conformance/bundlerImportTsExtensions(allowimportingtsextensions=true,noemit=false).trace.json new file mode 100644 index 0000000000..226fcdbbe3 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerImportTsExtensions(allowimportingtsextensions=true,noemit=false).trace.json @@ -0,0 +1,128 @@ +======== Resolving module './a' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.js' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.js' has a '.js' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.js' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.ts' has a '.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.ts' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './b' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.js' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.js' has a '.js' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.js' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.ts' has a '.ts' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.ts' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.d.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.d.ts' has a '.d.ts' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.d.ts' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.d.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.d.ts' has a '.d.ts' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.d.ts' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './c.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/c.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/c.ts' has a '.ts' extension - stripping it. +File '/project/c.ts' exists - use it as a name resolution result. +======== Module name './c.ts' was successfully resolved to '/project/c.ts'. ======== +======== Resolving module './c.tsx' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/c.tsx', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/c.tsx' has a '.tsx' extension - stripping it. +File '/project/c.tsx' exists - use it as a name resolution result. +======== Module name './c.tsx' was successfully resolved to '/project/c.tsx'. ======== +======== Resolving module './d' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/d', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/d.ts' does not exist. +File '/project/d.tsx' does not exist. +File '/project/d.d.ts' does not exist. +File '/project/d.js' does not exist. +File '/project/d.jsx' does not exist. +File '/project/d/package.json' does not exist. +File '/project/d/index.ts' exists - use it as a name resolution result. +======== Module name './d' was successfully resolved to '/project/d/index.ts'. ======== +======== Resolving module './d/index' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/d/index', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/d/index.ts' exists - use it as a name resolution result. +======== Module name './d/index' was successfully resolved to '/project/d/index.ts'. ======== +======== Resolving module './d/index.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/d/index.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/d/index.ts' has a '.ts' extension - stripping it. +File '/project/d/index.ts' exists - use it as a name resolution result. +======== Module name './d/index.ts' was successfully resolved to '/project/d/index.ts'. ======== +======== Resolving module './e' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/e', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/e.ts' exists - use it as a name resolution result. +======== Module name './e' was successfully resolved to '/project/e.ts'. ======== +======== Resolving module './e.txt' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/e.txt', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/e.txt' has a '.txt' extension - stripping it. +File '/project/e.d.txt.ts' does not exist. +File '/project/e.txt.ts' exists - use it as a name resolution result. +======== Module name './e.txt' was successfully resolved to '/project/e.txt.ts'. ======== +======== Resolving module './a.ts' from '/project/types.d.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.ts' has a '.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.ts' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.d.ts' from '/project/types.d.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.d.ts' has a '.d.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.d.ts' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.d.ts' from '/project/types.d.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.d.ts' has a '.d.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.d.ts' was successfully resolved to '/project/a.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerImportTsExtensions(allowimportingtsextensions=true,noemit=true).trace.json b/testdata/baselines/reference/submodule/conformance/bundlerImportTsExtensions(allowimportingtsextensions=true,noemit=true).trace.json new file mode 100644 index 0000000000..226fcdbbe3 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerImportTsExtensions(allowimportingtsextensions=true,noemit=true).trace.json @@ -0,0 +1,128 @@ +======== Resolving module './a' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.js' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.js' has a '.js' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.js' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.ts' has a '.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.ts' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './b' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.js' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.js' has a '.js' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.js' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.ts' has a '.ts' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.ts' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.d.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.d.ts' has a '.d.ts' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.d.ts' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './b.d.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/b.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/b.d.ts' has a '.d.ts' extension - stripping it. +File '/project/b.ts' exists - use it as a name resolution result. +======== Module name './b.d.ts' was successfully resolved to '/project/b.ts'. ======== +======== Resolving module './c.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/c.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/c.ts' has a '.ts' extension - stripping it. +File '/project/c.ts' exists - use it as a name resolution result. +======== Module name './c.ts' was successfully resolved to '/project/c.ts'. ======== +======== Resolving module './c.tsx' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/c.tsx', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/c.tsx' has a '.tsx' extension - stripping it. +File '/project/c.tsx' exists - use it as a name resolution result. +======== Module name './c.tsx' was successfully resolved to '/project/c.tsx'. ======== +======== Resolving module './d' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/d', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/d.ts' does not exist. +File '/project/d.tsx' does not exist. +File '/project/d.d.ts' does not exist. +File '/project/d.js' does not exist. +File '/project/d.jsx' does not exist. +File '/project/d/package.json' does not exist. +File '/project/d/index.ts' exists - use it as a name resolution result. +======== Module name './d' was successfully resolved to '/project/d/index.ts'. ======== +======== Resolving module './d/index' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/d/index', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/d/index.ts' exists - use it as a name resolution result. +======== Module name './d/index' was successfully resolved to '/project/d/index.ts'. ======== +======== Resolving module './d/index.ts' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/d/index.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/d/index.ts' has a '.ts' extension - stripping it. +File '/project/d/index.ts' exists - use it as a name resolution result. +======== Module name './d/index.ts' was successfully resolved to '/project/d/index.ts'. ======== +======== Resolving module './e' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/e', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/project/e.ts' exists - use it as a name resolution result. +======== Module name './e' was successfully resolved to '/project/e.ts'. ======== +======== Resolving module './e.txt' from '/project/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/e.txt', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/e.txt' has a '.txt' extension - stripping it. +File '/project/e.d.txt.ts' does not exist. +File '/project/e.txt.ts' exists - use it as a name resolution result. +======== Module name './e.txt' was successfully resolved to '/project/e.txt.ts'. ======== +======== Resolving module './a.ts' from '/project/types.d.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.ts' has a '.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.ts' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.d.ts' from '/project/types.d.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.d.ts' has a '.d.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.d.ts' was successfully resolved to '/project/a.ts'. ======== +======== Resolving module './a.d.ts' from '/project/types.d.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/project/a.d.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/project/a.d.ts' has a '.d.ts' extension - stripping it. +File '/project/a.ts' exists - use it as a name resolution result. +======== Module name './a.d.ts' was successfully resolved to '/project/a.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=esnext).trace.json b/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=esnext).trace.json new file mode 100644 index 0000000000..0e7da888eb --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=esnext).trace.json @@ -0,0 +1,57 @@ +======== Resolving module 'dual' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'dual' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/dual/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.js'. +File name '/node_modules/dual/index.js' has a '.js' extension - stripping it. +File '/node_modules/dual/index.ts' does not exist. +File '/node_modules/dual/index.tsx' does not exist. +File '/node_modules/dual/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/node_modules/dual/index.d.ts', result '/node_modules/dual/index.d.ts'. +======== Module name 'dual' was successfully resolved to '/node_modules/dual/index.d.ts' with Package ID 'dual@1.0.0'. ======== +======== Resolving module 'dual' from '/main.mts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'dual' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/dual/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.js'. +File name '/node_modules/dual/index.js' has a '.js' extension - stripping it. +File '/node_modules/dual/index.ts' does not exist. +File '/node_modules/dual/index.tsx' does not exist. +File '/node_modules/dual/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/node_modules/dual/index.d.ts', result '/node_modules/dual/index.d.ts'. +======== Module name 'dual' was successfully resolved to '/node_modules/dual/index.d.ts' with Package ID 'dual@1.0.0'. ======== +======== Resolving module 'dual' from '/main.cts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'dual' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/dual/package.json'. +Entering conditional exports. +Saw non-matching condition 'import'. +Matched 'exports' condition 'require'. +Using 'exports' subpath '.' with target './index.cjs'. +File name '/node_modules/dual/index.cjs' has a '.cjs' extension - stripping it. +File '/node_modules/dual/index.cts' does not exist. +File '/node_modules/dual/index.d.cts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'require'. +Exiting conditional exports. +Resolving real path for '/node_modules/dual/index.d.cts', result '/node_modules/dual/index.d.cts'. +======== Module name 'dual' was successfully resolved to '/node_modules/dual/index.d.cts' with Package ID 'dual@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=preserve).trace.json b/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=preserve).trace.json new file mode 100644 index 0000000000..0e7da888eb --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=preserve).trace.json @@ -0,0 +1,57 @@ +======== Resolving module 'dual' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'dual' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/dual/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.js'. +File name '/node_modules/dual/index.js' has a '.js' extension - stripping it. +File '/node_modules/dual/index.ts' does not exist. +File '/node_modules/dual/index.tsx' does not exist. +File '/node_modules/dual/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/node_modules/dual/index.d.ts', result '/node_modules/dual/index.d.ts'. +======== Module name 'dual' was successfully resolved to '/node_modules/dual/index.d.ts' with Package ID 'dual@1.0.0'. ======== +======== Resolving module 'dual' from '/main.mts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'dual' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/dual/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.js'. +File name '/node_modules/dual/index.js' has a '.js' extension - stripping it. +File '/node_modules/dual/index.ts' does not exist. +File '/node_modules/dual/index.tsx' does not exist. +File '/node_modules/dual/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/node_modules/dual/index.d.ts', result '/node_modules/dual/index.d.ts'. +======== Module name 'dual' was successfully resolved to '/node_modules/dual/index.d.ts' with Package ID 'dual@1.0.0'. ======== +======== Resolving module 'dual' from '/main.cts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'dual' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/dual/package.json'. +Entering conditional exports. +Saw non-matching condition 'import'. +Matched 'exports' condition 'require'. +Using 'exports' subpath '.' with target './index.cjs'. +File name '/node_modules/dual/index.cjs' has a '.cjs' extension - stripping it. +File '/node_modules/dual/index.cts' does not exist. +File '/node_modules/dual/index.d.cts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'require'. +Exiting conditional exports. +Resolving real path for '/node_modules/dual/index.d.cts', result '/node_modules/dual/index.d.cts'. +======== Module name 'dual' was successfully resolved to '/node_modules/dual/index.d.cts' with Package ID 'dual@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerRelative1(module=esnext).trace.json b/testdata/baselines/reference/submodule/conformance/bundlerRelative1(module=esnext).trace.json new file mode 100644 index 0000000000..348f217046 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerRelative1(module=esnext).trace.json @@ -0,0 +1,97 @@ +======== Resolving module './dir' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/dir', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/dir.ts' does not exist. +File '/dir.tsx' does not exist. +File '/dir.d.ts' does not exist. +File '/dir.js' does not exist. +File '/dir.jsx' does not exist. +File '/dir/package.json' does not exist. +File '/dir/index.ts' exists - use it as a name resolution result. +======== Module name './dir' was successfully resolved to '/dir/index.ts'. ======== +======== Resolving module './dir/index' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/dir/index', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/dir/index.ts' exists - use it as a name resolution result. +======== Module name './dir/index' was successfully resolved to '/dir/index.ts'. ======== +======== Resolving module './dir/index.js' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/dir/index.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/dir/index.js' has a '.js' extension - stripping it. +File '/dir/index.ts' exists - use it as a name resolution result. +======== Module name './dir/index.js' was successfully resolved to '/dir/index.ts'. ======== +======== Resolving module './dir/index.ts' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/dir/index.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/dir/index.ts' has a '.ts' extension - stripping it. +File '/dir/index.ts' exists - use it as a name resolution result. +======== Module name './dir/index.ts' was successfully resolved to '/dir/index.ts'. ======== +======== Resolving module './redirect' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/redirect', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/redirect.ts' does not exist. +File '/redirect.tsx' does not exist. +File '/redirect.d.ts' does not exist. +File '/redirect.js' does not exist. +File '/redirect.jsx' does not exist. +Found 'package.json' at '/redirect/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field '../foo' that references '/foo'. +Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/foo.ts' does not exist. +File '/foo.tsx' does not exist. +File '/foo.d.ts' does not exist. +File '/foo.js' does not exist. +File '/foo.jsx' does not exist. +File '/foo/index.ts' exists - use it as a name resolution result. +======== Module name './redirect' was successfully resolved to '/foo/index.ts'. ======== +======== Resolving module './redirect/index' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/redirect/index', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/redirect/index.ts' does not exist. +File '/redirect/index.tsx' does not exist. +File '/redirect/index.d.ts' does not exist. +File '/redirect/index.js' does not exist. +File '/redirect/index.jsx' does not exist. +Directory '/redirect/index' does not exist, skipping all lookups in it. +======== Module name './redirect/index' was not resolved. ======== +======== Resolving module './types/esm' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/types/esm', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/types/esm.ts' does not exist. +File '/types/esm.tsx' does not exist. +File '/types/esm.d.ts' exists - use it as a name resolution result. +======== Module name './types/esm' was successfully resolved to '/types/esm.d.ts'. ======== +======== Resolving module './types/esm' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/types/esm', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/types/esm.ts' does not exist. +File '/types/esm.tsx' does not exist. +File '/types/esm.d.ts' exists - use it as a name resolution result. +======== Module name './types/esm' was successfully resolved to '/types/esm.d.ts'. ======== +======== Resolving module './types/cjs' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/types/cjs', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/types/cjs.ts' does not exist. +File '/types/cjs.tsx' does not exist. +File '/types/cjs.d.ts' exists - use it as a name resolution result. +======== Module name './types/cjs' was successfully resolved to '/types/cjs.d.ts'. ======== +======== Resolving module './types/cjs' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/types/cjs', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/types/cjs.ts' does not exist. +File '/types/cjs.tsx' does not exist. +File '/types/cjs.d.ts' exists - use it as a name resolution result. +======== Module name './types/cjs' was successfully resolved to '/types/cjs.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerRelative1(module=preserve).trace.json b/testdata/baselines/reference/submodule/conformance/bundlerRelative1(module=preserve).trace.json new file mode 100644 index 0000000000..348f217046 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerRelative1(module=preserve).trace.json @@ -0,0 +1,97 @@ +======== Resolving module './dir' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/dir', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/dir.ts' does not exist. +File '/dir.tsx' does not exist. +File '/dir.d.ts' does not exist. +File '/dir.js' does not exist. +File '/dir.jsx' does not exist. +File '/dir/package.json' does not exist. +File '/dir/index.ts' exists - use it as a name resolution result. +======== Module name './dir' was successfully resolved to '/dir/index.ts'. ======== +======== Resolving module './dir/index' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/dir/index', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/dir/index.ts' exists - use it as a name resolution result. +======== Module name './dir/index' was successfully resolved to '/dir/index.ts'. ======== +======== Resolving module './dir/index.js' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/dir/index.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/dir/index.js' has a '.js' extension - stripping it. +File '/dir/index.ts' exists - use it as a name resolution result. +======== Module name './dir/index.js' was successfully resolved to '/dir/index.ts'. ======== +======== Resolving module './dir/index.ts' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/dir/index.ts', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/dir/index.ts' has a '.ts' extension - stripping it. +File '/dir/index.ts' exists - use it as a name resolution result. +======== Module name './dir/index.ts' was successfully resolved to '/dir/index.ts'. ======== +======== Resolving module './redirect' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/redirect', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/redirect.ts' does not exist. +File '/redirect.tsx' does not exist. +File '/redirect.d.ts' does not exist. +File '/redirect.js' does not exist. +File '/redirect.jsx' does not exist. +Found 'package.json' at '/redirect/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field '../foo' that references '/foo'. +Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/foo.ts' does not exist. +File '/foo.tsx' does not exist. +File '/foo.d.ts' does not exist. +File '/foo.js' does not exist. +File '/foo.jsx' does not exist. +File '/foo/index.ts' exists - use it as a name resolution result. +======== Module name './redirect' was successfully resolved to '/foo/index.ts'. ======== +======== Resolving module './redirect/index' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/redirect/index', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/redirect/index.ts' does not exist. +File '/redirect/index.tsx' does not exist. +File '/redirect/index.d.ts' does not exist. +File '/redirect/index.js' does not exist. +File '/redirect/index.jsx' does not exist. +Directory '/redirect/index' does not exist, skipping all lookups in it. +======== Module name './redirect/index' was not resolved. ======== +======== Resolving module './types/esm' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/types/esm', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/types/esm.ts' does not exist. +File '/types/esm.tsx' does not exist. +File '/types/esm.d.ts' exists - use it as a name resolution result. +======== Module name './types/esm' was successfully resolved to '/types/esm.d.ts'. ======== +======== Resolving module './types/esm' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/types/esm', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/types/esm.ts' does not exist. +File '/types/esm.tsx' does not exist. +File '/types/esm.d.ts' exists - use it as a name resolution result. +======== Module name './types/esm' was successfully resolved to '/types/esm.d.ts'. ======== +======== Resolving module './types/cjs' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/types/cjs', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/types/cjs.ts' does not exist. +File '/types/cjs.tsx' does not exist. +File '/types/cjs.d.ts' exists - use it as a name resolution result. +======== Module name './types/cjs' was successfully resolved to '/types/cjs.d.ts'. ======== +======== Resolving module './types/cjs' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +Loading module as file / folder, candidate module location '/types/cjs', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/types/cjs.ts' does not exist. +File '/types/cjs.tsx' does not exist. +File '/types/cjs.d.ts' exists - use it as a name resolution result. +======== Module name './types/cjs' was successfully resolved to '/types/cjs.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/conditionalExportsResolutionFallback(moduleresolution=bundler).trace.json b/testdata/baselines/reference/submodule/conformance/conditionalExportsResolutionFallback(moduleresolution=bundler).trace.json new file mode 100644 index 0000000000..6ab1ae8a5f --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/conditionalExportsResolutionFallback(moduleresolution=bundler).trace.json @@ -0,0 +1,23 @@ +======== Resolving module 'dep' from '/index.mts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist. +Loading module 'dep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/dep/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './dist/index.mjs'. +File name '/node_modules/dep/dist/index.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/dep/dist/index.mts' does not exist. +File '/node_modules/dep/dist/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './dist/index.d.ts'. +File '/node_modules/dep/dist/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/node_modules/dep/dist/index.d.ts', result '/node_modules/dep/dist/index.d.ts'. +======== Module name 'dep' was successfully resolved to '/node_modules/dep/dist/index.d.ts' with Package ID 'dep@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/conditionalExportsResolutionFallback(moduleresolution=node16).trace.json b/testdata/baselines/reference/submodule/conformance/conditionalExportsResolutionFallback(moduleresolution=node16).trace.json new file mode 100644 index 0000000000..b6bcab4eb7 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/conditionalExportsResolutionFallback(moduleresolution=node16).trace.json @@ -0,0 +1,23 @@ +======== Resolving module 'dep' from '/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist. +Loading module 'dep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/dep/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './dist/index.mjs'. +File name '/node_modules/dep/dist/index.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/dep/dist/index.mts' does not exist. +File '/node_modules/dep/dist/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './dist/index.d.ts'. +File '/node_modules/dep/dist/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/node_modules/dep/dist/index.d.ts', result '/node_modules/dep/dist/index.d.ts'. +======== Module name 'dep' was successfully resolved to '/node_modules/dep/dist/index.d.ts' with Package ID 'dep@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/conditionalExportsResolutionFallback(moduleresolution=nodenext).trace.json b/testdata/baselines/reference/submodule/conformance/conditionalExportsResolutionFallback(moduleresolution=nodenext).trace.json new file mode 100644 index 0000000000..db9b927d97 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/conditionalExportsResolutionFallback(moduleresolution=nodenext).trace.json @@ -0,0 +1,23 @@ +======== Resolving module 'dep' from '/index.mts'. ======== +Explicitly specified module resolution kind: 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist. +Loading module 'dep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/dep/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './dist/index.mjs'. +File name '/node_modules/dep/dist/index.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/dep/dist/index.mts' does not exist. +File '/node_modules/dep/dist/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './dist/index.d.ts'. +File '/node_modules/dep/dist/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/node_modules/dep/dist/index.d.ts', result '/node_modules/dep/dist/index.d.ts'. +======== Module name 'dep' was successfully resolved to '/node_modules/dep/dist/index.d.ts' with Package ID 'dep@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/customConditions(resolvepackagejsonexports=false).trace.json b/testdata/baselines/reference/submodule/conformance/customConditions(resolvepackagejsonexports=false).trace.json new file mode 100644 index 0000000000..a8379a790b --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/customConditions(resolvepackagejsonexports=false).trace.json @@ -0,0 +1,21 @@ +======== Resolving module 'lodash' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist. +Loading module 'lodash' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/lodash/package.json'. +File '/node_modules/lodash.ts' does not exist. +File '/node_modules/lodash.tsx' does not exist. +File '/node_modules/lodash.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'index.js' that references '/node_modules/lodash/index.js'. +File name '/node_modules/lodash/index.js' has a '.js' extension - stripping it. +File '/node_modules/lodash/index.ts' does not exist. +File '/node_modules/lodash/index.tsx' does not exist. +File '/node_modules/lodash/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/lodash/index.d.ts', result '/node_modules/lodash/index.d.ts'. +======== Module name 'lodash' was successfully resolved to '/node_modules/lodash/index.d.ts' with Package ID 'lodash@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/customConditions(resolvepackagejsonexports=true).trace.json b/testdata/baselines/reference/submodule/conformance/customConditions(resolvepackagejsonexports=true).trace.json new file mode 100644 index 0000000000..91a2907b8a --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/customConditions(resolvepackagejsonexports=true).trace.json @@ -0,0 +1,21 @@ +======== Resolving module 'lodash' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist. +Loading module 'lodash' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/lodash/package.json'. +Entering conditional exports. +Saw non-matching condition 'browser'. +Saw non-matching condition 'webpack'. +Matched 'exports' condition 'default'. +Using 'exports' subpath '.' with target './index.js'. +File name '/node_modules/lodash/index.js' has a '.js' extension - stripping it. +File '/node_modules/lodash/index.ts' does not exist. +File '/node_modules/lodash/index.tsx' does not exist. +File '/node_modules/lodash/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'default'. +Exiting conditional exports. +Resolving real path for '/node_modules/lodash/index.d.ts', result '/node_modules/lodash/index.d.ts'. +======== Module name 'lodash' was successfully resolved to '/node_modules/lodash/index.d.ts' with Package ID 'lodash@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/library-reference-1.trace.json b/testdata/baselines/reference/submodule/conformance/library-reference-1.trace.json new file mode 100644 index 0000000000..81c5a2b48a --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/library-reference-1.trace.json @@ -0,0 +1,11 @@ +======== Resolving type reference directive 'jquery', containing file '/src/consumer.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/src'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/src/node_modules' does not exist, skipping all lookups in it. +Directory '/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'jquery' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/conformance/library-reference-10.trace.json b/testdata/baselines/reference/submodule/conformance/library-reference-10.trace.json new file mode 100644 index 0000000000..4430d19bf0 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/library-reference-10.trace.json @@ -0,0 +1,11 @@ +======== Resolving type reference directive 'jquery', containing file '/foo/consumer.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/foo'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/foo/node_modules' does not exist, skipping all lookups in it. +Directory '/foo/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'jquery' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/conformance/library-reference-11.trace.json b/testdata/baselines/reference/submodule/conformance/library-reference-11.trace.json new file mode 100644 index 0000000000..29e08ea81f --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/library-reference-11.trace.json @@ -0,0 +1,14 @@ +======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/a/b'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/a/node_modules/jquery/package.json'. +File '/a/node_modules/jquery.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' has 'typings' field 'jquery.d.ts' that references '/a/node_modules/jquery/jquery.d.ts'. +File '/a/node_modules/jquery/jquery.d.ts' exists - use it as a name resolution result. +Resolving real path for '/a/node_modules/jquery/jquery.d.ts', result '/a/node_modules/jquery/jquery.d.ts'. +======== Type reference directive 'jquery' was successfully resolved to '/a/node_modules/jquery/jquery.d.ts', primary: false. ======== diff --git a/testdata/baselines/reference/submodule/conformance/library-reference-12.trace.json b/testdata/baselines/reference/submodule/conformance/library-reference-12.trace.json new file mode 100644 index 0000000000..c36ef8d0ab --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/library-reference-12.trace.json @@ -0,0 +1,15 @@ +======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/a/b'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/a/b/node_modules' does not exist, skipping all lookups in it. +Directory '/a/b/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/a/node_modules/jquery/package.json'. +File '/a/node_modules/jquery.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'dist/jquery.d.ts' that references '/a/node_modules/jquery/dist/jquery.d.ts'. +File '/a/node_modules/jquery/dist/jquery.d.ts' exists - use it as a name resolution result. +Resolving real path for '/a/node_modules/jquery/dist/jquery.d.ts', result '/a/node_modules/jquery/dist/jquery.d.ts'. +======== Type reference directive 'jquery' was successfully resolved to '/a/node_modules/jquery/dist/jquery.d.ts', primary: false. ======== diff --git a/testdata/baselines/reference/submodule/conformance/library-reference-13.trace.json b/testdata/baselines/reference/submodule/conformance/library-reference-13.trace.json new file mode 100644 index 0000000000..cdc64d65fc --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/library-reference-13.trace.json @@ -0,0 +1,7 @@ +======== Resolving type reference directive 'jquery', containing file '/a/__inferred type names__.ts', root directory '/a/types'. ======== +Resolving with primary search path '/a/types'. +File '/a/types/jquery.d.ts' does not exist. +File '/a/types/jquery/package.json' does not exist. +File '/a/types/jquery/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/a/types/jquery/index.d.ts', result '/a/types/jquery/index.d.ts'. +======== Type reference directive 'jquery' was successfully resolved to '/a/types/jquery/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/library-reference-2.trace.json b/testdata/baselines/reference/submodule/conformance/library-reference-2.trace.json new file mode 100644 index 0000000000..0f38836cae --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/library-reference-2.trace.json @@ -0,0 +1,9 @@ +======== Resolving type reference directive 'jquery', containing file '/consumer.ts', root directory '/test/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/test/node_modules/@types, /node_modules/@types'. +Directory '/test/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'jquery' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/conformance/library-reference-3.trace.json b/testdata/baselines/reference/submodule/conformance/library-reference-3.trace.json new file mode 100644 index 0000000000..deaa485e43 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/library-reference-3.trace.json @@ -0,0 +1,11 @@ +======== Resolving type reference directive 'jquery', containing file '/src/consumer.ts', root directory '/src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/src/node_modules/@types, /node_modules/@types'. +Directory '/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/src'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +File '/src/node_modules/jquery/package.json' does not exist. +File '/src/node_modules/jquery.d.ts' does not exist. +File '/src/node_modules/jquery/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/src/node_modules/jquery/index.d.ts', result '/src/node_modules/jquery/index.d.ts'. +======== Type reference directive 'jquery' was successfully resolved to '/src/node_modules/jquery/index.d.ts', primary: false. ======== diff --git a/testdata/baselines/reference/submodule/conformance/library-reference-4.trace.json b/testdata/baselines/reference/submodule/conformance/library-reference-4.trace.json new file mode 100644 index 0000000000..084081bfd1 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/library-reference-4.trace.json @@ -0,0 +1,52 @@ +======== Resolving type reference directive 'foo', containing file '/src/root.ts', root directory '/.src/test/node_modules/@types,/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/test/node_modules/@types, /.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/test/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/src'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/src/node_modules' does not exist, skipping all lookups in it. +Directory '/src/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/foo/package.json' does not exist. +File '/node_modules/foo.d.ts' does not exist. +File '/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/foo/index.d.ts', result '/node_modules/foo/index.d.ts'. +======== Type reference directive 'foo' was successfully resolved to '/node_modules/foo/index.d.ts', primary: false. ======== +======== Resolving type reference directive 'bar', containing file '/src/root.ts', root directory '/.src/test/node_modules/@types,/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/test/node_modules/@types, /.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/test/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/src'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/src/node_modules' does not exist, skipping all lookups in it. +Directory '/src/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/bar/package.json' does not exist. +File '/node_modules/bar.d.ts' does not exist. +File '/node_modules/bar/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/bar/index.d.ts', result '/node_modules/bar/index.d.ts'. +======== Type reference directive 'bar' was successfully resolved to '/node_modules/bar/index.d.ts', primary: false. ======== +======== Resolving type reference directive 'alpha', containing file '/node_modules/foo/index.d.ts', root directory '/.src/test/node_modules/@types,/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/test/node_modules/@types, /.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/test/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/node_modules/foo'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +File '/node_modules/foo/node_modules/alpha/package.json' does not exist. +File '/node_modules/foo/node_modules/alpha.d.ts' does not exist. +File '/node_modules/foo/node_modules/alpha/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/foo/node_modules/alpha/index.d.ts', result '/node_modules/foo/node_modules/alpha/index.d.ts'. +======== Type reference directive 'alpha' was successfully resolved to '/node_modules/foo/node_modules/alpha/index.d.ts', primary: false. ======== +======== Resolving type reference directive 'alpha', containing file '/node_modules/bar/index.d.ts', root directory '/.src/test/node_modules/@types,/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/test/node_modules/@types, /.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/test/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/node_modules/bar'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +File '/node_modules/bar/node_modules/alpha/package.json' does not exist. +File '/node_modules/bar/node_modules/alpha.d.ts' does not exist. +File '/node_modules/bar/node_modules/alpha/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/bar/node_modules/alpha/index.d.ts', result '/node_modules/bar/node_modules/alpha/index.d.ts'. +======== Type reference directive 'alpha' was successfully resolved to '/node_modules/bar/node_modules/alpha/index.d.ts', primary: false. ======== diff --git a/testdata/baselines/reference/submodule/conformance/library-reference-5.trace.json b/testdata/baselines/reference/submodule/conformance/library-reference-5.trace.json new file mode 100644 index 0000000000..77d8a02569 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/library-reference-5.trace.json @@ -0,0 +1,44 @@ +======== Resolving type reference directive 'foo', containing file '/src/root.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/src'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/src/node_modules' does not exist, skipping all lookups in it. +Directory '/src/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/foo/package.json' does not exist. +File '/node_modules/foo.d.ts' does not exist. +File '/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/foo/index.d.ts', result '/node_modules/foo/index.d.ts'. +======== Type reference directive 'foo' was successfully resolved to '/node_modules/foo/index.d.ts', primary: false. ======== +======== Resolving type reference directive 'bar', containing file '/src/root.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/src'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/src/node_modules' does not exist, skipping all lookups in it. +Directory '/src/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/bar/package.json' does not exist. +File '/node_modules/bar.d.ts' does not exist. +File '/node_modules/bar/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/bar/index.d.ts', result '/node_modules/bar/index.d.ts'. +======== Type reference directive 'bar' was successfully resolved to '/node_modules/bar/index.d.ts', primary: false. ======== +======== Resolving type reference directive 'alpha', containing file '/node_modules/foo/index.d.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/node_modules/foo'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +File '/node_modules/foo/node_modules/alpha/package.json' does not exist. +File '/node_modules/foo/node_modules/alpha.d.ts' does not exist. +File '/node_modules/foo/node_modules/alpha/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/foo/node_modules/alpha/index.d.ts', result '/node_modules/foo/node_modules/alpha/index.d.ts'. +======== Type reference directive 'alpha' was successfully resolved to '/node_modules/foo/node_modules/alpha/index.d.ts', primary: false. ======== +======== Resolving type reference directive 'alpha', containing file '/node_modules/bar/index.d.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/node_modules/bar'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +File '/node_modules/bar/node_modules/alpha/package.json' does not exist. +File '/node_modules/bar/node_modules/alpha.d.ts' does not exist. +File '/node_modules/bar/node_modules/alpha/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/bar/node_modules/alpha/index.d.ts', result '/node_modules/bar/node_modules/alpha/index.d.ts'. +======== Type reference directive 'alpha' was successfully resolved to '/node_modules/bar/node_modules/alpha/index.d.ts', primary: false. ======== diff --git a/testdata/baselines/reference/submodule/conformance/library-reference-6.trace.json b/testdata/baselines/reference/submodule/conformance/library-reference-6.trace.json new file mode 100644 index 0000000000..422db93453 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/library-reference-6.trace.json @@ -0,0 +1,12 @@ +======== Resolving type reference directive 'alpha', containing file '/src/foo.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +File '/node_modules/@types/alpha/package.json' does not exist according to earlier cached lookups. +File '/node_modules/@types/alpha/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/alpha/index.d.ts', result '/node_modules/@types/alpha/index.d.ts'. +======== Type reference directive 'alpha' was successfully resolved to '/node_modules/@types/alpha/index.d.ts', primary: true. ======== +======== Resolving type reference directive 'alpha', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +File '/node_modules/@types/alpha/package.json' does not exist. +File '/node_modules/@types/alpha/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/alpha/index.d.ts', result '/node_modules/@types/alpha/index.d.ts'. +======== Type reference directive 'alpha' was successfully resolved to '/node_modules/@types/alpha/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/library-reference-7.trace.json b/testdata/baselines/reference/submodule/conformance/library-reference-7.trace.json new file mode 100644 index 0000000000..a213a97694 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/library-reference-7.trace.json @@ -0,0 +1,10 @@ +======== Resolving type reference directive 'jquery', containing file '/src/consumer.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/src'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +File '/src/node_modules/jquery/package.json' does not exist. +File '/src/node_modules/jquery.d.ts' does not exist. +File '/src/node_modules/jquery/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/src/node_modules/jquery/index.d.ts', result '/src/node_modules/jquery/index.d.ts'. +======== Type reference directive 'jquery' was successfully resolved to '/src/node_modules/jquery/index.d.ts', primary: false. ======== diff --git a/testdata/baselines/reference/submodule/conformance/library-reference-8.trace.json b/testdata/baselines/reference/submodule/conformance/library-reference-8.trace.json new file mode 100644 index 0000000000..b27bc84028 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/library-reference-8.trace.json @@ -0,0 +1,22 @@ +======== Resolving type reference directive 'alpha', containing file '/test/foo.ts', root directory '/test/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/test/node_modules/@types, /node_modules/@types'. +Directory '/test/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/test'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/test/node_modules' does not exist, skipping all lookups in it. +Directory '/test/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'alpha' was not resolved. ======== +======== Resolving type reference directive 'beta', containing file '/test/foo.ts', root directory '/test/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/test/node_modules/@types, /node_modules/@types'. +Directory '/test/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/test'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +Directory '/test/node_modules' does not exist, skipping all lookups in it. +Directory '/test/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Type reference directive 'beta' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/conformance/library-reference-scoped-packages.trace.json b/testdata/baselines/reference/submodule/conformance/library-reference-scoped-packages.trace.json new file mode 100644 index 0000000000..5c8b96b752 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/library-reference-scoped-packages.trace.json @@ -0,0 +1,16 @@ +======== Resolving type reference directive '@beep/boop', containing file '/a.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. +Scoped package detected, looking in 'beep__boop' +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'beep__boop' +File '/node_modules/@types/beep__boop/package.json' does not exist according to earlier cached lookups. +File '/node_modules/@types/beep__boop/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/beep__boop/index.d.ts', result '/node_modules/@types/beep__boop/index.d.ts'. +======== Type reference directive '@beep/boop' was successfully resolved to '/node_modules/@types/beep__boop/index.d.ts', primary: true. ======== +======== Resolving type reference directive 'beep__boop', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/@types/beep__boop/package.json' does not exist. +File '/node_modules/@types/beep__boop/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/beep__boop/index.d.ts', result '/node_modules/@types/beep__boop/index.d.ts'. +======== Type reference directive 'beep__boop' was successfully resolved to '/node_modules/@types/beep__boop/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/moduleResolutionWithExtensions.trace.json b/testdata/baselines/reference/submodule/conformance/moduleResolutionWithExtensions.trace.json new file mode 100644 index 0000000000..c91bfb320e --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/moduleResolutionWithExtensions.trace.json @@ -0,0 +1,22 @@ +======== Resolving module './a' from '/src/b.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/src/a', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/src/a.ts' exists - use it as a name resolution result. +======== Module name './a' was successfully resolved to '/src/a.ts'. ======== +======== Resolving module './a.js' from '/src/d.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/src/a.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/src/a.js' has a '.js' extension - stripping it. +File '/src/a.ts' exists - use it as a name resolution result. +======== Module name './a.js' was successfully resolved to '/src/a.ts'. ======== +======== Resolving module './jquery.js' from '/src/jquery_user_1.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/src/jquery.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/src/jquery.js' has a '.js' extension - stripping it. +File '/src/jquery.ts' does not exist. +File '/src/jquery.tsx' does not exist. +File '/src/jquery.d.ts' exists - use it as a name resolution result. +======== Module name './jquery.js' was successfully resolved to '/src/jquery.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/nestedPackageJsonRedirect(moduleresolution=bundler).trace.json b/testdata/baselines/reference/submodule/conformance/nestedPackageJsonRedirect(moduleresolution=bundler).trace.json new file mode 100644 index 0000000000..5393d839b3 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/nestedPackageJsonRedirect(moduleresolution=bundler).trace.json @@ -0,0 +1,17 @@ +======== Resolving module '@restart/hooks/useMergedRefs' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module '@restart/hooks/useMergedRefs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/@restart/hooks/useMergedRefs/package.json'. +Found 'package.json' at '/node_modules/@restart/hooks/package.json'. +File '/node_modules/@restart/hooks/useMergedRefs.ts' does not exist. +File '/node_modules/@restart/hooks/useMergedRefs.tsx' does not exist. +File '/node_modules/@restart/hooks/useMergedRefs.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field '../esm/useMergedRefs.d.ts' that references '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts'. +File '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts', result '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts'. +======== Module name '@restart/hooks/useMergedRefs' was successfully resolved to '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/nestedPackageJsonRedirect(moduleresolution=node16).trace.json b/testdata/baselines/reference/submodule/conformance/nestedPackageJsonRedirect(moduleresolution=node16).trace.json new file mode 100644 index 0000000000..a6aac5151e --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/nestedPackageJsonRedirect(moduleresolution=node16).trace.json @@ -0,0 +1,17 @@ +======== Resolving module '@restart/hooks/useMergedRefs' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@restart/hooks/useMergedRefs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/@restart/hooks/useMergedRefs/package.json'. +Found 'package.json' at '/node_modules/@restart/hooks/package.json'. +File '/node_modules/@restart/hooks/useMergedRefs.ts' does not exist. +File '/node_modules/@restart/hooks/useMergedRefs.tsx' does not exist. +File '/node_modules/@restart/hooks/useMergedRefs.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field '../esm/useMergedRefs.d.ts' that references '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts'. +File '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts', result '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts'. +======== Module name '@restart/hooks/useMergedRefs' was successfully resolved to '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/nestedPackageJsonRedirect(moduleresolution=nodenext).trace.json b/testdata/baselines/reference/submodule/conformance/nestedPackageJsonRedirect(moduleresolution=nodenext).trace.json new file mode 100644 index 0000000000..f85fe49da0 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/nestedPackageJsonRedirect(moduleresolution=nodenext).trace.json @@ -0,0 +1,17 @@ +======== Resolving module '@restart/hooks/useMergedRefs' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@restart/hooks/useMergedRefs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/@restart/hooks/useMergedRefs/package.json'. +Found 'package.json' at '/node_modules/@restart/hooks/package.json'. +File '/node_modules/@restart/hooks/useMergedRefs.ts' does not exist. +File '/node_modules/@restart/hooks/useMergedRefs.tsx' does not exist. +File '/node_modules/@restart/hooks/useMergedRefs.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field '../esm/useMergedRefs.d.ts' that references '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts'. +File '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts', result '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts'. +======== Module name '@restart/hooks/useMergedRefs' was successfully resolved to '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/node10AlternateResult_noResolution.trace.json b/testdata/baselines/reference/submodule/conformance/node10AlternateResult_noResolution.trace.json new file mode 100644 index 0000000000..fd231b2be0 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/node10AlternateResult_noResolution.trace.json @@ -0,0 +1,15 @@ +======== Resolving module 'pkg' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'pkg' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/pkg/package.json'. +Using 'exports' subpath '.' with target './definitely-not-index.js'. +File name '/node_modules/pkg/definitely-not-index.js' has a '.js' extension - stripping it. +File '/node_modules/pkg/definitely-not-index.ts' does not exist. +File '/node_modules/pkg/definitely-not-index.tsx' does not exist. +File '/node_modules/pkg/definitely-not-index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/pkg/definitely-not-index.d.ts', result '/node_modules/pkg/definitely-not-index.d.ts'. +======== Module name 'pkg' was successfully resolved to '/node_modules/pkg/definitely-not-index.d.ts' with Package ID 'pkg@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/node10Alternateresult_noTypes.trace.json b/testdata/baselines/reference/submodule/conformance/node10Alternateresult_noTypes.trace.json new file mode 100644 index 0000000000..fd231b2be0 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/node10Alternateresult_noTypes.trace.json @@ -0,0 +1,15 @@ +======== Resolving module 'pkg' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'pkg' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/pkg/package.json'. +Using 'exports' subpath '.' with target './definitely-not-index.js'. +File name '/node_modules/pkg/definitely-not-index.js' has a '.js' extension - stripping it. +File '/node_modules/pkg/definitely-not-index.ts' does not exist. +File '/node_modules/pkg/definitely-not-index.tsx' does not exist. +File '/node_modules/pkg/definitely-not-index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/pkg/definitely-not-index.d.ts', result '/node_modules/pkg/definitely-not-index.d.ts'. +======== Module name 'pkg' was successfully resolved to '/node_modules/pkg/definitely-not-index.d.ts' with Package ID 'pkg@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/node10IsNode_node.trace.json b/testdata/baselines/reference/submodule/conformance/node10IsNode_node.trace.json new file mode 100644 index 0000000000..e62dd092f1 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/node10IsNode_node.trace.json @@ -0,0 +1,15 @@ +======== Resolving module 'fancy-lib' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'fancy-lib' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/fancy-lib/package.json'. +Using 'exports' subpath '.' with target './definitely-not-index.js'. +File name '/node_modules/fancy-lib/definitely-not-index.js' has a '.js' extension - stripping it. +File '/node_modules/fancy-lib/definitely-not-index.ts' does not exist. +File '/node_modules/fancy-lib/definitely-not-index.tsx' does not exist. +File '/node_modules/fancy-lib/definitely-not-index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/fancy-lib/definitely-not-index.d.ts', result '/node_modules/fancy-lib/definitely-not-index.d.ts'. +======== Module name 'fancy-lib' was successfully resolved to '/node_modules/fancy-lib/definitely-not-index.d.ts' with Package ID 'fancy-lib@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/node10IsNode_node10.trace.json b/testdata/baselines/reference/submodule/conformance/node10IsNode_node10.trace.json new file mode 100644 index 0000000000..e62dd092f1 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/node10IsNode_node10.trace.json @@ -0,0 +1,15 @@ +======== Resolving module 'fancy-lib' from '/main.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'fancy-lib' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/fancy-lib/package.json'. +Using 'exports' subpath '.' with target './definitely-not-index.js'. +File name '/node_modules/fancy-lib/definitely-not-index.js' has a '.js' extension - stripping it. +File '/node_modules/fancy-lib/definitely-not-index.ts' does not exist. +File '/node_modules/fancy-lib/definitely-not-index.tsx' does not exist. +File '/node_modules/fancy-lib/definitely-not-index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/fancy-lib/definitely-not-index.d.ts', result '/node_modules/fancy-lib/definitely-not-index.d.ts'. +======== Module name 'fancy-lib' was successfully resolved to '/node_modules/fancy-lib/definitely-not-index.d.ts' with Package ID 'fancy-lib@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAtTypesPriority.trace.json b/testdata/baselines/reference/submodule/conformance/nodeModulesAtTypesPriority.trace.json new file mode 100644 index 0000000000..98969b7f08 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAtTypesPriority.trace.json @@ -0,0 +1,57 @@ +======== Resolving module 'react' from '/packages/a/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/packages/a/package.json' does not exist according to earlier cached lookups. +File '/packages/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'react' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/packages/a/node_modules/react/package.json' does not exist. +File '/packages/a/node_modules/react.ts' does not exist. +File '/packages/a/node_modules/react.tsx' does not exist. +File '/packages/a/node_modules/react.d.ts' does not exist. +File '/packages/a/node_modules/react/index.ts' does not exist. +File '/packages/a/node_modules/react/index.tsx' does not exist. +File '/packages/a/node_modules/react/index.d.ts' does not exist. +Directory '/packages/a/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/packages/node_modules' does not exist, skipping all lookups in it. +Directory '/packages/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/react.ts' does not exist. +File '/node_modules/react.tsx' does not exist. +File '/node_modules/react.d.ts' does not exist. +File '/node_modules/@types/react/package.json' does not exist according to earlier cached lookups. +File '/node_modules/@types/react.d.ts' does not exist. +File '/node_modules/@types/react/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/react/index.d.ts', result '/node_modules/@types/react/index.d.ts'. +======== Module name 'react' was successfully resolved to '/node_modules/@types/react/index.d.ts'. ======== +======== Resolving module 'redux' from '/packages/a/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/packages/a/package.json' does not exist according to earlier cached lookups. +File '/packages/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'redux' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/packages/a/node_modules/redux/package.json' does not exist. +File '/packages/a/node_modules/redux.ts' does not exist. +File '/packages/a/node_modules/redux.tsx' does not exist. +File '/packages/a/node_modules/redux.d.ts' does not exist. +File '/packages/a/node_modules/redux/index.ts' does not exist. +File '/packages/a/node_modules/redux/index.tsx' does not exist. +File '/packages/a/node_modules/redux/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/packages/a/node_modules/redux/index.d.ts', result '/packages/a/node_modules/redux/index.d.ts'. +======== Module name 'redux' was successfully resolved to '/packages/a/node_modules/redux/index.d.ts'. ======== +======== Resolving type reference directive 'react', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/@types/react/package.json' does not exist. +File '/node_modules/@types/react/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/react/index.d.ts', result '/node_modules/@types/react/index.d.ts'. +======== Type reference directive 'react' was successfully resolved to '/node_modules/@types/react/index.d.ts', primary: true. ======== +======== Resolving type reference directive 'redux', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/@types/redux/package.json' does not exist. +File '/node_modules/@types/redux/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/redux/index.d.ts', result '/node_modules/@types/redux/index.d.ts'. +======== Type reference directive 'redux' was successfully resolved to '/node_modules/@types/redux/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node16).trace.json b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node16).trace.json new file mode 100644 index 0000000000..cdf5b6df2d --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node16).trace.json @@ -0,0 +1,210 @@ +======== Resolving module 'exports-and-types-versions/foo' from '/main.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './foo' with target './dist/foo.js'. +File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it. +File '/node_modules/exports-and-types-versions/dist/foo.ts' does not exist. +File '/node_modules/exports-and-types-versions/dist/foo.tsx' does not exist. +File '/node_modules/exports-and-types-versions/dist/foo.d.ts' does not exist. +Export specifier './foo' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './foo' with target './dist/foo.js'. +File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it. +File '/node_modules/exports-and-types-versions/dist/foo.js' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/exports-and-types-versions/dist/foo.js', result '/node_modules/exports-and-types-versions/dist/foo.js'. +======== Module name 'exports-and-types-versions/foo' was successfully resolved to '/node_modules/exports-and-types-versions/dist/foo.js' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/nope' from '/main.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +======== Module name 'exports-and-types-versions/nope' was not resolved. ======== +======== Resolving module 'exports-and-types-versions/yep' from '/main.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath './yep' with target './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/versioned-yep' from '/main.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'types@>=4'. +Using 'exports' subpath './versioned-yep' with target './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types@>=4'. +Exiting conditional exports. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/versioned-yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/versioned-nah' from '/main.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'types@<4'. +Exiting conditional exports. +Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'types@<4'. +Exiting conditional exports. +Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +======== Module name 'exports-and-types-versions/versioned-nah' was not resolved. ======== +======== Resolving module 'just-types-versions/foo' from '/main.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/just-types-versions/package.json' exists according to earlier cached lookups. +'package.json' has a 'typesVersions' entry '*' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'foo'. +Module name 'foo', matched pattern 'foo'. +Trying substitution './types/foo.d.ts', candidate module location: './types/foo.d.ts'. +File '/node_modules/just-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/just-types-versions/types/foo.d.ts', result '/node_modules/just-types-versions/types/foo.d.ts'. +======== Module name 'just-types-versions/foo' was successfully resolved to '/node_modules/just-types-versions/types/foo.d.ts'. ======== +======== Resolving module 'exports-and-types-versions/foo' from '/main.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist. +Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/exports-and-types-versions/package.json'. +Using 'exports' subpath './foo' with target './dist/foo.js'. +File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it. +File '/node_modules/exports-and-types-versions/dist/foo.ts' does not exist. +File '/node_modules/exports-and-types-versions/dist/foo.tsx' does not exist. +File '/node_modules/exports-and-types-versions/dist/foo.d.ts' does not exist. +Export specifier './foo' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './foo' with target './dist/foo.js'. +File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it. +File '/node_modules/exports-and-types-versions/dist/foo.js' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/exports-and-types-versions/dist/foo.js', result '/node_modules/exports-and-types-versions/dist/foo.js'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +'package.json' has a 'typesVersions' field with version-specific path mappings. +'package.json' has a 'typesVersions' entry '*' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'foo'. +Module name 'foo', matched pattern 'foo'. +Trying substitution './types/foo.d.ts', candidate module location: './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/foo' was successfully resolved to '/node_modules/exports-and-types-versions/dist/foo.js' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/nope' from '/main.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +======== Module name 'exports-and-types-versions/nope' was not resolved. ======== +======== Resolving module 'exports-and-types-versions/yep' from '/main.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath './yep' with target './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/versioned-yep' from '/main.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'types@>=4'. +Using 'exports' subpath './versioned-yep' with target './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types@>=4'. +Exiting conditional exports. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/versioned-yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/versioned-nah' from '/main.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'types@<4'. +Exiting conditional exports. +Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'types@<4'. +Exiting conditional exports. +Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +======== Module name 'exports-and-types-versions/versioned-nah' was not resolved. ======== +======== Resolving module 'just-types-versions/foo' from '/main.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/just-types-versions/package.json'. +'package.json' has a 'typesVersions' field with version-specific path mappings. +'package.json' has a 'typesVersions' entry '*' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'foo'. +Module name 'foo', matched pattern 'foo'. +Trying substitution './types/foo.d.ts', candidate module location: './types/foo.d.ts'. +File '/node_modules/just-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/just-types-versions/types/foo.d.ts', result '/node_modules/just-types-versions/types/foo.d.ts'. +======== Module name 'just-types-versions/foo' was successfully resolved to '/node_modules/just-types-versions/types/foo.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node18).trace.json b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node18).trace.json new file mode 100644 index 0000000000..cdf5b6df2d --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node18).trace.json @@ -0,0 +1,210 @@ +======== Resolving module 'exports-and-types-versions/foo' from '/main.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './foo' with target './dist/foo.js'. +File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it. +File '/node_modules/exports-and-types-versions/dist/foo.ts' does not exist. +File '/node_modules/exports-and-types-versions/dist/foo.tsx' does not exist. +File '/node_modules/exports-and-types-versions/dist/foo.d.ts' does not exist. +Export specifier './foo' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './foo' with target './dist/foo.js'. +File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it. +File '/node_modules/exports-and-types-versions/dist/foo.js' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/exports-and-types-versions/dist/foo.js', result '/node_modules/exports-and-types-versions/dist/foo.js'. +======== Module name 'exports-and-types-versions/foo' was successfully resolved to '/node_modules/exports-and-types-versions/dist/foo.js' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/nope' from '/main.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +======== Module name 'exports-and-types-versions/nope' was not resolved. ======== +======== Resolving module 'exports-and-types-versions/yep' from '/main.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath './yep' with target './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/versioned-yep' from '/main.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'types@>=4'. +Using 'exports' subpath './versioned-yep' with target './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types@>=4'. +Exiting conditional exports. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/versioned-yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/versioned-nah' from '/main.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'types@<4'. +Exiting conditional exports. +Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'types@<4'. +Exiting conditional exports. +Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +======== Module name 'exports-and-types-versions/versioned-nah' was not resolved. ======== +======== Resolving module 'just-types-versions/foo' from '/main.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/just-types-versions/package.json' exists according to earlier cached lookups. +'package.json' has a 'typesVersions' entry '*' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'foo'. +Module name 'foo', matched pattern 'foo'. +Trying substitution './types/foo.d.ts', candidate module location: './types/foo.d.ts'. +File '/node_modules/just-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/just-types-versions/types/foo.d.ts', result '/node_modules/just-types-versions/types/foo.d.ts'. +======== Module name 'just-types-versions/foo' was successfully resolved to '/node_modules/just-types-versions/types/foo.d.ts'. ======== +======== Resolving module 'exports-and-types-versions/foo' from '/main.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist. +Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/exports-and-types-versions/package.json'. +Using 'exports' subpath './foo' with target './dist/foo.js'. +File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it. +File '/node_modules/exports-and-types-versions/dist/foo.ts' does not exist. +File '/node_modules/exports-and-types-versions/dist/foo.tsx' does not exist. +File '/node_modules/exports-and-types-versions/dist/foo.d.ts' does not exist. +Export specifier './foo' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './foo' with target './dist/foo.js'. +File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it. +File '/node_modules/exports-and-types-versions/dist/foo.js' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/exports-and-types-versions/dist/foo.js', result '/node_modules/exports-and-types-versions/dist/foo.js'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +'package.json' has a 'typesVersions' field with version-specific path mappings. +'package.json' has a 'typesVersions' entry '*' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'foo'. +Module name 'foo', matched pattern 'foo'. +Trying substitution './types/foo.d.ts', candidate module location: './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/foo' was successfully resolved to '/node_modules/exports-and-types-versions/dist/foo.js' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/nope' from '/main.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +======== Module name 'exports-and-types-versions/nope' was not resolved. ======== +======== Resolving module 'exports-and-types-versions/yep' from '/main.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath './yep' with target './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/versioned-yep' from '/main.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'types@>=4'. +Using 'exports' subpath './versioned-yep' with target './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types@>=4'. +Exiting conditional exports. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/versioned-yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/versioned-nah' from '/main.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'types@<4'. +Exiting conditional exports. +Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'types@<4'. +Exiting conditional exports. +Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +======== Module name 'exports-and-types-versions/versioned-nah' was not resolved. ======== +======== Resolving module 'just-types-versions/foo' from '/main.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/just-types-versions/package.json'. +'package.json' has a 'typesVersions' field with version-specific path mappings. +'package.json' has a 'typesVersions' entry '*' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'foo'. +Module name 'foo', matched pattern 'foo'. +Trying substitution './types/foo.d.ts', candidate module location: './types/foo.d.ts'. +File '/node_modules/just-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/just-types-versions/types/foo.d.ts', result '/node_modules/just-types-versions/types/foo.d.ts'. +======== Module name 'just-types-versions/foo' was successfully resolved to '/node_modules/just-types-versions/types/foo.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json new file mode 100644 index 0000000000..851e28cb88 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json @@ -0,0 +1,210 @@ +======== Resolving module 'exports-and-types-versions/foo' from '/main.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './foo' with target './dist/foo.js'. +File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it. +File '/node_modules/exports-and-types-versions/dist/foo.ts' does not exist. +File '/node_modules/exports-and-types-versions/dist/foo.tsx' does not exist. +File '/node_modules/exports-and-types-versions/dist/foo.d.ts' does not exist. +Export specifier './foo' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './foo' with target './dist/foo.js'. +File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it. +File '/node_modules/exports-and-types-versions/dist/foo.js' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/exports-and-types-versions/dist/foo.js', result '/node_modules/exports-and-types-versions/dist/foo.js'. +======== Module name 'exports-and-types-versions/foo' was successfully resolved to '/node_modules/exports-and-types-versions/dist/foo.js' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/nope' from '/main.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +======== Module name 'exports-and-types-versions/nope' was not resolved. ======== +======== Resolving module 'exports-and-types-versions/yep' from '/main.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath './yep' with target './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/versioned-yep' from '/main.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'types@>=4'. +Using 'exports' subpath './versioned-yep' with target './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types@>=4'. +Exiting conditional exports. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/versioned-yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/versioned-nah' from '/main.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'types@<4'. +Exiting conditional exports. +Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'types@<4'. +Exiting conditional exports. +Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +======== Module name 'exports-and-types-versions/versioned-nah' was not resolved. ======== +======== Resolving module 'just-types-versions/foo' from '/main.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/just-types-versions/package.json' exists according to earlier cached lookups. +'package.json' has a 'typesVersions' entry '*' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'foo'. +Module name 'foo', matched pattern 'foo'. +Trying substitution './types/foo.d.ts', candidate module location: './types/foo.d.ts'. +File '/node_modules/just-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/just-types-versions/types/foo.d.ts', result '/node_modules/just-types-versions/types/foo.d.ts'. +======== Module name 'just-types-versions/foo' was successfully resolved to '/node_modules/just-types-versions/types/foo.d.ts'. ======== +======== Resolving module 'exports-and-types-versions/foo' from '/main.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist. +Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/exports-and-types-versions/package.json'. +Using 'exports' subpath './foo' with target './dist/foo.js'. +File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it. +File '/node_modules/exports-and-types-versions/dist/foo.ts' does not exist. +File '/node_modules/exports-and-types-versions/dist/foo.tsx' does not exist. +File '/node_modules/exports-and-types-versions/dist/foo.d.ts' does not exist. +Export specifier './foo' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './foo' with target './dist/foo.js'. +File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it. +File '/node_modules/exports-and-types-versions/dist/foo.js' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/exports-and-types-versions/dist/foo.js', result '/node_modules/exports-and-types-versions/dist/foo.js'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +'package.json' has a 'typesVersions' field with version-specific path mappings. +'package.json' has a 'typesVersions' entry '*' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'foo'. +Module name 'foo', matched pattern 'foo'. +Trying substitution './types/foo.d.ts', candidate module location: './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/foo' was successfully resolved to '/node_modules/exports-and-types-versions/dist/foo.js' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/nope' from '/main.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +======== Module name 'exports-and-types-versions/nope' was not resolved. ======== +======== Resolving module 'exports-and-types-versions/yep' from '/main.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath './yep' with target './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/versioned-yep' from '/main.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'types@>=4'. +Using 'exports' subpath './versioned-yep' with target './types/foo.d.ts'. +File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types@>=4'. +Exiting conditional exports. +Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'. +======== Module name 'exports-and-types-versions/versioned-yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions@1.0.0'. ======== +======== Resolving module 'exports-and-types-versions/versioned-nah' from '/main.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'types@<4'. +Exiting conditional exports. +Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'types@<4'. +Exiting conditional exports. +Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'. +======== Module name 'exports-and-types-versions/versioned-nah' was not resolved. ======== +======== Resolving module 'just-types-versions/foo' from '/main.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/just-types-versions/package.json'. +'package.json' has a 'typesVersions' field with version-specific path mappings. +'package.json' has a 'typesVersions' entry '*' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'foo'. +Module name 'foo', matched pattern 'foo'. +Trying substitution './types/foo.d.ts', candidate module location: './types/foo.d.ts'. +File '/node_modules/just-types-versions/types/foo.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/just-types-versions/types/foo.d.ts', result '/node_modules/just-types-versions/types/foo.d.ts'. +======== Module name 'just-types-versions/foo' was successfully resolved to '/node_modules/just-types-versions/types/foo.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesPackageImports(module=node16).trace.json b/testdata/baselines/reference/submodule/conformance/nodeModulesPackageImports(module=node16).trace.json new file mode 100644 index 0000000000..cc02d686fa --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesPackageImports(module=node16).trace.json @@ -0,0 +1,72 @@ +======== Resolving module '#cjs' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#cjs' with target './index.cjs'. +File name '/.src/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/index.cts' exists - use it as a name resolution result. +======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ======== +======== Resolving module '#mjs' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#mjs' with target './index.mjs'. +File name '/.src/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/index.mts' exists - use it as a name resolution result. +======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ======== +======== Resolving module '#type' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#type' with target './index.js'. +File name '/.src/index.js' has a '.js' extension - stripping it. +File '/.src/index.ts' exists - use it as a name resolution result. +======== Module name '#type' was successfully resolved to '/.src/index.ts'. ======== +======== Resolving module '#cjs' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Found 'package.json' at '/.src/package.json'. +Using 'imports' subpath '#cjs' with target './index.cjs'. +File name '/.src/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/index.cts' exists - use it as a name resolution result. +======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ======== +======== Resolving module '#mjs' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#mjs' with target './index.mjs'. +File name '/.src/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/index.mts' exists - use it as a name resolution result. +======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ======== +======== Resolving module '#type' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#type' with target './index.js'. +File name '/.src/index.js' has a '.js' extension - stripping it. +File '/.src/index.ts' exists - use it as a name resolution result. +======== Module name '#type' was successfully resolved to '/.src/index.ts'. ======== +======== Resolving module '#cjs' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#cjs' with target './index.cjs'. +File name '/.src/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/index.cts' exists - use it as a name resolution result. +======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ======== +======== Resolving module '#mjs' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#mjs' with target './index.mjs'. +File name '/.src/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/index.mts' exists - use it as a name resolution result. +======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ======== +======== Resolving module '#type' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#type' with target './index.js'. +File name '/.src/index.js' has a '.js' extension - stripping it. +File '/.src/index.ts' exists - use it as a name resolution result. +======== Module name '#type' was successfully resolved to '/.src/index.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesPackageImports(module=node18).trace.json b/testdata/baselines/reference/submodule/conformance/nodeModulesPackageImports(module=node18).trace.json new file mode 100644 index 0000000000..cc02d686fa --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesPackageImports(module=node18).trace.json @@ -0,0 +1,72 @@ +======== Resolving module '#cjs' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#cjs' with target './index.cjs'. +File name '/.src/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/index.cts' exists - use it as a name resolution result. +======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ======== +======== Resolving module '#mjs' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#mjs' with target './index.mjs'. +File name '/.src/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/index.mts' exists - use it as a name resolution result. +======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ======== +======== Resolving module '#type' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#type' with target './index.js'. +File name '/.src/index.js' has a '.js' extension - stripping it. +File '/.src/index.ts' exists - use it as a name resolution result. +======== Module name '#type' was successfully resolved to '/.src/index.ts'. ======== +======== Resolving module '#cjs' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Found 'package.json' at '/.src/package.json'. +Using 'imports' subpath '#cjs' with target './index.cjs'. +File name '/.src/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/index.cts' exists - use it as a name resolution result. +======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ======== +======== Resolving module '#mjs' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#mjs' with target './index.mjs'. +File name '/.src/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/index.mts' exists - use it as a name resolution result. +======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ======== +======== Resolving module '#type' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#type' with target './index.js'. +File name '/.src/index.js' has a '.js' extension - stripping it. +File '/.src/index.ts' exists - use it as a name resolution result. +======== Module name '#type' was successfully resolved to '/.src/index.ts'. ======== +======== Resolving module '#cjs' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#cjs' with target './index.cjs'. +File name '/.src/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/index.cts' exists - use it as a name resolution result. +======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ======== +======== Resolving module '#mjs' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#mjs' with target './index.mjs'. +File name '/.src/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/index.mts' exists - use it as a name resolution result. +======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ======== +======== Resolving module '#type' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#type' with target './index.js'. +File name '/.src/index.js' has a '.js' extension - stripping it. +File '/.src/index.ts' exists - use it as a name resolution result. +======== Module name '#type' was successfully resolved to '/.src/index.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesPackageImports(module=nodenext).trace.json b/testdata/baselines/reference/submodule/conformance/nodeModulesPackageImports(module=nodenext).trace.json new file mode 100644 index 0000000000..6e070a05d0 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesPackageImports(module=nodenext).trace.json @@ -0,0 +1,72 @@ +======== Resolving module '#cjs' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#cjs' with target './index.cjs'. +File name '/.src/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/index.cts' exists - use it as a name resolution result. +======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ======== +======== Resolving module '#mjs' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#mjs' with target './index.mjs'. +File name '/.src/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/index.mts' exists - use it as a name resolution result. +======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ======== +======== Resolving module '#type' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#type' with target './index.js'. +File name '/.src/index.js' has a '.js' extension - stripping it. +File '/.src/index.ts' exists - use it as a name resolution result. +======== Module name '#type' was successfully resolved to '/.src/index.ts'. ======== +======== Resolving module '#cjs' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Found 'package.json' at '/.src/package.json'. +Using 'imports' subpath '#cjs' with target './index.cjs'. +File name '/.src/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/index.cts' exists - use it as a name resolution result. +======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ======== +======== Resolving module '#mjs' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#mjs' with target './index.mjs'. +File name '/.src/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/index.mts' exists - use it as a name resolution result. +======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ======== +======== Resolving module '#type' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#type' with target './index.js'. +File name '/.src/index.js' has a '.js' extension - stripping it. +File '/.src/index.ts' exists - use it as a name resolution result. +======== Module name '#type' was successfully resolved to '/.src/index.ts'. ======== +======== Resolving module '#cjs' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#cjs' with target './index.cjs'. +File name '/.src/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/index.cts' exists - use it as a name resolution result. +======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ======== +======== Resolving module '#mjs' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#mjs' with target './index.mjs'. +File name '/.src/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/index.mts' exists - use it as a name resolution result. +======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ======== +======== Resolving module '#type' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Using 'imports' subpath '#type' with target './index.js'. +File name '/.src/index.js' has a '.js' extension - stripping it. +File '/.src/index.ts' exists - use it as a name resolution result. +======== Module name '#type' was successfully resolved to '/.src/index.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesPackagePatternExportsTrailers(module=node16).trace.json b/testdata/baselines/reference/submodule/conformance/nodeModulesPackagePatternExportsTrailers(module=node16).trace.json new file mode 100644 index 0000000000..4ee363b110 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesPackagePatternExportsTrailers(module=node16).trace.json @@ -0,0 +1,213 @@ +======== Resolving module 'inner/cjs/index.cjs' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Found 'package.json' at '/.src/node_modules/inner/package.json'. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Found 'package.json' at '/.src/package.json'. +Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesPackagePatternExportsTrailers(module=node18).trace.json b/testdata/baselines/reference/submodule/conformance/nodeModulesPackagePatternExportsTrailers(module=node18).trace.json new file mode 100644 index 0000000000..4ee363b110 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesPackagePatternExportsTrailers(module=node18).trace.json @@ -0,0 +1,213 @@ +======== Resolving module 'inner/cjs/index.cjs' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Found 'package.json' at '/.src/node_modules/inner/package.json'. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Found 'package.json' at '/.src/package.json'. +Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json b/testdata/baselines/reference/submodule/conformance/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json new file mode 100644 index 0000000000..07a1a40899 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json @@ -0,0 +1,213 @@ +======== Resolving module 'inner/cjs/index.cjs' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/index.ts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Found 'package.json' at '/.src/node_modules/inner/package.json'. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.ts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.ts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.ts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/index.mts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== +======== Resolving module 'inner/cjs/index.cjs' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Found 'package.json' at '/.src/package.json'. +Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'. +File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it. +File '/.src/node_modules/inner/index.cts' does not exist. +File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'. +======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ======== +======== Resolving module 'inner/mjs/index.mjs' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'. +File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it. +File '/.src/node_modules/inner/index.mts' does not exist. +File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'. +======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ======== +======== Resolving module 'inner/js/index.js' from '/.src/index.cts'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/.src/package.json' exists according to earlier cached lookups. +Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups. +Using 'exports' subpath './js/*.js' with target './index.js'. +File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it. +File '/.src/node_modules/inner/index.ts' does not exist. +File '/.src/node_modules/inner/index.tsx' does not exist. +File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'. +======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/packageJsonMain.trace.json b/testdata/baselines/reference/submodule/conformance/packageJsonMain.trace.json new file mode 100644 index 0000000000..fb59dd4cab --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/packageJsonMain.trace.json @@ -0,0 +1,108 @@ +======== Resolving module 'foo' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/foo/package.json'. +File '/node_modules/foo.ts' does not exist. +File '/node_modules/foo.tsx' does not exist. +File '/node_modules/foo.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'. +Loading module as file / folder, candidate module location '/node_modules/foo/oof', target file types: TypeScript, Declaration. +File '/node_modules/foo/oof.ts' does not exist. +File '/node_modules/foo/oof.tsx' does not exist. +File '/node_modules/foo/oof.d.ts' does not exist. +Directory '/node_modules/foo/oof' does not exist, skipping all lookups in it. +File '/node_modules/foo/index.ts' does not exist. +File '/node_modules/foo/index.tsx' does not exist. +File '/node_modules/foo/index.d.ts' does not exist. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/node_modules/foo/package.json' exists according to earlier cached lookups. +File '/node_modules/foo.js' does not exist. +File '/node_modules/foo.jsx' does not exist. +'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'. +Loading module as file / folder, candidate module location '/node_modules/foo/oof', target file types: JavaScript, JSON. +File '/node_modules/foo/oof.js' exists - use it as a name resolution result. +Resolving real path for '/node_modules/foo/oof.js', result '/node_modules/foo/oof.js'. +======== Module name 'foo' was successfully resolved to '/node_modules/foo/oof.js'. ======== +======== Resolving module 'bar' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/bar/package.json'. +File '/node_modules/bar.ts' does not exist. +File '/node_modules/bar.tsx' does not exist. +File '/node_modules/bar.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'rab.js' that references '/node_modules/bar/rab.js'. +File name '/node_modules/bar/rab.js' has a '.js' extension - stripping it. +File '/node_modules/bar/rab.ts' does not exist. +File '/node_modules/bar/rab.tsx' does not exist. +File '/node_modules/bar/rab.d.ts' does not exist. +Loading module as file / folder, candidate module location '/node_modules/bar/rab.js', target file types: TypeScript, Declaration. +File name '/node_modules/bar/rab.js' has a '.js' extension - stripping it. +File '/node_modules/bar/rab.ts' does not exist. +File '/node_modules/bar/rab.tsx' does not exist. +File '/node_modules/bar/rab.d.ts' does not exist. +File '/node_modules/bar/rab.js.ts' does not exist. +File '/node_modules/bar/rab.js.tsx' does not exist. +File '/node_modules/bar/rab.js.d.ts' does not exist. +Directory '/node_modules/bar/rab.js' does not exist, skipping all lookups in it. +File '/node_modules/bar/index.ts' does not exist. +File '/node_modules/bar/index.tsx' does not exist. +File '/node_modules/bar/index.d.ts' does not exist. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/node_modules/bar/package.json' exists according to earlier cached lookups. +File '/node_modules/bar.js' does not exist. +File '/node_modules/bar.jsx' does not exist. +'package.json' has 'main' field 'rab.js' that references '/node_modules/bar/rab.js'. +File name '/node_modules/bar/rab.js' has a '.js' extension - stripping it. +File '/node_modules/bar/rab.js' exists - use it as a name resolution result. +Resolving real path for '/node_modules/bar/rab.js', result '/node_modules/bar/rab.js'. +======== Module name 'bar' was successfully resolved to '/node_modules/bar/rab.js'. ======== +======== Resolving module 'baz' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'baz' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/baz/package.json'. +File '/node_modules/baz.ts' does not exist. +File '/node_modules/baz.tsx' does not exist. +File '/node_modules/baz.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'zab' that references '/node_modules/baz/zab'. +Loading module as file / folder, candidate module location '/node_modules/baz/zab', target file types: TypeScript, Declaration. +File '/node_modules/baz/zab.ts' does not exist. +File '/node_modules/baz/zab.tsx' does not exist. +File '/node_modules/baz/zab.d.ts' does not exist. +File '/node_modules/baz/zab/index.ts' does not exist. +File '/node_modules/baz/zab/index.tsx' does not exist. +File '/node_modules/baz/zab/index.d.ts' does not exist. +File '/node_modules/baz/index.ts' does not exist. +File '/node_modules/baz/index.tsx' does not exist. +File '/node_modules/baz/index.d.ts' does not exist. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/node_modules/baz/package.json' exists according to earlier cached lookups. +File '/node_modules/baz.js' does not exist. +File '/node_modules/baz.jsx' does not exist. +'package.json' has 'main' field 'zab' that references '/node_modules/baz/zab'. +Loading module as file / folder, candidate module location '/node_modules/baz/zab', target file types: JavaScript, JSON. +File '/node_modules/baz/zab.js' does not exist. +File '/node_modules/baz/zab.jsx' does not exist. +File '/node_modules/baz/zab/index.js' exists - use it as a name resolution result. +Resolving real path for '/node_modules/baz/zab/index.js', result '/node_modules/baz/zab/index.js'. +======== Module name 'baz' was successfully resolved to '/node_modules/baz/zab/index.js'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/packageJsonMain_isNonRecursive.trace.json b/testdata/baselines/reference/submodule/conformance/packageJsonMain_isNonRecursive.trace.json new file mode 100644 index 0000000000..654fc3fe5c --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/packageJsonMain_isNonRecursive.trace.json @@ -0,0 +1,38 @@ +======== Resolving module 'foo' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/foo/package.json'. +File '/node_modules/foo.ts' does not exist. +File '/node_modules/foo.tsx' does not exist. +File '/node_modules/foo.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'. +Loading module as file / folder, candidate module location '/node_modules/foo/oof', target file types: TypeScript, Declaration. +File '/node_modules/foo/oof.ts' does not exist. +File '/node_modules/foo/oof.tsx' does not exist. +File '/node_modules/foo/oof.d.ts' does not exist. +File '/node_modules/foo/oof/index.ts' does not exist. +File '/node_modules/foo/oof/index.tsx' does not exist. +File '/node_modules/foo/oof/index.d.ts' does not exist. +File '/node_modules/foo/index.ts' does not exist. +File '/node_modules/foo/index.tsx' does not exist. +File '/node_modules/foo/index.d.ts' does not exist. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/node_modules/foo/package.json' exists according to earlier cached lookups. +File '/node_modules/foo.js' does not exist. +File '/node_modules/foo.jsx' does not exist. +'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'. +Loading module as file / folder, candidate module location '/node_modules/foo/oof', target file types: JavaScript, JSON. +File '/node_modules/foo/oof.js' does not exist. +File '/node_modules/foo/oof.jsx' does not exist. +File '/node_modules/foo/oof/index.js' does not exist. +File '/node_modules/foo/oof/index.jsx' does not exist. +File '/node_modules/foo/index.js' does not exist. +File '/node_modules/foo/index.jsx' does not exist. +======== Module name 'foo' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/conformance/resolutionModeCache.trace.json b/testdata/baselines/reference/submodule/conformance/resolutionModeCache.trace.json new file mode 100644 index 0000000000..cc9f657434 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/resolutionModeCache.trace.json @@ -0,0 +1,38 @@ +======== Resolving module 'pkg' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'pkg' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/pkg/package.json'. +Entering conditional exports. +Saw non-matching condition 'import'. +Matched 'exports' condition 'require'. +Using 'exports' subpath '.' with target './index.js'. +File name '/node_modules/pkg/index.js' has a '.js' extension - stripping it. +File '/node_modules/pkg/index.ts' does not exist. +File '/node_modules/pkg/index.tsx' does not exist. +File '/node_modules/pkg/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'require'. +Exiting conditional exports. +Resolving real path for '/node_modules/pkg/index.d.ts', result '/node_modules/pkg/index.d.ts'. +======== Module name 'pkg' was successfully resolved to '/node_modules/pkg/index.d.ts' with Package ID 'pkg@1.0.0'. ======== +======== Resolving module 'pkg' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'pkg' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/pkg/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/node_modules/pkg/index.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/pkg/index.mts' does not exist. +File '/node_modules/pkg/index.d.mts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/node_modules/pkg/index.d.mts', result '/node_modules/pkg/index.d.mts'. +======== Module name 'pkg' was successfully resolved to '/node_modules/pkg/index.d.mts' with Package ID 'pkg@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json b/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json new file mode 100644 index 0000000000..6c10883493 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json @@ -0,0 +1,120 @@ +======== Resolving module 'foo' from '/index.mts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/foo/index.mts' does not exist. +File '/node_modules/foo/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +File '/node_modules/@types/foo.d.ts' does not exist. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/node_modules/foo/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/foo/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/node_modules/foo/index.mjs', result '/node_modules/foo/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/foo/package.json' exists according to earlier cached lookups. +File '/node_modules/foo.ts' does not exist. +File '/node_modules/foo.tsx' does not exist. +File '/node_modules/foo.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/node_modules/foo/index.d.ts'. +File '/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/foo/index.d.ts', result '/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/node_modules/foo/index.mjs' with Package ID 'foo@1.0.0'. ======== +======== Resolving module 'bar' from '/index.mts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/bar/index.mts' does not exist. +File '/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +File '/node_modules/@types/bar/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/node_modules/bar/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/bar/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/node_modules/bar/index.mjs', result '/node_modules/bar/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/bar/package.json' exists according to earlier cached lookups. +File '/node_modules/bar.ts' does not exist. +File '/node_modules/bar.tsx' does not exist. +File '/node_modules/bar.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'index.js' that references '/node_modules/bar/index.js'. +File name '/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/node_modules/bar/index.ts' does not exist. +File '/node_modules/bar/index.tsx' does not exist. +File '/node_modules/bar/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/node_modules/bar/index.js', target file types: TypeScript, Declaration. +File name '/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/node_modules/bar/index.ts' does not exist. +File '/node_modules/bar/index.tsx' does not exist. +File '/node_modules/bar/index.d.ts' does not exist. +File '/node_modules/bar/index.js.ts' does not exist. +File '/node_modules/bar/index.js.tsx' does not exist. +File '/node_modules/bar/index.js.d.ts' does not exist. +Directory '/node_modules/bar/index.js' does not exist, skipping all lookups in it. +File '/node_modules/bar/index.ts' does not exist. +File '/node_modules/bar/index.tsx' does not exist. +File '/node_modules/bar/index.d.ts' does not exist. +File '/node_modules/@types/bar/package.json' exists according to earlier cached lookups. +File '/node_modules/@types/bar.d.ts' does not exist. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/node_modules/@types/bar/index.d.ts'. +File '/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/@types/bar/index.d.ts', result '/node_modules/@types/bar/index.d.ts'. +======== Module name 'bar' was successfully resolved to '/node_modules/bar/index.mjs' with Package ID 'bar@1.0.0'. ======== +======== Resolving type reference directive 'bar', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/node_modules/@types/bar/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/node_modules/@types/bar/index.d.ts'. +File '/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/bar/index.d.ts', result '/node_modules/@types/bar/index.d.ts'. +======== Type reference directive 'bar' was successfully resolved to '/node_modules/@types/bar/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).trace.json b/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).trace.json new file mode 100644 index 0000000000..b045c091db --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).trace.json @@ -0,0 +1,109 @@ +======== Resolving module 'foo' from '/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/foo/index.mts' does not exist. +File '/node_modules/foo/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/foo/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/foo/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/node_modules/foo/index.mjs', result '/node_modules/foo/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/foo/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/node_modules/foo/index.d.ts'. +File '/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/foo/index.d.ts', result '/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/node_modules/foo/index.mjs' with Package ID 'foo@1.0.0'. ======== +======== Resolving module 'bar' from '/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/bar/index.mts' does not exist. +File '/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +File '/node_modules/@types/bar/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/node_modules/bar/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/bar/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/node_modules/bar/index.mjs', result '/node_modules/bar/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/bar/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'index.js' that references '/node_modules/bar/index.js'. +File name '/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/node_modules/bar/index.ts' does not exist. +File '/node_modules/bar/index.tsx' does not exist. +File '/node_modules/bar/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/node_modules/bar/index.js', target file types: TypeScript, Declaration. +File name '/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/node_modules/bar/index.ts' does not exist. +File '/node_modules/bar/index.tsx' does not exist. +File '/node_modules/bar/index.d.ts' does not exist. +File '/node_modules/bar/index.js.ts' does not exist. +File '/node_modules/bar/index.js.tsx' does not exist. +File '/node_modules/bar/index.js.d.ts' does not exist. +Directory '/node_modules/bar/index.js' does not exist, skipping all lookups in it. +File '/node_modules/@types/bar/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/node_modules/@types/bar/index.d.ts'. +File '/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/node_modules/@types/bar/index.d.ts', result '/node_modules/@types/bar/index.d.ts'. +======== Module name 'bar' was successfully resolved to '/node_modules/bar/index.mjs' with Package ID 'bar@1.0.0'. ======== +======== Resolving type reference directive 'bar', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/node_modules/@types/bar/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/node_modules/@types/bar/index.d.ts'. +File '/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/bar/index.d.ts', result '/node_modules/@types/bar/index.d.ts'. +======== Type reference directive 'bar' was successfully resolved to '/node_modules/@types/bar/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/scopedPackages.trace.json b/testdata/baselines/reference/submodule/conformance/scopedPackages.trace.json new file mode 100644 index 0000000000..52e7c20137 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/scopedPackages.trace.json @@ -0,0 +1,45 @@ +======== Resolving module '@cow/boy' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@cow/boy' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/@cow/boy/package.json' does not exist. +File '/node_modules/@cow/boy.ts' does not exist. +File '/node_modules/@cow/boy.tsx' does not exist. +File '/node_modules/@cow/boy.d.ts' does not exist. +File '/node_modules/@cow/boy/index.ts' does not exist. +File '/node_modules/@cow/boy/index.tsx' does not exist. +File '/node_modules/@cow/boy/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@cow/boy/index.d.ts', result '/node_modules/@cow/boy/index.d.ts'. +======== Module name '@cow/boy' was successfully resolved to '/node_modules/@cow/boy/index.d.ts'. ======== +======== Resolving module '@be/bop' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@be/bop' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Scoped package detected, looking in 'be__bop' +File '/node_modules/@types/be__bop/package.json' does not exist according to earlier cached lookups. +File '/node_modules/@types/be__bop.d.ts' does not exist. +File '/node_modules/@types/be__bop/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/be__bop/index.d.ts', result '/node_modules/@types/be__bop/index.d.ts'. +======== Module name '@be/bop' was successfully resolved to '/node_modules/@types/be__bop/index.d.ts'. ======== +======== Resolving module '@be/bop/e/z' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@be/bop/e/z' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Scoped package detected, looking in 'be__bop/e/z' +File '/node_modules/@types/be__bop/package.json' does not exist according to earlier cached lookups. +File '/node_modules/@types/be__bop/e/z.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/be__bop/e/z.d.ts', result '/node_modules/@types/be__bop/e/z.d.ts'. +======== Module name '@be/bop/e/z' was successfully resolved to '/node_modules/@types/be__bop/e/z.d.ts'. ======== +======== Resolving type reference directive 'be__bop', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/@types/be__bop/package.json' does not exist. +File '/node_modules/@types/be__bop/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/be__bop/index.d.ts', result '/node_modules/@types/be__bop/index.d.ts'. +======== Type reference directive 'be__bop' was successfully resolved to '/node_modules/@types/be__bop/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/scopedPackagesClassic.trace.json b/testdata/baselines/reference/submodule/conformance/scopedPackagesClassic.trace.json new file mode 100644 index 0000000000..ad6915bbc7 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/scopedPackagesClassic.trace.json @@ -0,0 +1,19 @@ +======== Resolving module '@see/saw' from '/a.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module '@see/saw' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Scoped package detected, looking in 'see__saw' +File '/node_modules/@types/see__saw/package.json' does not exist according to earlier cached lookups. +File '/node_modules/@types/see__saw.d.ts' does not exist. +File '/node_modules/@types/see__saw/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/see__saw/index.d.ts', result '/node_modules/@types/see__saw/index.d.ts'. +======== Module name '@see/saw' was successfully resolved to '/node_modules/@types/see__saw/index.d.ts'. ======== +======== Resolving type reference directive 'see__saw', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +File '/node_modules/@types/see__saw/package.json' does not exist. +File '/node_modules/@types/see__saw/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/see__saw/index.d.ts', result '/node_modules/@types/see__saw/index.d.ts'. +======== Type reference directive 'see__saw' was successfully resolved to '/node_modules/@types/see__saw/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/selfNameModuleAugmentation.trace.json b/testdata/baselines/reference/submodule/conformance/selfNameModuleAugmentation.trace.json new file mode 100644 index 0000000000..9999e1b66b --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/selfNameModuleAugmentation.trace.json @@ -0,0 +1,50 @@ +======== Resolving module 'acorn-walk' from '/node_modules/acorn-walk/dist/walk.d.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/node_modules/acorn-walk/dist/package.json' does not exist according to earlier cached lookups. +File '/node_modules/acorn-walk/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './dist/walk.mjs'. +File name '/node_modules/acorn-walk/dist/walk.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/acorn-walk/dist/walk.mts' does not exist. +File '/node_modules/acorn-walk/dist/walk.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Matched 'exports' condition 'default'. +Using 'exports' subpath '.' with target './dist/walk.js'. +File name '/node_modules/acorn-walk/dist/walk.js' has a '.js' extension - stripping it. +File '/node_modules/acorn-walk/dist/walk.ts' does not exist. +File '/node_modules/acorn-walk/dist/walk.tsx' does not exist. +File '/node_modules/acorn-walk/dist/walk.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'default'. +Exiting conditional exports. +Resolving real path for '/node_modules/acorn-walk/dist/walk.d.ts', result '/node_modules/acorn-walk/dist/walk.d.ts'. +======== Module name 'acorn-walk' was successfully resolved to '/node_modules/acorn-walk/dist/walk.d.ts' with Package ID 'acorn-walk@8.2.0'. ======== +======== Resolving module 'acorn-walk' from '/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' does not exist. +Loading module 'acorn-walk' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/acorn-walk/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './dist/walk.mjs'. +File name '/node_modules/acorn-walk/dist/walk.mjs' has a '.mjs' extension - stripping it. +File '/node_modules/acorn-walk/dist/walk.mts' does not exist. +File '/node_modules/acorn-walk/dist/walk.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Matched 'exports' condition 'default'. +Using 'exports' subpath '.' with target './dist/walk.js'. +File name '/node_modules/acorn-walk/dist/walk.js' has a '.js' extension - stripping it. +File '/node_modules/acorn-walk/dist/walk.ts' does not exist. +File '/node_modules/acorn-walk/dist/walk.tsx' does not exist. +File '/node_modules/acorn-walk/dist/walk.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'default'. +Exiting conditional exports. +Resolving real path for '/node_modules/acorn-walk/dist/walk.d.ts', result '/node_modules/acorn-walk/dist/walk.d.ts'. +======== Module name 'acorn-walk' was successfully resolved to '/node_modules/acorn-walk/dist/walk.d.ts' with Package ID 'acorn-walk@8.2.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/typesVersions.ambientModules.trace.json b/testdata/baselines/reference/submodule/conformance/typesVersions.ambientModules.trace.json new file mode 100644 index 0000000000..387ace26b1 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesVersions.ambientModules.trace.json @@ -0,0 +1,71 @@ +======== Resolving module 'ext' from '/.src/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'ext' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/.src/node_modules/ext/package.json'. +File '/.src/node_modules/ext.ts' does not exist. +File '/.src/node_modules/ext.tsx' does not exist. +File '/.src/node_modules/ext.d.ts' does not exist. +'package.json' has a 'typesVersions' field with version-specific path mappings. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index' that references '/.src/node_modules/ext/index'. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration. +File '/.src/node_modules/ext/ts3.1/index.ts' does not exist. +File '/.src/node_modules/ext/ts3.1/index.tsx' does not exist. +File '/.src/node_modules/ext/ts3.1/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/.src/node_modules/ext/ts3.1/index.d.ts', result '/.src/node_modules/ext/ts3.1/index.d.ts'. +======== Module name 'ext' was successfully resolved to '/.src/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext@1.0.0'. ======== +======== Resolving module 'ext/other' from '/.src/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'ext/other' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/ext/package.json' exists according to earlier cached lookups. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'other'. +Module name 'other', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'. +File '/.src/node_modules/ext/ts3.1/other.ts' does not exist. +File '/.src/node_modules/ext/ts3.1/other.tsx' does not exist. +File '/.src/node_modules/ext/ts3.1/other.d.ts' does not exist. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/other/ts3.1/index', target file types: TypeScript, Declaration. +File '/.src/node_modules/ext/other.ts' does not exist. +File '/.src/node_modules/ext/other.tsx' does not exist. +File '/.src/node_modules/ext/other.d.ts' does not exist. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/other/ts3.1/index', target file types: TypeScript, Declaration. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/.src/node_modules/ext/package.json' exists according to earlier cached lookups. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'other'. +Module name 'other', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'. +File '/.src/node_modules/ext/ts3.1/other.js' does not exist. +File '/.src/node_modules/ext/ts3.1/other.jsx' does not exist. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/other/ts3.1/index', target file types: JavaScript, JSON. +File '/.src/node_modules/ext/other.js' does not exist. +File '/.src/node_modules/ext/other.jsx' does not exist. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/other/ts3.1/index', target file types: JavaScript, JSON. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'ext/other' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/conformance/typesVersions.emptyTypes.trace.json b/testdata/baselines/reference/submodule/conformance/typesVersions.emptyTypes.trace.json new file mode 100644 index 0000000000..f7084a863a --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesVersions.emptyTypes.trace.json @@ -0,0 +1,15 @@ +======== Resolving module 'a' from '/b/user.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/b/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'a' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/b/node_modules' does not exist, skipping all lookups in it. +Directory '/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/b/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'a' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/conformance/typesVersions.justIndex.trace.json b/testdata/baselines/reference/submodule/conformance/typesVersions.justIndex.trace.json new file mode 100644 index 0000000000..f7084a863a --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesVersions.justIndex.trace.json @@ -0,0 +1,15 @@ +======== Resolving module 'a' from '/b/user.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/b/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'a' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/b/node_modules' does not exist, skipping all lookups in it. +Directory '/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/b/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'a' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/conformance/typesVersions.multiFile.trace.json b/testdata/baselines/reference/submodule/conformance/typesVersions.multiFile.trace.json new file mode 100644 index 0000000000..43b3446387 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesVersions.multiFile.trace.json @@ -0,0 +1,41 @@ +======== Resolving module 'ext' from '/.src/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'ext' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/.src/node_modules/ext/package.json'. +File '/.src/node_modules/ext.ts' does not exist. +File '/.src/node_modules/ext.tsx' does not exist. +File '/.src/node_modules/ext.d.ts' does not exist. +'package.json' has a 'typesVersions' field with version-specific path mappings. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index' that references '/.src/node_modules/ext/index'. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration. +File '/.src/node_modules/ext/ts3.1/index.ts' does not exist. +File '/.src/node_modules/ext/ts3.1/index.tsx' does not exist. +File '/.src/node_modules/ext/ts3.1/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/.src/node_modules/ext/ts3.1/index.d.ts', result '/.src/node_modules/ext/ts3.1/index.d.ts'. +======== Module name 'ext' was successfully resolved to '/.src/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext@1.0.0'. ======== +======== Resolving module 'ext/other' from '/.src/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'ext/other' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/ext/package.json' exists according to earlier cached lookups. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'other'. +Module name 'other', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'. +File '/.src/node_modules/ext/ts3.1/other.ts' does not exist. +File '/.src/node_modules/ext/ts3.1/other.tsx' does not exist. +File '/.src/node_modules/ext/ts3.1/other.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/.src/node_modules/ext/ts3.1/other.d.ts', result '/.src/node_modules/ext/ts3.1/other.d.ts'. +======== Module name 'ext/other' was successfully resolved to '/.src/node_modules/ext/ts3.1/other.d.ts' with Package ID 'ext@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/typesVersionsDeclarationEmit.ambient.trace.json b/testdata/baselines/reference/submodule/conformance/typesVersionsDeclarationEmit.ambient.trace.json new file mode 100644 index 0000000000..387ace26b1 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesVersionsDeclarationEmit.ambient.trace.json @@ -0,0 +1,71 @@ +======== Resolving module 'ext' from '/.src/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'ext' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/.src/node_modules/ext/package.json'. +File '/.src/node_modules/ext.ts' does not exist. +File '/.src/node_modules/ext.tsx' does not exist. +File '/.src/node_modules/ext.d.ts' does not exist. +'package.json' has a 'typesVersions' field with version-specific path mappings. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index' that references '/.src/node_modules/ext/index'. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration. +File '/.src/node_modules/ext/ts3.1/index.ts' does not exist. +File '/.src/node_modules/ext/ts3.1/index.tsx' does not exist. +File '/.src/node_modules/ext/ts3.1/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/.src/node_modules/ext/ts3.1/index.d.ts', result '/.src/node_modules/ext/ts3.1/index.d.ts'. +======== Module name 'ext' was successfully resolved to '/.src/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext@1.0.0'. ======== +======== Resolving module 'ext/other' from '/.src/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'ext/other' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/ext/package.json' exists according to earlier cached lookups. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'other'. +Module name 'other', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'. +File '/.src/node_modules/ext/ts3.1/other.ts' does not exist. +File '/.src/node_modules/ext/ts3.1/other.tsx' does not exist. +File '/.src/node_modules/ext/ts3.1/other.d.ts' does not exist. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/other/ts3.1/index', target file types: TypeScript, Declaration. +File '/.src/node_modules/ext/other.ts' does not exist. +File '/.src/node_modules/ext/other.tsx' does not exist. +File '/.src/node_modules/ext/other.d.ts' does not exist. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/other/ts3.1/index', target file types: TypeScript, Declaration. +Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/.src/node_modules/ext/package.json' exists according to earlier cached lookups. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'other'. +Module name 'other', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'. +File '/.src/node_modules/ext/ts3.1/other.js' does not exist. +File '/.src/node_modules/ext/ts3.1/other.jsx' does not exist. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/other/ts3.1/index', target file types: JavaScript, JSON. +File '/.src/node_modules/ext/other.js' does not exist. +File '/.src/node_modules/ext/other.jsx' does not exist. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/other/ts3.1/index', target file types: JavaScript, JSON. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'ext/other' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/conformance/typesVersionsDeclarationEmit.multiFile.trace.json b/testdata/baselines/reference/submodule/conformance/typesVersionsDeclarationEmit.multiFile.trace.json new file mode 100644 index 0000000000..43b3446387 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesVersionsDeclarationEmit.multiFile.trace.json @@ -0,0 +1,41 @@ +======== Resolving module 'ext' from '/.src/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'ext' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/.src/node_modules/ext/package.json'. +File '/.src/node_modules/ext.ts' does not exist. +File '/.src/node_modules/ext.tsx' does not exist. +File '/.src/node_modules/ext.d.ts' does not exist. +'package.json' has a 'typesVersions' field with version-specific path mappings. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index' that references '/.src/node_modules/ext/index'. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration. +File '/.src/node_modules/ext/ts3.1/index.ts' does not exist. +File '/.src/node_modules/ext/ts3.1/index.tsx' does not exist. +File '/.src/node_modules/ext/ts3.1/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/.src/node_modules/ext/ts3.1/index.d.ts', result '/.src/node_modules/ext/ts3.1/index.d.ts'. +======== Module name 'ext' was successfully resolved to '/.src/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext@1.0.0'. ======== +======== Resolving module 'ext/other' from '/.src/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'ext/other' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/ext/package.json' exists according to earlier cached lookups. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'other'. +Module name 'other', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'. +File '/.src/node_modules/ext/ts3.1/other.ts' does not exist. +File '/.src/node_modules/ext/ts3.1/other.tsx' does not exist. +File '/.src/node_modules/ext/ts3.1/other.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/.src/node_modules/ext/ts3.1/other.d.ts', result '/.src/node_modules/ext/ts3.1/other.d.ts'. +======== Module name 'ext/other' was successfully resolved to '/.src/node_modules/ext/ts3.1/other.d.ts' with Package ID 'ext@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json b/testdata/baselines/reference/submodule/conformance/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json new file mode 100644 index 0000000000..1a6647f1f6 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json @@ -0,0 +1,66 @@ +======== Resolving module 'ext' from '/.src/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'ext' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/.src/node_modules/ext/package.json'. +File '/.src/node_modules/ext.ts' does not exist. +File '/.src/node_modules/ext.tsx' does not exist. +File '/.src/node_modules/ext.d.ts' does not exist. +'package.json' has a 'typesVersions' field with version-specific path mappings. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index' that references '/.src/node_modules/ext/index'. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration. +File '/.src/node_modules/ext/ts3.1/index.ts' does not exist. +File '/.src/node_modules/ext/ts3.1/index.tsx' does not exist. +File '/.src/node_modules/ext/ts3.1/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/.src/node_modules/ext/ts3.1/index.d.ts', result '/.src/node_modules/ext/ts3.1/index.d.ts'. +======== Module name 'ext' was successfully resolved to '/.src/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext@1.0.0'. ======== +======== Resolving module 'ext/other' from '/.src/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'ext/other' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/ext/package.json' exists according to earlier cached lookups. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'other'. +Module name 'other', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'. +File '/.src/node_modules/ext/ts3.1/other.ts' does not exist. +File '/.src/node_modules/ext/ts3.1/other.tsx' does not exist. +File '/.src/node_modules/ext/ts3.1/other.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/.src/node_modules/ext/ts3.1/other.d.ts', result '/.src/node_modules/ext/ts3.1/other.d.ts'. +======== Module name 'ext/other' was successfully resolved to '/.src/node_modules/ext/ts3.1/other.d.ts' with Package ID 'ext@1.0.0'. ======== +======== Resolving module '../' from '/.src/node_modules/ext/ts3.1/index.d.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/.src/node_modules/ext/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index' that references '/.src/node_modules/ext/index'. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern '*'. +Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/index', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/.src/node_modules/ext/ts3.1/index.ts' does not exist. +File '/.src/node_modules/ext/ts3.1/index.tsx' does not exist. +File '/.src/node_modules/ext/ts3.1/index.d.ts' exists - use it as a name resolution result. +======== Module name '../' was successfully resolved to '/.src/node_modules/ext/ts3.1/index.d.ts'. ======== +======== Resolving module '../other' from '/.src/node_modules/ext/ts3.1/other.d.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/other', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/.src/node_modules/ext/other.ts' does not exist. +File '/.src/node_modules/ext/other.tsx' does not exist. +File '/.src/node_modules/ext/other.d.ts' exists - use it as a name resolution result. +File '/.src/node_modules/ext/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'peerDependencies' field. +======== Module name '../other' was successfully resolved to '/.src/node_modules/ext/other.d.ts' with Package ID 'ext@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json b/testdata/baselines/reference/submodule/conformance/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json new file mode 100644 index 0000000000..acbcde0cbb --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json @@ -0,0 +1,49 @@ +======== Resolving module 'ext' from '/.src/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'ext' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/.src/node_modules/ext/package.json'. +File '/.src/node_modules/ext.ts' does not exist. +File '/.src/node_modules/ext.tsx' does not exist. +File '/.src/node_modules/ext.d.ts' does not exist. +'package.json' has a 'typesVersions' field with version-specific path mappings. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index' that references '/.src/node_modules/ext/index'. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'index'. +Module name 'index', matched pattern 'index'. +Trying substitution 'ts3.1/index', candidate module location: 'ts3.1/index'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration. +File '/.src/node_modules/ext/ts3.1/index.ts' does not exist. +File '/.src/node_modules/ext/ts3.1/index.tsx' does not exist. +File '/.src/node_modules/ext/ts3.1/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/.src/node_modules/ext/ts3.1/index.d.ts', result '/.src/node_modules/ext/ts3.1/index.d.ts'. +======== Module name 'ext' was successfully resolved to '/.src/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext@1.0.0'. ======== +======== Resolving module 'ext/other' from '/.src/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/.src/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'ext/other' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/.src/node_modules/ext/package.json' exists according to earlier cached lookups. +'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '7.0.0-dev', looking for a pattern to match module name 'other'. +File '/.src/node_modules/ext/other.ts' does not exist. +File '/.src/node_modules/ext/other.tsx' does not exist. +File '/.src/node_modules/ext/other.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/.src/node_modules/ext/other.d.ts', result '/.src/node_modules/ext/other.d.ts'. +======== Module name 'ext/other' was successfully resolved to '/.src/node_modules/ext/other.d.ts' with Package ID 'ext@1.0.0'. ======== +======== Resolving module '../other' from '/.src/node_modules/ext/ts3.1/index.d.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/.src/node_modules/ext/other', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/.src/node_modules/ext/other.ts' does not exist. +File '/.src/node_modules/ext/other.tsx' does not exist. +File '/.src/node_modules/ext/other.d.ts' exists - use it as a name resolution result. +File '/.src/node_modules/ext/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'peerDependencies' field. +======== Module name '../other' was successfully resolved to '/.src/node_modules/ext/other.d.ts' with Package ID 'ext@1.0.0'. ======== diff --git a/testdata/baselines/reference/submodule/conformance/typingsLookup1.trace.json b/testdata/baselines/reference/submodule/conformance/typingsLookup1.trace.json new file mode 100644 index 0000000000..0febc68e1d --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typingsLookup1.trace.json @@ -0,0 +1,12 @@ +======== Resolving type reference directive 'jquery', containing file '/a.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +File '/node_modules/@types/jquery/package.json' does not exist according to earlier cached lookups. +File '/node_modules/@types/jquery/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/jquery/index.d.ts', result '/node_modules/@types/jquery/index.d.ts'. +======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ======== +======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +File '/node_modules/@types/jquery/package.json' does not exist. +File '/node_modules/@types/jquery/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/jquery/index.d.ts', result '/node_modules/@types/jquery/index.d.ts'. +======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/typingsLookup3.trace.json b/testdata/baselines/reference/submodule/conformance/typingsLookup3.trace.json new file mode 100644 index 0000000000..b615d44651 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typingsLookup3.trace.json @@ -0,0 +1,14 @@ +======== Resolving type reference directive 'JqUeRy', containing file '/a.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Looking up in 'node_modules' folder, initial location '/'. +Searching all ancestor node_modules directories for preferred extensions: Declaration. +File '/node_modules/JqUeRy.d.ts' does not exist. +File '/node_modules/@types/JqUeRy.d.ts' does not exist. +======== Type reference directive 'JqUeRy' was not resolved. ======== +======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +File '/node_modules/@types/jquery/package.json' does not exist. +File '/node_modules/@types/jquery/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/jquery/index.d.ts', result '/node_modules/@types/jquery/index.d.ts'. +======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/typingsLookup4.trace.json b/testdata/baselines/reference/submodule/conformance/typingsLookup4.trace.json new file mode 100644 index 0000000000..100c208ad4 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typingsLookup4.trace.json @@ -0,0 +1,110 @@ +======== Resolving module 'jquery' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist. +Loading module 'jquery' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/jquery.ts' does not exist. +File '/node_modules/jquery.tsx' does not exist. +File '/node_modules/jquery.d.ts' does not exist. +File '/node_modules/@types/jquery/package.json' exists according to earlier cached lookups. +File '/node_modules/@types/jquery.d.ts' does not exist. +'package.json' has 'typings' field 'jquery.d.ts' that references '/node_modules/@types/jquery/jquery.d.ts'. +File '/node_modules/@types/jquery/jquery.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/jquery/jquery.d.ts', result '/node_modules/@types/jquery/jquery.d.ts'. +======== Module name 'jquery' was successfully resolved to '/node_modules/@types/jquery/jquery.d.ts'. ======== +======== Resolving module 'kquery' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'kquery' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/kquery.ts' does not exist. +File '/node_modules/kquery.tsx' does not exist. +File '/node_modules/kquery.d.ts' does not exist. +File '/node_modules/@types/kquery/package.json' exists according to earlier cached lookups. +File '/node_modules/@types/kquery.d.ts' does not exist. +'package.json' has 'typings' field 'kquery' that references '/node_modules/@types/kquery/kquery'. +Loading module as file / folder, candidate module location '/node_modules/@types/kquery/kquery', target file types: TypeScript, Declaration. +File '/node_modules/@types/kquery/kquery.ts' does not exist. +File '/node_modules/@types/kquery/kquery.tsx' does not exist. +File '/node_modules/@types/kquery/kquery.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/kquery/kquery.d.ts', result '/node_modules/@types/kquery/kquery.d.ts'. +======== Module name 'kquery' was successfully resolved to '/node_modules/@types/kquery/kquery.d.ts'. ======== +======== Resolving module 'lquery' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'lquery' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/lquery.ts' does not exist. +File '/node_modules/lquery.tsx' does not exist. +File '/node_modules/lquery.d.ts' does not exist. +File '/node_modules/@types/lquery/package.json' exists according to earlier cached lookups. +File '/node_modules/@types/lquery.d.ts' does not exist. +'package.json' has 'typings' field 'lquery' that references '/node_modules/@types/lquery/lquery'. +Loading module as file / folder, candidate module location '/node_modules/@types/lquery/lquery', target file types: TypeScript, Declaration. +File '/node_modules/@types/lquery/lquery.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/lquery/lquery.ts', result '/node_modules/@types/lquery/lquery.ts'. +======== Module name 'lquery' was successfully resolved to '/node_modules/@types/lquery/lquery.ts'. ======== +======== Resolving module 'mquery' from '/a.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'mquery' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/mquery.ts' does not exist. +File '/node_modules/mquery.tsx' does not exist. +File '/node_modules/mquery.d.ts' does not exist. +File '/node_modules/@types/mquery/package.json' exists according to earlier cached lookups. +File '/node_modules/@types/mquery.d.ts' does not exist. +'package.json' has 'typings' field 'mquery' that references '/node_modules/@types/mquery/mquery'. +Loading module as file / folder, candidate module location '/node_modules/@types/mquery/mquery', target file types: TypeScript, Declaration. +File '/node_modules/@types/mquery/mquery.ts' does not exist. +File '/node_modules/@types/mquery/mquery.tsx' does not exist. +File '/node_modules/@types/mquery/mquery.d.ts' does not exist. +File '/node_modules/@types/mquery/mquery/index.ts' does not exist. +File '/node_modules/@types/mquery/mquery/index.tsx' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/mquery/mquery/index.tsx', result '/node_modules/@types/mquery/mquery/index.tsx'. +======== Module name 'mquery' was successfully resolved to '/node_modules/@types/mquery/mquery/index.tsx'. ======== +======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Found 'package.json' at '/node_modules/@types/jquery/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' has 'typings' field 'jquery.d.ts' that references '/node_modules/@types/jquery/jquery.d.ts'. +File '/node_modules/@types/jquery/jquery.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/jquery/jquery.d.ts', result '/node_modules/@types/jquery/jquery.d.ts'. +======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/jquery.d.ts', primary: true. ======== +======== Resolving type reference directive 'kquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Found 'package.json' at '/node_modules/@types/kquery/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' has 'typings' field 'kquery' that references '/node_modules/@types/kquery/kquery'. +Loading module as file / folder, candidate module location '/node_modules/@types/kquery/kquery', target file types: TypeScript, Declaration. +File '/node_modules/@types/kquery/kquery.ts' does not exist. +File '/node_modules/@types/kquery/kquery.tsx' does not exist. +File '/node_modules/@types/kquery/kquery.d.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/kquery/kquery.d.ts', result '/node_modules/@types/kquery/kquery.d.ts'. +======== Type reference directive 'kquery' was successfully resolved to '/node_modules/@types/kquery/kquery.d.ts', primary: true. ======== +======== Resolving type reference directive 'lquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Found 'package.json' at '/node_modules/@types/lquery/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' has 'typings' field 'lquery' that references '/node_modules/@types/lquery/lquery'. +Loading module as file / folder, candidate module location '/node_modules/@types/lquery/lquery', target file types: TypeScript, Declaration. +File '/node_modules/@types/lquery/lquery.ts' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/lquery/lquery.ts', result '/node_modules/@types/lquery/lquery.ts'. +======== Type reference directive 'lquery' was successfully resolved to '/node_modules/@types/lquery/lquery.ts', primary: true. ======== +======== Resolving type reference directive 'mquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== +Resolving with primary search path '/node_modules/@types'. +Found 'package.json' at '/node_modules/@types/mquery/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' has 'typings' field 'mquery' that references '/node_modules/@types/mquery/mquery'. +Loading module as file / folder, candidate module location '/node_modules/@types/mquery/mquery', target file types: TypeScript, Declaration. +File '/node_modules/@types/mquery/mquery.ts' does not exist. +File '/node_modules/@types/mquery/mquery.tsx' does not exist. +File '/node_modules/@types/mquery/mquery.d.ts' does not exist. +File '/node_modules/@types/mquery/mquery/index.ts' does not exist. +File '/node_modules/@types/mquery/mquery/index.tsx' exists - use it as a name resolution result. +Resolving real path for '/node_modules/@types/mquery/mquery/index.tsx', result '/node_modules/@types/mquery/mquery/index.tsx'. +======== Type reference directive 'mquery' was successfully resolved to '/node_modules/@types/mquery/mquery/index.tsx', primary: true. ======== diff --git a/testdata/baselines/reference/tsc/extends/configDir-template-with-commandline.js b/testdata/baselines/reference/tsc/extends/configDir-template-with-commandline.js index 816c9654de..d6c4cd5960 100644 --- a/testdata/baselines/reference/tsc/extends/configDir-template-with-commandline.js +++ b/testdata/baselines/reference/tsc/extends/configDir-template-with-commandline.js @@ -51,6 +51,50 @@ export const x = 10; tsgo --explainFiles --outDir ${configDir}/outDir ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +======== Resolving module '@myscope/sometype' from '/home/src/projects/myproject/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '@myscope/sometype'. +Module name '@myscope/sometype', matched pattern '@myscope/*'. +Trying substitution '/home/src/projects/myproject/types/*', candidate module location: '/home/src/projects/myproject/types/sometype'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/types/sometype', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/home/src/projects/myproject/types/sometype.ts' exists - use it as a name resolution result. +======== Module name '@myscope/sometype' was successfully resolved to '/home/src/projects/myproject/types/sometype.ts'. ======== +======== Resolving module 'other/sometype2' from '/home/src/projects/myproject/src/secondary.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'other/sometype2'. +Module name 'other/sometype2', matched pattern 'other/*'. +Trying substitution 'other/*', candidate module location: 'other/sometype2'. +Loading module as file / folder, candidate module location '/home/src/projects/configs/second/other/sometype2', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/home/src/projects/myproject/src/package.json' does not exist. +File '/home/src/projects/myproject/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'other/sometype2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'other/sometype2' was not resolved. ======== tsconfig.json:3:5 - error TS5090: Non-relative paths are not allowed. Did you forget a leading './'? 3 "compilerOptions": { diff --git a/testdata/baselines/reference/tsc/extends/configDir-template.js b/testdata/baselines/reference/tsc/extends/configDir-template.js index 084f1836b3..4ea0c2d01d 100644 --- a/testdata/baselines/reference/tsc/extends/configDir-template.js +++ b/testdata/baselines/reference/tsc/extends/configDir-template.js @@ -51,6 +51,50 @@ export const x = 10; tsgo --explainFiles ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +======== Resolving module '@myscope/sometype' from '/home/src/projects/myproject/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '@myscope/sometype'. +Module name '@myscope/sometype', matched pattern '@myscope/*'. +Trying substitution '/home/src/projects/myproject/types/*', candidate module location: '/home/src/projects/myproject/types/sometype'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/types/sometype', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/home/src/projects/myproject/types/sometype.ts' exists - use it as a name resolution result. +======== Module name '@myscope/sometype' was successfully resolved to '/home/src/projects/myproject/types/sometype.ts'. ======== +======== Resolving module 'other/sometype2' from '/home/src/projects/myproject/src/secondary.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'other/sometype2'. +Module name 'other/sometype2', matched pattern 'other/*'. +Trying substitution 'other/*', candidate module location: 'other/sometype2'. +Loading module as file / folder, candidate module location '/home/src/projects/configs/second/other/sometype2', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/home/src/projects/myproject/src/package.json' does not exist. +File '/home/src/projects/myproject/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'other/sometype2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'other/sometype2' was not resolved. ======== tsconfig.json:3:5 - error TS5090: Non-relative paths are not allowed. Did you forget a leading './'? 3 "compilerOptions": {