Skip to content

Commit 1157147

Browse files
exaby73dackers86
andauthored
feat: Angular parity (#19)
* Initial migration to Angular components * wip: Initial Angular migration * wip * refactor(auth): Update form components to use async initialization and validation * chore(deps): Upgrade @tanstack/angular-form to version 1.1.0 and refactor form component initialization * refactor(auth): Update handleSubmit methods in form components to be async for improved handling of asynchronous operations * feat: Angular tests (#20) * feat: Angular unit tests * feat: Add Firebase integration tests for authentication flows * chore: Remove pull request branch specification from workflow files * chore: Update Angular build process in CI workflows to include development mode compilation * chore(deps): Replace @nanostores/angular with nanostores and implement useStore * chore(deps): Add zod as a dependency in ng-package.json --------- Co-authored-by: Darren Ackers <[email protected]>
1 parent c96f6d4 commit 1157147

File tree

99 files changed

+7552
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+7552
-216
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Angular Integration Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
integration-test:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
node-version: [22.x]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
24+
- name: Setup Java for Firebase Emulator
25+
uses: actions/setup-java@v4
26+
with:
27+
distribution: "temurin"
28+
java-version: "17"
29+
30+
- name: Install pnpm
31+
uses: pnpm/action-setup@v2
32+
with:
33+
version: 8
34+
35+
- name: Install dependencies
36+
run: pnpm install
37+
38+
- name: Build core package
39+
run: pnpm --filter @firebase-ui/core build
40+
41+
- name: Compile Angular in development mode first
42+
run: pnpm --filter angular-example exec ng build firebaseui-angular --configuration=development
43+
44+
- name: Install Firebase Tools
45+
run: npm install -g firebase-tools
46+
47+
- name: Create Firebase config
48+
run: |
49+
cat > firebase.json << EOF
50+
{
51+
"emulators": {
52+
"auth": {
53+
"port": 9099
54+
},
55+
"ui": {
56+
"enabled": false
57+
}
58+
}
59+
}
60+
EOF
61+
62+
- name: Start Firebase Emulator and Run Integration Tests
63+
run: |
64+
firebase emulators:start &
65+
sleep 10
66+
pnpm --filter angular-example test:integration || test_exit_code=$?
67+
if [[ $test_exit_code -eq 1 ]]; then
68+
echo "Tests completed with expected exit code 1"
69+
exit 0
70+
else
71+
echo "Unexpected exit code: $test_exit_code"
72+
exit 1
73+
fi
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Angular Unit Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
unit-test:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
node-version: [22.x]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
24+
- name: Install pnpm
25+
uses: pnpm/action-setup@v2
26+
with:
27+
version: 8
28+
29+
- name: Install dependencies
30+
run: pnpm install
31+
32+
- name: Build core package
33+
run: pnpm --filter @firebase-ui/core build
34+
35+
- name: Compile Angular in development mode first
36+
run: pnpm --filter angular-example exec ng build firebaseui-angular --configuration=development
37+
38+
- name: Run unit tests
39+
run: |
40+
pnpm --filter angular-example test:unit || test_exit_code=$?
41+
if [[ $test_exit_code -eq 1 ]]; then
42+
echo "Tests completed with expected exit code 1"
43+
exit 0
44+
else
45+
echo "Unexpected exit code: $test_exit_code"
46+
exit 1
47+
fi

.github/workflows/core-integration-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches: [main]
66
pull_request:
7-
branches: [main]
87

98
jobs:
109
integration-test:

.github/workflows/core-unit-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches: [main]
66
pull_request:
7-
branches: [main]
87

98
jobs:
109
unit-test:

.github/workflows/react-integration-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches: [main]
66
pull_request:
7-
branches: [main]
87

98
jobs:
109
integration-test:

.github/workflows/react-unit-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches: [main]
66
pull_request:
7-
branches: [main]
87

98
jobs:
109
unit-test:

examples/nextjs/app/globals.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
@import "@firebase-ui/styles/src/base.css";
33

44
/* @import "@firebase-ui/styles/src/themes/dark.css"; */
5-
@import "@firebase-ui/styles/src/themes/brutalist.css";
5+
/* @import "@firebase-ui/styles/src/themes/brutalist.css"; */

packages/angular/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,24 @@
99
"build:local": "pnpm run build:lib && cd projects/firebaseui-angular && pnpm pack",
1010
"watch": "ng build --watch --configuration development",
1111
"test": "ng test",
12+
"test:unit": "ng test --exclude=\"**/integration/**\" --no-watch --no-progress --browsers=ChromeHeadless",
13+
"test:integration": "ng test --include=\"**/tests/integration/**/*.spec.ts\" --no-watch --no-progress --browsers=ChromeHeadless",
1214
"serve:ssr:angular-ssr": "node dist/angular-ssr/server/server.mjs"
1315
},
1416
"private": true,
1517
"dependencies": {
16-
"@firebase-ui/core": "workspace:*",
1718
"@angular/animations": "^19.1.0",
1819
"@angular/common": "^19.1.0",
1920
"@angular/compiler": "^19.1.0",
2021
"@angular/core": "^19.1.0",
21-
"@angular/forms": "^19.1.0",
2222
"@angular/fire": "^19.0.0",
23+
"@angular/forms": "^19.1.0",
2324
"@angular/platform-browser": "^19.1.0",
2425
"@angular/platform-browser-dynamic": "^19.1.0",
2526
"@angular/platform-server": "^19.1.0",
2627
"@angular/router": "^19.1.0",
2728
"@angular/ssr": "^19.1.7",
29+
"@firebase-ui/core": "workspace:*",
2830
"@tailwindcss/postcss": "^4.0.6",
2931
"express": "^4.18.2",
3032
"postcss": "^8.5.2",
@@ -34,20 +36,21 @@
3436
"zone.js": "~0.15.0"
3537
},
3638
"devDependencies": {
37-
"@tanstack/angular-form": "^0.42.0",
38-
"@nanostores/angular": "^0.0.4",
3939
"@angular-devkit/build-angular": "^19.1.7",
4040
"@angular/cli": "^19.1.7",
4141
"@angular/compiler-cli": "^19.1.0",
42+
"@tanstack/angular-form": "^0.42.0",
4243
"@types/express": "^4.17.17",
4344
"@types/jasmine": "~5.1.0",
4445
"@types/node": "^18.18.0",
46+
"firebase": "^11",
4547
"jasmine-core": "~5.5.0",
4648
"karma": "~6.4.0",
4749
"karma-chrome-launcher": "~3.2.0",
4850
"karma-coverage": "~2.2.0",
4951
"karma-jasmine": "~5.1.0",
5052
"karma-jasmine-html-reporter": "~2.1.0",
53+
"nanostores": "^0.11.3",
5154
"ng-packagr": "^19.1.0",
5255
"typescript": "~5.7.2"
5356
}

packages/angular/projects/firebaseui-angular/ng-package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"@firebase-ui/core",
99
"@firebase-ui/styles",
1010
"@tanstack/angular-form",
11-
"@nanostores/angular",
12-
"tslib"
11+
"nanostores",
12+
"tslib",
13+
"zod"
1314
]
1415
}

packages/angular/projects/firebaseui-angular/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"@firebase-ui/core": "workspace:*"
88
},
99
"dependencies": {
10-
"@tanstack/angular-form": "^0.42.0",
11-
"@nanostores/angular": "^0.0.4",
12-
"tslib": "^2.3.0"
10+
"@tanstack/angular-form": "^1.1.0",
11+
"nanostores": "^0.11.3",
12+
"tslib": "^2.3.0",
13+
"zod": "^3.24.1"
1314
},
1415
"sideEffects": false
1516
}

0 commit comments

Comments
 (0)