mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Complete baseUrl deprecation implementation with tests and migration examples
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
This commit is contained in:
parent
de7c7eeda5
commit
3db3a9f961
@ -4525,13 +4525,13 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
}
|
||||
});
|
||||
|
||||
checkDeprecations("6.0", "7.0", createDiagnostic, createDeprecatedDiagnostic => {
|
||||
if (options.moduleResolution === ModuleResolutionKind.Node10) {
|
||||
createDeprecatedDiagnostic("moduleResolution", "node10");
|
||||
}
|
||||
if (options.baseUrl) {
|
||||
createDeprecatedDiagnostic("baseUrl");
|
||||
}
|
||||
checkDeprecations("6.0", "7.0", createDiagnostic, createDeprecatedDiagnostic => {
|
||||
if (options.moduleResolution === ModuleResolutionKind.Node10) {
|
||||
createDeprecatedDiagnostic("moduleResolution", "node10");
|
||||
}
|
||||
if (options.baseUrl) {
|
||||
createDeprecatedDiagnostic("baseUrl");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
58
tests/baselines/reference/baseUrlMigrationExample.errors.txt
Normal file
58
tests/baselines/reference/baseUrlMigrationExample.errors.txt
Normal file
@ -0,0 +1,58 @@
|
||||
/before/tsconfig.json(3,9): error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
||||
|
||||
|
||||
==== /before/tsconfig.json (1 errors) ====
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./src",
|
||||
~~~~~~~~~
|
||||
!!! error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
||||
"paths": {
|
||||
"@app/*": ["app/*"],
|
||||
"@lib/*": ["lib/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
==== /before/src/app/module.ts (0 errors) ====
|
||||
export const value = 42;
|
||||
|
||||
==== /before/src/lib/utils.ts (0 errors) ====
|
||||
export function helper() { return "help"; }
|
||||
|
||||
==== /before/src/main.ts (0 errors) ====
|
||||
import { value } from "@app/module";
|
||||
import { helper } from "@lib/utils";
|
||||
// This would also resolve due to baseUrl:
|
||||
import * as something from "someModule"; // Resolves to ./src/someModule
|
||||
|
||||
==== /before/src/someModule.ts (0 errors) ====
|
||||
export const data = "from baseUrl resolution";
|
||||
|
||||
==== /after/tsconfig.json (0 errors) ====
|
||||
{
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
// Explicit prefix for all path mappings
|
||||
"@app/*": ["./src/app/*"],
|
||||
"@lib/*": ["./src/lib/*"],
|
||||
// Optional: preserve baseUrl behavior with catch-all
|
||||
"*": ["./src/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
==== /after/src/app/module.ts (0 errors) ====
|
||||
export const value = 42;
|
||||
|
||||
==== /after/src/lib/utils.ts (0 errors) ====
|
||||
export function helper() { return "help"; }
|
||||
|
||||
==== /after/src/main.ts (0 errors) ====
|
||||
import { value } from "@app/module";
|
||||
import { helper } from "@lib/utils";
|
||||
// With explicit catch-all mapping, this still works:
|
||||
import * as something from "someModule"; // Resolves to ./src/someModule
|
||||
|
||||
==== /after/src/someModule.ts (0 errors) ====
|
||||
export const data = "from explicit path mapping";
|
||||
63
tests/baselines/reference/baseUrlMigrationExample.js
Normal file
63
tests/baselines/reference/baseUrlMigrationExample.js
Normal file
@ -0,0 +1,63 @@
|
||||
//// [tests/cases/compiler/baseUrlMigrationExample.ts] ////
|
||||
|
||||
//// [tsconfig.json]
|
||||
{
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
// Explicit prefix for all path mappings
|
||||
"@app/*": ["./src/app/*"],
|
||||
"@lib/*": ["./src/lib/*"],
|
||||
// Optional: preserve baseUrl behavior with catch-all
|
||||
"*": ["./src/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//// [module.ts]
|
||||
export const value = 42;
|
||||
|
||||
//// [utils.ts]
|
||||
export function helper() { return "help"; }
|
||||
|
||||
//// [main.ts]
|
||||
import { value } from "@app/module";
|
||||
import { helper } from "@lib/utils";
|
||||
// With explicit catch-all mapping, this still works:
|
||||
import * as something from "someModule"; // Resolves to ./src/someModule
|
||||
|
||||
//// [someModule.ts]
|
||||
export const data = "from explicit path mapping";
|
||||
//// [module.ts]
|
||||
export const value = 42;
|
||||
|
||||
//// [utils.ts]
|
||||
export function helper() { return "help"; }
|
||||
|
||||
//// [main.ts]
|
||||
import { value } from "@app/module";
|
||||
import { helper } from "@lib/utils";
|
||||
// This would also resolve due to baseUrl:
|
||||
import * as something from "someModule"; // Resolves to ./src/someModule
|
||||
|
||||
//// [someModule.ts]
|
||||
export const data = "from baseUrl resolution";
|
||||
|
||||
|
||||
//// [module.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.value = void 0;
|
||||
exports.value = 42;
|
||||
//// [utils.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.helper = helper;
|
||||
function helper() { return "help"; }
|
||||
//// [someModule.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.data = void 0;
|
||||
exports.data = "from baseUrl resolution";
|
||||
//// [main.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
25
tests/baselines/reference/baseUrlMigrationExample.symbols
Normal file
25
tests/baselines/reference/baseUrlMigrationExample.symbols
Normal file
@ -0,0 +1,25 @@
|
||||
//// [tests/cases/compiler/baseUrlMigrationExample.ts] ////
|
||||
|
||||
=== /before/src/app/module.ts ===
|
||||
export const value = 42;
|
||||
>value : Symbol(value, Decl(module.ts, 0, 12))
|
||||
|
||||
=== /before/src/lib/utils.ts ===
|
||||
export function helper() { return "help"; }
|
||||
>helper : Symbol(helper, Decl(utils.ts, 0, 0))
|
||||
|
||||
=== /before/src/main.ts ===
|
||||
import { value } from "@app/module";
|
||||
>value : Symbol(value, Decl(main.ts, 0, 8))
|
||||
|
||||
import { helper } from "@lib/utils";
|
||||
>helper : Symbol(helper, Decl(main.ts, 1, 8))
|
||||
|
||||
// This would also resolve due to baseUrl:
|
||||
import * as something from "someModule"; // Resolves to ./src/someModule
|
||||
>something : Symbol(something, Decl(main.ts, 3, 6))
|
||||
|
||||
=== /before/src/someModule.ts ===
|
||||
export const data = "from baseUrl resolution";
|
||||
>data : Symbol(data, Decl(someModule.ts, 0, 12))
|
||||
|
||||
37
tests/baselines/reference/baseUrlMigrationExample.types
Normal file
37
tests/baselines/reference/baseUrlMigrationExample.types
Normal file
@ -0,0 +1,37 @@
|
||||
//// [tests/cases/compiler/baseUrlMigrationExample.ts] ////
|
||||
|
||||
=== /before/src/app/module.ts ===
|
||||
export const value = 42;
|
||||
>value : 42
|
||||
> : ^^
|
||||
>42 : 42
|
||||
> : ^^
|
||||
|
||||
=== /before/src/lib/utils.ts ===
|
||||
export function helper() { return "help"; }
|
||||
>helper : () => string
|
||||
> : ^^^^^^^^^^^^
|
||||
>"help" : "help"
|
||||
> : ^^^^^^
|
||||
|
||||
=== /before/src/main.ts ===
|
||||
import { value } from "@app/module";
|
||||
>value : 42
|
||||
> : ^^
|
||||
|
||||
import { helper } from "@lib/utils";
|
||||
>helper : () => string
|
||||
> : ^^^^^^^^^^^^
|
||||
|
||||
// This would also resolve due to baseUrl:
|
||||
import * as something from "someModule"; // Resolves to ./src/someModule
|
||||
>something : typeof something
|
||||
> : ^^^^^^^^^^^^^^^^
|
||||
|
||||
=== /before/src/someModule.ts ===
|
||||
export const data = "from baseUrl resolution";
|
||||
>data : "from baseUrl resolution"
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>"from baseUrl resolution" : "from baseUrl resolution"
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
56
tests/cases/compiler/baseUrlMigrationExample.ts
Normal file
56
tests/cases/compiler/baseUrlMigrationExample.ts
Normal file
@ -0,0 +1,56 @@
|
||||
// @typeScriptVersion: 6.0
|
||||
// Test showing the recommended migration from baseUrl to explicit path mappings
|
||||
|
||||
// @filename: /before/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./src",
|
||||
"paths": {
|
||||
"@app/*": ["app/*"],
|
||||
"@lib/*": ["lib/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: /before/src/app/module.ts
|
||||
export const value = 42;
|
||||
|
||||
// @filename: /before/src/lib/utils.ts
|
||||
export function helper() { return "help"; }
|
||||
|
||||
// @filename: /before/src/main.ts
|
||||
import { value } from "@app/module";
|
||||
import { helper } from "@lib/utils";
|
||||
// This would also resolve due to baseUrl:
|
||||
import * as something from "someModule"; // Resolves to ./src/someModule
|
||||
|
||||
// @filename: /before/src/someModule.ts
|
||||
export const data = "from baseUrl resolution";
|
||||
|
||||
// @filename: /after/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
// Explicit prefix for all path mappings
|
||||
"@app/*": ["./src/app/*"],
|
||||
"@lib/*": ["./src/lib/*"],
|
||||
// Optional: preserve baseUrl behavior with catch-all
|
||||
"*": ["./src/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: /after/src/app/module.ts
|
||||
export const value = 42;
|
||||
|
||||
// @filename: /after/src/lib/utils.ts
|
||||
export function helper() { return "help"; }
|
||||
|
||||
// @filename: /after/src/main.ts
|
||||
import { value } from "@app/module";
|
||||
import { helper } from "@lib/utils";
|
||||
// With explicit catch-all mapping, this still works:
|
||||
import * as something from "someModule"; // Resolves to ./src/someModule
|
||||
|
||||
// @filename: /after/src/someModule.ts
|
||||
export const data = "from explicit path mapping";
|
||||
@ -1,18 +1,19 @@
|
||||
// @module: commonjs
|
||||
// @traceResolution: true
|
||||
|
||||
// baseurl is defined in tsconfig.json
|
||||
// paths has errors
|
||||
|
||||
// @filename: root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./src",
|
||||
"paths": {
|
||||
"*1*": [ "*2*" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: root/src/folder1/file1.ts
|
||||
// @module: commonjs
|
||||
// @traceResolution: true
|
||||
|
||||
// baseurl is defined in tsconfig.json
|
||||
// paths has errors
|
||||
|
||||
// @filename: root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./src",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"*1*": [ "*2*" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: root/src/folder1/file1.ts
|
||||
export var x = 1;
|
||||
@ -1,28 +1,29 @@
|
||||
// @moduleResolution: bundler
|
||||
// @module: commonjs
|
||||
// @traceResolution: true
|
||||
|
||||
// baseUrl set via command line
|
||||
|
||||
// @filename: c:/root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "."
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: c:/root/folder1/file1.ts
|
||||
import {x} from "folder2/file2"
|
||||
declare function use(a: any): void;
|
||||
use(x.toExponential());
|
||||
|
||||
// @filename: c:/root/folder2/file2.ts
|
||||
import {x as a} from "./file3" // found with baseurl
|
||||
import {y as b} from "file4" // found with fallback
|
||||
export var x = a + b;
|
||||
|
||||
// @filename: c:/root/folder2/file3.ts
|
||||
export var x = 1;
|
||||
|
||||
// @filename: c:/node_modules/file4/index.d.ts
|
||||
// @moduleResolution: bundler
|
||||
// @module: commonjs
|
||||
// @traceResolution: true
|
||||
|
||||
// baseUrl set via command line
|
||||
|
||||
// @filename: c:/root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0"
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: c:/root/folder1/file1.ts
|
||||
import {x} from "folder2/file2"
|
||||
declare function use(a: any): void;
|
||||
use(x.toExponential());
|
||||
|
||||
// @filename: c:/root/folder2/file2.ts
|
||||
import {x as a} from "./file3" // found with baseurl
|
||||
import {y as b} from "file4" // found with fallback
|
||||
export var x = a + b;
|
||||
|
||||
// @filename: c:/root/folder2/file3.ts
|
||||
export var x = 1;
|
||||
|
||||
// @filename: c:/node_modules/file4/index.d.ts
|
||||
export var y: number;
|
||||
@ -1,43 +1,44 @@
|
||||
// @module: amd
|
||||
// @traceResolution: true
|
||||
|
||||
// paths is defined in tsconfig.json
|
||||
// @filename: c:/root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"*": [
|
||||
"*",
|
||||
"generated/*"
|
||||
],
|
||||
"components/*": [
|
||||
"shared/components/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
// @filename: c:/root/folder1/file1.ts
|
||||
import {x} from "folder2/file1"
|
||||
import {y} from "folder3/file2"
|
||||
import {z} from "components/file3"
|
||||
import {z1} from "file4"
|
||||
|
||||
declare function use(a: any): void;
|
||||
|
||||
use(x.toExponential());
|
||||
use(y.toExponential());
|
||||
use(z.toExponential());
|
||||
use(z1.toExponential());
|
||||
|
||||
// @filename: c:/root/folder2/file1.ts
|
||||
export var x = 1;
|
||||
|
||||
// @filename: c:/root/generated/folder3/file2.ts
|
||||
export var y = 1;
|
||||
|
||||
// @filename: c:/root/shared/components/file3.ts
|
||||
export var z = 1;
|
||||
|
||||
// @filename: c:/file4.ts
|
||||
// @module: amd
|
||||
// @traceResolution: true
|
||||
|
||||
// paths is defined in tsconfig.json
|
||||
// @filename: c:/root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"*": [
|
||||
"*",
|
||||
"generated/*"
|
||||
],
|
||||
"components/*": [
|
||||
"shared/components/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
// @filename: c:/root/folder1/file1.ts
|
||||
import {x} from "folder2/file1"
|
||||
import {y} from "folder3/file2"
|
||||
import {z} from "components/file3"
|
||||
import {z1} from "file4"
|
||||
|
||||
declare function use(a: any): void;
|
||||
|
||||
use(x.toExponential());
|
||||
use(y.toExponential());
|
||||
use(z.toExponential());
|
||||
use(z1.toExponential());
|
||||
|
||||
// @filename: c:/root/folder2/file1.ts
|
||||
export var x = 1;
|
||||
|
||||
// @filename: c:/root/generated/folder3/file2.ts
|
||||
export var y = 1;
|
||||
|
||||
// @filename: c:/root/shared/components/file3.ts
|
||||
export var z = 1;
|
||||
|
||||
// @filename: c:/file4.ts
|
||||
export var z1 = 1;
|
||||
@ -1,43 +1,44 @@
|
||||
// @module: commonjs
|
||||
// @traceResolution: true
|
||||
|
||||
// paths is defined in tsconfig.json
|
||||
// @filename: c:/root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"*": [
|
||||
"*",
|
||||
"generated/*"
|
||||
],
|
||||
"components/*": [
|
||||
"shared/components/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
// @filename: c:/root/folder1/file1.ts
|
||||
import {x} from "folder2/file1"
|
||||
import {y} from "folder3/file2"
|
||||
import {z} from "components/file3"
|
||||
import {z1} from "file4"
|
||||
|
||||
declare function use(a: any): void;
|
||||
|
||||
use(x.toExponential());
|
||||
use(y.toExponential());
|
||||
use(z.toExponential());
|
||||
use(z1.toExponential());
|
||||
|
||||
// @filename: c:/root/folder2/file1.ts
|
||||
export var x = 1;
|
||||
|
||||
// @filename: c:/root/generated/folder3/file2.ts
|
||||
export var y = 1;
|
||||
|
||||
// @filename: c:/root/shared/components/file3/index.d.ts
|
||||
export var z: number;
|
||||
|
||||
// @filename: c:/node_modules/file4.ts
|
||||
export var z1 = 1;
|
||||
// @module: commonjs
|
||||
// @traceResolution: true
|
||||
|
||||
// paths is defined in tsconfig.json
|
||||
// @filename: c:/root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"*": [
|
||||
"*",
|
||||
"generated/*"
|
||||
],
|
||||
"components/*": [
|
||||
"shared/components/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
// @filename: c:/root/folder1/file1.ts
|
||||
import {x} from "folder2/file1"
|
||||
import {y} from "folder3/file2"
|
||||
import {z} from "components/file3"
|
||||
import {z1} from "file4"
|
||||
|
||||
declare function use(a: any): void;
|
||||
|
||||
use(x.toExponential());
|
||||
use(y.toExponential());
|
||||
use(z.toExponential());
|
||||
use(z1.toExponential());
|
||||
|
||||
// @filename: c:/root/folder2/file1.ts
|
||||
export var x = 1;
|
||||
|
||||
// @filename: c:/root/generated/folder3/file2.ts
|
||||
export var y = 1;
|
||||
|
||||
// @filename: c:/root/shared/components/file3/index.d.ts
|
||||
export var z: number;
|
||||
|
||||
// @filename: c:/node_modules/file4.ts
|
||||
export var z1 = 1;
|
||||
|
||||
@ -1,49 +1,50 @@
|
||||
// @module: amd
|
||||
// @traceResolution: true
|
||||
|
||||
// @filename: c:/root/src/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "../",
|
||||
"paths": {
|
||||
"*": [
|
||||
"*",
|
||||
"c:/shared/*"
|
||||
],
|
||||
"templates/*": [
|
||||
"generated/src/templates/*"
|
||||
]
|
||||
},
|
||||
"rootDirs": [
|
||||
".",
|
||||
"../generated/src"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: c:/root/src/file1.ts
|
||||
import {x} from "./project/file2";
|
||||
import {y} from "module3";
|
||||
|
||||
declare function use(x: string);
|
||||
use(x.toFixed());
|
||||
use(y.toFixed());
|
||||
|
||||
// @filename: c:/root/generated/src/project/file2.ts
|
||||
import {a} from "module1";
|
||||
import {b} from "templates/module2";
|
||||
import {x as c} from "../file3";
|
||||
export let x = a + b + c;
|
||||
|
||||
// @filename: c:/shared/module1.d.ts
|
||||
export let a: number
|
||||
|
||||
// @filename: c:/root/generated/src/templates/module2.ts
|
||||
export let b: number;
|
||||
|
||||
// @filename: c:/root/src/file3.d.ts
|
||||
export let x: number;
|
||||
|
||||
// @filename: c:/module3.d.ts
|
||||
export let y: number;
|
||||
|
||||
// @module: amd
|
||||
// @traceResolution: true
|
||||
|
||||
// @filename: c:/root/src/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "../",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"*": [
|
||||
"*",
|
||||
"c:/shared/*"
|
||||
],
|
||||
"templates/*": [
|
||||
"generated/src/templates/*"
|
||||
]
|
||||
},
|
||||
"rootDirs": [
|
||||
".",
|
||||
"../generated/src"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: c:/root/src/file1.ts
|
||||
import {x} from "./project/file2";
|
||||
import {y} from "module3";
|
||||
|
||||
declare function use(x: string);
|
||||
use(x.toFixed());
|
||||
use(y.toFixed());
|
||||
|
||||
// @filename: c:/root/generated/src/project/file2.ts
|
||||
import {a} from "module1";
|
||||
import {b} from "templates/module2";
|
||||
import {x as c} from "../file3";
|
||||
export let x = a + b + c;
|
||||
|
||||
// @filename: c:/shared/module1.d.ts
|
||||
export let a: number
|
||||
|
||||
// @filename: c:/root/generated/src/templates/module2.ts
|
||||
export let b: number;
|
||||
|
||||
// @filename: c:/root/src/file3.d.ts
|
||||
export let x: number;
|
||||
|
||||
// @filename: c:/module3.d.ts
|
||||
export let y: number;
|
||||
|
||||
|
||||
@ -1,49 +1,50 @@
|
||||
// @module: commonjs
|
||||
// @traceResolution: true
|
||||
|
||||
// @filename: c:/root/src/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "../",
|
||||
"paths": {
|
||||
"*": [
|
||||
"*",
|
||||
"c:/shared/*"
|
||||
],
|
||||
"templates/*": [
|
||||
"generated/src/templates/*"
|
||||
]
|
||||
},
|
||||
"rootDirs": [
|
||||
".",
|
||||
"../generated/src"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: c:/root/src/file1.ts
|
||||
import {x} from "./project/file2";
|
||||
import {y} from "module3";
|
||||
|
||||
declare function use(x: string);
|
||||
use(x.toFixed());
|
||||
use(y.toFixed());
|
||||
|
||||
// @filename: c:/root/generated/src/project/file2.ts
|
||||
import {a} from "module1";
|
||||
import {b} from "templates/module2";
|
||||
import {x as c} from "../file3";
|
||||
export let x = a + b + c;
|
||||
|
||||
// @filename: c:/shared/module1/index.d.ts
|
||||
export let a: number
|
||||
|
||||
// @filename: c:/root/generated/src/templates/module2.ts
|
||||
export let b: number;
|
||||
|
||||
// @filename: c:/root/src/file3/index.d.ts
|
||||
export let x: number;
|
||||
|
||||
// @filename: c:/node_modules/module3.d.ts
|
||||
export let y: number;
|
||||
|
||||
// @module: commonjs
|
||||
// @traceResolution: true
|
||||
|
||||
// @filename: c:/root/src/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "../",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"*": [
|
||||
"*",
|
||||
"c:/shared/*"
|
||||
],
|
||||
"templates/*": [
|
||||
"generated/src/templates/*"
|
||||
]
|
||||
},
|
||||
"rootDirs": [
|
||||
".",
|
||||
"../generated/src"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: c:/root/src/file1.ts
|
||||
import {x} from "./project/file2";
|
||||
import {y} from "module3";
|
||||
|
||||
declare function use(x: string);
|
||||
use(x.toFixed());
|
||||
use(y.toFixed());
|
||||
|
||||
// @filename: c:/root/generated/src/project/file2.ts
|
||||
import {a} from "module1";
|
||||
import {b} from "templates/module2";
|
||||
import {x as c} from "../file3";
|
||||
export let x = a + b + c;
|
||||
|
||||
// @filename: c:/shared/module1/index.d.ts
|
||||
export let a: number
|
||||
|
||||
// @filename: c:/root/generated/src/templates/module2.ts
|
||||
export let b: number;
|
||||
|
||||
// @filename: c:/root/src/file3/index.d.ts
|
||||
export let x: number;
|
||||
|
||||
// @filename: c:/node_modules/module3.d.ts
|
||||
export let y: number;
|
||||
|
||||
|
||||
@ -1,21 +1,22 @@
|
||||
// @moduleResolution: classic
|
||||
// @module: amd
|
||||
// @traceResolution: true
|
||||
|
||||
// @filename: c:/root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@speedy/*/testing": [
|
||||
"*/dist/index.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: c:/root/index.ts
|
||||
import {x} from "@speedy/folder1/testing"
|
||||
|
||||
// @filename: c:/root/folder1/dist/index.ts
|
||||
export const x = 1 + 2;
|
||||
// @moduleResolution: classic
|
||||
// @module: amd
|
||||
// @traceResolution: true
|
||||
|
||||
// @filename: c:/root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"@speedy/*/testing": [
|
||||
"*/dist/index.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: c:/root/index.ts
|
||||
import {x} from "@speedy/folder1/testing"
|
||||
|
||||
// @filename: c:/root/folder1/dist/index.ts
|
||||
export const x = 1 + 2;
|
||||
|
||||
@ -1,21 +1,22 @@
|
||||
// @moduleResolution: bundler
|
||||
// @module: commonjs
|
||||
// @traceResolution: true
|
||||
|
||||
// @filename: c:/root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@speedy/*/testing": [
|
||||
"*/dist/index.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: c:/root/index.ts
|
||||
import {x} from "@speedy/folder1/testing"
|
||||
|
||||
// @filename: c:/root/folder1/dist/index.ts
|
||||
export const x = 1 + 2;
|
||||
// @moduleResolution: bundler
|
||||
// @module: commonjs
|
||||
// @traceResolution: true
|
||||
|
||||
// @filename: c:/root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"@speedy/*/testing": [
|
||||
"*/dist/index.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: c:/root/index.ts
|
||||
import {x} from "@speedy/folder1/testing"
|
||||
|
||||
// @filename: c:/root/folder1/dist/index.ts
|
||||
export const x = 1 + 2;
|
||||
|
||||
@ -1,25 +1,26 @@
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
|
||||
// @filename: /root/src/foo.ts
|
||||
export function foo() {}
|
||||
|
||||
// @filename: /root/src/bar.js
|
||||
export function bar() {}
|
||||
|
||||
// @filename: /root/a.ts
|
||||
import { foo } from "/foo";
|
||||
import { bar } from "/bar";
|
||||
|
||||
// @filename: /root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"/*": ["./src/*"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
|
||||
// @filename: /root/src/foo.ts
|
||||
export function foo() {}
|
||||
|
||||
// @filename: /root/src/bar.js
|
||||
export function bar() {}
|
||||
|
||||
// @filename: /root/a.ts
|
||||
import { foo } from "/foo";
|
||||
import { bar } from "/bar";
|
||||
|
||||
// @filename: /root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"/*": ["./src/*"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,49 +1,50 @@
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
|
||||
// @filename: /root/src/foo.ts
|
||||
export function foo() {}
|
||||
|
||||
// @filename: /root/src/bar.js
|
||||
export function bar() {}
|
||||
|
||||
// @filename: /root/a.ts
|
||||
import { foo as foo1 } from "/foo";
|
||||
import { bar as bar1 } from "/bar";
|
||||
import { foo as foo2 } from "c:/foo";
|
||||
import { bar as bar2 } from "c:/bar";
|
||||
import { foo as foo3 } from "c:\\foo";
|
||||
import { bar as bar3 } from "c:\\bar";
|
||||
import { foo as foo4 } from "//server/foo";
|
||||
import { bar as bar4 } from "//server/bar";
|
||||
import { foo as foo5 } from "\\\\server\\foo";
|
||||
import { bar as bar5 } from "\\\\server\\bar";
|
||||
import { foo as foo6 } from "file:///foo";
|
||||
import { bar as bar6 } from "file:///bar";
|
||||
import { foo as foo7 } from "file://c:/foo";
|
||||
import { bar as bar7 } from "file://c:/bar";
|
||||
import { foo as foo8 } from "file://server/foo";
|
||||
import { bar as bar8 } from "file://server/bar";
|
||||
import { foo as foo9 } from "http://server/foo";
|
||||
import { bar as bar9 } from "http://server/bar";
|
||||
|
||||
// @filename: /root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"/*": ["./src/*"],
|
||||
"c:/*": ["./src/*"],
|
||||
"c:\\*": ["./src/*"],
|
||||
"//server/*": ["./src/*"],
|
||||
"\\\\server\\*": ["./src/*"],
|
||||
"file:///*": ["./src/*"],
|
||||
"file://c:/*": ["./src/*"],
|
||||
"file://server/*": ["./src/*"],
|
||||
"http://server/*": ["./src/*"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
|
||||
// @filename: /root/src/foo.ts
|
||||
export function foo() {}
|
||||
|
||||
// @filename: /root/src/bar.js
|
||||
export function bar() {}
|
||||
|
||||
// @filename: /root/a.ts
|
||||
import { foo as foo1 } from "/foo";
|
||||
import { bar as bar1 } from "/bar";
|
||||
import { foo as foo2 } from "c:/foo";
|
||||
import { bar as bar2 } from "c:/bar";
|
||||
import { foo as foo3 } from "c:\\foo";
|
||||
import { bar as bar3 } from "c:\\bar";
|
||||
import { foo as foo4 } from "//server/foo";
|
||||
import { bar as bar4 } from "//server/bar";
|
||||
import { foo as foo5 } from "\\\\server\\foo";
|
||||
import { bar as bar5 } from "\\\\server\\bar";
|
||||
import { foo as foo6 } from "file:///foo";
|
||||
import { bar as bar6 } from "file:///bar";
|
||||
import { foo as foo7 } from "file://c:/foo";
|
||||
import { bar as bar7 } from "file://c:/bar";
|
||||
import { foo as foo8 } from "file://server/foo";
|
||||
import { bar as bar8 } from "file://server/bar";
|
||||
import { foo as foo9 } from "http://server/foo";
|
||||
import { bar as bar9 } from "http://server/bar";
|
||||
|
||||
// @filename: /root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"/*": ["./src/*"],
|
||||
"c:/*": ["./src/*"],
|
||||
"c:\\*": ["./src/*"],
|
||||
"//server/*": ["./src/*"],
|
||||
"\\\\server\\*": ["./src/*"],
|
||||
"file:///*": ["./src/*"],
|
||||
"file://c:/*": ["./src/*"],
|
||||
"file://server/*": ["./src/*"],
|
||||
"http://server/*": ["./src/*"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,26 +1,27 @@
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
|
||||
// @filename: /root/import/foo.ts
|
||||
export function foo() {}
|
||||
|
||||
// @filename: /root/client/bar.js
|
||||
export function bar() {}
|
||||
|
||||
// @filename: /root/src/a.ts
|
||||
import { foo } from "/import/foo";
|
||||
import { bar } from "/client/bar";
|
||||
|
||||
// @filename: /root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"/client/*": ["./client/*"],
|
||||
"/import/*": ["./import/*"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
|
||||
// @filename: /root/import/foo.ts
|
||||
export function foo() {}
|
||||
|
||||
// @filename: /root/client/bar.js
|
||||
export function bar() {}
|
||||
|
||||
// @filename: /root/src/a.ts
|
||||
import { foo } from "/import/foo";
|
||||
import { bar } from "/client/bar";
|
||||
|
||||
// @filename: /root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"/client/*": ["./client/*"],
|
||||
"/import/*": ["./import/*"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,25 +1,26 @@
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
|
||||
// @filename: /foo.ts
|
||||
export function foo() {}
|
||||
|
||||
// @filename: /bar.js
|
||||
export function bar() {}
|
||||
|
||||
// @filename: /root/a.ts
|
||||
import { foo } from "/foo";
|
||||
import { bar } from "/bar";
|
||||
|
||||
// @filename: /root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"/*": ["./src/*"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
|
||||
// @filename: /foo.ts
|
||||
export function foo() {}
|
||||
|
||||
// @filename: /bar.js
|
||||
export function bar() {}
|
||||
|
||||
// @filename: /root/a.ts
|
||||
import { foo } from "/foo";
|
||||
import { bar } from "/bar";
|
||||
|
||||
// @filename: /root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"/*": ["./src/*"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,25 +1,26 @@
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
|
||||
// @filename: /root/src/foo.ts
|
||||
export function foo() {}
|
||||
|
||||
// @filename: /root/src/bar.js
|
||||
export function bar() {}
|
||||
|
||||
// @filename: /root/a.ts
|
||||
import { foo } from "/foo";
|
||||
import { bar } from "/bar";
|
||||
|
||||
// @filename: /root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"*": ["./src/*"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
|
||||
// @filename: /root/src/foo.ts
|
||||
export function foo() {}
|
||||
|
||||
// @filename: /root/src/bar.js
|
||||
export function bar() {}
|
||||
|
||||
// @filename: /root/a.ts
|
||||
import { foo } from "/foo";
|
||||
import { bar } from "/bar";
|
||||
|
||||
// @filename: /root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"*": ["./src/*"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,25 +1,26 @@
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
|
||||
// @filename: /foo.ts
|
||||
export function foo() {}
|
||||
|
||||
// @filename: /bar.js
|
||||
export function bar() {}
|
||||
|
||||
// @filename: /root/a.ts
|
||||
import { foo } from "/foo";
|
||||
import { bar } from "/bar";
|
||||
|
||||
// @filename: /root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"*": ["./src/*"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
|
||||
// @filename: /foo.ts
|
||||
export function foo() {}
|
||||
|
||||
// @filename: /bar.js
|
||||
export function bar() {}
|
||||
|
||||
// @filename: /root/a.ts
|
||||
import { foo } from "/foo";
|
||||
import { bar } from "/bar";
|
||||
|
||||
// @filename: /root/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"*": ["./src/*"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,26 +1,27 @@
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
|
||||
// @Filename: /foo/foo.ts
|
||||
export function foo() {}
|
||||
|
||||
// @Filename: /bar/bar.js
|
||||
export function bar() {}
|
||||
|
||||
// @Filename: /a.ts
|
||||
import { foo } from "foo";
|
||||
import { bar } from "bar";
|
||||
|
||||
// @Filename: /tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"foo": ["foo/foo.ts"],
|
||||
"bar": ["bar/bar.js"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
|
||||
// @Filename: /foo/foo.ts
|
||||
export function foo() {}
|
||||
|
||||
// @Filename: /bar/bar.js
|
||||
export function bar() {}
|
||||
|
||||
// @Filename: /a.ts
|
||||
import { foo } from "foo";
|
||||
import { bar } from "bar";
|
||||
|
||||
// @Filename: /tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"foo": ["foo/foo.ts"],
|
||||
"bar": ["bar/bar.js"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,23 +1,24 @@
|
||||
// @traceResolution: true
|
||||
// @module: commonjs
|
||||
// @noImplicitReferences: true
|
||||
|
||||
// @filename: /tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"*": ["foo/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: /foo/zone.js/index.d.ts
|
||||
export const x: number;
|
||||
|
||||
// @filename: /foo/zone.tsx/index.d.ts
|
||||
export const y: number;
|
||||
|
||||
// @filename: /a.ts
|
||||
import { x } from "zone.js";
|
||||
import { y } from "zone.tsx";
|
||||
// @traceResolution: true
|
||||
// @module: commonjs
|
||||
// @noImplicitReferences: true
|
||||
|
||||
// @filename: /tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"*": ["foo/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: /foo/zone.js/index.d.ts
|
||||
export const x: number;
|
||||
|
||||
// @filename: /foo/zone.tsx/index.d.ts
|
||||
export const y: number;
|
||||
|
||||
// @filename: /a.ts
|
||||
import { x } from "zone.js";
|
||||
import { y } from "zone.tsx";
|
||||
|
||||
@ -1,23 +1,24 @@
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
// @esModuleInterop: true
|
||||
// @fullEmitPaths: true
|
||||
|
||||
// @Filename: /node_modules/foo/bar/foobar.js
|
||||
module.exports = { a: 10 };
|
||||
|
||||
// @Filename: /a.ts
|
||||
import foobar from "foo/bar/foobar.js";
|
||||
|
||||
// @Filename: /tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"*": ["node_modules/*", "src/types"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @allowJs: true
|
||||
// @esModuleInterop: true
|
||||
// @fullEmitPaths: true
|
||||
|
||||
// @Filename: /node_modules/foo/bar/foobar.js
|
||||
module.exports = { a: 10 };
|
||||
|
||||
// @Filename: /a.ts
|
||||
import foobar from "foo/bar/foobar.js";
|
||||
|
||||
// @Filename: /tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"*": ["node_modules/*", "src/types"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"outDir": "bin"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,15 +1,16 @@
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
|
||||
// @Filename: /a.ts
|
||||
import { foo } from "foo";
|
||||
|
||||
// @Filename: /tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"foo": ["foo/foo.ts"]
|
||||
}
|
||||
}
|
||||
}
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
|
||||
// @Filename: /a.ts
|
||||
import { foo } from "foo";
|
||||
|
||||
// @Filename: /tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"foo": ["foo/foo.ts"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user