From 97ef32f7ca7f0e5bb536262de36a3851fa4e94ae Mon Sep 17 00:00:00 2001 From: luzpaz Date: Mon, 24 Feb 2025 09:44:08 -0500 Subject: [PATCH] fix: typos in several package/ directories (#19495) * fix: typos in packages/embeds Found via codespell * fix: typos in packages/lib Found via codespell * fix: typos in packages/trpc Found via codespell --- packages/embeds/embed-core/README.md | 2 +- packages/embeds/embed-core/playwright/lib/testUtils.ts | 2 +- packages/embeds/embed-core/src/embed-iframe.ts | 6 +++--- packages/embeds/embed-core/src/embed.ts | 4 ++-- packages/embeds/embed-react/inline.tsx | 2 +- packages/embeds/embed-react/test/packaged/api.test.ts | 2 +- packages/lib/CloseCom.ts | 2 +- packages/lib/apps/getEnabledAppsFromCredentials.ts | 2 +- packages/lib/availability.ts | 2 +- packages/lib/cva/cva.test.ts | 2 +- packages/lib/event-types/utils/checkForEmptyAssignment.ts | 2 +- packages/lib/getValidRhfFieldName.test.ts | 2 +- packages/lib/redactError.ts | 2 +- packages/lib/server/checkCfTurnstileToken.ts | 2 +- packages/lib/server/getLuckyUser.test.ts | 4 ++-- packages/lib/server/repository/team.ts | 2 +- packages/lib/service/TODO.md | 6 +++--- packages/lib/slugify.test.ts | 2 +- .../loggedInViewer/unlinkConnectedAccount.handler.spec.ts | 2 +- .../loggedInViewer/unlinkConnectedAccount.handler.ts | 2 +- .../server/routers/loggedInViewer/updateProfile.handler.ts | 2 +- packages/trpc/server/routers/viewer/bookings/get.handler.ts | 2 +- .../routers/viewer/organizations/adminVerify.handler.ts | 2 +- .../routers/viewer/organizations/updateUser.handler.ts | 2 +- .../findTeamMembersMatchingAttributeLogicOfRoute.handler.ts | 2 +- packages/trpc/server/routers/viewer/slots/util.ts | 2 +- packages/trpc/server/routers/viewer/teams/update.handler.ts | 2 +- 27 files changed, 33 insertions(+), 33 deletions(-) diff --git a/packages/embeds/embed-core/README.md b/packages/embeds/embed-core/README.md index b8631d9919..58bd4081c8 100644 --- a/packages/embeds/embed-core/README.md +++ b/packages/embeds/embed-core/README.md @@ -101,7 +101,7 @@ Make `dist/embed.umd.js` servable on URL - Release Issues - - Compatibility Issue - When embed-iframe.js is updated in such a way that it is not compatible with embed.js, doing a release might break the embed for some time. e.g. iframeReady event let's say get's changed to something else + - Compatibility Issue - When embed-iframe.js is updated in such a way that it is not compatible with embed.js, doing a release might break the embed for some time. e.g. iframeReady event let's say gets changed to something else - Best Case scenario - App and Website goes live at the same time. A website using embed loads the same updated and thus compatible versions of embed.js and embed-iframe.js - Worst case scenario - App goes live first, website PR isn't merged yet and thus a website using the embed would load updated version of embed-iframe but outdated version of embed.js possibly breaking the embed. - Ideal Solution: It would be to keep the libraries versioned and embed.js should instruct app within iframe to load a particular version. But if we push a security fix, it is possible that someone is still enforcing embed to load version with security issue. Need to handle this. diff --git a/packages/embeds/embed-core/playwright/lib/testUtils.ts b/packages/embeds/embed-core/playwright/lib/testUtils.ts index 7f0e405b74..cccfd9ad31 100644 --- a/packages/embeds/embed-core/playwright/lib/testUtils.ts +++ b/packages/embeds/embed-core/playwright/lib/testUtils.ts @@ -109,7 +109,7 @@ export async function bookFirstEvent(username: string, frame: Frame, page: Page) }); // Let current month dates fully render. - // There is a bug where if we don't let current month fully render and quickly click go to next month, current month get's rendered + // There is a bug where if we don't let current month fully render and quickly click go to next month, current month gets rendered // This doesn't seem to be replicable with the speed of a person, only during automation. // It would also allow correct snapshot to be taken for current month. await frame.waitForTimeout(1000); diff --git a/packages/embeds/embed-core/src/embed-iframe.ts b/packages/embeds/embed-core/src/embed-iframe.ts index 04446755dc..80e44f88d5 100644 --- a/packages/embeds/embed-core/src/embed-iframe.ts +++ b/packages/embeds/embed-core/src/embed-iframe.ts @@ -227,7 +227,7 @@ export const useEmbedTheme = () => { /** * It serves following purposes - * - Gives consistent values for ui config even after Soft Navigation. When a new React component mounts, it would ensure that the component get's the correct value of ui config + * - Gives consistent values for ui config even after Soft Navigation. When a new React component mounts, it would ensure that the component gets the correct value of ui config * - Ensures that all the components using useEmbedUiConfig are updated when ui config changes. It is done by maintaining a list of all non-stale setters. */ export const useEmbedUiConfig = () => { @@ -243,7 +243,7 @@ export const useEmbedUiConfig = () => { return uiConfig; }; -// TODO: Make it usable as an attribute directly instead of styles value. It would allow us to go beyond styles e.g. for debugging we can add a special attribute indentifying the element on which UI config has been applied +// TODO: Make it usable as an attribute directly instead of styles value. It would allow us to go beyond styles e.g. for debugging we can add a special attribute identifying the element on which UI config has been applied export const useEmbedStyles = (elementName: keyof EmbedStyles) => { const [, setStyles] = useState({}); @@ -485,7 +485,7 @@ function keepParentInformedAboutDimensionChanges() { // During first render let iframe tell parent that how much is the expected height to avoid scroll. // Parent would set the same value as the height of iframe which would prevent scroll. - // On subsequent renders, consider html height as the height of the iframe. If we don't do this, then if iframe get's bigger in height, it would never shrink + // On subsequent renders, consider html height as the height of the iframe. If we don't do this, then if iframe gets bigger in height, it would never shrink const iframeHeight = isFirstTime ? documentScrollHeight : contentHeight; const iframeWidth = isFirstTime ? documentScrollWidth : contentWidth; embedStore.parentInformedAboutContentHeight = true; diff --git a/packages/embeds/embed-core/src/embed.ts b/packages/embeds/embed-core/src/embed.ts index 2d67a37b1e..c0eca414cf 100644 --- a/packages/embeds/embed-core/src/embed.ts +++ b/packages/embeds/embed-core/src/embed.ts @@ -132,7 +132,7 @@ function withColorScheme( // https://fvsch.com/transparent-iframes#:~:text=the%20resolution%20was%3A-,If%20the%20color%20scheme%20of%20an%20iframe%20differs%20from%20embedding%20document%2C%20iframe%20gets%20an%20opaque%20canvas%20background%20appropriate%20to%20its%20color%20scheme.,-So%20the%20dark if (!config["ui.color-scheme"]) { const colorScheme = getColorScheme(containerEl); - // Only handle two color-schemes for now. We don't want to have unintented affect by always explicitly adding color-scheme + // Only handle two color-schemes for now. We don't want to have unintended affect by always explicitly adding color-scheme if (colorScheme) { config["ui.color-scheme"] = colorScheme; } @@ -388,7 +388,7 @@ export class Cal { // But it's okay to do it here for now because the embedded calLink also keeps itself hidden till it receives `parentKnowsIframeReady` message(It has it's own reasons for that) // Once the embedded calLink starts not hiding the document, we should optimize this line to make the iframe visible earlier than this. - // Imp: Don't use visiblity:visible as that would make the iframe show even if the host element(A paren tof the iframe) has visiblity:hidden set. Just reset the visibility to default + // Imp: Don't use visibility:visible as that would make the iframe show even if the host element(A paren tof the iframe) has visibility:hidden set. Just reset the visibility to default this.iframe.style.visibility = ""; } this.doInIframe({ method: "parentKnowsIframeReady" } as const); diff --git a/packages/embeds/embed-react/inline.tsx b/packages/embeds/embed-react/inline.tsx index d9d070b9cb..9c7641accb 100644 --- a/packages/embeds/embed-react/inline.tsx +++ b/packages/embeds/embed-react/inline.tsx @@ -7,7 +7,7 @@ import { useState } from "react"; import ReactDom from "react-dom"; // Because we don't import from @calcom/embed-react, this file isn't able to test if the build is successful or not and thus npm package would work or not correctly. -// There are tests in test/built which verifiy that the types from built package are correctly generated and exported correctly. +// There are tests in test/built which verify that the types from built package are correctly generated and exported correctly. import Cal, { getCalApi, type EmbedEvent } from "./src/index"; const api = getCalApi({ diff --git a/packages/embeds/embed-react/test/packaged/api.test.ts b/packages/embeds/embed-react/test/packaged/api.test.ts index 2cd751d010..7afd84d511 100644 --- a/packages/embeds/embed-react/test/packaged/api.test.ts +++ b/packages/embeds/embed-react/test/packaged/api.test.ts @@ -18,7 +18,7 @@ test("Check that the API is available", async () => { calLink: "free", config: { // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-expect-error We are intentionaly testing invalid value + // @ts-expect-error We are intentionally testing invalid value layout: "wrongview", }, }); diff --git a/packages/lib/CloseCom.ts b/packages/lib/CloseCom.ts index 2c3d87499a..23b00c7f96 100644 --- a/packages/lib/CloseCom.ts +++ b/packages/lib/CloseCom.ts @@ -477,7 +477,7 @@ export default class CloseCom { body: JSON.stringify(data), }).then(async (response) => { if (!response.ok) { - const message = `[Close.com app] An error has occured: ${response.status}`; + const message = `[Close.com app] An error has occurred: ${response.status}`; this.log.error(await response.json()); throw new Error(message); } diff --git a/packages/lib/apps/getEnabledAppsFromCredentials.ts b/packages/lib/apps/getEnabledAppsFromCredentials.ts index 18904e5b3b..1903d190e8 100644 --- a/packages/lib/apps/getEnabledAppsFromCredentials.ts +++ b/packages/lib/apps/getEnabledAppsFromCredentials.ts @@ -10,7 +10,7 @@ type EnabledApp = ReturnType[number] & { enabled: boolean }; * * @param credentials - Can be user or team credentials * @param options - * @param options.where Aditional where conditions to filter out apps + * @param options.where Additional where conditions to filter out apps * @param options.filterOnCredentials - Only include apps where credentials are present * @returns A list of enabled app metadata & credentials tied to them */ diff --git a/packages/lib/availability.ts b/packages/lib/availability.ts index b604e07742..b578d4c9bd 100644 --- a/packages/lib/availability.ts +++ b/packages/lib/availability.ts @@ -138,7 +138,7 @@ export function availabilityAsString( // append if the range is not complete (but the next day needs adding) days[days.length - 1].push(day); } else if (days[days.length - 1][days[days.length - 1].length - 1] === day - 1) { - // range complete, overwrite if the last day directly preceeds the current day + // range complete, overwrite if the last day directly precedes the current day days[days.length - 1] = [days[days.length - 1][0], day]; } else { // new range diff --git a/packages/lib/cva/cva.test.ts b/packages/lib/cva/cva.test.ts index 31c29eb4ac..96bcbd6cdb 100644 --- a/packages/lib/cva/cva.test.ts +++ b/packages/lib/cva/cva.test.ts @@ -21,7 +21,7 @@ describe("CVA Utils", () => { ]); }); - it("Should no erorr when no arrays are passed in", () => { + it("Should not error when no arrays are passed in", () => { const variants = { color: "blue", size: "large", diff --git a/packages/lib/event-types/utils/checkForEmptyAssignment.ts b/packages/lib/event-types/utils/checkForEmptyAssignment.ts index 3c23dd9df8..d7b33fd096 100644 --- a/packages/lib/event-types/utils/checkForEmptyAssignment.ts +++ b/packages/lib/event-types/utils/checkForEmptyAssignment.ts @@ -17,7 +17,7 @@ export function checkForEmptyAssignment({ isManagedEventType: boolean; assignAllTeamMembers: boolean; }): boolean { - // If Team-events have assignAllTeamMembers checked, return false as assignemnt is complete. + // If Team-events have assignAllTeamMembers checked, return false as assignment is complete. if (assignAllTeamMembers) { return false; } diff --git a/packages/lib/getValidRhfFieldName.test.ts b/packages/lib/getValidRhfFieldName.test.ts index a7855ead2d..77319cea24 100644 --- a/packages/lib/getValidRhfFieldName.test.ts +++ b/packages/lib/getValidRhfFieldName.test.ts @@ -15,7 +15,7 @@ describe("getValidRhfFieldName", () => { expect(getValidRhfFieldName("$hello.there")).toEqual("-hello-there"); }); - // So that user can freely add spaces and any other character iteratively and it get's converted to - and he can add more characters. + // So that user can freely add spaces and any other character iteratively and it gets converted to - and he can add more characters. // We don't really care about a hyphen in the end it("should not remove dashes from start and end.", () => { expect(getValidRhfFieldName("hello-there-")).toEqual("hello-there-"); diff --git a/packages/lib/redactError.ts b/packages/lib/redactError.ts index 6df4355cb1..67246ea032 100644 --- a/packages/lib/redactError.ts +++ b/packages/lib/redactError.ts @@ -22,7 +22,7 @@ export const redactError = (error: T) => { log.debug("Type of Error: ", error.constructor); if (shouldRedact(error) && IS_PRODUCTION) { log.error("Error: ", JSON.stringify(error)); - return new Error("An error occured while querying the database."); + return new Error("An error occurred while querying the database."); } return error; }; diff --git a/packages/lib/server/checkCfTurnstileToken.ts b/packages/lib/server/checkCfTurnstileToken.ts index 0c9dc0a6f4..7985dfa7d9 100644 --- a/packages/lib/server/checkCfTurnstileToken.ts +++ b/packages/lib/server/checkCfTurnstileToken.ts @@ -3,7 +3,7 @@ import { HttpError } from "../http-error"; const TURNSTILE_SECRET_ID = process.env.CLOUDFLARE_TURNSTILE_SECRET; export async function checkCfTurnstileToken({ token, remoteIp }: { token?: string; remoteIp: string }) { - // This means the instance doesnt have turnstile enabled - we skip the check and just return success. + // This means the instance doesn't have turnstile enabled - we skip the check and just return success. // OR the instance is running in CI so we skip these checks also if (!TURNSTILE_SECRET_ID || !!process.env.NEXT_PUBLIC_IS_E2E) { return { diff --git a/packages/lib/server/getLuckyUser.test.ts b/packages/lib/server/getLuckyUser.test.ts index c181dab688..c93e68391c 100644 --- a/packages/lib/server/getLuckyUser.test.ts +++ b/packages/lib/server/getLuckyUser.test.ts @@ -686,13 +686,13 @@ describe("maximize availability and weights", () => { userId: 1, createdAt: dayjs().startOf("month").add(10, "day").toDate(), }), - // happend during OOO + // happened during OOO buildBooking({ id: 2, userId: 2, createdAt: dayjs().startOf("month").add(5, "hour").toDate(), }), - // happend during OOO + // happened during OOO buildBooking({ id: 3, userId: 2, diff --git a/packages/lib/server/repository/team.ts b/packages/lib/server/repository/team.ts index 3407ad337b..ac33e722ce 100644 --- a/packages/lib/server/repository/team.ts +++ b/packages/lib/server/repository/team.ts @@ -47,7 +47,7 @@ type GetTeamOrOrgArg = { const log = logger.getSubLogger({ prefix: ["repository", "team"] }); /** - * Get's the team or organization with the given slug or id reliably along with parsed metadata. + * Gets the team or organization with the given slug or id reliably along with parsed metadata. */ async function getTeamOrOrg({ lookupBy, diff --git a/packages/lib/service/TODO.md b/packages/lib/service/TODO.md index 33a1970c4a..977d65e3bb 100644 --- a/packages/lib/service/TODO.md +++ b/packages/lib/service/TODO.md @@ -8,7 +8,7 @@ - [x] Unlocked attribute shouldn't get updates from SCIM but in case they still do, we follow this strategy - If attribute from SCIM, doesn't exist on user, we allow it to be freely set on the user - If attribute from SCIM, exists on user - - [x] It is a single select or a non-enum attribute, we don't let it be overriden and completely ignore the SCIM update for that attribute + - [x] It is a single select or a non-enum attribute, we don't let it be overridden and completely ignore the SCIM update for that attribute - [x] It is a multi select, we remove the options that were created from SCIM and add the new options from SCIM. AttributeToUser.createdByDSyncId is set to SCIM directorySync id for those options. It allows both SCIM set and User set options to be assigned to the User. - [x] The options created by SCIM aren't deletable from Cal.com UI. User can only remove options created by Cal.com i.e. where AttributeToUser.createdByDSyncId is null. - Restrict setting values @@ -25,9 +25,9 @@ ## Test - Okta to Cal.com 1. Add a user with attribute - 2. Simular a failure in adding the user + 2. Simulate a failure in adding the user - Failure could be in user creation or attribute assignment creation - 3. Remove the user and Re-add the user and see it is correctly synced. + 3. Remove the user and Re-add the user and see if it's correctly synced. - [x] Try removing a locked attribute assignment from a user. diff --git a/packages/lib/slugify.test.ts b/packages/lib/slugify.test.ts index 042ff7a0c5..908e6d681a 100644 --- a/packages/lib/slugify.test.ts +++ b/packages/lib/slugify.test.ts @@ -22,7 +22,7 @@ describe("slugify", () => { expect(slugify("hello$there")).toEqual("hello-there"); }); - // So that user can freely add spaces and any other character iteratively and it get's converted to - later on. + // So that user can freely add spaces and any other character iteratively and it gets converted to - later on. it("should remove dashes from start and end.", () => { expect(slugify("hello-there-")).toEqual("hello-there"); expect(slugify("hello-there_")).toEqual("hello-there"); diff --git a/packages/trpc/server/routers/loggedInViewer/unlinkConnectedAccount.handler.spec.ts b/packages/trpc/server/routers/loggedInViewer/unlinkConnectedAccount.handler.spec.ts index fce5ae45d8..73ff5daeb6 100644 --- a/packages/trpc/server/routers/loggedInViewer/unlinkConnectedAccount.handler.spec.ts +++ b/packages/trpc/server/routers/loggedInViewer/unlinkConnectedAccount.handler.spec.ts @@ -59,7 +59,7 @@ describe("unlinkConnectedAccount.handler", () => { } `); }); - it("Should respond with an error message if unlink was unsucessful", async () => { + it("Should respond with an error message if unlink was unsuccessful", async () => { const user = await buildMockData(IdentityProvider.CAL); const response = await unlinkConnectedAccountHandler({ ctx: { user } }); expect(response).toMatchInlineSnapshot(` diff --git a/packages/trpc/server/routers/loggedInViewer/unlinkConnectedAccount.handler.ts b/packages/trpc/server/routers/loggedInViewer/unlinkConnectedAccount.handler.ts index f6b416898c..6911ac9d75 100644 --- a/packages/trpc/server/routers/loggedInViewer/unlinkConnectedAccount.handler.ts +++ b/packages/trpc/server/routers/loggedInViewer/unlinkConnectedAccount.handler.ts @@ -23,7 +23,7 @@ const unlinkConnectedAccount = async ({ ctx }: UpdateProfileOptions) => { providerAccountId: user.identityProviderId || "", }); } catch { - // Fail silenty if we don't have an record in the account table + // Fail silently if we don't have a record in the account table } // Fall back to the default identity provider const _user = await prisma.user.update({ diff --git a/packages/trpc/server/routers/loggedInViewer/updateProfile.handler.ts b/packages/trpc/server/routers/loggedInViewer/updateProfile.handler.ts index 79534730d7..935d46c05a 100644 --- a/packages/trpc/server/routers/loggedInViewer/updateProfile.handler.ts +++ b/packages/trpc/server/routers/loggedInViewer/updateProfile.handler.ts @@ -139,7 +139,7 @@ export const updateProfileHandler = async ({ ctx, input }: UpdateProfileOptions) emailChangeWaitingForVerification: input.email?.toLocaleLowerCase(), }; - // Check to ensure this email isnt in use + // Check to ensure this email isn't in use // Don't include email in the data payload if we need to verify delete data.email; } diff --git a/packages/trpc/server/routers/viewer/bookings/get.handler.ts b/packages/trpc/server/routers/viewer/bookings/get.handler.ts index 4a5e41c6d6..0bf34b7082 100644 --- a/packages/trpc/server/routers/viewer/bookings/get.handler.ts +++ b/packages/trpc/server/routers/viewer/bookings/get.handler.ts @@ -326,7 +326,7 @@ export async function getBookings({ }; const [ - // Quering these in parallel to save time. + // Querying these in parallel to save time. // Note that because we are applying `take` to individual queries, we will usually get more bookings then we need. It is okay to have more bookings faster than having what we need slower bookingsQueryUserId, bookingsQueryAttendees, diff --git a/packages/trpc/server/routers/viewer/organizations/adminVerify.handler.ts b/packages/trpc/server/routers/viewer/organizations/adminVerify.handler.ts index 00015bde2c..1400dfa3dc 100644 --- a/packages/trpc/server/routers/viewer/organizations/adminVerify.handler.ts +++ b/packages/trpc/server/routers/viewer/organizations/adminVerify.handler.ts @@ -34,7 +34,7 @@ export const adminVerifyHandler = async ({ input }: AdminVerifyOptions) => { if (!foundOrg) throw new TRPCError({ code: "FORBIDDEN", - message: "This team isnt a org or doesnt exist", + message: "This team isn't an org or doesn't exist", }); const acceptedEmailDomain = foundOrg.members[0].user.email.split("@")[1]; diff --git a/packages/trpc/server/routers/viewer/organizations/updateUser.handler.ts b/packages/trpc/server/routers/viewer/organizations/updateUser.handler.ts index 9d286ef82d..c090be00e4 100644 --- a/packages/trpc/server/routers/viewer/organizations/updateUser.handler.ts +++ b/packages/trpc/server/routers/viewer/organizations/updateUser.handler.ts @@ -40,7 +40,7 @@ export const updateUserHandler = async ({ ctx, input }: UpdateUserOptions) => { const { id: userId, organizationId } = user; if (!organizationId) - throw new TRPCError({ code: "UNAUTHORIZED", message: "You must be a memeber of an organizaiton" }); + throw new TRPCError({ code: "UNAUTHORIZED", message: "You must be a member of an organizaiton" }); if (!(await isOrganisationAdmin(userId, organizationId))) throw new TRPCError({ code: "UNAUTHORIZED" }); diff --git a/packages/trpc/server/routers/viewer/routing-forms/findTeamMembersMatchingAttributeLogicOfRoute.handler.ts b/packages/trpc/server/routers/viewer/routing-forms/findTeamMembersMatchingAttributeLogicOfRoute.handler.ts index 2e851d9b64..cd839b2bd3 100644 --- a/packages/trpc/server/routers/viewer/routing-forms/findTeamMembersMatchingAttributeLogicOfRoute.handler.ts +++ b/packages/trpc/server/routers/viewer/routing-forms/findTeamMembersMatchingAttributeLogicOfRoute.handler.ts @@ -204,7 +204,7 @@ export const findTeamMembersMatchingAttributeLogicOfRouteHandler = async ({ }, { enablePerf: _enablePerf, - // Reuse same flag for enabling troubleshooter. We would normall use them together + // Reuse same flag for enabling troubleshooter. We would normally use them together enableTroubleshooter: _enablePerf, concurrency: _concurrency, } diff --git a/packages/trpc/server/routers/viewer/slots/util.ts b/packages/trpc/server/routers/viewer/slots/util.ts index 3812962ddb..c06b27759a 100644 --- a/packages/trpc/server/routers/viewer/slots/util.ts +++ b/packages/trpc/server/routers/viewer/slots/util.ts @@ -669,7 +669,7 @@ async function _getAvailableSlots({ input, ctx }: GetScheduleOptions): Promise { }); if (!parentTeam?.slug) { - throw new Error(`Parent team wth slug: ${parentTeam?.slug} not found`); + throw new Error(`Parent team with slug: ${parentTeam?.slug} not found`); } const orgUrlPrefix = getOrgFullOrigin(parentTeam.slug);