Scheduling infrastructure for absolutely everyone.
chore: Update version in main for embeds that are already released. (#9822)
Hariom Balhara2a8eca788501
diff --git a/apps/web/CHANGELOG.md b/apps/web/CHANGELOG.mdindex 795250d0dff..ef0070cf209 100644--- a/apps/web/CHANGELOG.md+++ b/apps/web/CHANGELOG.md@@ -1,5 +1,39 @@# @calcom/web+## 3.1.3++### Patch Changes++- Updated dependencies+ - @calcom/[email protected]++## 3.0.10++### Patch Changes++- Updated dependencies+ - @calcom/[email protected]+ - @calcom/[email protected]+ - @calcom/[email protected]++## 3.0.9++### Patch Changes++- Updated dependencies+ - @calcom/[email protected]+ - @calcom/[email protected]+ - @calcom/[email protected]++## 3.0.8++### Patch Changes++- Updated dependencies+ - @calcom/[email protected]+ - @calcom/[email protected]+ - @calcom/[email protected]+## 2.9.4### Patch Changesdiff --git a/packages/embeds/.eslintrc.js b/packages/embeds/.eslintrc.jsnew file mode 100644index 00000000000..59165894d4d--- /dev/null+++ b/packages/embeds/.eslintrc.js@@ -0,0 +1,12 @@+module.exports = {+ extends: ["../../.eslintrc.js"],+ rules: {+ "no-restricted-imports": [+ "error",+ {+ // Ensure that embed packages(They are published) can't access unpublished packages which is basically all @calcom/* packages except embed packages+ patterns: ["@calcom/*", "!@calcom/embed-*"],+ },+ ],+ },+};diff --git a/packages/embeds/embed-core/CHANGELOG.md b/packages/embeds/embed-core/CHANGELOG.mdindex e01551960cf..0331d544060 100644--- a/packages/embeds/embed-core/CHANGELOG.md+++ b/packages/embeds/embed-core/CHANGELOG.md@@ -1,5 +1,23 @@# @calcom/embed-core+## 1.3.2++### Patch Changes++- Improve UI instruction layout typings++## 1.3.1++### Patch Changes++- layout type fix as zod-utils can't be used in npm package++## 1.3.0++### Minor Changes++- Supports new booker layout+## 1.2.1### Patch Changesdiff --git a/packages/embeds/embed-core/package.json b/packages/embeds/embed-core/package.jsonindex 41ea214e5ba..222ee9d7495 100644--- a/packages/embeds/embed-core/package.json+++ b/packages/embeds/embed-core/package.json@@ -1,6 +1,6 @@{"name": "@calcom/embed-core",- "version": "1.2.1",+ "version": "1.3.2","description": "This is the vanilla JS core script that embeds Cal Link","main": "./dist/embed/embed.js","types": "./dist/index.d.ts",@@ -30,7 +30,7 @@"embed-tests-quick": "QUICK=true yarn embed-tests","embed-tests-update-snapshots:ci": "yarn embed-tests-quick --update-snapshots","withEmbedPublishEnv": "NEXT_PUBLIC_EMBED_LIB_URL='https://app.cal.com/embed/embed.js' NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com' yarn",- "prepack": "yarn withEmbedPublishEnv build",+ "prepack": "yarn ../../../ lint --filter='@calcom/embed-core' && yarn withEmbedPublishEnv build","clean": "rm -rf .turbo && rm -rf node_modules && rm -rf ../../../apps/web/public/embed"},"files": [diff --git a/packages/embeds/embed-core/src/embed-iframe.ts b/packages/embeds/embed-core/src/embed-iframe.tsindex 47b87b02722..12f7658719f 100644--- a/packages/embeds/embed-core/src/embed-iframe.ts+++ b/packages/embeds/embed-core/src/embed-iframe.ts@@ -2,13 +2,13 @@ import { useRouter } from "next/router";import type { CSSProperties } from "react";import { useState, useEffect } from "react";-import type { BookerStore } from "@calcom/features/bookings/Booker/store";-import { BookerLayouts } from "@calcom/prisma/zod-utils";-import type { Message } from "./embed";import { sdkActionManager } from "./sdk-event";type Theme = "dark" | "light";++export type BookerLayouts = "month_view" | "week_view" | "column_view";+export type EmbedThemeConfig = Theme | "auto";export type UiConfig = {hideEventTypeDetails?: boolean;@@ -45,7 +45,6 @@ const embedStore = {* We maintain a list of all setUiConfig setters that are in use at the moment so that we can update all those components.*/setUiConfig: [] as ((arg0: UiConfig) => void)[],- layout: BookerLayouts,};declare global {@@ -54,7 +53,6 @@ declare global {__logQueue?: unknown[];embedStore: typeof embedStore;applyCssVars: (cssVarsPerTheme: UiConfig["cssVarsPerTheme"]) => void;- setLayout?: BookerStore["setLayout"];};CalComPageStatus: string;isEmbed?: () => boolean;diff --git a/packages/embeds/embed-core/src/embed.ts b/packages/embeds/embed-core/src/embed.tsindex 79015bbe4b0..70b3bf9b66a 100644--- a/packages/embeds/embed-core/src/embed.ts+++ b/packages/embeds/embed-core/src/embed.ts@@ -1,10 +1,14 @@/// <reference types="../env" />-import type { BookerLayouts } from "@calcom/prisma/zod-utils";-import { FloatingButton } from "./FloatingButton/FloatingButton";import { Inline } from "./Inline/inline";import { ModalBox } from "./ModalBox/ModalBox";-import type { InterfaceWithParent, interfaceWithParent, UiConfig, EmbedThemeConfig } from "./embed-iframe";+import type {+ InterfaceWithParent,+ interfaceWithParent,+ UiConfig,+ EmbedThemeConfig,+ BookerLayouts,+} from "./embed-iframe";import css from "./embed.css";import type { EventData, EventDataMap } from "./sdk-action-manager";import { SdkActionManager } from "./sdk-action-manager";@@ -164,9 +168,11 @@ export type PrefillAndIframeAttrsConfig = Record<string, string | string[] | Rec// TODO: It should have a dedicated prefill prop// prefill: {},+ // TODO: Move layout and theme as nested props of ui as it makes it clear that these two can be configured using `ui` instruction as well any time.+ // ui: {layout; theme}+ layout?: BookerLayouts;// TODO: Rename layout and theme as ui.layout and ui.theme as it makes it clear that these two can be configured using `ui` instruction as well any time."ui.color-scheme"?: string;- layout?: `${BookerLayouts}`;theme?: EmbedThemeConfig;};diff --git a/packages/embeds/embed-react/CHANGELOG.md b/packages/embeds/embed-react/CHANGELOG.mdindex 3f7e69a25df..150612b5c06 100644--- a/packages/embeds/embed-react/CHANGELOG.md+++ b/packages/embeds/embed-react/CHANGELOG.md@@ -1,5 +1,41 @@# @calcom/embed-react+## 1.3.0++### Minor Changes++- Fix module import of the embed-react package++## 1.2.2++### Patch Changes++- Improve UI instruction layout typings+- Updated dependencies+ - @calcom/[email protected]+ - @calcom/[email protected]++## 1.2.1++### Patch Changes++- layout type fix as zod-utils can't be used in npm package+- Updated dependencies+ - @calcom/[email protected]+ - @calcom/[email protected]++## 1.2.0++### Minor Changes++- Supports new booker layout++### Patch Changes++- Updated dependencies+ - @calcom/[email protected]+ - @calcom/[email protected]+## 1.1.1### Patch Changesdiff --git a/packages/embeds/embed-react/package.json b/packages/embeds/embed-react/package.jsonindex 60099cdc028..52c69b3f4be 100644--- a/packages/embeds/embed-react/package.json+++ b/packages/embeds/embed-react/package.json@@ -1,7 +1,7 @@{"name": "@calcom/embed-react","sideEffects": false,- "version": "1.1.1",+ "version": "1.3.0","description": "Embed Cal Link as a React Component","license": "SEE LICENSE IN LICENSE","repository": {@@ -11,7 +11,7 @@},"scripts": {"dev": "vite --port=3101 --open",- "build": "rm -rf dist && vite build && tsc --emitDeclarationOnly --declarationDir dist",+ "build": "rm -rf dist && vite build && cp ./dist/Cal.es.js ./dist/Cal.es.mjs && tsc --emitDeclarationOnly --declarationDir dist","preview": "vite preview","type-check": "tsc --pretty --noEmit","type-check:ci": "tsc-absolute --pretty --noEmit",@@ -21,13 +21,13 @@"embed-tests-update-snapshots:ci": "yarn embed-tests-quick --update-snapshots","packaged:tests": "cd test/packaged && yarn tsc --noEmit && yarn run -T test -- --packaged-embed-tests-only","withEmbedPublishEnv": "NEXT_PUBLIC_EMBED_LIB_URL='https://app.cal.com/embed/embed.js' NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com' yarn",- "prepack": "yarn withEmbedPublishEnv build && yarn packaged:tests",+ "prepack": "yarn ../../../ lint --filter='@calcom/embed-react' && yarn withEmbedPublishEnv build && yarn packaged:tests","embed-web-start": "yarn workspace @calcom/web start","embed-dev": "yarn workspace @calcom/embed-react dev","clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"},"main": "./dist/Cal.umd.js",- "module": "./dist/Cal.es.js",+ "module": "./dist/Cal.es.mjs","types": "./dist/embed-react/src/index.d.ts","peerDependencies": {"react": "^18.2.0",@@ -38,7 +38,7 @@],"exports": {".": {- "import": "./dist/Cal.es.js",+ "import": "./dist/Cal.es.mjs","require": "./dist/Cal.umd.js"}},diff --git a/packages/embeds/embed-react/test/packaged/api.test.ts b/packages/embeds/embed-react/test/packaged/api.test.tsindex 574bc410111..ec4aebf8915 100644--- a/packages/embeds/embed-react/test/packaged/api.test.ts+++ b/packages/embeds/embed-react/test/packaged/api.test.ts@@ -11,6 +11,14 @@ import { getCalApi } from "@calcom/embed-react";const api = getCalApi();-test("Check that the API is available", () => {+test("Check that the API is available", async () => {expect(api).toBeDefined()+ const awaitedApi = await api;+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment+ awaitedApi('floatingButton', {+ config: {+ // @ts-expect-error We are intentionaly testing invalid value+ layout: 'wrongview'+ }+ })});diff --git a/packages/embeds/embed-snippet/CHANGELOG.md b/packages/embeds/embed-snippet/CHANGELOG.mdindex ff1fa627086..148e8691831 100644--- a/packages/embeds/embed-snippet/CHANGELOG.md+++ b/packages/embeds/embed-snippet/CHANGELOG.md@@ -1,5 +1,32 @@# @calcom/embed-snippet+## 1.1.2++### Patch Changes++- Improve UI instruction layout typings+- Updated dependencies+ - @calcom/[email protected]++## 1.1.1++### Patch Changes++- layout type fix as zod-utils can't be used in npm package+- Updated dependencies+ - @calcom/[email protected]++## 1.1.0++### Minor Changes++- Supports new booker layout++### Patch Changes++- Updated dependencies+ - @calcom/[email protected]+## 1.0.9### Patch Changesdiff --git a/packages/embeds/embed-snippet/package.json b/packages/embeds/embed-snippet/package.jsonindex b4d17750cdf..53baa566233 100644--- a/packages/embeds/embed-snippet/package.json+++ b/packages/embeds/embed-snippet/package.json@@ -1,7 +1,7 @@{"name": "@calcom/embed-snippet","sideEffects": false,- "version": "1.0.9",+ "version": "1.1.2","main": "./dist/snippet.umd.js","module": "./dist/snippet.es.js","description": "Vanilla JS embed snippet that is responsible to fetch @calcom/embed-core and thus show Cal Link as an embed on a page.",@@ -17,7 +17,7 @@"type-check:ci": "tsc-absolute --pretty --noEmit","lint": "eslint --ext .ts,.js src","withEmbedPublishEnv": "NEXT_PUBLIC_EMBED_LIB_URL='https://app.cal.com/embed/embed.js' NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com' yarn",- "prepack": "yarn withEmbedPublishEnv build",+ "prepack": "yarn ../../../ lint --filter='@calcom/embed-snippet' && yarn withEmbedPublishEnv build","clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"},"files": [diff --git a/packages/embeds/embed-snippet/src/index.ts b/packages/embeds/embed-snippet/src/index.tsindex 3652f002a36..6ebe0b38f5a 100644--- a/packages/embeds/embed-snippet/src/index.ts+++ b/packages/embeds/embed-snippet/src/index.ts@@ -1,5 +1,8 @@/* eslint-disable @typescript-eslint/ban-ts-comment,prefer-rest-params,prefer-const */import type { GlobalCal, GlobalCalWithoutNs } from "@calcom/embed-core";+// FIXME: embed-snippet is a published package and shouldn't import from @calcom/types which is unpublished+// This isn't a problem at the moment because embed-snippet isn't directly imported and embed-react which uses it doesn't depend on this+// eslint-disable-next-line no-restricted-importsimport type { Optional } from "@calcom/types/utils";/**diff --git a/packages/features/bookings/Booker/utils/layout.ts b/packages/features/bookings/Booker/utils/layout.tsindex 895ebbdb51e..52f7119a0f9 100644--- a/packages/features/bookings/Booker/utils/layout.ts+++ b/packages/features/bookings/Booker/utils/layout.ts@@ -1,6 +1,5 @@-import type { BookerLayouts } from "@calcom/prisma/zod-utils";import { bookerLayoutOptions } from "@calcom/prisma/zod-utils";-export const validateLayout = (layout?: BookerLayouts | null) => {+export const validateLayout = (layout?: "week_view" | "month_view" | "column_view" | null) => {return bookerLayoutOptions.find((validLayout) => validLayout === layout);};