@berachain/config 0.1.18-beta.1 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bepolia.cjs +1 -8
- package/dist/bepolia.mjs +1 -8
- package/dist/chunk-276AZYTL.cjs +1 -0
- package/dist/chunk-2HIIMZE4.cjs +1 -0
- package/dist/chunk-2OLL4MUY.cjs +1 -0
- package/dist/chunk-3KQLFIHT.cjs +2 -0
- package/dist/chunk-3WZ7JUD6.cjs +1 -0
- package/dist/chunk-4EBBM3AH.mjs +1 -0
- package/dist/chunk-4EBC3WWP.mjs +1 -0
- package/dist/chunk-4VDLQK6F.cjs +1 -0
- package/dist/chunk-BWV5APOW.cjs +1 -0
- package/dist/chunk-DL645PXT.mjs +1 -0
- package/dist/chunk-DUO7UEQD.cjs +1 -0
- package/dist/chunk-DVULZ7ID.cjs +1 -0
- package/dist/chunk-FVNATITS.mjs +1 -0
- package/dist/chunk-FZ23S6ID.mjs +1 -0
- package/dist/chunk-JYSZ2GU3.cjs +1 -0
- package/dist/chunk-JZXLCA2E.mjs +1 -0
- package/dist/chunk-LCQFSMRO.mjs +1 -0
- package/dist/chunk-MB5HZZ3S.mjs +1 -0
- package/dist/chunk-MS6UGFXI.mjs +1 -0
- package/dist/chunk-O243TIHY.mjs +1 -0
- package/dist/chunk-S2A3Z34I.mjs +2 -0
- package/dist/chunk-S5CMEFTY.cjs +1 -0
- package/dist/chunk-VPOS7FPU.cjs +1 -0
- package/dist/chunk-XO2H4NRK.mjs +1 -0
- package/dist/index.cjs +1 -11
- package/dist/index.mjs +1 -11
- package/dist/internal/edge-config/index.cjs +1 -37
- package/dist/internal/edge-config/index.d.cts +0 -30
- package/dist/internal/edge-config/index.d.ts +0 -30
- package/dist/internal/edge-config/index.mjs +1 -37
- package/dist/internal/flags/index.cjs +1 -199
- package/dist/internal/flags/index.mjs +1 -199
- package/dist/internal/header-sources.cjs +11 -283
- package/dist/internal/header-sources.mjs +11 -283
- package/dist/internal/index.cjs +1 -40
- package/dist/internal/index.d.cts +8 -2
- package/dist/internal/index.d.ts +8 -2
- package/dist/internal/index.mjs +1 -40
- package/dist/internal/maintenance.cjs +1 -26
- package/dist/internal/maintenance.mjs +1 -26
- package/dist/internal/nextjs/index.cjs +1 -85
- package/dist/internal/nextjs/index.mjs +1 -85
- package/dist/internal/nextjs/utils/index.cjs +1 -39
- package/dist/internal/nextjs/utils/index.mjs +1 -39
- package/dist/internal/sentry/index.cjs +1 -11
- package/dist/internal/sentry/index.mjs +1 -11
- package/dist/internal/sentry/sentry.client.config.cjs +1 -67
- package/dist/internal/sentry/sentry.client.config.mjs +1 -67
- package/dist/internal/tailwind/index.cjs +1 -239
- package/dist/internal/tailwind/index.mjs +1 -239
- package/dist/internal/tsup/index.cjs +1 -73
- package/dist/internal/tsup/index.mjs +1 -73
- package/dist/internal/wagmi/index.cjs +1 -60
- package/dist/internal/wagmi/index.mjs +1 -60
- package/dist/mainnet.cjs +1 -10
- package/dist/mainnet.d.cts +4 -1
- package/dist/mainnet.d.ts +4 -1
- package/dist/mainnet.mjs +1 -10
- package/dist/sentry.edge.config-DS2KE3CX.cjs +1 -0
- package/dist/sentry.edge.config-OEQTPQ2L.mjs +1 -0
- package/dist/sentry.server.config-KRS7OUMO.mjs +1 -0
- package/dist/sentry.server.config-RNY6FTJT.cjs +1 -0
- package/package.json +1 -1
- package/dist/chunk-2BJ55Y5U.cjs +0 -166
- package/dist/chunk-2JZ7QJEW.cjs +0 -84
- package/dist/chunk-2XYRGOX3.mjs +0 -64
- package/dist/chunk-3K6IUX3G.mjs +0 -25
- package/dist/chunk-4H4HDUCC.mjs +0 -179
- package/dist/chunk-6TL5ZQOM.cjs +0 -75
- package/dist/chunk-75ZPJI57.cjs +0 -9
- package/dist/chunk-7P6ASYW6.mjs +0 -9
- package/dist/chunk-ADH7F47T.cjs +0 -26
- package/dist/chunk-AP2XG6GJ.mjs +0 -84
- package/dist/chunk-BM46XQJA.mjs +0 -55
- package/dist/chunk-CAOMAWN5.mjs +0 -26
- package/dist/chunk-EYYJ2UZT.cjs +0 -10
- package/dist/chunk-FNTZIXS7.cjs +0 -179
- package/dist/chunk-FOUI63VD.mjs +0 -138
- package/dist/chunk-HJXRHQST.mjs +0 -166
- package/dist/chunk-KJXYSGNH.mjs +0 -10
- package/dist/chunk-LALEUPWL.mjs +0 -8
- package/dist/chunk-NQ3UKQHW.mjs +0 -75
- package/dist/chunk-NX4FI7G3.cjs +0 -64
- package/dist/chunk-ONKAV4AG.cjs +0 -25
- package/dist/chunk-REBIMTSJ.cjs +0 -138
- package/dist/chunk-WRTYGXJM.cjs +0 -55
- package/dist/chunk-YT7WZDGI.cjs +0 -8
- package/dist/sentry.edge.config-F4334LEP.cjs +0 -24
- package/dist/sentry.edge.config-JU55FF2U.mjs +0 -24
- package/dist/sentry.server.config-KFRT37Q3.cjs +0 -24
- package/dist/sentry.server.config-M77KFJ6J.mjs +0 -24
|
@@ -1,288 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
sentryRelease
|
|
4
|
-
} from "../chunk-3K6IUX3G.mjs";
|
|
5
|
-
import {
|
|
6
|
-
getUriFromLink
|
|
7
|
-
} from "../chunk-LALEUPWL.mjs";
|
|
8
|
-
import {
|
|
9
|
-
chainConfigs
|
|
10
|
-
} from "../chunk-FOUI63VD.mjs";
|
|
11
|
-
import "../chunk-4H4HDUCC.mjs";
|
|
12
|
-
import "../chunk-HJXRHQST.mjs";
|
|
13
|
-
import {
|
|
14
|
-
alchemyJsonRpcUrl,
|
|
15
|
-
goldskyBaseUrl,
|
|
16
|
-
imageBaseUrl,
|
|
17
|
-
jsonRpcUrl,
|
|
18
|
-
publicJsonRpcUrl
|
|
19
|
-
} from "../chunk-BM46XQJA.mjs";
|
|
20
|
-
import {
|
|
21
|
-
defaultChainId
|
|
22
|
-
} from "../chunk-CAOMAWN5.mjs";
|
|
23
|
-
import "../chunk-KJXYSGNH.mjs";
|
|
24
|
-
import "../chunk-7P6ASYW6.mjs";
|
|
25
|
-
|
|
26
|
-
// src/internal/sentry/getSentryKeys.ts
|
|
27
|
-
function getSentryKeys({
|
|
28
|
-
dsn = process.env.NEXT_PUBLIC_SENTRY_DSN
|
|
29
|
-
} = {}) {
|
|
30
|
-
if (!dsn) {
|
|
31
|
-
return void 0;
|
|
32
|
-
}
|
|
33
|
-
const re = /^(?:https:\/\/)([A-z0-9]{32})(?::{0,1})([A-z0-9]*)(?:@)(o[a-z0-9]+)(?:\.ingest\.us\.sentry\.io)\/([0-9]{16})/i;
|
|
34
|
-
const match = dsn?.match(re);
|
|
35
|
-
if (!match) {
|
|
36
|
-
return void 0;
|
|
37
|
-
}
|
|
38
|
-
const [
|
|
39
|
-
,
|
|
40
|
-
key,
|
|
41
|
-
// this is a secret stored in a deprecated dns format
|
|
42
|
-
deprecatedSecret,
|
|
43
|
-
org,
|
|
44
|
-
projectId
|
|
45
|
-
] = match;
|
|
46
|
-
const cspEndpoint = new URL(
|
|
47
|
-
`https://${org}.ingest.us.sentry.io/api/${projectId}/security/?sentry_key=${key}`
|
|
48
|
-
);
|
|
49
|
-
cspEndpoint.searchParams.set("sentry_key", key);
|
|
50
|
-
cspEndpoint.searchParams.set("sentry_env", sentryEnvironment);
|
|
51
|
-
cspEndpoint.searchParams.set("sentry_release", sentryRelease);
|
|
52
|
-
return {
|
|
53
|
-
dsn: match[0],
|
|
54
|
-
projectId,
|
|
55
|
-
deprecatedSecret: deprecatedSecret || void 0,
|
|
56
|
-
cspEndpoint,
|
|
57
|
-
org,
|
|
58
|
-
publicKey: match[1]
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// src/internal/header-sources.ts
|
|
63
|
-
function getContentSecurityPolicy({
|
|
64
|
-
isDevelopment,
|
|
65
|
-
nonce,
|
|
66
|
-
cspReporting,
|
|
67
|
-
...args
|
|
68
|
-
}) {
|
|
69
|
-
const defaultSrc = [];
|
|
70
|
-
const config = chainConfigs[defaultChainId];
|
|
71
|
-
const connectionSources = [
|
|
72
|
-
// csp reporting
|
|
73
|
-
"https://*.sentry.io/",
|
|
74
|
-
"https://*.berachain.com/",
|
|
75
|
-
"https://*.berachain-staging.com/",
|
|
76
|
-
"wss://www.walletlink.org/rpc",
|
|
77
|
-
"https://*.thirdweb.com/",
|
|
78
|
-
"https://raw.githubusercontent.com/berachain/metadata/",
|
|
79
|
-
imageBaseUrl,
|
|
80
|
-
// QUICKNODE RPCs
|
|
81
|
-
"https://*.quiknode.pro",
|
|
82
|
-
// Beranames avatar
|
|
83
|
-
"https://beranames-assets-berachain.s3.eu-central-003.backblazeb2.com/",
|
|
84
|
-
goldskyBaseUrl,
|
|
85
|
-
// Subgraph queries are served by same-origin typed REST endpoints under
|
|
86
|
-
// /api/honey/* and /api/pol/* (covered by 'self'), not direct browser
|
|
87
|
-
// requests to the upstream URLs.
|
|
88
|
-
config.pol.bribeBoostApi,
|
|
89
|
-
getUriFromLink(config.api),
|
|
90
|
-
jsonRpcUrl,
|
|
91
|
-
publicJsonRpcUrl,
|
|
92
|
-
alchemyJsonRpcUrl,
|
|
93
|
-
"https://open-api.openocean.finance/",
|
|
94
|
-
"https://api.haiku.trade/",
|
|
95
|
-
"https://api.fly.trade/",
|
|
96
|
-
`${config.bex.aggregatorsProxyUrl}/`,
|
|
97
|
-
"wss://relay.walletconnect.com/",
|
|
98
|
-
"wss://relay.walletconnect.org/",
|
|
99
|
-
"https://verify.walletconnect.org/v3/public-key",
|
|
100
|
-
"https://api.routescan.io/v2/network/",
|
|
101
|
-
"wss://metamask-sdk.api.cx.metamask.io/socket.io/",
|
|
102
|
-
"https://metamask-sdk.api.cx.metamask.io",
|
|
103
|
-
"https://app.dynamicauth.com/api",
|
|
104
|
-
"https://www.walletlink.org/events",
|
|
105
|
-
"https://api.trongrid.io/",
|
|
106
|
-
"https://api-mainnet.layerzero-scan.com/",
|
|
107
|
-
"https://api-testnet.layerzero-scan.com/",
|
|
108
|
-
"https://chain-proxy.wallet.coinbase.com/",
|
|
109
|
-
"https://wallet.binance.com/tonbridge/",
|
|
110
|
-
"https://*.thirdweb.com/",
|
|
111
|
-
"https://eth.merkle.io/",
|
|
112
|
-
"https://cdn.whisk.so/",
|
|
113
|
-
// use to fetch tokens
|
|
114
|
-
// POSTHOG TOOLBAR
|
|
115
|
-
"https://*.posthog.com",
|
|
116
|
-
// VERCEL TOOLBAR
|
|
117
|
-
"https://vercel.live",
|
|
118
|
-
"wss://ws-us3.pusher.com",
|
|
119
|
-
// COOKIE3
|
|
120
|
-
"https://cdn.markfi.xyz/scripts/analytics/",
|
|
121
|
-
"https://a.markfi.xyz/",
|
|
122
|
-
// PYTH
|
|
123
|
-
"https://hermes.pyth.network/v2/",
|
|
124
|
-
// PORTO WALLET
|
|
125
|
-
"https://rpc.porto.sh",
|
|
126
|
-
// external rpc urls
|
|
127
|
-
"https://api.avax.network/ext/bc/C/rpc",
|
|
128
|
-
"https://polygon-rpc.com",
|
|
129
|
-
"https://mainnet.optimism.io/",
|
|
130
|
-
"https://arb1.arbitrum.io/rpc",
|
|
131
|
-
"wss://www.walletlink.org/rpc",
|
|
132
|
-
"https://eth.merkle.io",
|
|
133
|
-
"https://mainnet.base.org/",
|
|
134
|
-
// enso api
|
|
135
|
-
"https://api.enso.finance/",
|
|
136
|
-
"wss://www.walletlink.org/rpc",
|
|
137
|
-
// backend
|
|
138
|
-
getUriFromLink(config.backend)
|
|
139
|
-
].concat(args.connectionSources ?? []).filter((link) => {
|
|
140
|
-
if (!link) {
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
143
|
-
const url = getUriFromLink(link);
|
|
144
|
-
if (!url || url.trim() === "") {
|
|
145
|
-
return false;
|
|
146
|
-
}
|
|
147
|
-
if (url.startsWith(goldskyBaseUrl) && url !== goldskyBaseUrl) {
|
|
148
|
-
return false;
|
|
149
|
-
}
|
|
150
|
-
return true;
|
|
151
|
-
});
|
|
152
|
-
const pictureSources = [
|
|
153
|
-
imageBaseUrl,
|
|
154
|
-
"https://raw.githubusercontent.com/berachain/metadata/",
|
|
155
|
-
"https://assets.coingecko.com/coins/images/",
|
|
156
|
-
"https://coin-images.coingecko.com/coins/images/",
|
|
157
|
-
"https://beranames-assets-berachain.s3.eu-central-003.backblazeb2.com/",
|
|
158
|
-
"https://icons.llama.fi/",
|
|
159
|
-
"https://icons.llamao.fi/",
|
|
160
|
-
"https://static.debank.com/",
|
|
161
|
-
"https://cdn.whisk.so/",
|
|
162
|
-
// bend
|
|
163
|
-
"https://cdn.morpho.org/",
|
|
164
|
-
// bend
|
|
165
|
-
"https://raw.githubusercontent.com/trustwallet/assets/",
|
|
166
|
-
// bend
|
|
167
|
-
"https://pelaguswallet.io/docs/img",
|
|
168
|
-
// POSTHOG TOOLBAR
|
|
169
|
-
"https://*.posthog.com",
|
|
170
|
-
// VERCEL TOOLBAR
|
|
171
|
-
"https://vercel.live",
|
|
172
|
-
"https://vercel.com"
|
|
173
|
-
].concat(args.pictureSources ?? []).filter((url) => {
|
|
174
|
-
if (!url || url.trim() === "") {
|
|
175
|
-
return false;
|
|
176
|
-
}
|
|
177
|
-
return true;
|
|
178
|
-
});
|
|
179
|
-
const frameSources = [
|
|
180
|
-
"https://verify.walletconnect.com/",
|
|
181
|
-
"https://verify.walletconnect.org/",
|
|
182
|
-
// thirdweb export pk iframe
|
|
183
|
-
"https://embedded-wallet.thirdweb.com/",
|
|
184
|
-
// POSTHOG TOOLBAR
|
|
185
|
-
"https://*.posthog.com",
|
|
186
|
-
// VERCEL TOOLBAR
|
|
187
|
-
"https://vercel.live/",
|
|
188
|
-
// PORTO WALLET
|
|
189
|
-
"https://id.porto.sh"
|
|
190
|
-
].concat(args.frameSources ?? []);
|
|
191
|
-
const fontSources = [
|
|
192
|
-
"https://cdn.jsdelivr.net/npm/@fontsource/",
|
|
193
|
-
// POSTHOG TOOLBAR
|
|
194
|
-
"https://*.posthog.com",
|
|
195
|
-
// VERCEL TOOLBAR
|
|
196
|
-
"https://vercel.live",
|
|
197
|
-
"https://assets.vercel.com",
|
|
198
|
-
// collected by sentry (need by browsers extensions)
|
|
199
|
-
"https://fonts.gstatic.com",
|
|
200
|
-
"https://use.typekit.net/"
|
|
201
|
-
].concat(args.fontSources ?? []);
|
|
202
|
-
const styleSources = [
|
|
203
|
-
// POSTHOG TOOLBAR
|
|
204
|
-
"https://*.posthog.com",
|
|
205
|
-
// VERCEL TOOLBAR
|
|
206
|
-
"https://vercel.live"
|
|
207
|
-
].concat(args.styleSources ?? []);
|
|
208
|
-
let cspHeader = `
|
|
209
|
-
default-src 'self' ${defaultSrc.join(" ")};
|
|
1
|
+
import{a as k,c as b}from"../chunk-DL645PXT.mjs";import{a as l}from"../chunk-O243TIHY.mjs";import{a as w}from"../chunk-MB5HZZ3S.mjs";import"../chunk-LCQFSMRO.mjs";import"../chunk-4EBC3WWP.mjs";import{a as h,b as m,d as g,e as d,f as y}from"../chunk-4EBBM3AH.mjs";import{a as f}from"../chunk-S2A3Z34I.mjs";import"../chunk-MS6UGFXI.mjs";import"../chunk-JZXLCA2E.mjs";function v({dsn:t=process.env.NEXT_PUBLIC_SENTRY_DSN}={}){if(!t)return;let n=/^(?:https:\/\/)([A-z0-9]{32})(?::{0,1})([A-z0-9]*)(?:@)(o[a-z0-9]+)(?:\.ingest\.us\.sentry\.io)\/([0-9]{16})/i,e=t?.match(n);if(!e)return;let[,s,r,o,a]=e,c=new URL(`https://${o}.ingest.us.sentry.io/api/${a}/security/?sentry_key=${s}`);return c.searchParams.set("sentry_key",s),c.searchParams.set("sentry_env",k),c.searchParams.set("sentry_release",b),{dsn:e[0],projectId:a,deprecatedSecret:r||void 0,cspEndpoint:c,org:o,publicKey:e[1]}}function N({isDevelopment:t,nonce:n,cspReporting:e,...s}){let r=[],o=w[f],a=["https://*.sentry.io/","https://*.berachain.com/","https://*.berachain-staging.com/","wss://www.walletlink.org/rpc","https://*.thirdweb.com/","https://raw.githubusercontent.com/berachain/metadata/",h,"https://*.quiknode.pro","https://beranames-assets-berachain.s3.eu-central-003.backblazeb2.com/",m,o.pol.bribeBoostApi,l(o.api),d,g,y,"https://open-api.openocean.finance/","https://api.haiku.trade/","https://api.fly.trade/",`${o.bex.aggregatorsProxyUrl}/`,"wss://relay.walletconnect.com/","wss://relay.walletconnect.org/","https://verify.walletconnect.org/v3/public-key","https://api.routescan.io/v2/network/","wss://metamask-sdk.api.cx.metamask.io/socket.io/","https://metamask-sdk.api.cx.metamask.io","https://app.dynamicauth.com/api","https://www.walletlink.org/events","https://api.trongrid.io/","https://api-mainnet.layerzero-scan.com/","https://api-testnet.layerzero-scan.com/","https://chain-proxy.wallet.coinbase.com/","https://wallet.binance.com/tonbridge/","https://*.thirdweb.com/","https://eth.merkle.io/","https://cdn.whisk.so/","https://*.posthog.com","https://vercel.live","wss://ws-us3.pusher.com","https://cdn.markfi.xyz/scripts/analytics/","https://a.markfi.xyz/","https://hermes.pyth.network/v2/","https://rpc.porto.sh","https://api.avax.network/ext/bc/C/rpc","https://polygon-rpc.com","https://mainnet.optimism.io/","https://arb1.arbitrum.io/rpc","wss://www.walletlink.org/rpc","https://eth.merkle.io","https://mainnet.base.org/","https://api.enso.finance/","wss://www.walletlink.org/rpc",l(o.backend)].concat(s.connectionSources??[]).filter(i=>{if(!i)return!1;let p=l(i);return!(!p||p.trim()===""||p.startsWith(m)&&p!==m)}),c=[h,"https://raw.githubusercontent.com/berachain/metadata/","https://assets.coingecko.com/coins/images/","https://coin-images.coingecko.com/coins/images/","https://beranames-assets-berachain.s3.eu-central-003.backblazeb2.com/","https://icons.llama.fi/","https://icons.llamao.fi/","https://static.debank.com/","https://cdn.whisk.so/","https://cdn.morpho.org/","https://raw.githubusercontent.com/trustwallet/assets/","https://pelaguswallet.io/docs/img","https://*.posthog.com","https://vercel.live","https://vercel.com"].concat(s.pictureSources??[]).filter(i=>!(!i||i.trim()==="")),S=["https://verify.walletconnect.com/","https://verify.walletconnect.org/","https://embedded-wallet.thirdweb.com/","https://*.posthog.com","https://vercel.live/","https://id.porto.sh"].concat(s.frameSources??[]),x=["https://cdn.jsdelivr.net/npm/@fontsource/","https://*.posthog.com","https://vercel.live","https://assets.vercel.com","https://fonts.gstatic.com","https://use.typekit.net/"].concat(s.fontSources??[]),$=["https://*.posthog.com","https://vercel.live"].concat(s.styleSources??[]),u=`
|
|
2
|
+
default-src 'self' ${r.join(" ")};
|
|
210
3
|
base-uri 'self';
|
|
211
|
-
frame-src 'self' ${
|
|
4
|
+
frame-src 'self' ${S.join(" ")};
|
|
212
5
|
frame-ancestors 'self' https://*.posthog.com;
|
|
213
|
-
script-src 'self' 'sha256-k2HGvaYkGyYZxOwKGxgE1mr06tZEDcEXNZ5mdcldK0o=' 'nonce-${
|
|
6
|
+
script-src 'self' 'sha256-k2HGvaYkGyYZxOwKGxgE1mr06tZEDcEXNZ5mdcldK0o=' 'nonce-${n}' https://*.posthog.com 'strict-dynamic' ${t?"'unsafe-eval'":""};
|
|
214
7
|
worker-src 'self' blob: data:;
|
|
215
|
-
font-src 'self' ${
|
|
216
|
-
style-src 'self' ${
|
|
217
|
-
img-src 'self' data: ${
|
|
218
|
-
connect-src 'self' ${
|
|
8
|
+
font-src 'self' ${x.join(" ")};
|
|
9
|
+
style-src 'self' ${$.join(" ")} 'unsafe-inline';
|
|
10
|
+
img-src 'self' data: ${c.join(" ")};
|
|
11
|
+
connect-src 'self' ${a.join(" ")};
|
|
219
12
|
media-src https://*.posthog.com;
|
|
220
|
-
`;
|
|
221
|
-
|
|
222
|
-
cspHeader += `
|
|
223
|
-
report-uri ${cspReporting};
|
|
13
|
+
`;return e&&(u+=`
|
|
14
|
+
report-uri ${e};
|
|
224
15
|
report-to csp-endpoint;
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
return cspHeader.replace(/\s{2,}/g, " ").trim();
|
|
228
|
-
}
|
|
229
|
-
var staticPictureSources = [
|
|
230
|
-
// Only add image delivery URL if it exists and can be processed
|
|
231
|
-
imageBaseUrl,
|
|
232
|
-
"https://raw.githubusercontent.com/berachain/metadata/",
|
|
233
|
-
"https://assets.coingecko.com/coins/images/",
|
|
234
|
-
"https://berachain.ghost.io/content/images/"
|
|
235
|
-
].filter((url) => {
|
|
236
|
-
if (!url || url.trim() === "") {
|
|
237
|
-
return false;
|
|
238
|
-
}
|
|
239
|
-
return true;
|
|
240
|
-
});
|
|
241
|
-
function cspMiddleware({
|
|
242
|
-
response
|
|
243
|
-
}) {
|
|
244
|
-
const sentryCspEndpoint = getSentryKeys()?.cspEndpoint;
|
|
245
|
-
const nonce = Buffer.from(crypto.randomUUID()).toString("base64");
|
|
246
|
-
const isDevelopment = process.env.NODE_ENV === "development";
|
|
247
|
-
const headers = [
|
|
248
|
-
{
|
|
249
|
-
key: "Content-Security-Policy",
|
|
250
|
-
value: getContentSecurityPolicy({
|
|
251
|
-
isDevelopment,
|
|
252
|
-
cspReporting: sentryCspEndpoint?.toString(),
|
|
253
|
-
nonce
|
|
254
|
-
})
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
key: "X-Frame-Options",
|
|
258
|
-
value: "DENY"
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
key: "X-Content-Type-Options",
|
|
262
|
-
value: "nosniff"
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
key: "X-Nonce",
|
|
266
|
-
value: nonce
|
|
267
|
-
}
|
|
268
|
-
];
|
|
269
|
-
if (sentryCspEndpoint) {
|
|
270
|
-
headers.push({
|
|
271
|
-
key: "Reporting-To",
|
|
272
|
-
value: `{"group":"csp-endpoint","max_age":10886400,"endpoints":[{"url":"${sentryCspEndpoint}"}],"include_subdomains":true}"`
|
|
273
|
-
});
|
|
274
|
-
headers.push({
|
|
275
|
-
key: "Reporting-Endpoints",
|
|
276
|
-
value: `csp-endpoint="${sentryCspEndpoint}"`
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
for (const header of headers) {
|
|
280
|
-
response.headers.set(header.key, header.value);
|
|
281
|
-
}
|
|
282
|
-
return response;
|
|
283
|
-
}
|
|
284
|
-
export {
|
|
285
|
-
cspMiddleware,
|
|
286
|
-
getContentSecurityPolicy,
|
|
287
|
-
staticPictureSources
|
|
288
|
-
};
|
|
16
|
+
`),u.replace(/\s{2,}/g," ").trim()}var C=[h,"https://raw.githubusercontent.com/berachain/metadata/","https://assets.coingecko.com/coins/images/","https://berachain.ghost.io/content/images/"].filter(t=>!(!t||t.trim()===""));function P({response:t}){let n=v()?.cspEndpoint,e=Buffer.from(crypto.randomUUID()).toString("base64"),s=process.env.NODE_ENV==="development",r=[{key:"Content-Security-Policy",value:N({isDevelopment:s,cspReporting:n?.toString(),nonce:e})},{key:"X-Frame-Options",value:"DENY"},{key:"X-Content-Type-Options",value:"nosniff"},{key:"X-Nonce",value:e}];n&&(r.push({key:"Reporting-To",value:`{"group":"csp-endpoint","max_age":10886400,"endpoints":[{"url":"${n}"}],"include_subdomains":true}"`}),r.push({key:"Reporting-Endpoints",value:`csp-endpoint="${n}"`}));for(let o of r)t.headers.set(o.key,o.value);return t}export{P as cspMiddleware,N as getContentSecurityPolicy,C as staticPictureSources};
|
package/dist/internal/index.cjs
CHANGED
|
@@ -1,40 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _chunkREBIMTSJcjs = require('../chunk-REBIMTSJ.cjs');
|
|
6
|
-
require('../chunk-FNTZIXS7.cjs');
|
|
7
|
-
require('../chunk-2BJ55Y5U.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var _chunkWRTYGXJMcjs = require('../chunk-WRTYGXJM.cjs');
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var _chunkADH7F47Tcjs = require('../chunk-ADH7F47T.cjs');
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var _chunkEYYJ2UZTcjs = require('../chunk-EYYJ2UZT.cjs');
|
|
24
|
-
require('../chunk-75ZPJI57.cjs');
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
exports.ChainId = _chunkEYYJ2UZTcjs.ChainId; exports.alchemyJsonRpcUrl = _chunkWRTYGXJMcjs.alchemyJsonRpcUrl; exports.appConfig = _chunkREBIMTSJcjs.appConfig; exports.chainConfigs = _chunkREBIMTSJcjs.chainConfigs; exports.chainId = _chunkADH7F47Tcjs.defaultChainId; exports.config = _chunkREBIMTSJcjs.config; exports.currentDapp = _chunkADH7F47Tcjs.currentDapp; exports.defaultChainId = _chunkADH7F47Tcjs.defaultChainId; exports.getRpcUrls = _chunkWRTYGXJMcjs.getRpcUrls; exports.goldskyBaseUrl = _chunkWRTYGXJMcjs.goldskyBaseUrl; exports.imageBaseUrl = _chunkWRTYGXJMcjs.imageBaseUrl; exports.jsonRpcUrl = _chunkWRTYGXJMcjs.jsonRpcUrl; exports.privateRcpUrl = _chunkWRTYGXJMcjs.privateRcpUrl; exports.publicJsonRpcUrl = _chunkWRTYGXJMcjs.publicJsonRpcUrl;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBWV5APOWcjs = require('../chunk-BWV5APOW.cjs');require('../chunk-S5CMEFTY.cjs');require('../chunk-2HIIMZE4.cjs');var _chunk276AZYTLcjs = require('../chunk-276AZYTL.cjs');var _chunk3KQLFIHTcjs = require('../chunk-3KQLFIHT.cjs');var _chunk2OLL4MUYcjs = require('../chunk-2OLL4MUY.cjs');require('../chunk-4VDLQK6F.cjs');exports.ChainId = _chunk2OLL4MUYcjs.a; exports.alchemyJsonRpcUrl = _chunk276AZYTLcjs.f; exports.appConfig = _chunkBWV5APOWcjs.b; exports.chainConfigs = _chunkBWV5APOWcjs.a; exports.chainId = _chunk3KQLFIHTcjs.a; exports.config = _chunkBWV5APOWcjs.c; exports.currentDapp = _chunk3KQLFIHTcjs.f; exports.defaultChainId = _chunk3KQLFIHTcjs.a; exports.getRpcUrls = _chunk276AZYTLcjs.c; exports.goldskyBaseUrl = _chunk276AZYTLcjs.b; exports.imageBaseUrl = _chunk276AZYTLcjs.a; exports.jsonRpcUrl = _chunk276AZYTLcjs.e; exports.privateRcpUrl = _chunk276AZYTLcjs.g; exports.publicJsonRpcUrl = _chunk276AZYTLcjs.d;
|
|
@@ -80,7 +80,10 @@ declare const chainConfigs: {
|
|
|
80
80
|
readonly name: "Berachain Backend";
|
|
81
81
|
readonly uri: string;
|
|
82
82
|
};
|
|
83
|
-
readonly beep:
|
|
83
|
+
readonly beep: {
|
|
84
|
+
uri: string;
|
|
85
|
+
name: string;
|
|
86
|
+
} | null;
|
|
84
87
|
readonly bex: {
|
|
85
88
|
readonly chainName: "BERACHAIN";
|
|
86
89
|
readonly vault: "0x4Be03f781C497A489E3cB0287833452cA9B9E80B";
|
|
@@ -506,7 +509,10 @@ declare const config: {
|
|
|
506
509
|
readonly name: "Berachain Backend";
|
|
507
510
|
readonly uri: string;
|
|
508
511
|
};
|
|
509
|
-
readonly beep:
|
|
512
|
+
readonly beep: {
|
|
513
|
+
uri: string;
|
|
514
|
+
name: string;
|
|
515
|
+
} | null;
|
|
510
516
|
readonly bex: {
|
|
511
517
|
readonly chainName: "BERACHAIN";
|
|
512
518
|
readonly vault: "0x4Be03f781C497A489E3cB0287833452cA9B9E80B";
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -80,7 +80,10 @@ declare const chainConfigs: {
|
|
|
80
80
|
readonly name: "Berachain Backend";
|
|
81
81
|
readonly uri: string;
|
|
82
82
|
};
|
|
83
|
-
readonly beep:
|
|
83
|
+
readonly beep: {
|
|
84
|
+
uri: string;
|
|
85
|
+
name: string;
|
|
86
|
+
} | null;
|
|
84
87
|
readonly bex: {
|
|
85
88
|
readonly chainName: "BERACHAIN";
|
|
86
89
|
readonly vault: "0x4Be03f781C497A489E3cB0287833452cA9B9E80B";
|
|
@@ -506,7 +509,10 @@ declare const config: {
|
|
|
506
509
|
readonly name: "Berachain Backend";
|
|
507
510
|
readonly uri: string;
|
|
508
511
|
};
|
|
509
|
-
readonly beep:
|
|
512
|
+
readonly beep: {
|
|
513
|
+
uri: string;
|
|
514
|
+
name: string;
|
|
515
|
+
} | null;
|
|
510
516
|
readonly bex: {
|
|
511
517
|
readonly chainName: "BERACHAIN";
|
|
512
518
|
readonly vault: "0x4Be03f781C497A489E3cB0287833452cA9B9E80B";
|
package/dist/internal/index.mjs
CHANGED
|
@@ -1,40 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
appConfig,
|
|
3
|
-
chainConfigs,
|
|
4
|
-
config
|
|
5
|
-
} from "../chunk-FOUI63VD.mjs";
|
|
6
|
-
import "../chunk-4H4HDUCC.mjs";
|
|
7
|
-
import "../chunk-HJXRHQST.mjs";
|
|
8
|
-
import {
|
|
9
|
-
alchemyJsonRpcUrl,
|
|
10
|
-
getRpcUrls,
|
|
11
|
-
goldskyBaseUrl,
|
|
12
|
-
imageBaseUrl,
|
|
13
|
-
jsonRpcUrl,
|
|
14
|
-
privateRcpUrl,
|
|
15
|
-
publicJsonRpcUrl
|
|
16
|
-
} from "../chunk-BM46XQJA.mjs";
|
|
17
|
-
import {
|
|
18
|
-
currentDapp,
|
|
19
|
-
defaultChainId
|
|
20
|
-
} from "../chunk-CAOMAWN5.mjs";
|
|
21
|
-
import {
|
|
22
|
-
ChainId
|
|
23
|
-
} from "../chunk-KJXYSGNH.mjs";
|
|
24
|
-
import "../chunk-7P6ASYW6.mjs";
|
|
25
|
-
export {
|
|
26
|
-
ChainId,
|
|
27
|
-
alchemyJsonRpcUrl,
|
|
28
|
-
appConfig,
|
|
29
|
-
chainConfigs,
|
|
30
|
-
defaultChainId as chainId,
|
|
31
|
-
config,
|
|
32
|
-
currentDapp,
|
|
33
|
-
defaultChainId,
|
|
34
|
-
getRpcUrls,
|
|
35
|
-
goldskyBaseUrl,
|
|
36
|
-
imageBaseUrl,
|
|
37
|
-
jsonRpcUrl,
|
|
38
|
-
privateRcpUrl,
|
|
39
|
-
publicJsonRpcUrl
|
|
40
|
-
};
|
|
1
|
+
import{a as k,b as l,c as m}from"../chunk-MB5HZZ3S.mjs";import"../chunk-LCQFSMRO.mjs";import"../chunk-4EBC3WWP.mjs";import{a as d,b as e,c as f,d as g,e as h,f as i,g as j}from"../chunk-4EBBM3AH.mjs";import{a as b,f as c}from"../chunk-S2A3Z34I.mjs";import{a}from"../chunk-MS6UGFXI.mjs";import"../chunk-JZXLCA2E.mjs";export{a as ChainId,i as alchemyJsonRpcUrl,l as appConfig,k as chainConfigs,b as chainId,m as config,c as currentDapp,b as defaultChainId,f as getRpcUrls,e as goldskyBaseUrl,d as imageBaseUrl,h as jsonRpcUrl,j as privateRcpUrl,g as publicJsonRpcUrl};
|
|
@@ -1,26 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-
|
|
2
|
-
|
|
3
|
-
// src/internal/maintenance.ts
|
|
4
|
-
var _server = require('next/server');
|
|
5
|
-
var DEFAULT_MAINTENANCE_EXEMPT_PATHS = [
|
|
6
|
-
"/maintenance",
|
|
7
|
-
"/_next",
|
|
8
|
-
"/api"
|
|
9
|
-
];
|
|
10
|
-
function checkMaintenanceMode(req, config) {
|
|
11
|
-
const {
|
|
12
|
-
isMaintenance,
|
|
13
|
-
exemptPaths = DEFAULT_MAINTENANCE_EXEMPT_PATHS,
|
|
14
|
-
maintenancePath = "/maintenance"
|
|
15
|
-
} = config;
|
|
16
|
-
if (isMaintenance && !exemptPaths.some((path) => req.nextUrl.pathname.startsWith(path))) {
|
|
17
|
-
return _server.NextResponse.redirect(new URL(maintenancePath, req.url), {
|
|
18
|
-
status: 307
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
exports.DEFAULT_MAINTENANCE_EXEMPT_PATHS = DEFAULT_MAINTENANCE_EXEMPT_PATHS; exports.checkMaintenanceMode = checkMaintenanceMode;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-4VDLQK6F.cjs');var _server = require('next/server');var o=["/maintenance","/_next","/api"];function p(e,n){let{isMaintenance:t,exemptPaths:a=o,maintenancePath:i="/maintenance"}=n;return t&&!a.some(s=>e.nextUrl.pathname.startsWith(s))?_server.NextResponse.redirect(new URL(i,e.url),{status:307}):null}exports.DEFAULT_MAINTENANCE_EXEMPT_PATHS = o; exports.checkMaintenanceMode = p;
|
|
@@ -1,26 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
// src/internal/maintenance.ts
|
|
4
|
-
import { NextResponse } from "next/server";
|
|
5
|
-
var DEFAULT_MAINTENANCE_EXEMPT_PATHS = [
|
|
6
|
-
"/maintenance",
|
|
7
|
-
"/_next",
|
|
8
|
-
"/api"
|
|
9
|
-
];
|
|
10
|
-
function checkMaintenanceMode(req, config) {
|
|
11
|
-
const {
|
|
12
|
-
isMaintenance,
|
|
13
|
-
exemptPaths = DEFAULT_MAINTENANCE_EXEMPT_PATHS,
|
|
14
|
-
maintenancePath = "/maintenance"
|
|
15
|
-
} = config;
|
|
16
|
-
if (isMaintenance && !exemptPaths.some((path) => req.nextUrl.pathname.startsWith(path))) {
|
|
17
|
-
return NextResponse.redirect(new URL(maintenancePath, req.url), {
|
|
18
|
-
status: 307
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
export {
|
|
24
|
-
DEFAULT_MAINTENANCE_EXEMPT_PATHS,
|
|
25
|
-
checkMaintenanceMode
|
|
26
|
-
};
|
|
1
|
+
import"../chunk-JZXLCA2E.mjs";import{NextResponse as c}from"next/server";var o=["/maintenance","/_next","/api"];function p(e,n){let{isMaintenance:t,exemptPaths:a=o,maintenancePath:i="/maintenance"}=n;return t&&!a.some(s=>e.nextUrl.pathname.startsWith(s))?c.redirect(new URL(i,e.url),{status:307}):null}export{o as DEFAULT_MAINTENANCE_EXEMPT_PATHS,p as checkMaintenanceMode};
|
|
@@ -1,85 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
-
|
|
3
|
-
var _chunk6TL5ZQOMcjs = require('../../chunk-6TL5ZQOM.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunk2JZ7QJEWcjs = require('../../chunk-2JZ7QJEW.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunkREBIMTSJcjs = require('../../chunk-REBIMTSJ.cjs');
|
|
10
|
-
require('../../chunk-FNTZIXS7.cjs');
|
|
11
|
-
require('../../chunk-2BJ55Y5U.cjs');
|
|
12
|
-
require('../../chunk-WRTYGXJM.cjs');
|
|
13
|
-
require('../../chunk-ADH7F47T.cjs');
|
|
14
|
-
require('../../chunk-EYYJ2UZT.cjs');
|
|
15
|
-
require('../../chunk-75ZPJI57.cjs');
|
|
16
|
-
|
|
17
|
-
// src/internal/nextjs/index.ts
|
|
18
|
-
var _dotenv = require('dotenv'); var _dotenv2 = _interopRequireDefault(_dotenv);
|
|
19
|
-
_dotenv2.default.config({ path: ["../../.env.local", "../../.env"] });
|
|
20
|
-
function withBeraConfig(config, {
|
|
21
|
-
withSentry = true,
|
|
22
|
-
withPostHogReverseProxy = true,
|
|
23
|
-
appName
|
|
24
|
-
}) {
|
|
25
|
-
const nextConfig = {
|
|
26
|
-
reactStrictMode: true,
|
|
27
|
-
trailingSlash: true,
|
|
28
|
-
pageExtensions: ["ts", "tsx"],
|
|
29
|
-
env: {
|
|
30
|
-
// this is used to check if component is running in nextjs inside the package folder
|
|
31
|
-
NEXT_PUBLIC_IS_NEXTJS: "true",
|
|
32
|
-
NEXT_PUBLIC_BERA_APP_NAME: appName
|
|
33
|
-
},
|
|
34
|
-
turbopack: {
|
|
35
|
-
rules: {
|
|
36
|
-
"*.svg": {
|
|
37
|
-
as: "*.js",
|
|
38
|
-
loaders: ["@svgr/webpack"]
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
experimental: {
|
|
43
|
-
webpackBuildWorker: true
|
|
44
|
-
// optimizePackageImports: [
|
|
45
|
-
// "@berachain/ui",
|
|
46
|
-
// "@berachain/shared-ui",
|
|
47
|
-
// "@berachain/berajs",
|
|
48
|
-
// "@berachain/wagmi",
|
|
49
|
-
// "@berachain/config",
|
|
50
|
-
// "@berachain/graphql",
|
|
51
|
-
// ],
|
|
52
|
-
},
|
|
53
|
-
/** We already do linting and typechecking as separate tasks in CI */
|
|
54
|
-
typescript: { ignoreBuildErrors: true },
|
|
55
|
-
...config,
|
|
56
|
-
images: {
|
|
57
|
-
...config.images,
|
|
58
|
-
remotePatterns: [..._chunk2JZ7QJEWcjs.IMAGE_REMOTE_PATTERNS]
|
|
59
|
-
},
|
|
60
|
-
async rewrites() {
|
|
61
|
-
if (!withPostHogReverseProxy) {
|
|
62
|
-
return [];
|
|
63
|
-
}
|
|
64
|
-
return [
|
|
65
|
-
{
|
|
66
|
-
source: "/ph/static/:path*",
|
|
67
|
-
destination: `https://${_chunkREBIMTSJcjs.appConfig.urls.postHog.region}-assets.i.posthog.com/static/:path*`
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
source: "/ph/:path*",
|
|
71
|
-
destination: `https://${_chunkREBIMTSJcjs.appConfig.urls.postHog.region}.i.posthog.com/:path*`
|
|
72
|
-
}
|
|
73
|
-
];
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
if (withPostHogReverseProxy) {
|
|
77
|
-
nextConfig.env.NEXT_PUBLIC_PH_REVERSE_PROXY_PATH = "/ph";
|
|
78
|
-
nextConfig.skipTrailingSlashRedirect = true;
|
|
79
|
-
}
|
|
80
|
-
if (withSentry) return _chunk6TL5ZQOMcjs.withSentryConfig.call(void 0, nextConfig);
|
|
81
|
-
return nextConfig;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
exports.withBeraConfig = withBeraConfig;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk3WZ7JUD6cjs = require('../../chunk-3WZ7JUD6.cjs');var _chunkVPOS7FPUcjs = require('../../chunk-VPOS7FPU.cjs');var _chunkBWV5APOWcjs = require('../../chunk-BWV5APOW.cjs');require('../../chunk-S5CMEFTY.cjs');require('../../chunk-2HIIMZE4.cjs');require('../../chunk-276AZYTL.cjs');require('../../chunk-3KQLFIHT.cjs');require('../../chunk-2OLL4MUY.cjs');require('../../chunk-4VDLQK6F.cjs');var _dotenv = require('dotenv'); var _dotenv2 = _interopRequireDefault(_dotenv);_dotenv2.default.config({path:["../../.env.local","../../.env"]});function c(r,{withSentry:a=!0,withPostHogReverseProxy:o=!0,appName:s}){let t={reactStrictMode:!0,trailingSlash:!0,pageExtensions:["ts","tsx"],env:{NEXT_PUBLIC_IS_NEXTJS:"true",NEXT_PUBLIC_BERA_APP_NAME:s},turbopack:{rules:{"*.svg":{as:"*.js",loaders:["@svgr/webpack"]}}},experimental:{webpackBuildWorker:!0},typescript:{ignoreBuildErrors:!0},...r,images:{...r.images,remotePatterns:[..._chunkVPOS7FPUcjs.a]},async rewrites(){return o?[{source:"/ph/static/:path*",destination:`https://${_chunkBWV5APOWcjs.b.urls.postHog.region}-assets.i.posthog.com/static/:path*`},{source:"/ph/:path*",destination:`https://${_chunkBWV5APOWcjs.b.urls.postHog.region}.i.posthog.com/:path*`}]:[]}};return o&&(t.env.NEXT_PUBLIC_PH_REVERSE_PROXY_PATH="/ph",t.skipTrailingSlashRedirect=!0),a?_chunk3WZ7JUD6cjs.b.call(void 0, t):t}exports.withBeraConfig = c;
|
|
@@ -1,85 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
withSentryConfig
|
|
3
|
-
} from "../../chunk-NQ3UKQHW.mjs";
|
|
4
|
-
import {
|
|
5
|
-
IMAGE_REMOTE_PATTERNS
|
|
6
|
-
} from "../../chunk-AP2XG6GJ.mjs";
|
|
7
|
-
import {
|
|
8
|
-
appConfig
|
|
9
|
-
} from "../../chunk-FOUI63VD.mjs";
|
|
10
|
-
import "../../chunk-4H4HDUCC.mjs";
|
|
11
|
-
import "../../chunk-HJXRHQST.mjs";
|
|
12
|
-
import "../../chunk-BM46XQJA.mjs";
|
|
13
|
-
import "../../chunk-CAOMAWN5.mjs";
|
|
14
|
-
import "../../chunk-KJXYSGNH.mjs";
|
|
15
|
-
import "../../chunk-7P6ASYW6.mjs";
|
|
16
|
-
|
|
17
|
-
// src/internal/nextjs/index.ts
|
|
18
|
-
import dotenv from "dotenv";
|
|
19
|
-
dotenv.config({ path: ["../../.env.local", "../../.env"] });
|
|
20
|
-
function withBeraConfig(config, {
|
|
21
|
-
withSentry = true,
|
|
22
|
-
withPostHogReverseProxy = true,
|
|
23
|
-
appName
|
|
24
|
-
}) {
|
|
25
|
-
const nextConfig = {
|
|
26
|
-
reactStrictMode: true,
|
|
27
|
-
trailingSlash: true,
|
|
28
|
-
pageExtensions: ["ts", "tsx"],
|
|
29
|
-
env: {
|
|
30
|
-
// this is used to check if component is running in nextjs inside the package folder
|
|
31
|
-
NEXT_PUBLIC_IS_NEXTJS: "true",
|
|
32
|
-
NEXT_PUBLIC_BERA_APP_NAME: appName
|
|
33
|
-
},
|
|
34
|
-
turbopack: {
|
|
35
|
-
rules: {
|
|
36
|
-
"*.svg": {
|
|
37
|
-
as: "*.js",
|
|
38
|
-
loaders: ["@svgr/webpack"]
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
experimental: {
|
|
43
|
-
webpackBuildWorker: true
|
|
44
|
-
// optimizePackageImports: [
|
|
45
|
-
// "@berachain/ui",
|
|
46
|
-
// "@berachain/shared-ui",
|
|
47
|
-
// "@berachain/berajs",
|
|
48
|
-
// "@berachain/wagmi",
|
|
49
|
-
// "@berachain/config",
|
|
50
|
-
// "@berachain/graphql",
|
|
51
|
-
// ],
|
|
52
|
-
},
|
|
53
|
-
/** We already do linting and typechecking as separate tasks in CI */
|
|
54
|
-
typescript: { ignoreBuildErrors: true },
|
|
55
|
-
...config,
|
|
56
|
-
images: {
|
|
57
|
-
...config.images,
|
|
58
|
-
remotePatterns: [...IMAGE_REMOTE_PATTERNS]
|
|
59
|
-
},
|
|
60
|
-
async rewrites() {
|
|
61
|
-
if (!withPostHogReverseProxy) {
|
|
62
|
-
return [];
|
|
63
|
-
}
|
|
64
|
-
return [
|
|
65
|
-
{
|
|
66
|
-
source: "/ph/static/:path*",
|
|
67
|
-
destination: `https://${appConfig.urls.postHog.region}-assets.i.posthog.com/static/:path*`
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
source: "/ph/:path*",
|
|
71
|
-
destination: `https://${appConfig.urls.postHog.region}.i.posthog.com/:path*`
|
|
72
|
-
}
|
|
73
|
-
];
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
if (withPostHogReverseProxy) {
|
|
77
|
-
nextConfig.env.NEXT_PUBLIC_PH_REVERSE_PROXY_PATH = "/ph";
|
|
78
|
-
nextConfig.skipTrailingSlashRedirect = true;
|
|
79
|
-
}
|
|
80
|
-
if (withSentry) return withSentryConfig(nextConfig);
|
|
81
|
-
return nextConfig;
|
|
82
|
-
}
|
|
83
|
-
export {
|
|
84
|
-
withBeraConfig
|
|
85
|
-
};
|
|
1
|
+
import{b as i}from"../../chunk-XO2H4NRK.mjs";import{a as n}from"../../chunk-FZ23S6ID.mjs";import{b as e}from"../../chunk-MB5HZZ3S.mjs";import"../../chunk-LCQFSMRO.mjs";import"../../chunk-4EBC3WWP.mjs";import"../../chunk-4EBBM3AH.mjs";import"../../chunk-S2A3Z34I.mjs";import"../../chunk-MS6UGFXI.mjs";import"../../chunk-JZXLCA2E.mjs";import p from"dotenv";p.config({path:["../../.env.local","../../.env"]});function c(r,{withSentry:a=!0,withPostHogReverseProxy:o=!0,appName:s}){let t={reactStrictMode:!0,trailingSlash:!0,pageExtensions:["ts","tsx"],env:{NEXT_PUBLIC_IS_NEXTJS:"true",NEXT_PUBLIC_BERA_APP_NAME:s},turbopack:{rules:{"*.svg":{as:"*.js",loaders:["@svgr/webpack"]}}},experimental:{webpackBuildWorker:!0},typescript:{ignoreBuildErrors:!0},...r,images:{...r.images,remotePatterns:[...n]},async rewrites(){return o?[{source:"/ph/static/:path*",destination:`https://${e.urls.postHog.region}-assets.i.posthog.com/static/:path*`},{source:"/ph/:path*",destination:`https://${e.urls.postHog.region}.i.posthog.com/:path*`}]:[]}};return o&&(t.env.NEXT_PUBLIC_PH_REVERSE_PROXY_PATH="/ph",t.skipTrailingSlashRedirect=!0),a?i(t):t}export{c as withBeraConfig};
|