Skip to content

Commit

Permalink
Upgrade individual packages to TS 4.7.4 (firebase#6799)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 authored and levino committed Dec 10, 2022
1 parent 14b86c2 commit 24a8cf2
Show file tree
Hide file tree
Showing 77 changed files with 274 additions and 150 deletions.
47 changes: 47 additions & 0 deletions .changeset/tidy-games-fry.md
@@ -0,0 +1,47 @@
---
'@firebase/analytics': minor
'@firebase/analytics-compat': minor
'@firebase/analytics-interop-types': minor
'@firebase/analytics-types': minor
'@firebase/app': minor
'@firebase/app-check': minor
'@firebase/app-check-compat': minor
'@firebase/app-check-interop-types': minor
'@firebase/app-check-types': minor
'@firebase/app-compat': minor
'@firebase/app-types': minor
'@firebase/auth': minor
'@firebase/auth-compat': minor
'@firebase/auth-interop-types': minor
'@firebase/auth-types': minor
'@firebase/component': minor
'@firebase/database': minor
'@firebase/database-compat': minor
'@firebase/database-types': minor
'@firebase/functions': minor
'@firebase/functions-compat': minor
'@firebase/functions-types': minor
'@firebase/installations': minor
'@firebase/installations-compat': minor
'@firebase/installations-types': minor
'@firebase/logger': minor
'@firebase/messaging': minor
'@firebase/messaging-compat': minor
'@firebase/messaging-interop-types': minor
'@firebase/performance': minor
'@firebase/performance-compat': minor
'@firebase/performance-types': minor
'@firebase/remote-config': minor
'@firebase/remote-config-compat': minor
'@firebase/remote-config-types': minor
'@firebase/storage': minor
'@firebase/storage-compat': minor
'@firebase/storage-types': minor
'@firebase/template': minor
'@firebase/template-types': minor
'@firebase/util': minor
'@firebase/webchannel-wrapper': minor
'firebase': minor
---

Update TypeScript version to 4.7.4.
4 changes: 2 additions & 2 deletions integration/compat-interop/package.json
Expand Up @@ -24,6 +24,6 @@
"@firebase/remote-config-compat": "0.1.16"
},
"devDependencies": {
"typescript": "4.2.2"
"typescript": "4.7.4"
}
}
}
2 changes: 1 addition & 1 deletion integration/compat-typings/package.json
Expand Up @@ -10,6 +10,6 @@
"firebase": "*"
},
"devDependencies": {
"typescript": "4.2.2"
"typescript": "4.7.4"
}
}
2 changes: 1 addition & 1 deletion integration/firebase/package.json
Expand Up @@ -20,6 +20,6 @@
"karma-typescript": "5.5.3",
"mocha": "9.2.2",
"npm-run-all": "4.1.5",
"typescript": "4.2.2"
"typescript": "4.7.4"
}
}
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -86,9 +86,9 @@
"@types/sinon-chai": "3.2.8",
"@types/tmp": "0.2.3",
"@types/yargs": "17.0.13",
"@typescript-eslint/eslint-plugin": "4.33.0",
"@typescript-eslint/eslint-plugin-tslint": "4.33.0",
"@typescript-eslint/parser": "4.33.0",
"@typescript-eslint/eslint-plugin": "5.43.0",
"@typescript-eslint/eslint-plugin-tslint": "5.43.0",
"@typescript-eslint/parser": "5.43.0",
"api-documenter-me": "0.1.1",
"api-extractor-me": "0.1.2",
"babel-loader": "8.2.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics-compat/package.json
Expand Up @@ -28,7 +28,7 @@
"rollup": "2.79.1",
"@rollup/plugin-json": "4.1.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.2.2"
"typescript": "4.7.4"
},
"repository": {
"directory": "packages/analytics-compat",
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics-interop-types/package.json
Expand Up @@ -20,6 +20,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.2.2"
"typescript": "4.7.4"
}
}
2 changes: 1 addition & 1 deletion packages/analytics-types/package.json
Expand Up @@ -20,6 +20,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.2.2"
"typescript": "4.7.4"
}
}
2 changes: 1 addition & 1 deletion packages/analytics/package.json
Expand Up @@ -54,7 +54,7 @@
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.2.2"
"typescript": "4.7.4"
},
"repository": {
"directory": "packages/analytics",
Expand Down
4 changes: 2 additions & 2 deletions packages/analytics/src/get-config.test.ts
Expand Up @@ -16,7 +16,7 @@
*/

import { expect } from 'chai';
import { SinonStub, stub, useFakeTimers, restore } from 'sinon';
import { SinonStub, stub, useFakeTimers, restore, match } from 'sinon';
import '../testing/setup';
import {
fetchDynamicConfig,
Expand Down Expand Up @@ -246,7 +246,7 @@ describe('Dynamic Config Fetch Functions', () => {
});
// Set fetch timeout to 50 ms.
await fetchDynamicConfigWithRetry(app, fakeRetryData, 50);
expect(consoleStub.args[0][1]).to.include(fakeMeasurementId);
expect(consoleStub).calledWith(match.any, match(fakeMeasurementId));
consoleStub.restore();
}
);
Expand Down
2 changes: 1 addition & 1 deletion packages/app-check-compat/package.json
Expand Up @@ -50,7 +50,7 @@
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.2.2"
"typescript": "4.7.4"
},
"repository": {
"directory": "packages/app-check",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-check-interop-types/package.json
Expand Up @@ -20,6 +20,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.2.2"
"typescript": "4.7.4"
}
}
2 changes: 1 addition & 1 deletion packages/app-check-types/package.json
Expand Up @@ -20,6 +20,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.2.2"
"typescript": "4.7.4"
}
}
2 changes: 1 addition & 1 deletion packages/app-check/package.json
Expand Up @@ -51,7 +51,7 @@
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.2.2"
"typescript": "4.7.4"
},
"repository": {
"directory": "packages/app-check",
Expand Down
5 changes: 4 additions & 1 deletion packages/app-check/src/client.test.ts
Expand Up @@ -31,7 +31,10 @@ import { BASE_ENDPOINT } from './constants';

describe('client', () => {
let app: FirebaseApp;
let fetchStub: SinonStub<[RequestInfo, RequestInit?], Promise<Response>>;
let fetchStub: SinonStub<
[RequestInfo | URL, RequestInit?],
Promise<Response>
>;
beforeEach(() => {
app = getFakeApp();
fetchStub = stub(window, 'fetch').returns(
Expand Down
2 changes: 1 addition & 1 deletion packages/app-compat/package.json
Expand Up @@ -51,7 +51,7 @@
"@rollup/plugin-json": "4.1.0",
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.2.2"
"typescript": "4.7.4"
},
"repository": {
"directory": "packages/app-compat",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-types/package.json
Expand Up @@ -24,6 +24,6 @@
"@firebase/logger": "0.2.6"
},
"devDependencies": {
"typescript": "4.2.2"
"typescript": "4.7.4"
}
}
2 changes: 1 addition & 1 deletion packages/app/package.json
Expand Up @@ -50,7 +50,7 @@
"rollup": "2.79.1",
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.2.2"
"typescript": "4.7.4"
},
"repository": {
"directory": "packages/app",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-compat/demo/package.json
Expand Up @@ -34,7 +34,7 @@
"rollup-plugin-sourcemaps": "0.6.3",
"rollup-plugin-typescript2": "0.31.2",
"rollup-plugin-uglify": "6.0.4",
"typescript": "4.2.2"
"typescript": "4.7.4"
},
"repository": {
"directory": "packages/auth-compat/demo",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-compat/package.json
Expand Up @@ -61,7 +61,7 @@
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-typescript2": "0.31.2",
"selenium-webdriver": "4.5.0",
"typescript": "4.2.2"
"typescript": "4.7.4"
},
"repository": {
"directory": "packages/auth-compat",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-interop-types/package.json
Expand Up @@ -24,6 +24,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.2.2"
"typescript": "4.7.4"
}
}
2 changes: 1 addition & 1 deletion packages/auth-types/package.json
Expand Up @@ -24,6 +24,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.2.2"
"typescript": "4.7.4"
}
}
2 changes: 1 addition & 1 deletion packages/auth/package.json
Expand Up @@ -118,7 +118,7 @@
"rollup-plugin-sourcemaps": "0.6.3",
"rollup-plugin-typescript2": "0.31.2",
"selenium-webdriver": "4.5.0",
"typescript": "4.2.2",
"typescript": "4.7.4",
"@types/express": "4.17.14"
},
"repository": {
Expand Down
12 changes: 9 additions & 3 deletions packages/auth/src/api/index.test.ts
Expand Up @@ -383,7 +383,9 @@ describe('api/_performApiRequest', () => {
);
assert.fail('Call should have failed');
} catch (e) {
expect(e.code).to.eq(`auth/${AuthErrorCode.NEED_CONFIRMATION}`);
expect((e as FirebaseError).code).to.eq(
`auth/${AuthErrorCode.NEED_CONFIRMATION}`
);
expect((e as FirebaseError).customData!._tokenResponse).to.eql({
needConfirmation: true,
idToken: 'id-token'
Expand Down Expand Up @@ -413,7 +415,9 @@ describe('api/_performApiRequest', () => {
);
assert.fail('Call should have failed');
} catch (e) {
expect(e.code).to.eq(`auth/${AuthErrorCode.CREDENTIAL_ALREADY_IN_USE}`);
expect((e as FirebaseError).code).to.eq(
`auth/${AuthErrorCode.CREDENTIAL_ALREADY_IN_USE}`
);
expect((e as FirebaseError).customData!._tokenResponse).to.eql(
response
);
Expand Down Expand Up @@ -444,7 +448,9 @@ describe('api/_performApiRequest', () => {
);
assert.fail('Call should have failed');
} catch (e) {
expect(e.code).to.eq(`auth/${AuthErrorCode.EMAIL_EXISTS}`);
expect((e as FirebaseError).code).to.eq(
`auth/${AuthErrorCode.EMAIL_EXISTS}`
);
expect((e as FirebaseError).customData!.email).to.eq('email@test.com');
expect((e as FirebaseError).customData!.phoneNumber).to.eq(
'+1555-this-is-a-number'
Expand Down
Expand Up @@ -76,7 +76,7 @@ export abstract class AbstractPopupRedirectOperation
await this.onExecution();
this.eventManager.registerConsumer(this);
} catch (e) {
this.reject(e);
this.reject(e as Error);
}
}
);
Expand All @@ -102,7 +102,7 @@ export abstract class AbstractPopupRedirectOperation
try {
this.resolve(await this.getIdpTask(type)(params));
} catch (e) {
this.reject(e);
this.reject(e as Error);
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/platform_browser/popup_redirect.test.ts
Expand Up @@ -93,7 +93,7 @@ describe('platform_browser/popup_redirect', () => {
});

context('#_openPopup', () => {
let popupUrl: string | undefined;
let popupUrl: string | URL | undefined;
let provider: OAuthProvider;
const event = AuthEventType.LINK_VIA_POPUP;

Expand Down
5 changes: 4 additions & 1 deletion packages/auth/test/helpers/mock_fetch.ts
Expand Up @@ -34,7 +34,10 @@ let fetchImpl: typeof fetch | null;
const routes = new Map<string, Route>();

// Using a constant rather than a function to enforce the type matches fetch()
const fakeFetch: typeof fetch = (input: RequestInfo, request?: RequestInit) => {
const fakeFetch: typeof fetch = (
input: RequestInfo | URL,
request?: RequestInit
) => {
if (typeof input !== 'string') {
throw new Error('URL passed to fetch was not a string');
}
Expand Down
2 changes: 1 addition & 1 deletion packages/component/package.json
Expand Up @@ -39,7 +39,7 @@
"devDependencies": {
"rollup": "2.79.1",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.2.2"
"typescript": "4.7.4"
},
"repository": {
"directory": "packages/component",
Expand Down
3 changes: 2 additions & 1 deletion packages/database-compat/package.json
Expand Up @@ -53,7 +53,8 @@
"tslib": "^2.1.0"
},
"devDependencies": {
"@firebase/app-compat": "0.1.39"
"@firebase/app-compat": "0.1.39",
"typescript": "4.7.4"
},
"repository": {
"directory": "packages/database-compat",
Expand Down
2 changes: 1 addition & 1 deletion packages/database-types/package.json
Expand Up @@ -24,6 +24,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.2.2"
"typescript": "4.7.4"
}
}
2 changes: 1 addition & 1 deletion packages/database/package.json
Expand Up @@ -56,7 +56,7 @@
"@firebase/app": "0.8.4",
"rollup": "2.79.1",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.2.2"
"typescript": "4.7.4"
},
"repository": {
"directory": "packages/database",
Expand Down
2 changes: 1 addition & 1 deletion packages/functions-compat/package.json
Expand Up @@ -31,7 +31,7 @@
"rollup": "2.79.1",
"@rollup/plugin-json": "4.1.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.2.2"
"typescript": "4.7.4"
},
"repository": {
"directory": "packages/functions-compat",
Expand Down
8 changes: 4 additions & 4 deletions packages/functions-compat/src/callable.test.ts
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/
import { expect } from 'chai';
import { FunctionsErrorCode } from '@firebase/functions';
import { FunctionsError, FunctionsErrorCode } from '@firebase/functions';
import { createTestService } from '../test/utils';
import firebase, { FirebaseApp } from '@firebase/app-compat';

Expand All @@ -35,9 +35,9 @@ async function expectError(
await promise;
} catch (e) {
failed = true;
expect(e.code).to.equal(code);
expect(e.message).to.equal(message);
expect(e.details).to.deep.equal(details);
expect((e as FunctionsError).code).to.equal(code);
expect((e as FunctionsError).message).to.equal(message);
expect((e as FunctionsError).details).to.deep.equal(details);
}
if (!failed) {
expect(false, 'Promise should have failed.').to.be.true;
Expand Down

0 comments on commit 24a8cf2

Please sign in to comment.