From fafb8ddf981c3b07ecd2c753d700de8840f9fbc1 Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Thu, 19 Oct 2023 10:56:48 -0400 Subject: [PATCH 1/3] fix(repo): Fix turborepo globalDependencies --- package.json | 1 + turbo.json | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8d4bbc9c11..a953ab5f18 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "test:integration:generic": "E2E_APP_ID=react.vite.* npm run test:integration:base -- --grep @generic", "test:integration:nextjs": "E2E_APP_ID=next.appRouter.withEmailCodes npm run test:integration:base -- --grep \"@generic|@nextjs\"", "test:integration:remix": "echo 'placeholder'", + "turbo:clean": "turbo daemon clean", "update:lockfile": "npm run nuke && npm install -D --arch=x64 --platform=linux turbo && npm install -D --arch=arm64 --platform=darwin turbo", "version": "changeset version && ./scripts/version-info.sh", "version:snapshot": "./scripts/snapshot.mjs", diff --git a/turbo.json b/turbo.json index 67a165388a..ac0d926ac6 100644 --- a/turbo.json +++ b/turbo.json @@ -4,7 +4,13 @@ "signature": true }, "globalDependencies": [ - ".*", + ".changeset/changelog.js", + ".changeset/config.json", + ".dockerignore", + ".github/**", + ".jit", + ".nvmrc", + ".pretter*", "jest.*.ts", "packages/eslint-config-custom/index.js", "package.json", From ad9e9658f824b4f7a6f87e719a3b9cc3fe20ad5f Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Thu, 19 Oct 2023 10:59:27 -0400 Subject: [PATCH 2/3] chore(repo): Fix typo --- turbo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbo.json b/turbo.json index ac0d926ac6..7d2694fc46 100644 --- a/turbo.json +++ b/turbo.json @@ -10,7 +10,7 @@ ".github/**", ".jit", ".nvmrc", - ".pretter*", + ".prettier*", "jest.*.ts", "packages/eslint-config-custom/index.js", "package.json", From 6086101dcf4ea547a3b432e63ef57e2fdca69a31 Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Thu, 19 Oct 2023 11:48:55 -0400 Subject: [PATCH 3/3] chore(clerk-js): Fix or temp disable ESLint issues --- .changeset/empty-terms-scream.md | 2 ++ .github/workflows/checks.yml | 2 +- .../ui/components/OrganizationProfile/InviteMembersPage.tsx | 1 + .../ui/components/OrganizationProfile/MembershipWidget.tsx | 5 ++++- .../components/OrganizationProfile/ProfileSettingsPage.tsx | 1 + .../OrganizationSwitcher/OrganizationSwitcherTrigger.tsx | 1 + .../src/ui/components/UserProfile/ConnectedAccountsPage.tsx | 2 +- .../clerk-js/src/ui/components/UserProfile/EmailPage.tsx | 1 + .../clerk-js/src/ui/components/UserProfile/PhonePage.tsx | 1 + .../clerk-js/src/ui/components/UserProfile/ProfilePage.tsx | 1 + 10 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .changeset/empty-terms-scream.md diff --git a/.changeset/empty-terms-scream.md b/.changeset/empty-terms-scream.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/empty-terms-scream.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index a56ec49cc3..afef97f547 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -34,7 +34,7 @@ jobs: with: use-turbo-cache: 'true' - name: Run lint - run: npm run lint + run: npm run lint -- --output-logs=errors-only -- --quiet unit-tests: name: Run unit tests diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/InviteMembersPage.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/InviteMembersPage.tsx index f99b9cba5e..ed6c72a0f5 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/InviteMembersPage.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/InviteMembersPage.tsx @@ -24,6 +24,7 @@ export const InviteMembersPage = withCardStateProvider(() => { const reachedOrganizationMemberLimit = !!__unstable_manageBillingMembersLimit && runIfFunctionOrReturn(__unstable_manageBillingMembersLimit) <= + // eslint-disable-next-line @typescript-eslint/restrict-plus-operands organization.pendingInvitationsCount + organization.membersCount; return ( diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/MembershipWidget.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/MembershipWidget.tsx index e5deb2966b..9224cd6c67 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/MembershipWidget.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/MembershipWidget.tsx @@ -14,6 +14,9 @@ export const MembershipWidget = () => { return null; } + // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + const totalCount = organization?.membersCount + organization?.pendingInvitationsCount; + return ( ({ @@ -57,7 +60,7 @@ export const MembershipWidget = () => { color: t.colors.$blackAlpha600, })} > - {organization?.membersCount + organization?.pendingInvitationsCount} of{' '} + {totalCount} of{' '} {__unstable_manageBillingMembersLimit ? `${runIfFunctionOrReturn(__unstable_manageBillingMembersLimit)} members` : 'unlimited'} diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileSettingsPage.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileSettingsPage.tsx index 8aaa0c4aa2..2002c34ff6 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileSettingsPage.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileSettingsPage.tsx @@ -37,6 +37,7 @@ export const ProfileSettingsPage = withCardStateProvider(() => { const dataChanged = organization.name !== nameField.value || organization.slug !== slugField.value; const canSubmit = (dataChanged || avatarChanged) && !slugField.errorText; + // eslint-disable-next-line @typescript-eslint/require-await const onSubmit = async (e: React.FormEvent) => { e.preventDefault(); return (dataChanged ? organization.update({ name: nameField.value, slug: slugField.value }) : Promise.resolve()) diff --git a/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherTrigger.tsx b/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherTrigger.tsx index 4d7e5f90f4..31b72059c3 100644 --- a/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherTrigger.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherTrigger.tsx @@ -85,6 +85,7 @@ const NotificationCountBadgeSwitcherTrigger = withGate( }); const notificationCount = + // eslint-disable-next-line @typescript-eslint/restrict-plus-operands (userInvitations.count || 0) + (userSuggestions.count || 0) + (membershipRequests?.count || 0); return ( diff --git a/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsPage.tsx b/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsPage.tsx index 4bb84bd82f..985379eb29 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsPage.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsPage.tsx @@ -51,7 +51,7 @@ const AddConnectedAccount = () => { const isModal = mode === 'modal'; const enabledStrategies = strategies.filter(s => s.startsWith('oauth')) as OAuthStrategy[]; - const connectedStrategies = user.verifiedExternalAccounts.map(a => 'oauth_' + a.provider) as OAuthStrategy[]; + const connectedStrategies = user.verifiedExternalAccounts.map(a => `oauth_${a.provider}`) as OAuthStrategy[]; const unconnectedStrategies = enabledStrategies.filter(provider => { return !connectedStrategies.includes(provider); diff --git a/packages/clerk-js/src/ui/components/UserProfile/EmailPage.tsx b/packages/clerk-js/src/ui/components/UserProfile/EmailPage.tsx index 2a43f931c4..a0fa4c2a04 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/EmailPage.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/EmailPage.tsx @@ -37,6 +37,7 @@ export const EmailPage = withCardStateProvider(() => { const canSubmit = emailField.value.length > 1 && user.username !== emailField.value; + // eslint-disable-next-line @typescript-eslint/require-await const addEmail = async (e: React.FormEvent) => { e.preventDefault(); return user diff --git a/packages/clerk-js/src/ui/components/UserProfile/PhonePage.tsx b/packages/clerk-js/src/ui/components/UserProfile/PhonePage.tsx index be65f1a621..9beb8fbe4d 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/PhonePage.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/PhonePage.tsx @@ -62,6 +62,7 @@ export const AddPhone = (props: AddPhoneProps) => { const canSubmit = phoneField.value.length > 1 && user.username !== phoneField.value; + // eslint-disable-next-line @typescript-eslint/require-await const addPhone = async (e: React.FormEvent) => { e.preventDefault(); return user diff --git a/packages/clerk-js/src/ui/components/UserProfile/ProfilePage.tsx b/packages/clerk-js/src/ui/components/UserProfile/ProfilePage.tsx index 744040bd84..7d5906d4b0 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/ProfilePage.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/ProfilePage.tsx @@ -51,6 +51,7 @@ export const ProfilePage = withCardStateProvider(() => { const nameEditDisabled = user.samlAccounts.some(sa => sa.active); + // eslint-disable-next-line @typescript-eslint/require-await const onSubmit = async (e: React.FormEvent) => { e.preventDefault();