Skip to content

Commit e351643

Browse files
Merge pull request #107 from angular/master
Create a new pull request by comparing changes across two branches
2 parents b7fc084 + 5793d6f commit e351643

File tree

204 files changed

+7509
-8618
lines changed

Some content is hidden

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

204 files changed

+7509
-8618
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,20 @@ jobs:
2525
- name: Setup node
2626
uses: actions/setup-node@v3
2727
with:
28-
node-version: '16'
28+
node-version: '18'
2929
check-latest: true
3030
- name: node_modules cache
3131
uses: actions/cache@v3
3232
id: node_modules_cache
3333
with:
3434
path: ./node_modules
3535
key: ${{ runner.os }}-16-12-9-9-6-node_modules-${{ hashFiles('yarn.lock') }}
36-
restore-keys: |
37-
${{ runner.os }}-16-12-9-9-6-node_modules-
38-
${{ runner.os }}-16-12-9-9-
39-
${{ runner.os }}-16-12-9-
40-
${{ runner.os }}-16-12-
41-
${{ runner.os }}-16-
4236
- name: Yarn offline cache
4337
if: steps.node_modules_cache.outputs.cache-hit != 'true'
4438
uses: actions/cache@v3
4539
with:
4640
path: ~/.npm-packages-offline-cache
4741
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
48-
restore-keys: yarn-offline
4942
- name: Install deps
5043
if: steps.node_modules_cache.outputs.cache-hit != 'true'
5144
run: |
@@ -70,7 +63,7 @@ jobs:
7063
strategy:
7164
matrix:
7265
os: [ ubuntu-latest, macos-latest, windows-latest ]
73-
node: ["16", "18", "20"]
66+
node: ["18", "20"]
7467
fail-fast: false
7568
name: Test Node ${{ matrix.node }} (${{ matrix.os }})
7669
steps:
@@ -86,19 +79,12 @@ jobs:
8679
uses: actions/cache@v3
8780
with:
8881
path: ./node_modules
89-
key: ${{ runner.os }}-${{ matrix.node }}-16-9-12-7-node_modules-${{ hashFiles('yarn.lock') }}
90-
restore-keys: |
91-
${{ runner.os }}-${{ matrix.node }}-16-9-12-7-node_modules-
92-
${{ runner.os }}-${{ matrix.node }}-16-9-12-
93-
${{ runner.os }}-${{ matrix.node }}-16-9-
94-
${{ runner.os }}-${{ matrix.node }}-16-
95-
${{ runner.os }}-${{ matrix.node }}-
82+
key: ${{ runner.os }}-${{ matrix.node }}-16-9-12-8-node_modules-${{ hashFiles('yarn.lock') }}
9683
- name: Yarn offline cache
9784
uses: actions/cache@v3
9885
with:
9986
path: ~/.npm-packages-offline-cache
10087
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
101-
restore-keys: yarn-offline
10288
- name: Configure yarn
10389
run: |
10490
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
@@ -132,16 +118,17 @@ jobs:
132118
matrix:
133119
os: [ ubuntu-latest ]
134120
browser: [ chrome-headless, firefox-headless ]
135-
include:
136-
- os: macos-latest
137-
browser: safari
121+
# TODO(davideast): Figure out why Safari tests timeout only on CI
122+
# include:
123+
# - os: macos-latest
124+
# browser: safari
138125
steps:
139126
- name: Checkout
140127
uses: actions/checkout@v3
141128
- name: Setup node
142129
uses: actions/setup-node@v3
143130
with:
144-
node-version: 16
131+
node-version: 18
145132
check-latest: true
146133
- name: Setup java
147134
uses: actions/setup-java@v3
@@ -153,19 +140,12 @@ jobs:
153140
uses: actions/cache@v3
154141
with:
155142
path: ./node_modules
156-
key: ${{ runner.os }}-${{ matrix.node }}-16-9-12-7-node_modules-${{ hashFiles('yarn.lock') }}
157-
restore-keys: |
158-
${{ runner.os }}-${{ matrix.node }}-16-9-12-7-node_modules-
159-
${{ runner.os }}-${{ matrix.node }}-16-9-12-
160-
${{ runner.os }}-${{ matrix.node }}-16-9-
161-
${{ runner.os }}-${{ matrix.node }}-16-
162-
${{ runner.os }}-${{ matrix.node }}-
143+
key: ${{ runner.os }}-${{ matrix.node }}-16-9-12-8-node_modules-${{ hashFiles('yarn.lock') }}
163144
- name: Yarn offline cache
164145
uses: actions/cache@v3
165146
with:
166147
path: ~/.npm-packages-offline-cache
167148
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
168-
restore-keys: yarn-offline
169149
- name: Configure yarn
170150
run: |
171151
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
@@ -192,7 +172,7 @@ jobs:
192172
strategy:
193173
matrix:
194174
os: [ ubuntu-latest, macos-latest, windows-latest ]
195-
node: ["16"]
175+
node: ["18"]
196176
fail-fast: false
197177
steps:
198178
- name: Checkout
@@ -208,19 +188,12 @@ jobs:
208188
with:
209189
path: ./node_modules
210190
key: ${{ runner.os }}-${{ matrix.node }}-12-9-9-6-node_modules-${{ hashFiles('yarn.lock') }}
211-
restore-keys: |
212-
${{ runner.os }}-${{ matrix.node }}-12-9-9-6-node_modules-
213-
${{ runner.os }}-${{ matrix.node }}-12-9-9-
214-
${{ runner.os }}-${{ matrix.node }}-12-9-
215-
${{ runner.os }}-${{ matrix.node }}-12-
216-
${{ runner.os }}-${{ matrix.node }}-
217191
- name: Yarn offline cache
218192
if: steps.node_modules_cache.outputs.cache-hit != 'true'
219193
uses: actions/cache@v3
220194
with:
221195
path: ~/.npm-packages-offline-cache
222196
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
223-
restore-keys: yarn-offline
224197
- name: Install deps
225198
if: steps.node_modules_cache.outputs.cache-hit != 'true'
226199
run: |
@@ -268,7 +241,7 @@ jobs:
268241
- name: Setup node
269242
uses: actions/setup-node@v3
270243
with:
271-
node-version: '16'
244+
node-version: '18'
272245
registry-url: 'https://registry.npmjs.org'
273246
check-latest: true
274247
- name: 'Download Artifacts'
@@ -279,4 +252,4 @@ jobs:
279252
chmod +x publish.sh
280253
./publish.sh
281254
env:
282-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
255+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# AngularFire
23
The official [Angular](https://angular.io/) library for [Firebase](https://firebase.google.com/).
34

angular.json

Lines changed: 40 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,43 @@
11
{
2-
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3-
"version": 1,
4-
"newProjectRoot": ".",
5-
"projects": {
6-
"angularfire": {
7-
"projectType": "library",
8-
"root": "src",
9-
"sourceRoot": "src",
10-
"prefix": "angularfire",
11-
"architect": {
12-
"build": {
13-
"builder": "@angular-devkit/build-angular:ng-packagr",
14-
"options": {
15-
"tsConfig": "tsconfig.json",
16-
"project": "src/package.json"
17-
}
18-
},
19-
"test": {
20-
"builder": "@angular-devkit/build-angular:karma",
21-
"options": {
22-
"main": "src/test.ts",
23-
"tsConfig": "tsconfig.spec.json",
24-
"karmaConfig": "karma.conf.js"
25-
}
26-
},
27-
"lint": {
28-
"builder": "@angular-devkit/build-angular:tslint",
29-
"options": {
30-
"tsConfig": [
31-
"tsconfig.json",
32-
"tsconfig.spec.json"
33-
],
34-
"exclude": [
35-
"**/node_modules/**"
36-
]
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": ".",
5+
"projects": {
6+
"angularfire": {
7+
"projectType": "library",
8+
"root": "src",
9+
"sourceRoot": "src",
10+
"prefix": "angularfire",
11+
"architect": {
12+
"build": {
13+
"builder": "@angular-devkit/build-angular:ng-packagr",
14+
"options": {
15+
"tsConfig": "tsconfig.json",
16+
"project": "src/ng-package.json"
17+
}
18+
},
19+
"test": {
20+
"builder": "@angular-devkit/build-angular:karma",
21+
"options": {
22+
"polyfills": [
23+
"zone.js",
24+
"zone.js/testing"
25+
],
26+
"tsConfig": "tsconfig.spec.json",
27+
"karmaConfig": "karma.conf.js"
28+
}
29+
},
30+
"lint": {
31+
"builder": "@angular-eslint/builder:lint",
32+
"options": {
33+
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
3734
}
3835
}
39-
}
40-
}
41-
},
42-
"defaultProject": "angularfire",
43-
"cli": {
44-
"packageManager": "yarn",
45-
"analytics": "86795b8f-9036-4a53-929c-a7303453d677"
46-
}
47-
}
36+
}
37+
}
38+
},
39+
"cli": {
40+
"packageManager": "yarn",
41+
"analytics": "86795b8f-9036-4a53-929c-a7303453d677"
42+
}
43+
}

eslint.config.js

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
const tsParser = require('@typescript-eslint/parser');
2+
const js = require('@eslint/js');
3+
const globals = require('globals');
4+
const ts = require('@typescript-eslint/eslint-plugin');
5+
const ng = require('@angular-eslint/eslint-plugin');
6+
const esImport = require('eslint-plugin-import');
7+
8+
module.exports = [
9+
{
10+
files: ['**/*.ts'],
11+
plugins: {
12+
'@typescript-eslint': ts,
13+
'@angular-eslint': ng,
14+
import: esImport,
15+
},
16+
languageOptions: {
17+
parser: tsParser,
18+
globals: {
19+
...globals.browser,
20+
},
21+
parserOptions: {
22+
project: ['tsconfig.build.json', 'tsconfig.json', 'tsconfig.spec.json'],
23+
},
24+
},
25+
rules: {
26+
...js.configs.recommended.rules,
27+
...ts.configs['recommended-requiring-type-checking'].rules,
28+
...ts.configs['stylistic-type-checked'].rules,
29+
...ng.configs.recommended.rules,
30+
...esImport.configs.errors.rules,
31+
// eslint/js rules
32+
'no-undef': 'off',
33+
'no-redeclare': 'off',
34+
'prefer-arrow-callback': 'error',
35+
'curly': 'error',
36+
'no-dupe-class-members': 'off',
37+
"no-restricted-imports": ["error", "rxjs/Rx"],
38+
"no-console": ["error", {allow: ['log', 'error', 'warn']}],
39+
'sort-imports': [
40+
'error',
41+
{
42+
ignoreDeclarationSort: true,
43+
},
44+
],
45+
// @typescript-eslint rules
46+
'@typescript-eslint/prefer-nullish-coalescing': 'off', // require `strictNullChecks`
47+
'@typescript-eslint/no-explicit-any': 'off',
48+
'@typescript-eslint/no-unsafe-assignment': 'off',
49+
'@typescript-eslint/no-unsafe-member-access': 'off',
50+
'@typescript-eslint/no-unsafe-call': 'off',
51+
'@typescript-eslint/no-unsafe-return': 'off',
52+
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
53+
'@typescript-eslint/no-unsafe-argument': 'off',
54+
'@typescript-eslint/no-floating-promises': 'off',
55+
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
56+
'@typescript-eslint/no-redundant-type-constituents': 'off', // causing pipeline error in src/compat/firestore/utils.spec.ts
57+
'@typescript-eslint/no-non-null-assertion': 'error',
58+
"@typescript-eslint/member-ordering": ["error", {
59+
"default": [
60+
"static-field",
61+
"instance-field",
62+
"static-method",
63+
"instance-method"
64+
]
65+
}],
66+
'@typescript-eslint/no-unused-vars': [
67+
'error', {args: "after-used", "argsIgnorePattern": "^_"}
68+
],
69+
// @angular-eslint rules
70+
'@angular-eslint/directive-selector': [
71+
'error',
72+
{
73+
type: 'attribute',
74+
prefix: 'app',
75+
style: 'camelCase',
76+
},
77+
],
78+
'@angular-eslint/component-selector': [
79+
'error',
80+
{
81+
type: 'element',
82+
prefix: 'app',
83+
style: 'kebab-case',
84+
},
85+
],
86+
// import rules
87+
'import/no-unresolved': 'off',
88+
'import/namespace': 'off',
89+
'import/default': 'off',
90+
'import/export': 'off',
91+
'import/newline-after-import': 'error',
92+
'import/order': [
93+
'error',
94+
{
95+
alphabetize: {order: 'asc'},
96+
"newlines-between": "never"
97+
},
98+
],
99+
},
100+
},
101+
{
102+
files: ['**/*.spec.ts'],
103+
languageOptions: {
104+
globals: {
105+
...globals.jasmine,
106+
},
107+
},
108+
},
109+
];

firebase.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
},
1212
"emulators": {
1313
"auth": {
14-
"port": 9099
14+
"port": 9098
1515
},
1616
"functions": {
1717
"port": 5001
1818
},
1919
"firestore": {
20-
"port": 8080
20+
"port": 8089
2121
},
2222
"database": {
23-
"port": 9000
23+
"port": 9002
2424
},
2525
"storage": {
2626
"port": 9199

karma.conf.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
const dns = require('node:dns');
2+
3+
// The emulator suite fails in CI, only on Node 18.
4+
// This apparently fixes it.
5+
// https://github.com/firebase/firebase-tools/issues/5755#issuecomment-1535445383
6+
dns.setDefaultResultOrder('ipv4first')
7+
18
// Karma configuration file, see link for more information
29
// https://karma-runner.github.io/1.0/config/configuration-file.html
310
module.exports = function (config) {

0 commit comments

Comments
 (0)