Skip to content

Commit

Permalink
Updgrade to TS5
Browse files Browse the repository at this point in the history
  • Loading branch information
dlarocque committed Oct 9, 2024
1 parent 0dbb8e6 commit ddd4dad
Show file tree
Hide file tree
Showing 91 changed files with 21,191 additions and 237 deletions.
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Prune .d.ts",
"program": "${workspaceRoot}/repo-scripts/prune-dts/node_modules/.bin/_mocha",
"cwd": "${workspaceRoot}/repo-scripts/prune-dts",
"args": [
"--require",
"ts-node/register",
"--timeout",
"5000",
"${workspaceFolder}/repo-scripts/prune-dts/*.test.ts"
],
"env": {
"TS_NODE_COMPILER_OPTIONS" : "{\"module\":\"commonjs\"}"
},
"sourceMaps": true,
},
{
"type": "node",
"request": "launch",
Expand Down
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"karma-typescript": "5.5.4",
"karma-typescript-es6-transform": "5.5.4",
"mocha": "9.2.2",
"typescript": "4.7.4",
"typescript": "5.5.4",
"webpack": "5.76.0",
"webpack-cli": "4.10.0",
"webpack-dev-server": "4.11.1"
Expand Down
2 changes: 1 addition & 1 deletion integration/compat-interop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@firebase/remote-config-compat": "0.2.9"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"engines": {
"node": ">=18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion integration/compat-typings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"firebase": "*"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"engines": {
"node": ">=18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion integration/firebase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"karma-typescript": "5.5.4",
"mocha": "9.2.2",
"npm-run-all": "4.1.5",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"engines": {
"node": ">=18.0.0"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"@types/long": "4.0.2",
"@types/mocha": "9.1.1",
"@types/mz": "2.7.8",
"@types/node": "16.18.68",
"@types/node": "22.7.5",
"@types/request": "2.48.12",
"@types/sinon": "9.0.11",
"@types/sinon-chai": "3.2.12",
Expand Down Expand Up @@ -156,7 +156,7 @@
"tsec": "0.2.8",
"tslint": "6.1.3",
"typedoc": "0.16.11",
"typescript": "4.7.4",
"typescript": "5.5.4",
"watch": "1.0.2",
"webpack": "5.76.0",
"yargs": "17.7.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"rollup": "2.79.1",
"@rollup/plugin-json": "4.1.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/analytics-compat",
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics-interop-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/analytics-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/analytics",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-check-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/app-check",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-check-interop-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/app-check-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/app-check/package.json
Original file line number Diff line number Diff line change
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.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/app-check",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@rollup/plugin-json": "4.1.0",
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/app-compat",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"@firebase/logger": "0.2.6"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-typescript2": "0.31.2",
"rollup-plugin-dts": "5.3.1",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/app",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-compat/demo/package.json
Original file line number Diff line number Diff line change
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.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/auth-compat/demo",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-typescript2": "0.31.2",
"selenium-webdriver": "4.8.0",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/auth-compat",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-interop-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/auth-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"rollup-plugin-typescript2": "0.31.2",
"selenium-webdriver": "4.8.0",
"totp-generator": "0.0.14",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/auth",
Expand Down
6 changes: 3 additions & 3 deletions packages/auth/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,20 +237,20 @@ export async function _performSignInRequest<T, V extends IdTokenResponse>(
request?: T,
customErrorMap: Partial<ServerErrorMap<ServerError>> = {}
): Promise<V> {
const serverResponse = (await _performApiRequest<T, V | IdTokenMfaResponse>(
const serverResponse = await _performApiRequest<T, V | IdTokenMfaResponse>(
auth,
method,
path,
request,
customErrorMap
)) as V;
);
if ('mfaPendingCredential' in serverResponse) {
_fail(auth, AuthErrorCode.MFA_REQUIRED, {
_serverResponse: serverResponse
});
}

return serverResponse;
return serverResponse as V;
}

export function _getFinalTarget(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,22 +159,20 @@ export async function injectRecaptchaFields<T>(
captchaResp = false
): Promise<T> {
const verifier = new RecaptchaEnterpriseVerifier(auth);
let captchaResponse;
let captchaResponse: string;
try {
captchaResponse = await verifier.verify(action);
} catch (error) {
captchaResponse = await verifier.verify(action, true);
}
const newRequest = { ...request };
if (!captchaResp) {
Object.assign(newRequest, { captchaResponse });
} else {
Object.assign(newRequest, { 'captchaResp': captchaResponse });
}
Object.assign(newRequest, { 'clientType': RecaptchaClientType.WEB });
Object.assign(newRequest, {
'recaptchaVersion': RecaptchaVersion.ENTERPRISE
});

const newRequest: T = {
...request,
...(captchaResp ? { captchaResp: captchaResponse } : { captchaResponse }),
clientType: RecaptchaClientType.WEB,
recaptchaVersion: RecaptchaVersion.ENTERPRISE
};

return newRequest;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"devDependencies": {
"rollup": "2.79.1",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/component",
Expand Down
2 changes: 1 addition & 1 deletion packages/database-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
},
"devDependencies": {
"@firebase/app-compat": "0.2.42",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/database-compat",
Expand Down
2 changes: 1 addition & 1 deletion packages/database-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@firebase/app": "0.10.12",
"rollup": "2.79.1",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/database",
Expand Down
2 changes: 1 addition & 1 deletion packages/firestore-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"rollup-plugin-typescript2": "0.31.2",
"@rollup/plugin-node-resolve": "13.3.0",
"ts-node": "10.9.1",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"license": "Apache-2.0",
"typings": "dist/src/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/firestore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"rollup-plugin-typescript2": "0.31.2",
"rollup-plugin-dts": "5.3.1",
"ts-node": "10.9.1",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/firestore",
Expand Down
2 changes: 1 addition & 1 deletion packages/firestore/scripts/build-bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/firestore/scripts/remove-asserts.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/firestore/scripts/remove-asserts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ class RemoveAsserts {
) {
const method = declaration.name!.text;
if (method === 'debugAssert') {
updatedNode = ts.createOmittedExpression();
updatedNode = ts.factory.createOmittedExpression();
} else if (method === 'hardAssert') {
// Remove the log message but keep the assertion
updatedNode = ts.createCall(
updatedNode = ts.factory.createCallExpression(
declaration.name!,
/*typeArgs*/ undefined,
[node.arguments[0]]
);
} else if (method === 'fail') {
// Remove the log message
updatedNode = ts.createCall(
updatedNode = ts.factory.createCallExpression(
declaration.name!,
/*typeArgs*/ undefined,
[]
Expand Down
Loading

0 comments on commit ddd4dad

Please sign in to comment.