Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
20
11 changes: 10 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ export default {
docs: {
autodocs: true
},
typescript: {
check: false,
checkOptions: {},
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
},
},
webpackFinal: async (config) => {
if (config.resolve) {
config.resolve.plugins = [
Expand All @@ -34,4 +43,4 @@ export default {
}
return config;
}
} satisfies StorybookConfig;
} satisfies StorybookConfig;
3 changes: 2 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[build]
publish = ".next"
command = "NODE_OPTIONS=--max_old_space_size=4096 npm run build"

[[plugins]]
package = "@netlify/plugin-nextjs"
Expand All @@ -18,4 +19,4 @@
"node_modules/next/dist/server/future/route-modules/pages/vendored/contexts/router-context*",
"node_modules/next/dist/server/future/route-modules/pages/vendored/contexts/amp-context*",
"node_modules/next/dist/server/future/route-modules/pages/vendored/contexts/head-manager-context*",
]
]
35 changes: 33 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true"
});

// Initialize Sentry for frontend error tracking
const { withSentryConfig } = require("@sentry/nextjs");

/**
* @type {import('next').NextConfig}
*/
Expand Down Expand Up @@ -93,7 +96,35 @@ const config = {
esmExternals: "loose",
optimizePackageImports: ["@flanksource/icons"]
},
transpilePackages: ["monaco-editor"]
transpilePackages: ["monaco-editor"],
sentry: {
// Use `hidden-source-map` rather than `source-map` as the Webpack `devtool`
// for client-side builds. (This will be the default starting in
// `@sentry/nextjs` version 8.0.0.) See:
// https://webpack.js.org/configuration/devtool/
//
// You can also use `hidden-nosources-source-map` to hide the source maps
// completely, but still get stack traces.
hideSourceMaps: true,

// This option will automatically add release information to your
// Sentry events.
autoInstrumentServerFunctions: true,
}
};

// Make sure adding Sentry options is the last code to run before exporting
const sentryWebpackPluginOptions = {
// Additional config options for the Sentry webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
silent: true, // Suppresses all logs
};

module.exports = withBundleAnalyzer(config);
// Export modified config - first with bundle analyzer, then with Sentry
module.exports = withSentryConfig(
withBundleAnalyzer(config),
sentryWebpackPluginOptions
);
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@next/bundle-analyzer": "^14.2.5",
"@ory/client": "^1.2.11",
"@ory/integrations": "^1.1.5",
"@sentry/nextjs": "^7.101.1",
"@storybook/client-api": "^7.6.17",
"@storybook/theming": "^7.6.17",
"@tailwindcss/forms": "^0.5.2",
Expand Down Expand Up @@ -104,7 +105,7 @@
"yup": "^0.32.11"
},
"dependecyComments": {
"@headlessui/react": "We are using insiders version to use `by` property on `Combobox`. Without `by`, selected item logic was difficult to achieve.",
"@headlressui/react": "We are using insiders version to headlessui/react, for the `by` property on `Combobox`. Without `by`, selected item logic was difficult to achieve.",
"@tanstack/react-query-devtools": "React Query Devtools are only included in bundles when process.env.NODE_ENV === 'development', so we don't have to exclude it from production build. Check it's docs."
},
"proxy": "https://incident-commander.canary.lab.flanksource.com",
Expand Down Expand Up @@ -223,4 +224,4 @@
"msw": {
"workerDirectory": "public"
}
}
}
30 changes: 30 additions & 0 deletions sentry.client.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// This file configures the initialization of Sentry on the client.
// The config you add here will be used whenever a users loads a page in their browser.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,

// Adjust this value in production, or use tracesSampler for finer control
tracesSampleRate: 1,

// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,

replaysOnErrorSampleRate: 1.0,

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,

// You can remove this option if you're not planning to use the Sentry Session Replay feature:
integrations: [
new Sentry.Replay({
// Additional Replay configuration goes here, for example:
maskAllText: true,
blockAllMedia: true,
}),
],
});
16 changes: 16 additions & 0 deletions sentry.edge.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).
// The config you add here will be used whenever one of the edge features is loaded.
// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,

// Adjust this value in production, or use tracesSampler for finer control
tracesSampleRate: 1,

// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
});
15 changes: 15 additions & 0 deletions sentry.server.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// This file configures the initialization of Sentry on the server.
// The config you add here will be used whenever the server handles a request.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,

// Adjust this value in production, or use tracesSampler for finer control
tracesSampleRate: 1,

// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
});
Loading