Fix @calcom/embed-react installation with TS project (#2870)
This commit is contained in:
1 parent
d6678f9b3a
commit
445cdd7cbf
41 files changed
+171
-107
No files matched your search
Vendored
+10
@@ -1 +1,11 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly EMBED_PUBLIC_WEBAPP_URL: string;
|
||||
readonly EMBED_PUBLIC_VERCEL_URL: string;
|
||||
readonly EMBED_PUBLIC_EMBED_LIB_URL: string;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@calcom/embed-react",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6-beta.10",
|
||||
"description": "Embed Cal Link as a React Component",
|
||||
"scripts": {
|
||||
"dev": "vite --port=3101 --open",
|
||||
"tsc": "tsc",
|
||||
"build": "vite build && yarn tsc --emitDeclarationOnly --declarationDir dist",
|
||||
"preview": "vite preview",
|
||||
"prepare": "yarn build",
|
||||
"prepare": "NEXT_PUBLIC_EMBED_LIB_URL='https://app.cal.com/embed/embed.js' NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com' yarn build",
|
||||
"type-check": "tsc --pretty --noEmit",
|
||||
"lint": "eslint --ext .ts,.js,.tsx,.jsx ./src",
|
||||
"embed-tests": "yarn playwright test --config=./playwright/config/playwright.config.ts",
|
||||
@@ -17,7 +17,7 @@
|
||||
},
|
||||
"main": "./dist/Cal.umd.js",
|
||||
"module": "./dist/Cal.es.js",
|
||||
"types": "./dist/src/index.d.ts",
|
||||
"types": "./dist/index.d.ts",
|
||||
"peerDependencies": {
|
||||
"react": "^18.1.0",
|
||||
"react-dom": "^18.1.0"
|
||||
@@ -32,14 +32,16 @@
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@calcom/embed-snippet": "^1.0.0",
|
||||
"@types/react": "18.0.9",
|
||||
"@types/react-dom": "18.0.4",
|
||||
"@vitejs/plugin-react": "^1.3.2",
|
||||
"eslint": "^8.15.0",
|
||||
"vite": "^2.9.9"
|
||||
"vite": "^2.9.9",
|
||||
"playwright": "^1.22.1",
|
||||
"typescript": "^4.6.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"typescript": "^4.6.4"
|
||||
"@calcom/embed-snippet": "1.0.1-beta.10",
|
||||
"@calcom/embed-core": "1.1.0-beta.10"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CalWindow } from "@calcom/embed-snippet";
|
||||
import { CalWindow } from "@calcom/embed-core";
|
||||
|
||||
import Cal from "./Cal";
|
||||
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
"@lib/*": ["../../../apps/web/lib/*"]
|
||||
}
|
||||
},
|
||||
"include": ["."],
|
||||
"include": ["src","env.d.ts"],
|
||||
"exclude": ["dist", "build", "node_modules", "test-cal.tsx"]
|
||||
}
|
||||
@@ -2,10 +2,12 @@ import react from "@vitejs/plugin-react";
|
||||
import path from "path";
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
import viteBaseConfig from "../vite.config";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
...viteBaseConfig,
|
||||
plugins: [react()],
|
||||
envPrefix: "NEXT_PUBLIC_",
|
||||
build: {
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, "src/index.ts"),
|
||||
|
||||
Reference in new issue
Block a user