update Next.JS to latest

This commit is contained in:
Aarni Halinen
2025-04-09 10:41:43 +03:00
parent aea9563a0f
commit d308d27727
9 changed files with 7543 additions and 2127 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
+6 -16
View File
@@ -3,19 +3,7 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
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
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
};
module.exports = withBundleAnalyzer(withSentryConfig({
const nextConfig = {
images: {
domains: [
"api.sahkoinsinoorikilta.fi",
@@ -23,7 +11,9 @@ module.exports = withBundleAnalyzer(withSentryConfig({
"api.dev.sahkoinsinoorikilta.fi",
],
},
sentry: {
};
module.exports = withBundleAnalyzer(withSentryConfig(nextConfig, {
silent: !process.env.CI,
hideSourceMaps: true, // Hide source maps, see: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-source-maps
},
}, sentryWebpackPluginOptions));
}));
+7480 -2059
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -48,11 +48,11 @@
"eslint": "^8.13.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-next": "^13.1.6",
"eslint-config-next": "^15.2.5",
"eslint-plugin-import": "^2.26.0",
"husky": "^7.0.4",
"jest": "^27.5.1",
"next-sitemap": "^3.1.11",
"next-sitemap": "^4.2.3",
"npm-run-all": "^4.1.5",
"postcss-jsx": "^0.36.4",
"postcss-syntax": "^0.36.2",
@@ -64,15 +64,15 @@
"typescript": "^4.6.3"
},
"dependencies": {
"@next/bundle-analyzer": "^12.2.3",
"@next/bundle-analyzer": "^15.2.5",
"@rjsf/core": "^4.2.0",
"@sentry/nextjs": "^7.34.0",
"@sentry/nextjs": "^9.12.0",
"axios": "^0.26.1",
"date-fns": "^2.28.0",
"fast-deep-equal": "^3.1.3",
"js-cookie": "^3.0.1",
"lodash": "^4.17.21",
"next": "^13.1.6",
"next": "^15.2.5",
"normalize.css": "^8.0.1",
"react": "^18.2.0",
"react-csv": "^2.2.2",
+16
View File
@@ -0,0 +1,16 @@
// This file configures the initialization of Sentry on the browser.
// The config you add here will be used whenever a page is visited.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from "@sentry/nextjs";
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;
const ENV = process.env.NEXT_PUBLIC_DEPLOY_ENV;
Sentry.init({
dsn: SENTRY_DSN,
environment: ENV,
// Note: if you want to override the automatic release value, do not set a
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
// that it will also get attached to your source maps
});
+12
View File
@@ -0,0 +1,12 @@
import * as Sentry from "@sentry/nextjs";
export const onRequestError = Sentry.captureRequestError;
export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
await import("../sentry.server.config");
}
if (process.env.NEXT_RUNTIME === "edge") {
await import("../sentry.edge.config");
}
}
+14 -37
View File
@@ -6,10 +6,7 @@
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "preserve",
"lib": [
"dom",
"esnext"
],
"lib": ["dom", "esnext"],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
@@ -22,36 +19,17 @@
"sourceMap": true,
"strict": false, // TODO: switch true
"target": "esnext",
"typeRoots": [
"types",
"node_modules/@types"
],
"typeRoots": ["types", "node_modules/@types"],
"baseUrl": "./",
"paths": {
"@api/*": [
"src/api/*"
],
"@components/*": [
"src/components/*"
],
"@hooks/*": [
"src/hooks/*"
],
"@models/*": [
"src/models/*"
],
"@pages/*": [
"src/pages/*"
],
"@theme/*": [
"src/theme/*"
],
"@views/*": [
"src/views/*"
],
"@utils/*": [
"src/utils/*"
]
"@api/*": ["src/api/*"],
"@components/*": ["src/components/*"],
"@hooks/*": ["src/hooks/*"],
"@models/*": ["src/models/*"],
"@pages/*": ["src/pages/*"],
"@theme/*": ["src/theme/*"],
"@views/*": ["src/views/*"],
"@utils/*": ["src/utils/*"]
},
"incremental": true
},
@@ -63,10 +41,9 @@
"next.config.js",
"jest.config.js",
".eslintrc.js",
"sentry.client.config.js",
"sentry.server.config.js"
"sentry.client.config.ts",
"sentry.edge.config.ts",
"sentry.server.config.ts"
],
"exclude": [
"node_modules"
]
"exclude": ["node_modules"]
}