From 725b88583007cecec62f38237d8c7ffe8a1106cb Mon Sep 17 00:00:00 2001 From: Alexandros Ntitoras <47026269+AlexNti@users.noreply.github.com> Date: Wed, 20 Nov 2024 13:10:53 +0200 Subject: [PATCH] chore(clerk-expo-passkeys): fix breaking changes (#4601) --- .changeset/fifty-cameras-tease.md | 6 ++++++ packages/expo-passkeys/.eslintrc.js | 8 ++++++++ packages/expo-passkeys/src/utils.ts | 3 +-- packages/expo/package.json | 6 +++++- pnpm-lock.yaml | 6 +++--- 5 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 .changeset/fifty-cameras-tease.md diff --git a/.changeset/fifty-cameras-tease.md b/.changeset/fifty-cameras-tease.md new file mode 100644 index 0000000000..b0c77f8f96 --- /dev/null +++ b/.changeset/fifty-cameras-tease.md @@ -0,0 +1,6 @@ +--- +'@clerk/expo-passkeys': patch +'@clerk/clerk-expo': patch +--- +- Replaced import { Buffer } from 'node:buffer' with import { Buffer } from 'buffer'. +- Moved @clerk/expo-passkeys to a devDependency in @clerk/clerk-expo. diff --git a/packages/expo-passkeys/.eslintrc.js b/packages/expo-passkeys/.eslintrc.js index 9c27d64800..0aab09b0b2 100644 --- a/packages/expo-passkeys/.eslintrc.js +++ b/packages/expo-passkeys/.eslintrc.js @@ -4,4 +4,12 @@ module.exports = { settings: { 'import/ignore': ['node_modules/react-native/index\\.js$'], }, + rules: { + 'no-restricted-imports': [ + 'error', + { + patterns: ['node:*'], + }, + ], + }, }; diff --git a/packages/expo-passkeys/src/utils.ts b/packages/expo-passkeys/src/utils.ts index 0a7bfb5cee..c9dc88fe9e 100644 --- a/packages/expo-passkeys/src/utils.ts +++ b/packages/expo-passkeys/src/utils.ts @@ -1,6 +1,5 @@ -import { Buffer } from 'node:buffer'; - import { ClerkWebAuthnError } from '@clerk/shared/error'; +import { Buffer } from 'buffer'; export { ClerkWebAuthnError }; export function encodeBase64(data: ArrayLike | ArrayBufferLike) { diff --git a/packages/expo/package.json b/packages/expo/package.json index 782ca86349..2456ad046f 100644 --- a/packages/expo/package.json +++ b/packages/expo/package.json @@ -62,7 +62,6 @@ "dependencies": { "@clerk/clerk-js": "workspace:*", "@clerk/clerk-react": "workspace:*", - "@clerk/expo-passkeys": "workspace:*", "@clerk/shared": "workspace:*", "@clerk/types": "workspace:*", "base-64": "^1.0.0", @@ -71,6 +70,7 @@ }, "devDependencies": { "@clerk/eslint-config-custom": "workspace:*", + "@clerk/expo-passkeys": "workspace:*", "@types/base-64": "^1.0.2", "@types/node": "^20.11.24", "@types/react": "18.3.12", @@ -83,6 +83,7 @@ "typescript": "*" }, "peerDependencies": { + "@clerk/expo-passkeys": ">=0.0.6", "expo-auth-session": ">=5", "expo-local-authentication": ">=13.5.0", "expo-secure-store": ">=12.4.0", @@ -92,6 +93,9 @@ "react-native": ">=0.73" }, "peerDependenciesMeta": { + "@clerk/expo-passkeys": { + "optional": true + }, "expo-local-authentication": { "optional": true }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e1799e9e37..1272255666 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -567,9 +567,6 @@ importers: '@clerk/clerk-react': specifier: workspace:* version: link:../react - '@clerk/expo-passkeys': - specifier: workspace:* - version: link:../expo-passkeys '@clerk/shared': specifier: workspace:* version: link:../shared @@ -595,6 +592,9 @@ importers: '@clerk/eslint-config-custom': specifier: workspace:* version: link:../eslint-config-custom + '@clerk/expo-passkeys': + specifier: workspace:* + version: link:../expo-passkeys '@types/base-64': specifier: ^1.0.2 version: 1.0.2