Skip to content

Commit 65dd6cd

Browse files
committed
feat: alyout
Signed-off-by: Innei <[email protected]>
1 parent 302db77 commit 65dd6cd

26 files changed

+842
-178
lines changed

.npmrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# https://zenn.dev/haxibami/scraps/083718c1beec04
2+
strict-peer-dependencies=false
3+
4+
registry=https://registry.npmjs.org

global.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ declare global {
1414
PropsWithChildren
1515
>
1616
}
17+
18+
1719
export {}

next.config.mts

+72-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,83 @@
1+
import { config } from 'dotenv'
12
import type { NextConfig } from 'next'
23

4+
import { withSentryConfig } from '@sentry/nextjs'
5+
import { sentryWebpackPlugin } from '@sentry/webpack-plugin'
36
import { createVanillaExtractPlugin } from '@vanilla-extract/next-plugin'
47

58
const withVanillaExtract = createVanillaExtractPlugin()
69

7-
/** @type {import('next').NextConfig} */
8-
const nextConfig: NextConfig = {
10+
process.title = 'Kami (NextJS)'
11+
12+
const env = config().parsed || {}
13+
const isProd = process.env.NODE_ENV === 'production'
14+
15+
// eslint-disable-next-line import/no-mutable-exports
16+
let nextConfig: NextConfig = {
917
experimental: {
1018
appDir: true,
1119
},
20+
webpack: (config, options) => {
21+
if (
22+
process.env.SENTRY === 'true' &&
23+
process.env.NEXT_PUBLIC_SENTRY_DSN &&
24+
isProd
25+
) {
26+
config.plugins.push(
27+
sentryWebpackPlugin({
28+
include: '.next',
29+
ignore: ['node_modules', 'cypress', 'test'],
30+
urlPrefix: '~/_next',
31+
32+
org: 'inneis-site',
33+
headers: {
34+
Authorization: `DSN ${process.env.NEXT_PUBLIC_SENTRY_DSN}`,
35+
},
36+
project: 'kami',
37+
}),
38+
)
39+
}
40+
41+
return config
42+
},
1243
}
1344

14-
export default withVanillaExtract(nextConfig)
45+
if (process.env.SENTRY === 'true' && isProd) {
46+
// @ts-expect-error
47+
nextConfig = withSentryConfig(
48+
nextConfig,
49+
{
50+
// For all available options, see:
51+
// https://github.com/getsentry/sentry-webpack-plugin#options
52+
53+
// Suppresses source map uploading logs during build
54+
silent: true,
55+
56+
org: 'inneis-site',
57+
project: 'springtide',
58+
},
59+
{
60+
// For all available options, see:
61+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
62+
63+
// Upload a larger set of source maps for prettier stack traces (increases build time)
64+
widenClientFileUpload: true,
65+
66+
// Transpiles SDK to be compatible with IE11 (increases bundle size)
67+
transpileClientSDK: true,
68+
69+
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
70+
tunnelRoute: '/monitoring',
71+
72+
// Hides source maps from generated client bundles
73+
hideSourceMaps: true,
74+
75+
// Automatically tree-shake Sentry logger statements to reduce bundle size
76+
disableLogger: true,
77+
},
78+
)
79+
}
80+
81+
nextConfig = withVanillaExtract(nextConfig)
82+
83+
export default nextConfig

package.json

+3-9
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@
66
"engines": {
77
"node": ">=14"
88
},
9-
"pnpm": {
10-
"peerDependencyRules": {
11-
"ignoreMissing": [
12-
"react",
13-
"next-pwa",
14-
"next"
15-
]
16-
}
17-
},
189
"bump": {
1910
"before": [
2011
"git pull --rebase",
@@ -59,13 +50,16 @@
5950
"@formkit/auto-animate": "1.0.0-beta.6",
6051
"@headlessui/react": "1.7.15",
6152
"@mx-space/api-client": "1.4.1",
53+
"@sentry/nextjs": "7.53.1",
54+
"@sentry/webpack-plugin": "2.2.1",
6255
"@tanstack/react-query": "4.29.12",
6356
"@tanstack/react-query-devtools": "4.29.12",
6457
"@tanstack/react-query-persist-client": "4.29.12",
6558
"axios": "1.4.0",
6659
"clsx": "1.2.1",
6760
"daisyui": "3.0.25",
6861
"dayjs": "1.11.8",
62+
"foxact": "0.2.8",
6963
"framer-motion": "^10.12.16",
7064
"idb-keyval": "6.2.1",
7165
"immer": "^10.0.2",

0 commit comments

Comments
 (0)