Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "./tsconfig.app.json",
"compilerOptions": {
"outDir": "../dist-server",
"baseUrl": "./",
"types": ["@angular/localize", "node"]
},
"files": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
Expand All @@ -17,7 +16,6 @@
]
},
"angularCompilerOptions": {
"enableIvy": true,
"disableTypeScriptVersionCheck": true,
"strictTemplates": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
await harness.modifyFile('tsconfig.json', (content) => {
const tsconfig = JSON.parse(content);
tsconfig.compilerOptions.paths = {
'app-module': ['a.js'],
'app-module': ['./a.js'],
};

return JSON.stringify(tsconfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,13 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
it('should not show warning in JIT for templateUrl and styleUrl when using paths', async () => {
await harness.modifyFile('tsconfig.json', (content) => {
return content.replace(
/"baseUrl": ".\/",/,
`
"baseUrl": "./",
"paths": {
"@app/*": [
"src/app/*"
]
},
/"compilerOptions": {/,
`"compilerOptions": {
"paths": {
"@app/*": [
"./src/app/*"
]
},
`,
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ describeKarmaBuilder(execute, KARMA_BUILDER_INFO, (harness, setupTarget) => {

it(`should collect coverage from paths in 'sourceRoot'`, async () => {
await harness.writeFiles({
'./dist/my-lib/index.d.ts': `
'./node_modules/my-lib/index.d.ts': `
export declare const title = 'app';
`,
'./dist/my-lib/index.js': `
'./node_modules/my-lib/index.js': `
export const title = 'app';
`,
'./src/app/app.component.ts': `
Expand All @@ -88,20 +88,6 @@ describeKarmaBuilder(execute, KARMA_BUILDER_INFO, (harness, setupTarget) => {
}
`,
});
await harness.modifyFile('tsconfig.json', (content) =>
content.replace(
/"baseUrl": ".\/",/,
`
"baseUrl": "./",
"paths": {
"my-lib": [
"./dist/my-lib"
]
},
`,
),
);

harness.useTarget('test', {
...BASE_OPTIONS,
codeCoverage: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@ describe('Browser Builder tsconfig paths', () => {

it('works', async () => {
host.replaceInFile('src/app/app.module.ts', './app.component', '@root/app/app.component');

// TODO(crisbeto): the `baseUrl` here will trigger a deprecation error in TS6. We may
// have to opt out of it for this test since Webpack seems to depend on the `baseUrl`.
host.replaceInFile(
'tsconfig.json',
/"baseUrl": ".\/",/,
/"compilerOptions": {/,
`
"baseUrl": "./",
"paths": {
"@root/*": [
"./src/*"
]
},
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@root/*": [
"./src/*"
]
},
`,
);

Expand All @@ -43,23 +47,27 @@ describe('Browser Builder tsconfig paths', () => {
'src/app/shared/meaning.ts': 'export var meaning = 42;',
'src/app/shared/index.ts': `export * from './meaning'`,
});

// TODO(crisbeto): the `baseUrl` here will trigger a deprecation error in TS6. We may
// have to opt out of it for this test since Webpack seems to depend on the `baseUrl`.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The context here is that it should work without the baseUrl since the default has been ./ for a while, but it doesn't for some reason. I suspect something in Webpack might be depending on it. Once TS6 is out, we can opt out these tests from the deprecation error.

host.replaceInFile(
'tsconfig.json',
/"baseUrl": ".\/",/,
/"compilerOptions": {/,
`
"baseUrl": "./",
"paths": {
"@shared": [
"src/app/shared"
],
"@shared/*": [
"src/app/shared/*"
],
"*": [
"*",
"src/app/shared/*"
]
},
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@shared": [
"./src/app/shared"
],
"@shared/*": [
"./src/app/shared/*"
],
"*": [
"*",
"./src/app/shared/*"
]
},
`,
);
host.appendToFile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
it('should not show warning in JIT for templateUrl and styleUrl when using paths', async () => {
await harness.modifyFile('tsconfig.json', (content) => {
return content.replace(
/"baseUrl": ".\/",/,
`
/"compilerOptions": {/,
// TODO(crisbeto): the `baseUrl` here will trigger a deprecation error in TS6. We may
// have to opt out of it for this test since Webpack seems to depend on the `baseUrl`.
`"compilerOptions": {
"baseUrl": "./",
"paths": {
"@app/*": [
"src/app/*"
"./src/app/*"
]
},
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ describeKarmaBuilder(execute, KARMA_BUILDER_INFO, (harness, setupTarget) => {

it(`should collect coverage from paths in 'sourceRoot'`, async () => {
await harness.writeFiles({
'./dist/my-lib/index.d.ts': `
'./node_modules/my-lib/index.d.ts': `
export declare const title = 'app';
`,
'./dist/my-lib/index.js': `
'./node_modules/my-lib/index.js': `
export const title = 'app';
`,
'./src/app/app.component.ts': `
Expand All @@ -88,20 +88,6 @@ describeKarmaBuilder(execute, KARMA_BUILDER_INFO, (harness, setupTarget) => {
}
`,
});
await harness.modifyFile('tsconfig.json', (content) =>
content.replace(
/"baseUrl": ".\/",/,
`
"baseUrl": "./",
"paths": {
"my-lib": [
"./dist/my-lib"
]
},
`,
),
);

harness.useTarget('test', {
...BASE_OPTIONS,
codeCoverage: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
Expand All @@ -16,7 +15,6 @@
]
},
"angularCompilerOptions": {
"enableIvy": true,
"disableTypeScriptVersionCheck": true
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
Expand All @@ -12,7 +11,6 @@
"lib": ["es2022", "dom"]
},
"angularCompilerOptions": {
"enableIvy": true,
"disableTypeScriptVersionCheck": true
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"compilerOptions": {
"baseUrl": "tsconfig",
"lib": ["es2018", "dom"],
"declaration": true,
"module": "commonjs",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"compilerOptions": {
"baseUrl": "tsconfig",
"lib": ["es2018", "dom"],
"module": "commonjs",
"moduleResolution": "node",
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/assets/ssr-project-webpack/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"strict": true,
"noImplicitOverride": true,
Expand Down