Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
897099c
chore(repo): Upgrade to TypeScript 6.0
dstaley Mar 27, 2026
8301649
fix(expo-passkeys): Use new lib DOM types (#8178)
dstaley Mar 27, 2026
c980c0e
fix(backend): TypeScript 6.0 compatibility (#8179)
dstaley Mar 27, 2026
de7c97e
chore(localizations): Migrate to tsdown (#8180)
dstaley Mar 27, 2026
c62e6ab
chore(testing): TypeScript 6.0 compatibility (#8182)
dstaley Mar 27, 2026
843a673
chore(hono): TypeScript 6.0 compatibility (#8183)
dstaley Mar 27, 2026
9250276
chore(agent-toolkit): TypeScript 6.0 compatibility (#8184)
dstaley Mar 27, 2026
c2f60f3
chore(fastify): TypeScript 6.0 compatibility (#8185)
dstaley Mar 27, 2026
d8c8801
chore(vue): Migrate to tsdown (#8188)
wobsoriano Mar 27, 2026
6a300ef
chore(ui): TypeScript 6.0 compatibility (#8190)
dstaley Mar 27, 2026
c54142a
chore(express): TypeScript 6.0 compatibility (#8187)
dstaley Mar 27, 2026
75100e2
chore(astro): TypeScript 6.0 compatibility (#8191)
dstaley Mar 27, 2026
81001cb
chore(nuxt): Support TS6 and migrate to tsdown (#8192)
wobsoriano Mar 27, 2026
75b8816
chore(react): TypeScript 6.0 compatibility (#8194)
dstaley Mar 28, 2026
ef2d238
chore(clerk-js): TypeScript 6.0 compatibility (#8193)
dstaley Mar 28, 2026
5dbf5bd
Merge branch 'main' into ds.chore/ts-6.0
dstaley Mar 30, 2026
c1f0691
chore(nextjs): TypeScript 6.0 compatibility (#8201)
dstaley Mar 30, 2026
e57e2c0
chore(chrome-extension): TypeScript 6.0 compatibility (#8202)
dstaley Mar 30, 2026
4d2aaf6
chore(tanstack-react-start): TypeScript 6.0 compatibility (#8204)
dstaley Mar 30, 2026
91e83cb
chore(react-router): TypeScript 6.0 compatibility (#8206)
dstaley Mar 30, 2026
b9c484f
chore(expo): TypeScript 6.0 compatibility (#8200)
dstaley Mar 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/agent-toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"dist"
],
"scripts": {
"build": "tsup --env.NODE_ENV production",
"build": "tsdown --env.NODE_ENV production",
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev": "tsdown --watch",
"dev:pub": "pnpm dev -- --env.publish",
"format": "node ../../scripts/format-package.mjs",
"format:check": "node ../../scripts/format-package.mjs --check",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'tsup';
import { defineConfig } from 'tsdown';

import { name, version } from './package.json';
import pkgJson from './package.json' with { type: 'json' };

export default defineConfig(overrideOptions => {
const isProd = overrideOptions.env?.NODE_ENV === 'production';
Expand All @@ -15,13 +15,12 @@ export default defineConfig(overrideOptions => {
],
dts: true,
clean: true,
bundle: true,
sourcemap: true,
format: 'esm',
onSuccess: shouldPublish ? 'pkglab pub --ping' : undefined,
define: {
PACKAGE_NAME: `"${name}"`,
PACKAGE_VERSION: `"${version}"`,
PACKAGE_NAME: `"${pkgJson.name}"`,
PACKAGE_VERSION: `"${pkgJson.version}"`,
__DEV__: `${!isProd}`,
},
};
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@
"types.ts"
],
"scripts": {
"build": "tsup --onSuccess \"pnpm build:dts\" && pnpm copy:components",
"build": "tsdown --onSuccess \"pnpm build:dts\" && pnpm copy:components",
"build:dts": "tsc --emitDeclarationOnly --declaration",
"copy:components": "rm -rf ./components && mkdir -p ./components/ && cp -r ./src/astro-components/* ./components/ && cp ./src/types.ts ./",
"dev": "tsup --watch",
"dev": "tsdown --watch",
"dev:pub": "pnpm dev -- --env.publish",
"format": "node ../../scripts/format-package.mjs",
"format:check": "node ../../scripts/format-package.mjs --check",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { defineConfig } from 'tsup';
import { defineConfig } from 'tsdown';

// @ts-ignore
import { name, version } from './package.json';
import pkgJson from './package.json' with { type: 'json' };

export default defineConfig(overrideOptions => {
const shouldPublish = !!overrideOptions.env?.publish;
Expand All @@ -23,10 +22,9 @@ export default defineConfig(overrideOptions => {
minify: false,
onSuccess: shouldPublish ? 'pnpm build:dts && pkglab pub --ping' : 'pnpm build:dts',
define: {
PACKAGE_NAME: `"${name}"`,
PACKAGE_VERSION: `"${version}"`,
PACKAGE_NAME: `"${pkgJson.name}"`,
PACKAGE_VERSION: `"${pkgJson.version}"`,
},
bundle: true,
sourcemap: true,
format: ['esm'],
external: ['astro', 'react', 'react-dom', 'node:async_hooks', '#async-local-storage', 'astro:transitions/client'],
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/api/endpoints/JwtTemplatesApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ClerkPaginationRequest } from '@clerk/shared/types';

Check failure on line 1 in packages/backend/src/api/endpoints/JwtTemplatesApi.ts

View workflow job for this annotation

GitHub Actions / Static analysis

Run autofix to sort these imports!
import { joinPaths } from 'src/util/path';
import { joinPaths } from '../../util/path';

import type { DeletedObject, JwtTemplate } from '../resources';
import type { PaginatedResourceResponse } from '../resources/Deserializer';
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/api/endpoints/WaitlistEntryApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ClerkPaginationRequest } from '@clerk/shared/types';

Check failure on line 1 in packages/backend/src/api/endpoints/WaitlistEntryApi.ts

View workflow job for this annotation

GitHub Actions / Static analysis

Run autofix to sort these imports!
import { joinPaths } from 'src/util/path';
import { joinPaths } from '../../util/path';

import type { DeletedObject } from '../resources/DeletedObject';
import type { PaginatedResourceResponse } from '../resources/Deserializer';
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/jwt/cryptoKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { isomorphicAtob } from '@clerk/shared/isomorphicAtob';
import { runtime } from '../runtime';

// https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#pkcs_8_import
function pemToBuffer(secret: string): ArrayBuffer {
function pemToBuffer(secret: string): Uint8Array<ArrayBuffer> {
const trimmed = secret
.replace(/-----BEGIN.*?-----/g, '')
.replace(/-----END.*?-----/g, '')
Expand Down
7 changes: 6 additions & 1 deletion packages/backend/src/jwt/verifyJwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ export async function hasValidSignature(jwt: Jwt, key: JsonWebKey | string): Pro
try {
const cryptoKey = await importKey(key, algorithm, 'verify');

const verified = await runtime.crypto.subtle.verify(algorithm.name, cryptoKey, signature, data);
const verified = await runtime.crypto.subtle.verify(
algorithm.name,
cryptoKey,
signature as Uint8Array<ArrayBuffer>,
data,
);
return { data: verified };
} catch (error) {
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/tokens/__tests__/getAuth.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expectTypeOf, test } from 'vitest';
import { expectTypeOf, test, describe } from 'vitest';

Check failure on line 1 in packages/backend/src/tokens/__tests__/getAuth.test-d.ts

View workflow job for this annotation

GitHub Actions / Static analysis

Run autofix to sort these imports!

import type { RedirectFun } from '../../createRedirect';
import type { AuthObject, InvalidTokenAuthObject } from '../authObjects';
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/webhooks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getEnvVariable } from '@clerk/shared/getEnvVariable';

Check failure on line 1 in packages/backend/src/webhooks.ts

View workflow job for this annotation

GitHub Actions / Static analysis

Run autofix to sort these imports!
import { errorThrower } from 'src/util/shared';
import { Webhook } from 'standardwebhooks';
import { errorThrower } from './util/shared';

import type { WebhookEvent } from './api/resources/Webhooks';

Expand Down
1 change: 0 additions & 1 deletion packages/backend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
Expand Down
4 changes: 3 additions & 1 deletion packages/chrome-extension/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"declaration": true,
"declarationDir": "dist/types",
"declarationMap": true,
"emitDeclarationOnly": true
"emitDeclarationOnly": true,
"rootDir": "./src",
"types": ["jest"]
},
"include": ["src"]
}
6 changes: 4 additions & 2 deletions packages/clerk-js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"isolatedModules": true,
"jsx": "react-jsx",
"jsxImportSource": "@emotion/react",
"lib": ["dom", "dom.iterable", "es2021.intl"],
"lib": ["dom", "dom.iterable", "es2020", "es2021.intl"],
"module": "esnext",
"moduleResolution": "Bundler",
"noEmit": true,
Expand All @@ -22,7 +22,9 @@
"useUnknownInCatchVariables": false,
"paths": {
"@/*": ["./src/*"]
}
},
"rootDir": "./src",
"types": ["@rspack/core/module", "cloudflare-turnstile"]
},
"include": ["src", "vitest.config.mts", "vitest.setup.mts", "../shared/internal/clerk-js/componentGuards.ts"]
}
36 changes: 0 additions & 36 deletions packages/expo-passkeys/src/ClerkExpoPasskeys.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,50 +43,14 @@ export type SerializedPublicKeyCredentialRequestOptions = Omit<
challenge: string;
};

// The return type from the "get" native module.
export interface AuthenticationResponseJSON {
id: string;
rawId: string;
response: AuthenticatorAssertionResponseJSON;
authenticatorAttachment?: AuthenticatorAttachment;
clientExtensionResults: AuthenticationExtensionsClientOutputs;
type: PublicKeyCredentialType;
}

// The serialized response of the native module "create" response to be send back to clerk
export type PublicKeyCredentialWithAuthenticatorAttestationResponse =
ClerkPublicKeyCredentialWithAuthenticatorAttestationResponse & {
toJSON: () => any;
};

interface AuthenticatorAssertionResponseJSON {
clientDataJSON: string;
authenticatorData: string;
signature: string;
userHandle?: string;
}

// The serialized response of the native module "get" response to be send back to clerk
export type PublicKeyCredentialWithAuthenticatorAssertionResponse =
ClerkPublicKeyCredentialWithAuthenticatorAssertionResponse & {
toJSON: () => any;
};

interface AuthenticatorAttestationResponseJSON {
clientDataJSON: string;
attestationObject: string;
authenticatorData?: string;
transports?: AuthenticatorTransportFuture[];
publicKeyAlgorithm?: COSEAlgorithmIdentifier;
publicKey?: string;
}

// The type is returned from from native module "create" response
export interface RegistrationResponseJSON {
id: string;
rawId: string;
response: AuthenticatorAttestationResponseJSON;
authenticatorAttachment?: AuthenticatorAttachment;
clientExtensionResults: AuthenticationExtensionsClientOutputs;
type: PublicKeyCredentialType;
}
2 changes: 0 additions & 2 deletions packages/expo-passkeys/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { Platform } from 'react-native';

import type {
AuthenticationResponseJSON,
CredentialReturn,
PublicKeyCredentialCreationOptionsWithoutExtensions,
PublicKeyCredentialRequestOptionsWithoutExtensions,
PublicKeyCredentialWithAuthenticatorAssertionResponse,
PublicKeyCredentialWithAuthenticatorAttestationResponse,
RegistrationResponseJSON,
SerializedPublicKeyCredentialCreationOptions,
SerializedPublicKeyCredentialRequestOptions,
} from './ClerkExpoPasskeys.types';
Expand All @@ -27,7 +25,7 @@
id: publicCredential.id,
rawId: base64urlToArrayBuffer(publicCredential.rawId),
response: {
getTransports: () => publicCredential?.response?.transports as string[],

Check warning on line 28 in packages/expo-passkeys/src/index.ts

View workflow job for this annotation

GitHub Actions / Static analysis

This assertion is unnecessary since it does not change the type of the expression
attestationObject: base64urlToArrayBuffer(publicCredential.response.attestationObject),
clientDataJSON: base64urlToArrayBuffer(publicCredential.response.clientDataJSON),
},
Expand Down Expand Up @@ -65,8 +63,8 @@
};

const createPasskeyModule = Platform.select({
android: async () => ClerkExpoPasskeys.create(JSON.stringify(createOptions)),

Check warning on line 66 in packages/expo-passkeys/src/index.ts

View workflow job for this annotation

GitHub Actions / Static analysis

Async method 'android' has no 'await' expression
ios: async () =>

Check warning on line 67 in packages/expo-passkeys/src/index.ts

View workflow job for this annotation

GitHub Actions / Static analysis

Async method 'ios' has no 'await' expression
ClerkExpoPasskeys.create(
createOptions.challenge,
createOptions.rp.id,
Expand Down Expand Up @@ -130,8 +128,8 @@
};

const getPasskeyModule = Platform.select({
android: async () => ClerkExpoPasskeys.get(JSON.stringify(serializedPublicCredential)),

Check warning on line 131 in packages/expo-passkeys/src/index.ts

View workflow job for this annotation

GitHub Actions / Static analysis

Async method 'android' has no 'await' expression
ios: async () => ClerkExpoPasskeys.get(serializedPublicCredential.challenge, serializedPublicCredential.rpId),

Check warning on line 132 in packages/expo-passkeys/src/index.ts

View workflow job for this annotation

GitHub Actions / Static analysis

Async method 'ios' has no 'await' expression
default: null,
});

Expand Down
5 changes: 3 additions & 2 deletions packages/expo-passkeys/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"allowJs": true,
"baseUrl": ".",
"declaration": true,
"declarationMap": false,
"esModuleInterop": true,
Expand All @@ -20,7 +19,9 @@
"skipLibCheck": true,
"sourceMap": false,
"strict": true,
"target": "ES2019"
"target": "ES2019",
"types": ["node"],
"rootDir": "./src"
Comment on lines +22 to +24
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add migration coverage before merge.

This TypeScript 6 compiler-config change is not accompanied by test updates; please add/modify tests (at minimum package-level build/typecheck coverage for packages/expo-passkeys) to guard against upgrade regressions before merging.

As per coding guidelines, "If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/expo-passkeys/tsconfig.json` around lines 22 - 24, The tsconfig.json
change (changing "target" to "ES2019" and other compiler settings) needs
accompanying test coverage for packages/expo-passkeys; add or update tests that
perform a package-level build/typecheck (e.g., a CI job or npm script like
"build" / "typecheck" invoked in the package's test matrix) to ensure TypeScript
6 migration does not regress, include at least one unit or integration test that
imports core modules from packages/expo-passkeys to exercise compilation, and
ensure the package.json scripts and repository CI workflow reference this
new/updated test step so the typecheck/build runs before merge.

},
"include": ["src"]
}
4 changes: 2 additions & 2 deletions packages/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@
"app.plugin.d.ts"
],
"scripts": {
"build": "tsup",
"build": "tsdown",
"build:declarations": "tsc -p tsconfig.declarations.json",
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev": "tsdown --watch",
"dev:pub": "pnpm dev -- --env.publish",
"format": "node ../../scripts/format-package.mjs",
"format:check": "node ../../scripts/format-package.mjs --check",
Expand Down
8 changes: 4 additions & 4 deletions packages/expo/src/polyfills/base64Polyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { decode, encode } from 'base-64';
import { isHermes } from '../utils';

// See Default Expo 51 engine Hermes' issue: https://github.com/facebook/hermes/issues/1379
if (!global.btoa || isHermes()) {
global.btoa = encode;
if (!globalThis.btoa || isHermes()) {
globalThis.btoa = encode;
}

// See Default Expo 51 engine Hermes' issue: https://github.com/facebook/hermes/issues/1379
if (!global.atob || isHermes()) {
global.atob = decode;
if (!globalThis.atob || isHermes()) {
globalThis.atob = decode;
}
3 changes: 1 addition & 2 deletions packages/expo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"compilerOptions": {
"outDir": "dist",
"baseUrl": ".",
"lib": ["es6", "dom"],
"lib": ["es2019", "dom"],
"jsx": "react-jsx",
"module": "NodeNext",
"moduleResolution": "NodeNext",
Expand Down
17 changes: 8 additions & 9 deletions packages/expo/tsup.config.ts → packages/expo/tsdown.config.mts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Options } from 'tsup';
import { defineConfig } from 'tsup';
import type { Options } from 'tsdown';
import { defineConfig } from 'tsdown';

import { runAfterLast } from '../../scripts/utils';
import { version as clerkJsVersion } from '../clerk-js/package.json';
import { name, version } from './package.json';
import { runAfterLast } from '../../scripts/utils.ts';
import clerkJsPkgJson from '../clerk-js/package.json' with { type: 'json' };
import pkgJson from './package.json' with { type: 'json' };

export default defineConfig(overrideOptions => {
const isWatch = !!overrideOptions.watch;
Expand All @@ -17,11 +17,10 @@ export default defineConfig(overrideOptions => {
clean: true,
minify: false,
sourcemap: true,
legacyOutput: true,
define: {
PACKAGE_NAME: `"${name}"`,
PACKAGE_VERSION: `"${version}"`,
JS_PACKAGE_VERSION: `"${clerkJsVersion}"`,
PACKAGE_NAME: `"${pkgJson.name}"`,
PACKAGE_VERSION: `"${pkgJson.version}"`,
JS_PACKAGE_VERSION: `"${clerkJsPkgJson.version}"`,
__DEV__: `${isWatch}`,
},
};
Expand Down
4 changes: 2 additions & 2 deletions packages/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
"env.d.ts"
],
"scripts": {
"build": "pnpm clean && tsup",
"build": "pnpm clean && tsdown",
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev": "tsdown --watch",
"dev:pub": "pnpm dev -- --env.publish",
"format": "node ../../scripts/format-package.mjs",
"format:check": "node ../../scripts/format-package.mjs --check",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'tsup';
import { defineConfig } from 'tsdown';

import { name, version } from './package.json';
import pkgJson from './package.json' with { type: 'json' };

export default defineConfig(overrideOptions => {
const isWatch = !!overrideOptions.watch;
Expand All @@ -13,15 +13,14 @@ export default defineConfig(overrideOptions => {
types: './src/types/index.ts',
},
format: ['cjs', 'esm'],
bundle: true,
clean: true,
minify: false,
sourcemap: true,
dts: true,
onSuccess: shouldPublish ? 'pkglab pub --ping' : undefined,
define: {
PACKAGE_NAME: `"${name}"`,
PACKAGE_VERSION: `"${version}"`,
PACKAGE_NAME: `"${pkgJson.name}"`,
PACKAGE_VERSION: `"${pkgJson.version}"`,
__DEV__: `${isWatch}`,
},
};
Expand Down
4 changes: 2 additions & 2 deletions packages/fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
"webhooks"
],
"scripts": {
"build": "tsup --env.NODE_ENV production",
"build": "tsdown --env.NODE_ENV production",
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev": "tsdown --watch",
"dev:pub": "pnpm dev -- --env.publish",
"format": "node ../../scripts/format-package.mjs",
"format:check": "node ../../scripts/format-package.mjs --check",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'tsup';
import { defineConfig } from 'tsdown';

import { name, version } from './package.json';
import pkgJson from './package.json' with { type: 'json' };

export default defineConfig(overrideOptions => {
const isWatch = !!overrideOptions.watch;
Expand All @@ -13,15 +13,14 @@ export default defineConfig(overrideOptions => {
types: './src/types/index.ts',
},
format: ['cjs', 'esm'],
bundle: true,
clean: true,
minify: false,
sourcemap: true,
dts: true,
onSuccess: shouldPublish ? 'pkglab pub --ping' : undefined,
define: {
PACKAGE_NAME: `"${name}"`,
PACKAGE_VERSION: `"${version}"`,
PACKAGE_NAME: `"${pkgJson.name}"`,
PACKAGE_VERSION: `"${pkgJson.version}"`,
__DEV__: `${isWatch}`,
},
};
Expand Down
Loading
Loading