Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions internal/testutil/tsbaseline/js_emit_baseline.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/microsoft/typescript-go/internal/parser"
"github.com/microsoft/typescript-go/internal/testutil/baseline"
"github.com/microsoft/typescript-go/internal/testutil/harnessutil"
"github.com/microsoft/typescript-go/internal/tsoptions"
"github.com/microsoft/typescript-go/internal/tspath"
)

Expand Down Expand Up @@ -160,6 +161,7 @@ type declarationCompilationContext struct {
harnessSettings *harnessutil.HarnessOptions
options *core.CompilerOptions
currentDirectory string
configFile *tsoptions.TsConfigSourceFile
}

func prepareDeclarationCompilationContext(
Expand Down Expand Up @@ -237,11 +239,12 @@ func prepareDeclarationCompilationContext(
declOtherFiles = addDtsFile(file, declOtherFiles)
}
return &declarationCompilationContext{
declInputFiles,
declOtherFiles,
harnessSettings,
options,
core.IfElse(len(currentDirectory) > 0, currentDirectory, harnessSettings.CurrentDirectory),
declInputFiles: declInputFiles,
declOtherFiles: declOtherFiles,
harnessSettings: harnessSettings,
options: options,
currentDirectory: core.IfElse(len(currentDirectory) > 0, currentDirectory, harnessSettings.CurrentDirectory),
configFile: result.Program.Program().CommandLine().ConfigFile,
}
}
return nil
Expand All @@ -257,14 +260,20 @@ func compileDeclarationFiles(t *testing.T, context *declarationCompilationContex
if context == nil {
return nil
}
var tsconfig *tsoptions.ParsedCommandLine
if context.configFile != nil {
tsconfig = &tsoptions.ParsedCommandLine{
ConfigFile: context.configFile,
}
}
declFileCompilationResult := harnessutil.CompileFilesEx(t,
context.declInputFiles,
context.declOtherFiles,
context.harnessSettings,
context.options,
context.currentDirectory,
symlinks,
nil)
tsconfig)
return &declarationCompilationResult{
context.declInputFiles,
context.declOtherFiles,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ export {};
//// [DtsFileErrors]


error TS5011: The common source directory of 'tsconfig.json' is '../.src'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout.
/app/tsconfig.json(3,9): error TS5011: The common source directory of 'tsconfig.json' is '../.src'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.


!!! error TS5011: The common source directory of 'tsconfig.json' is '../.src'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout.
!!! error TS5011: Visit https://aka.ms/ts6 for migration information.
==== /app/tsconfig.json (0 errors) ====
==== /app/tsconfig.json (1 errors) ====
{
"compilerOptions": {
"outDir": "bin",
~~~~~~~~
!!! error TS5011: The common source directory of 'tsconfig.json' is '../.src'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout.
!!! error TS5011: Visit https://aka.ms/ts6 for migration information.
"typeRoots": ["../types"],
"sourceMap": true,
"mapRoot": "myMapRoot",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ export default Foo;
//// [DtsFileErrors]


error TS5011: The common source directory of 'tsconfig.json' is '../.src'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout.
/foo/tsconfig.json(2,47): error TS5011: The common source directory of 'tsconfig.json' is '../.src'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.


!!! error TS5011: The common source directory of 'tsconfig.json' is '../.src'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout.
!!! error TS5011: Visit https://aka.ms/ts6 for migration information.
==== /foo/tsconfig.json (0 errors) ====
==== /foo/tsconfig.json (1 errors) ====
{
"compilerOptions": { "declaration": true, "declarationDir": "out", "module": "commonjs", "target": "es2015" }
~~~~~~~~~~~~~~~~
!!! error TS5011: The common source directory of 'tsconfig.json' is '../.src'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout.
!!! error TS5011: Visit https://aka.ms/ts6 for migration information.
}

This file was deleted.

Loading