* Fix breadcrumb colors * HorizontalTabs * Team List Item WIP * Horizontal Tabs * Cards * Remove team list item WIP * Login Page * Add welcome back i118n * EventType page work * Update EventType Icons * WIP Availability * Horizontal Tab Work * Add build command for in root * Update build DIr/command * Add Edit Button + change buttons to v2 * Availablitiy page * Fix IPAD * Make mobile look a little nicer * WIP bookingshell * Remove list items from breaking build * Mian bulk of Booking Page. * Few updates to components * Fix chormatic feedback * Fix banner * Fix Empty Screen * Text area + embded window fixes * Semi fix avatar * Troubleshoot container + Active on count * Improve mobile * NITS * Fix padding on input * Fix icons * Starting to move event types settings to tabs * Begin migration to single page form * Single page tabs * Limits Page * Advanced tab * Add RHF to dependancies * Most of advanced tab * Solved RHF mismtach * Build fixes * RHF conditionals fixes * Improved legibility * Major refactor/organisation into optional V2 UI * Portal EditLocationModal * Fix dialoug form * Update imports * Auto Animate + custom inputs WIP * Custom Inputs * WIP Apps * Fixing stories imports * Stripe app * Remove duplicate dialog * Remove duplicate dialog * Fix embed URL * Fix app toggles + number of active apps * Fix container padding on disabledBorder prop * Removes strict * EventType Team page WIP * Fix embed * NIT * Add Darkmode gray color * V2 Shell WIP * Create my account folder * Add profile section * Fix headings on shell V2 * Fix mobile layout with V2 shell * V2 create event type button * Checked Team Select * Hidden to happen on save - not on toggle * Team Attendee Select animation * WIP * Fix scheduling type and remove multi select label * Fix overflow on teams url * Finish profile fields * Show toast on success * General tab WIP * Even Type move order handles * Add switching of destination calendar * List calendar and delete * Render empty screenwhen no calendars * Fix Embed TS errors * Fix TS errors * Fix Eslint errors * Fix TS errors for UI * Fix ESLINT error * added SidebarCard for promo to v2 and storybook (#3906) Co-authored-by: Julian Benegas <julianbenegas99@gmail.com> Co-authored-by: Alan <alannnc@gmail.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Tooltip Provider - Wrapper due to dep upgrade * public event type list darkmode * V2 Color changes to public booking * Remove unused component * Fix typecheck * Transfer to SSR * Appearance screen made * V2 image uploader * WIP appearance page * Remove unnecessary data from viewer.me * Add profile translations * Add translations to general page * Add calendar switch * Add calendar switch * Add translations to appearance page * Clean up conferencing page * Settings sidebar fixes * Updates middleware * Update SettingsLayout.tsx * Settings layout improvements * Type fix Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: zomars <zomars@me.com> Co-authored-by: Hariom Balhara <hariombalhara@gmail.com> Co-authored-by: Julian Benegas <julianbenegas99@gmail.com> Co-authored-by: Alan <alannnc@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
187 lines
5.2 KiB
JavaScript
187 lines
5.2 KiB
JavaScript
require("dotenv").config({ path: "../../.env" });
|
|
|
|
const withTM = require("next-transpile-modules")([
|
|
"@calcom/app-store",
|
|
"@calcom/core",
|
|
"@calcom/dayjs",
|
|
"@calcom/emails",
|
|
"@calcom/embed-core",
|
|
"@calcom/embed-react",
|
|
"@calcom/embed-snippet",
|
|
"@calcom/features",
|
|
"@calcom/lib",
|
|
"@calcom/prisma",
|
|
"@calcom/trpc",
|
|
"@calcom/ui",
|
|
]);
|
|
|
|
const { withAxiom } = require("next-axiom");
|
|
const { i18n } = require("./next-i18next.config");
|
|
|
|
if (!process.env.NEXTAUTH_SECRET) throw new Error("Please set NEXTAUTH_SECRET");
|
|
if (!process.env.CALENDSO_ENCRYPTION_KEY) throw new Error("Please set CALENDSO_ENCRYPTION_KEY");
|
|
|
|
// So we can test deploy previews preview
|
|
if (process.env.VERCEL_URL && !process.env.NEXT_PUBLIC_WEBAPP_URL) {
|
|
process.env.NEXT_PUBLIC_WEBAPP_URL = "https://" + process.env.VERCEL_URL;
|
|
}
|
|
if (process.env.NEXT_PUBLIC_WEBAPP_URL) {
|
|
process.env.NEXTAUTH_URL = process.env.NEXT_PUBLIC_WEBAPP_URL + "/api/auth";
|
|
}
|
|
if (!process.env.NEXT_PUBLIC_WEBSITE_URL) {
|
|
process.env.NEXT_PUBLIC_WEBSITE_URL = process.env.NEXT_PUBLIC_WEBAPP_URL;
|
|
}
|
|
|
|
if (!process.env.EMAIL_FROM) {
|
|
console.warn(
|
|
"\x1b[33mwarn",
|
|
"\x1b[0m",
|
|
"EMAIL_FROM environment variable is not set, this may indicate mailing is currently disabled. Please refer to the .env.example file."
|
|
);
|
|
}
|
|
|
|
if (!process.env.NEXTAUTH_URL) throw new Error("Please set NEXTAUTH_URL");
|
|
|
|
const validJson = (jsonString) => {
|
|
try {
|
|
const o = JSON.parse(jsonString);
|
|
if (o && typeof o === "object") {
|
|
return o;
|
|
}
|
|
} catch (e) {
|
|
console.error(e);
|
|
}
|
|
return false;
|
|
};
|
|
|
|
if (process.env.GOOGLE_API_CREDENTIALS && !validJson(process.env.GOOGLE_API_CREDENTIALS)) {
|
|
console.warn(
|
|
"\x1b[33mwarn",
|
|
"\x1b[0m",
|
|
'- Disabled \'Google Calendar\' integration. Reason: Invalid value for GOOGLE_API_CREDENTIALS environment variable. When set, this value needs to contain valid JSON like {"web":{"client_id":"<clid>","client_secret":"<secret>","redirect_uris":["<yourhost>/api/integrations/googlecalendar/callback>"]}. You can download this JSON from your OAuth Client @ https://console.cloud.google.com/apis/credentials.'
|
|
);
|
|
}
|
|
|
|
const plugins = [];
|
|
if (process.env.ANALYZE === "true") {
|
|
// only load dependency if env `ANALYZE` was set
|
|
const withBundleAnalyzer = require("@next/bundle-analyzer")({
|
|
enabled: true,
|
|
});
|
|
plugins.push(withBundleAnalyzer);
|
|
}
|
|
|
|
plugins.push(withTM);
|
|
plugins.push(withAxiom);
|
|
|
|
/** @type {import("next").NextConfig} */
|
|
const nextConfig = {
|
|
i18n,
|
|
webpack: (config) => {
|
|
config.resolve.fallback = {
|
|
...config.resolve.fallback, // if you miss it, all the other options in fallback, specified
|
|
// by next.js will be dropped. Doesn't make much sense, but how it is
|
|
fs: false,
|
|
};
|
|
|
|
/**
|
|
* TODO: Find more possible barrels for this project.
|
|
* @see https://github.com/vercel/next.js/issues/12557#issuecomment-1196931845
|
|
**/
|
|
config.module.rules.push({
|
|
test: [/lib\/.*.tsx?/i],
|
|
sideEffects: false,
|
|
});
|
|
|
|
return config;
|
|
},
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: "/:user/avatar.png",
|
|
destination: "/api/user/avatar?username=:user",
|
|
},
|
|
{
|
|
source: "/team/:teamname/avatar.png",
|
|
destination: "/api/user/avatar?teamname=:teamname",
|
|
},
|
|
{
|
|
source: "/forms/:formId",
|
|
destination: "/apps/routing_forms/routing-link/:formId",
|
|
},
|
|
{
|
|
source: "/router",
|
|
destination: "/apps/routing_forms/router",
|
|
},
|
|
/* TODO: have these files being served from another deployment or CDN {
|
|
source: "/embed/embed.js",
|
|
destination: process.env.NEXT_PUBLIC_EMBED_LIB_URL?,
|
|
}, */
|
|
];
|
|
},
|
|
async redirects() {
|
|
const redirects = [
|
|
{
|
|
source: "/settings",
|
|
destination: "/settings/profile",
|
|
permanent: true,
|
|
},
|
|
/* V2 testers get redirected to the new settings */
|
|
{
|
|
source: "/settings/profile",
|
|
has: [{ type: "cookie", key: "calcom-v2-early-access" }],
|
|
destination: "/settings/my-account/profile",
|
|
permanent: false,
|
|
},
|
|
{
|
|
source: "/bookings",
|
|
destination: "/bookings/upcoming",
|
|
permanent: true,
|
|
},
|
|
{
|
|
source: "/call/:path*",
|
|
destination: "/video/:path*",
|
|
permanent: false,
|
|
},
|
|
/* Attempt to mitigate DDoS attack */
|
|
{
|
|
source: "/api/auth/:path*",
|
|
has: [
|
|
{
|
|
type: "query",
|
|
key: "callbackUrl",
|
|
// prettier-ignore
|
|
value: "^(?!https?:\/\/).*$",
|
|
},
|
|
],
|
|
destination: "/404",
|
|
permanent: false,
|
|
},
|
|
];
|
|
|
|
if (process.env.NEXT_PUBLIC_WEBAPP_URL === "https://app.cal.com") {
|
|
redirects.push(
|
|
{
|
|
source: "/apps/dailyvideo",
|
|
destination: "/apps/daily-video",
|
|
permanent: true,
|
|
},
|
|
{
|
|
source: "/apps/huddle01_video",
|
|
destination: "/apps/huddle01",
|
|
permanent: true,
|
|
},
|
|
{
|
|
source: "/apps/jitsi_video",
|
|
destination: "/apps/jitsi",
|
|
permanent: true,
|
|
}
|
|
);
|
|
}
|
|
|
|
return redirects;
|
|
},
|
|
};
|
|
|
|
module.exports = () => plugins.reduce((acc, next) => next(acc), nextConfig);
|