From 0aa1628925288d18bed9e00e30f74786fe12d117 Mon Sep 17 00:00:00 2001 From: Morgan <33722304+ThyMinimalDev@users.noreply.github.com> Date: Thu, 18 Apr 2024 10:30:34 +0300 Subject: [PATCH] chore: atoms 1.0.29 + fix typing issues (#14633) --- packages/platform/atoms/package.json | 2 +- packages/platform/atoms/tsconfig.json | 30 ++++++++++++++++++++++-- packages/platform/atoms/vite.config.ts | 32 ++++++++++++++++++++++---- 3 files changed, 57 insertions(+), 7 deletions(-) diff --git a/packages/platform/atoms/package.json b/packages/platform/atoms/package.json index 5ccfb7acc0..cb0a3b9394 100644 --- a/packages/platform/atoms/package.json +++ b/packages/platform/atoms/package.json @@ -4,7 +4,7 @@ "type": "module", "description": "Customizable UI components to integrate scheduling into your product.", "authors": "Cal.com, Inc.", - "version": "1.0.23", + "version": "1.0.29", "scripts": { "dev": "yarn vite build --watch & npx tailwindcss -i ./globals.css -o ./globals.min.css --postcss --minify --watch", "build": "yarn vite build && npx tailwindcss -i ./globals.css -o ./globals.min.css --postcss --minify", diff --git a/packages/platform/atoms/tsconfig.json b/packages/platform/atoms/tsconfig.json index 5784f35d72..71da1bd21f 100644 --- a/packages/platform/atoms/tsconfig.json +++ b/packages/platform/atoms/tsconfig.json @@ -4,7 +4,23 @@ "baseUrl": ".", "paths": { "~/*": ["/*"], - "@/*": ["./src/*"] + "@/*": ["./src/*"], + "@calcom/lib": ["../../lib"], + "@calcom/lib/*": ["../../lib/*"], + "@calcom/features": ["../../features"], + "@calcom/features/*": ["../../features/*"], + "@calcom/prisma": ["../../prisma"], + "@calcom/dayjs": ["../../dayjs"], + "@calcom/prisma/*": ["../../prisma/*"], + "@calcom/dayjs/*": ["../../dayjs/*"], + "@calcom/platform-constants": ["../constants/index.ts"], + "@calcom/platform-types": ["../types/index.ts"], + "@calcom/platform-libraries": ["../libraries/index.ts"], + "@calcom/platform-utils": ["../constants/index.ts"], + "@calcom/trpc": ["../../trpc"], + "@calcom/app-store": ["../../app-store"], + "@calcom/app-store/*": ["../../app-store/*"], + "@calcom/trpc/*": ["../../trpc/*"] }, "resolveJsonModule": true, "outDir": "./dist" @@ -15,7 +31,17 @@ "../../types/next.d.ts", "../../types/@wojtekmaj__react-daterange-picker.d.ts", "../../types/business-days-plugin.d.ts", - "../../types/window.d.ts" + "../../types/window.d.ts", + "../../lib", + "../../features", + "../types", + "../constants", + "../utils", + "../libraries", + "../../prisma", + "../../dayjs", + "../../trpc", + "../../app-store" ], "exclude": ["dist", "build", "node_modules"] } diff --git a/packages/platform/atoms/vite.config.ts b/packages/platform/atoms/vite.config.ts index 562170b1da..8d57b15e70 100644 --- a/packages/platform/atoms/vite.config.ts +++ b/packages/platform/atoms/vite.config.ts @@ -5,15 +5,30 @@ import { defineConfig } from "vite"; import dts from "vite-plugin-dts"; export default defineConfig({ - plugins: [react(), dts()], + optimizeDeps: { + include: [ + "@calcom/lib", + "@calcom/features", + "@calcom/prisma", + "@calcom/dayjs", + "@calcom/platform-constants", + "@calcom/platform-types", + "@calcom/platform-libraries", + "@calcom/platform-utils", + ], + }, + plugins: [react(), dts({ insertTypesEntry: true })], build: { + commonjsOptions: { + include: [/@calcom\/lib/, /@calcom\/features/, /node_modules/], + }, lib: { entry: [resolve(__dirname, "index.ts")], name: "CalAtoms", fileName: "cal-atoms", }, rollupOptions: { - external: ["react", "fs", "path", "os", "react-dom"], + external: ["react", "fs", "path", "os", "react-dom", "@calcom/lib", "@calcom/features"], output: { globals: { react: "React", @@ -28,8 +43,17 @@ export default defineConfig({ path: resolve("../../../node_modules/rollup-plugin-node-builtins"), os: resolve("../../../node_modules/rollup-plugin-node-builtins"), "@": path.resolve(__dirname, "./src"), - "@calcom/lib": path.resolve(__dirname, "../../lib"), - "@calcom/platform-constants": resolve("../constants/index.ts"), + + "@calcom/prisma": path.resolve(__dirname, "../../prisma"), + "@calcom/dayjs": path.resolve(__dirname, "../../dayjs"), + "@calcom/platform-constants": path.resolve(__dirname, "../constants/index.ts"), + "@calcom/platform-types": path.resolve(__dirname, "../types/index.ts"), + "@calcom/platform-libraries": path.resolve(__dirname, "../libraries/index.ts"), + "@calcom/platform-utils": path.resolve(__dirname, "../constants/index.ts"), + "@calcom/web/public/static/locales/en/common.json": path.resolve( + __dirname, + "../../../apps/web/public/static/locales/en/common.json" + ), }, }, });