Skip to content

Commit f8aa992

Browse files
authored
refactor: support resolving ngcc from APF v13 output (#1523)
Angular v13 version comes with the APF v13 output where all FW packages are strict ESM. This required some changes in the ngcc lookup logic to properly work with strict ESM and the new `package.json` `exports` field. This is needed in v12 because a workspace may include projects that are using different versions of Angular. Because we resolve ngcc from the node modules of the application code, we need to support both formats.
1 parent afe2cab commit f8aa992

File tree

12 files changed

+804
-5
lines changed

12 files changed

+804
-5
lines changed

.circleci/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ jobs:
55
build-and-test:
66
executor:
77
name: node/default
8-
tag: '12.18'
8+
tag: '12.20'
99
steps:
1010
- checkout
1111
- node/install-packages:
1212
pkg-manager: yarn
1313
- node/install-packages:
1414
app-dir: integration/project
1515
pkg-manager: yarn
16+
- node/install-packages:
17+
app-dir: integration/apf_project
18+
pkg-manager: yarn
1619
- node/install-packages:
1720
app-dir: integration/workspace
1821
pkg-manager: yarn
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import {Component, EventEmitter, Input, Output} from '@angular/core';
2+
3+
@Component({
4+
selector: 'my-app',
5+
template: `<h1>Hello {{name}}</h1>`,
6+
})
7+
export class AppComponent {
8+
name = 'Angular';
9+
@Input() appInput = '';
10+
@Output() appOutput = new EventEmitter<string>();
11+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import {CommonModule} from '@angular/common';
2+
import {NgModule} from '@angular/core';
3+
import {AppComponent} from './app.component';
4+
import {FooComponent} from './foo.component';
5+
6+
@NgModule({
7+
imports: [
8+
CommonModule,
9+
],
10+
declarations: [
11+
AppComponent,
12+
FooComponent,
13+
],
14+
bootstrap: [AppComponent]
15+
})
16+
export class AppModule {
17+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{title | uppercase}}
2+
<span class="subtitle">
3+
subtitle
4+
</span>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {Component} from '@angular/core';
2+
3+
@Component({
4+
templateUrl: 'foo.component.html',
5+
})
6+
export class FooComponent {
7+
title = 'Foo Component';
8+
}

integration/apf_project/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "angular-ls-integration-test-project",
3+
"private": true,
4+
"dependencies": {
5+
"@angular/common": "13.0.0-next.15",
6+
"@angular/compiler": "13.0.0-next.15",
7+
"@angular/compiler-cli": "13.0.0-next.15",
8+
"@angular/core": "13.0.0-next.15",
9+
"rxjs": "6.6.7",
10+
"zone.js": "0.11.4"
11+
}
12+
}

integration/apf_project/tsconfig.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"compilerOptions": {
3+
"moduleResolution": "node",
4+
"experimentalDecorators": true,
5+
"target": "es2015",
6+
"typeRoots": [
7+
"node_modules/@types"
8+
]
9+
},
10+
"angularCompilerOptions": {
11+
"strictTemplates": true,
12+
"strictInjectionParameters": true
13+
}
14+
}

0 commit comments

Comments
 (0)