Skip to content

Commit 436ddbf

Browse files
committed
add support for Angular v13
1 parent 7334dcc commit 436ddbf

37 files changed

+1170
-174
lines changed

.bitmap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939
"mainFile": "index.ts",
4040
"rootDir": "packages/angular-v12"
4141
},
42+
"angular-v13": {
43+
"scope": "",
44+
"version": "",
45+
"mainFile": "index.ts",
46+
"rootDir": "packages/angular-v13"
47+
},
4248
"angular-v8": {
4349
"scope": "teambit.angular",
4450
"version": "0.0.22",

.github/workflows/main.yml

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,65 @@ env:
1717
BIT_TOKEN: ${{ secrets.BIT_TOKEN }}
1818

1919
jobs:
20-
# Test angular-v12
20+
# Test angular-v13
21+
v13:
22+
runs-on: ubuntu-latest
23+
if: "!contains(github.event.head_commit.message, 'skip-ci')"
24+
container:
25+
image: docker://bitcli/bit:latest
26+
steps:
27+
- uses: teambit/setup-action@v1
28+
with:
29+
name: angular-github-actions
30+
BIT_TOKEN: ${{ env.BIT_TOKEN }}
31+
32+
- uses: actions/checkout@v2
33+
34+
- name: Remove v12
35+
run: bit remove angular-v12 -s -f --log
36+
37+
- name: Remove v11
38+
run: bit remove angular-v11 -s -f --log
39+
40+
- name: Remove v10
41+
run: bit remove angular-v10 -s -f --log
42+
43+
- name: Remove v9
44+
run: bit remove angular-v9 -s -f --log
45+
46+
- name: Remove v8
47+
run: bit remove angular-v8 -s -f --log
48+
49+
- name: Add example app
50+
run: bit add examples/demo-lib-v13 --log
51+
52+
- name: Install dependencies
53+
run: bit install --log
54+
55+
# Compile the aspects
56+
- name: Bit compile aspects
57+
run: bit compile ng-packagr angular-eslint-config angular angular-v13 --log
58+
59+
# Run bit link to regenerate the package.json of the example component
60+
- name: Bit link
61+
run: bit link --log
62+
63+
# Compile the example component
64+
- name: Bit compile example
65+
run: bit compile demo-lib-v13 --log
66+
67+
- name: Bit test
68+
run: bit test --log
69+
70+
- name: Bit build
71+
run: bit build --log
72+
73+
- uses: actions/upload-artifact@v2
74+
with:
75+
name: debug-log
76+
path: $HOME/Library/Caches/Bit/logs
77+
78+
# Test angular-v12
2179
v12:
2280
runs-on: ubuntu-latest
2381
if: "!contains(github.event.head_commit.message, 'skip-ci')"
@@ -31,6 +89,9 @@ jobs:
3189

3290
- uses: actions/checkout@v2
3391

92+
- name: Remove v13
93+
run: bit remove angular-v13 -s -f --log
94+
3495
- name: Remove v11
3596
run: bit remove angular-v11 -s -f --log
3697

@@ -86,6 +147,9 @@ jobs:
86147

87148
- uses: actions/checkout@v2
88149

150+
- name: Remove v13
151+
run: bit remove angular-v13 -s -f --log
152+
89153
- name: Remove v12
90154
run: bit remove angular-v12 -s -f
91155

@@ -141,6 +205,9 @@ jobs:
141205

142206
- uses: actions/checkout@v2
143207

208+
- name: Remove v13
209+
run: bit remove angular-v13 -s -f --log
210+
144211
- name: Remove v12
145212
run: bit remove angular-v12 -s -f
146213

@@ -196,6 +263,9 @@ jobs:
196263

197264
- uses: actions/checkout@v2
198265

266+
- name: Remove v13
267+
run: bit remove angular-v13 -s -f --log
268+
199269
- name: Remove v12
200270
run: bit remove angular-v12 -s -f
201271

@@ -251,6 +321,9 @@ jobs:
251321

252322
- uses: actions/checkout@v2
253323

324+
- name: Remove v13
325+
run: bit remove angular-v13 -s -f --log
326+
254327
- name: Remove v12
255328
run: bit remove angular-v12 -s -f
256329

examples/demo-lib-v13/public-api.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Entry point for this Angular library, do not move or rename this file.
3+
*/
4+
export * from './src/bit-test.component';
5+
export * from './src/bit-test2.component';
6+
export * from './src/bit-test.module';
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Component } from "@angular/core";
2+
import { BitTestService } from './bit-test.service';
3+
4+
@Component({
5+
selector: 'bit-test',
6+
template: `
7+
<p>bit-test component works!</p>
8+
<small>{{ service.content }}</small>
9+
`
10+
})
11+
export class BitTestComponent {
12+
constructor(public service: BitTestService) {}
13+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
labels: ['angular', 'typescript', 'bit-test']
3+
description: 'A `bit-test` component.'
4+
---
5+
6+
# Bit test documentation
7+
Import `BitTestModule` :
8+
9+
```typescript
10+
import { BitTestModule } from './bit-test.module';
11+
12+
// add it to your module imports
13+
@NgModule({
14+
// ...
15+
imports: [
16+
BitTestModule
17+
]
18+
// ...
19+
})
20+
export class AppModule {}
21+
```
22+
23+
Use `BitTestComponent` in your templates :
24+
25+
```html
26+
<bit-test></bit-test>
27+
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { NgModule } from '@angular/core';
2+
import { BitTestComponent } from './bit-test.component';
3+
import { BitTest2Component } from './bit-test2.component';
4+
5+
@NgModule({
6+
declarations: [
7+
BitTestComponent,
8+
BitTest2Component
9+
],
10+
exports: [
11+
BitTestComponent,
12+
BitTest2Component
13+
]
14+
})
15+
export class BitTestModule {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Injectable } from '@angular/core';
2+
3+
@Injectable({ providedIn: 'any' })
4+
export class BitTestService {
5+
get content() {
6+
return 'Content from service';
7+
}
8+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { BitTestComponent } from './bit-test.component';
4+
5+
describe('BitTestComponent', () => {
6+
let component: BitTestComponent;
7+
let fixture: ComponentFixture<BitTestComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
declarations: [ BitTestComponent ]
12+
})
13+
.compileComponents();
14+
});
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(BitTestComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
26+
it('should have a service', () => {
27+
expect(component.service).toBeDefined();
28+
expect(component.service.content).toEqual('Content from service');
29+
})
30+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'bit-test2',
5+
template: `
6+
<p>
7+
bit-test 2 works as well!
8+
</p>
9+
`
10+
})
11+
export class BitTest2Component {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Component, NgModule } from '@angular/core';
2+
import { BitTestModule } from '../bit-test.module';
3+
4+
@Component({
5+
selector: 'composition-cmp',
6+
template: `Composition: <bit-test></bit-test>`
7+
})
8+
class CompositionComponent {}
9+
10+
@NgModule({
11+
declarations: [CompositionComponent],
12+
imports: [BitTestModule],
13+
bootstrap: [CompositionComponent]
14+
})
15+
export class CompositionModule {
16+
}

0 commit comments

Comments
 (0)