ab21c7f805
* feat: Cal.diy — community-driven MIT-licensed fork of Cal.com This squashed commit contains all Cal.diy changes applied on top of calcom/cal.com main: - Rebrand Cal.com to Cal.diy across the entire codebase - Remove Enterprise Edition (EE) features, license checks, and AGPL restrictions - Switch license from AGPL-3.0 to MIT - Remove docs/ directory (migrated to Nextra at cal.diy) - Remove dead code: org tests, EE tips, platform nav, premium username, SAML/SSO, etc. - Clean up .env.example for self-hosted Cal.diy - Update Docker image references to calcom/cal.diy - Update README, CONTRIBUTING.md, and issue templates for Cal.diy community fork - Add PR welcome bot for Cal.diy contributors - Fix API v2 breaking changes oasdiff ignore entries - Replace Blacksmith CI runners with default GitHub Actions 3893 files changed, 20789 insertions(+), 411020 deletions(-) Co-Authored-By: benny@cal.com <sldisek783@gmail.com> * refactor: remove org-specific /organizations/:orgId endpoints from API v2 atoms controllers (#1701) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: revert Cal.diy Inc to Cal.com, Inc. in license files, copyright notices, and package metadata (#1702) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * rip out org related comments in api v2 --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
207 lines
7.2 KiB
TypeScript
207 lines
7.2 KiB
TypeScript
import { defineWorkspace } from "vitest/config";
|
|
|
|
// Vitest 4.0 no longer allows custom CLI flags, so we use environment variables instead
|
|
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
const packagedEmbedTestsOnly = process.env.VITEST_MODE === "packaged-embed";
|
|
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
const timeZoneDependentTestsOnly = process.env.VITEST_MODE === "timezone";
|
|
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
const integrationTestsOnly = process.env.VITEST_MODE === "integration";
|
|
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
const envTZ = process.env.TZ;
|
|
if (timeZoneDependentTestsOnly && !envTZ) {
|
|
throw new Error("TZ environment variable is not set");
|
|
}
|
|
|
|
// Use pool: "forks" to prevent "Closing rpc while fetch was pending" errors.
|
|
const pool = "forks" as const;
|
|
|
|
const workspaces = packagedEmbedTestsOnly
|
|
? [
|
|
{
|
|
test: {
|
|
name: "PackagedEmbedTests",
|
|
include: ["packages/embeds/**/packaged/**/*.{test,spec}.{ts,js}"],
|
|
environment: "jsdom",
|
|
pool,
|
|
},
|
|
},
|
|
]
|
|
: integrationTestsOnly
|
|
? [
|
|
{
|
|
test: {
|
|
name: `IntegrationTests`,
|
|
include: ["packages/**/*.integration-test.ts", "apps/**/*.integration-test.ts"],
|
|
exclude: ["**/node_modules/**/*", "packages/embeds/**/*"],
|
|
setupFiles: ["packages/testing/src/setupVitest.ts"],
|
|
pool,
|
|
},
|
|
},
|
|
]
|
|
: // It doesn't seem to be possible to fake timezone per test, so we rerun the entire suite with different TZ. See https://github.com/vitest-dev/vitest/issues/1575#issuecomment-1439286286
|
|
timeZoneDependentTestsOnly
|
|
? [
|
|
{
|
|
test: {
|
|
name: `TimezoneDependentTests:${envTZ}`,
|
|
include: ["packages/**/*.timezone.test.ts", "apps/**/*.timezone.test.ts"],
|
|
// TODO: Ignore the api until tests are fixed
|
|
exclude: ["**/node_modules/**/*", "packages/embeds/**/*"],
|
|
setupFiles: ["packages/testing/src/setupVitest.ts"],
|
|
pool,
|
|
},
|
|
},
|
|
]
|
|
: [
|
|
{
|
|
test: {
|
|
include: ["packages/**/*.{test,spec}.{ts,js}", "apps/**/*.{test,spec}.{ts,js}"],
|
|
exclude: [
|
|
"**/node_modules/**/*",
|
|
"**/.next/**/*",
|
|
"packages/embeds/**/*",
|
|
"packages/lib/hooks/**/*",
|
|
"packages/platform/**/*",
|
|
"apps/api/v2/**/*",
|
|
],
|
|
name: "@calcom/lib",
|
|
setupFiles: ["packages/testing/src/setupVitest.ts"],
|
|
pool,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@lib": new URL("./apps/web/lib", import.meta.url).pathname,
|
|
"@server": new URL("./apps/web/server", import.meta.url).pathname,
|
|
"@components": new URL("./apps/web/components", import.meta.url).pathname,
|
|
"@pages": new URL("./apps/web/pages", import.meta.url).pathname,
|
|
"~": new URL("./apps/web/modules", import.meta.url).pathname,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
globals: true,
|
|
name: "@calcom/features",
|
|
include: ["packages/features/**/*.{test,spec}.tsx"],
|
|
exclude: ["packages/features/form-builder/**/*", "packages/features/bookings/**/*"],
|
|
environment: "jsdom",
|
|
setupFiles: ["setupVitest.ts", "packages/ui/components/test-setup.tsx"],
|
|
pool,
|
|
},
|
|
},
|
|
|
|
{
|
|
test: {
|
|
name: "@calcom/closecom",
|
|
include: ["packages/app-store/closecom/**/*.{test,spec}.{ts,js}"],
|
|
environment: "jsdom",
|
|
setupFiles: ["packages/app-store/closecom/test/globals.ts"],
|
|
pool,
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
globals: true,
|
|
name: "@calcom/app-store-core",
|
|
include: ["packages/app-store/*.{test,spec}.[jt]s?(x)"],
|
|
exclude: ["packages/app-store/delegationCredential.test.ts"],
|
|
environment: "jsdom",
|
|
setupFiles: ["packages/ui/components/test-setup.tsx"],
|
|
pool,
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
globals: true,
|
|
name: "@calcom/app-store-delegation-credential",
|
|
include: ["packages/app-store/delegationCredential.test.ts"],
|
|
environment: "node",
|
|
setupFiles: ["packages/testing/src/setupVitest.ts"],
|
|
pool,
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
globals: true,
|
|
name: "@calcom/ui",
|
|
include: ["packages/ui/components/**/*.{test,spec}.[jt]s?(x)"],
|
|
environment: "jsdom",
|
|
setupFiles: ["packages/ui/components/test-setup.tsx"],
|
|
pool,
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
globals: true,
|
|
name: "@calcom/features/form-builder",
|
|
include: ["packages/features/form-builder/**/*.{test,spec}.[jt]sx"],
|
|
environment: "jsdom",
|
|
setupFiles: ["packages/ui/components/test-setup.tsx"],
|
|
pool,
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
globals: true,
|
|
name: "@calcom/features/bookings",
|
|
include: ["packages/features/bookings/**/*.{test,spec}.[jt]sx"],
|
|
environment: "jsdom",
|
|
setupFiles: ["packages/ui/components/test-setup.tsx"],
|
|
pool,
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
globals: true,
|
|
name: "@calcom/web/components",
|
|
include: ["apps/web/components/**/*.{test,spec}.[jt]sx"],
|
|
environment: "jsdom",
|
|
setupFiles: ["packages/ui/components/test-setup.tsx"],
|
|
pool,
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
globals: true,
|
|
name: "EventTypeAppCardInterface components",
|
|
include: ["packages/app-store/_components/**/*.{test,spec}.[jt]s?(x)"],
|
|
environment: "jsdom",
|
|
setupFiles: ["packages/app-store/test-setup.ts"],
|
|
pool,
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
name: "@calcom/packages/lib/hooks",
|
|
include: ["packages/lib/hooks/**/*.{test,spec}.{ts,js}"],
|
|
environment: "jsdom",
|
|
setupFiles: [],
|
|
pool,
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
globals: true,
|
|
environment: "jsdom",
|
|
name: "@calcom/web/modules/views",
|
|
include: ["apps/web/modules/**/*.{test,spec}.tsx"],
|
|
setupFiles: ["apps/web/modules/test-setup.ts"],
|
|
pool,
|
|
},
|
|
},
|
|
|
|
{
|
|
test: {
|
|
globals: true,
|
|
environment: "jsdom",
|
|
name: "@calcom/embeds",
|
|
include: ["packages/embeds/**/*.{test,spec}.{ts,js}"],
|
|
exclude: ["packages/embeds/**/packaged/**/*.{test,spec}.{ts,js}"],
|
|
pool,
|
|
},
|
|
},
|
|
];
|
|
|
|
export default defineWorkspace(workspaces);
|