saleor-apps-redis_apl/apps/crm/next.config.js

45 lines
1.1 KiB
JavaScript
Raw Normal View History

Introduce CRM App (#292) * Add template Cleanup Update queries Basic mailchimp client Add Oauth flow remove next auth * Auth flow, mailchimp button * Basic layouts * session saver for appbridge * ideas drop * basic iframe flow * iframe flow - with post message * saving token in backend * saving token in backend * Extracted settings manager * Refactor audience router * Remove old macaw ui * Nav and layout * display lists and wip add customer * Metadata updater * Allow iframe to NOT have app layout * Add segment coming soon * App layout * Add removing config button * Add iframe * Fix postmessages * Display lists * webhook settings * Connect webhook * remove comment * batch customer adding client * Update macaw * Fetching customers component * Add bulk sync * add temp ts-ignore until macaw is fixed * Improve ui * redesign * Extract sections * Redesign mailchimp login * Refactor sections * Extract mailchimp list picker * Add name mapping * WIP tags, extracted colocated queries to folders * Wip - not working CustomerUpdated subs * Add instructions * Fix webhook config state * Add external links * envs * Protected Oauth handler * Fix instructions * Squash some todos * Instructions update with gql * empty trygger * Add env validation * Fix error message * Update macaw and remove todos * Add metadata manager test * Replace Mailchimp enum to lowercase * Update oauth routes * Fix typo * Add loader to removing config box * Update labeler to include CRM app * Apply suggestions from CR * Fix linter
2023-04-06 07:26:56 +00:00
const { z } = require("zod");
const { withSentryConfig } = require("@sentry/nextjs");
Introduce CRM App (#292) * Add template Cleanup Update queries Basic mailchimp client Add Oauth flow remove next auth * Auth flow, mailchimp button * Basic layouts * session saver for appbridge * ideas drop * basic iframe flow * iframe flow - with post message * saving token in backend * saving token in backend * Extracted settings manager * Refactor audience router * Remove old macaw ui * Nav and layout * display lists and wip add customer * Metadata updater * Allow iframe to NOT have app layout * Add segment coming soon * App layout * Add removing config button * Add iframe * Fix postmessages * Display lists * webhook settings * Connect webhook * remove comment * batch customer adding client * Update macaw * Fetching customers component * Add bulk sync * add temp ts-ignore until macaw is fixed * Improve ui * redesign * Extract sections * Redesign mailchimp login * Refactor sections * Extract mailchimp list picker * Add name mapping * WIP tags, extracted colocated queries to folders * Wip - not working CustomerUpdated subs * Add instructions * Fix webhook config state * Add external links * envs * Protected Oauth handler * Fix instructions * Squash some todos * Instructions update with gql * empty trygger * Add env validation * Fix error message * Update macaw and remove todos * Add metadata manager test * Replace Mailchimp enum to lowercase * Update oauth routes * Fix typo * Add loader to removing config box * Update labeler to include CRM app * Apply suggestions from CR * Fix linter
2023-04-06 07:26:56 +00:00
const RequiredEnvs = z.object({
MAILCHIMP_CLIENT_ID: z.string().min(5),
MAILCHIMP_CLIENT_SECRET: z.string().min(5),
});
/** @type {import('next').NextConfig} */
const nextConfig = () => {
Introduce CRM App (#292) * Add template Cleanup Update queries Basic mailchimp client Add Oauth flow remove next auth * Auth flow, mailchimp button * Basic layouts * session saver for appbridge * ideas drop * basic iframe flow * iframe flow - with post message * saving token in backend * saving token in backend * Extracted settings manager * Refactor audience router * Remove old macaw ui * Nav and layout * display lists and wip add customer * Metadata updater * Allow iframe to NOT have app layout * Add segment coming soon * App layout * Add removing config button * Add iframe * Fix postmessages * Display lists * webhook settings * Connect webhook * remove comment * batch customer adding client * Update macaw * Fetching customers component * Add bulk sync * add temp ts-ignore until macaw is fixed * Improve ui * redesign * Extract sections * Redesign mailchimp login * Refactor sections * Extract mailchimp list picker * Add name mapping * WIP tags, extracted colocated queries to folders * Wip - not working CustomerUpdated subs * Add instructions * Fix webhook config state * Add external links * envs * Protected Oauth handler * Fix instructions * Squash some todos * Instructions update with gql * empty trygger * Add env validation * Fix error message * Update macaw and remove todos * Add metadata manager test * Replace Mailchimp enum to lowercase * Update oauth routes * Fix typo * Add loader to removing config box * Update labeler to include CRM app * Apply suggestions from CR * Fix linter
2023-04-06 07:26:56 +00:00
try {
RequiredEnvs.parse(process.env);
} catch (e) {
console.error("🚫 Missing required env variables, see message below");
console.error(e.issues);
process.exit(1);
}
return {
reactStrictMode: true,
transpilePackages: ["@saleor/apps-shared"],
};
};
const isSentryPropertiesInEnvironment =
process.env.SENTRY_AUTH_TOKEN && process.env.SENTRY_PROJECT && process.env.SENTRY_ORG;
const configWithSentry = withSentryConfig(
nextConfig,
{
silent: true,
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
},
{
widenClientFileUpload: true,
transpileClientSDK: true,
tunnelRoute: "/monitoring",
hideSourceMaps: true,
disableLogger: true,
}
);
module.exports = isSentryPropertiesInEnvironment ? configWithSentry : nextConfig;