@berachain/config 0.1.13 → 0.1.15-beta.1
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 +8 -1
- package/dist/bepolia.d.cts +4 -5
- package/dist/bepolia.d.ts +4 -5
- package/dist/bepolia.mjs +8 -1
- package/dist/chunk-2JZ7QJEW.cjs +84 -0
- package/dist/chunk-2XYRGOX3.mjs +64 -0
- package/dist/chunk-3K6IUX3G.mjs +25 -0
- package/dist/chunk-3XMRQ4AF.cjs +169 -0
- package/dist/chunk-6TL5ZQOM.cjs +75 -0
- package/dist/chunk-75ZPJI57.cjs +9 -0
- package/dist/chunk-7P6ASYW6.mjs +9 -0
- package/dist/chunk-ADH7F47T.cjs +26 -0
- package/dist/chunk-AMUU2OH4.cjs +158 -0
- package/dist/chunk-AP2XG6GJ.mjs +84 -0
- package/dist/chunk-BM46XQJA.mjs +55 -0
- package/dist/chunk-CAOMAWN5.mjs +26 -0
- package/dist/chunk-EYYJ2UZT.cjs +10 -0
- package/dist/chunk-JHPXZOPW.mjs +158 -0
- package/dist/chunk-JZA34W4G.cjs +138 -0
- package/dist/chunk-KJXYSGNH.mjs +10 -0
- package/dist/chunk-KYJQS3T5.mjs +138 -0
- package/dist/chunk-LALEUPWL.mjs +8 -0
- package/dist/chunk-NQ3UKQHW.mjs +75 -0
- package/dist/chunk-NX4FI7G3.cjs +64 -0
- package/dist/chunk-ONKAV4AG.cjs +25 -0
- package/dist/chunk-SWEAJ6OD.mjs +169 -0
- package/dist/chunk-WRTYGXJM.cjs +55 -0
- package/dist/chunk-YT7WZDGI.cjs +8 -0
- package/dist/index.cjs +11 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +11 -1
- package/dist/internal/edge-config/index.cjs +37 -1
- package/dist/internal/edge-config/index.d.cts +1 -1
- package/dist/internal/edge-config/index.d.ts +1 -1
- package/dist/internal/edge-config/index.mjs +37 -1
- package/dist/internal/flags/index.cjs +206 -1
- package/dist/internal/flags/index.d.cts +3 -1
- package/dist/internal/flags/index.d.ts +3 -1
- package/dist/internal/flags/index.mjs +206 -1
- package/dist/internal/header-sources.cjs +283 -11
- package/dist/internal/header-sources.mjs +283 -11
- package/dist/internal/index.cjs +40 -1
- package/dist/internal/index.d.cts +14 -18
- package/dist/internal/index.d.ts +14 -18
- package/dist/internal/index.mjs +40 -1
- package/dist/internal/maintenance.cjs +26 -1
- package/dist/internal/maintenance.mjs +26 -1
- package/dist/internal/nextjs/index.cjs +85 -1
- package/dist/internal/nextjs/index.d.cts +1 -1
- package/dist/internal/nextjs/index.d.ts +1 -1
- package/dist/internal/nextjs/index.mjs +85 -1
- package/dist/internal/nextjs/utils/index.cjs +39 -1
- package/dist/internal/nextjs/utils/index.mjs +39 -1
- package/dist/internal/sentry/index.cjs +11 -1
- package/dist/internal/sentry/index.mjs +11 -1
- package/dist/internal/sentry/sentry.client.config.cjs +59 -1
- package/dist/internal/sentry/sentry.client.config.mjs +59 -1
- package/dist/internal/tailwind/index.cjs +239 -1
- package/dist/internal/tailwind/index.mjs +239 -1
- package/dist/internal/tsup/index.cjs +73 -1
- package/dist/internal/tsup/index.mjs +73 -1
- package/dist/internal/wagmi/index.cjs +60 -1
- package/dist/internal/wagmi/index.mjs +60 -1
- package/dist/mainnet.cjs +10 -1
- package/dist/mainnet.d.cts +4 -5
- package/dist/mainnet.d.ts +4 -5
- package/dist/mainnet.mjs +10 -1
- package/dist/sentry.edge.config-F4334LEP.cjs +24 -0
- package/dist/sentry.edge.config-JU55FF2U.mjs +24 -0
- package/dist/sentry.server.config-KFRT37Q3.cjs +24 -0
- package/dist/sentry.server.config-M77KFJ6J.mjs +24 -0
- package/dist/{types-MT3NuQb7.d.cts → types-ClIxAUdh.d.cts} +0 -5
- package/dist/{types-MT3NuQb7.d.ts → types-ClIxAUdh.d.ts} +0 -5
- package/package.json +2 -2
- package/dist/chunk-276AZYTL.cjs +0 -1
- package/dist/chunk-2OLL4MUY.cjs +0 -1
- package/dist/chunk-3KQLFIHT.cjs +0 -2
- package/dist/chunk-3WZ7JUD6.cjs +0 -1
- package/dist/chunk-4EBBM3AH.mjs +0 -1
- package/dist/chunk-4VDLQK6F.cjs +0 -1
- package/dist/chunk-7BJPOGJ3.cjs +0 -1
- package/dist/chunk-DL645PXT.mjs +0 -1
- package/dist/chunk-DUO7UEQD.cjs +0 -1
- package/dist/chunk-DVULZ7ID.cjs +0 -1
- package/dist/chunk-FVNATITS.mjs +0 -1
- package/dist/chunk-JW76KOHH.mjs +0 -1
- package/dist/chunk-JYSZ2GU3.cjs +0 -1
- package/dist/chunk-JZXLCA2E.mjs +0 -1
- package/dist/chunk-MS6UGFXI.mjs +0 -1
- package/dist/chunk-O243TIHY.mjs +0 -1
- package/dist/chunk-S2A3Z34I.mjs +0 -2
- package/dist/chunk-SU5YRBAA.mjs +0 -1
- package/dist/chunk-TQ67UFXV.cjs +0 -1
- package/dist/chunk-VWV244JK.mjs +0 -1
- package/dist/chunk-XBV7BAIE.cjs +0 -1
- package/dist/chunk-XO2H4NRK.mjs +0 -1
- package/dist/chunk-YQK5O5ZL.cjs +0 -1
- package/dist/chunk-ZA2X4K7Z.mjs +0 -1
- package/dist/sentry.edge.config-DS2KE3CX.cjs +0 -1
- package/dist/sentry.edge.config-OEQTPQ2L.mjs +0 -1
- package/dist/sentry.server.config-KRS7OUMO.mjs +0 -1
- package/dist/sentry.server.config-RNY6FTJT.cjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ChainId, a as AppName, A as Address } from '../types-
|
|
2
|
-
export { B as BeraConfig, H as HttpLink, P as ProjectName } from '../types-
|
|
1
|
+
import { C as ChainId, a as AppName, A as Address } from '../types-ClIxAUdh.cjs';
|
|
2
|
+
export { B as BeraConfig, H as HttpLink, P as ProjectName } from '../types-ClIxAUdh.cjs';
|
|
3
3
|
|
|
4
4
|
declare const defaultChainId: ChainId;
|
|
5
5
|
|
|
@@ -57,10 +57,9 @@ declare const chainConfigs: {
|
|
|
57
57
|
readonly subgraph: {
|
|
58
58
|
readonly name: "pol-subgraph";
|
|
59
59
|
readonly uri: string;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
readonly uri: string;
|
|
60
|
+
readonly headers: {
|
|
61
|
+
Authorization: string;
|
|
62
|
+
} | undefined;
|
|
64
63
|
};
|
|
65
64
|
readonly bribeBoostApi: string;
|
|
66
65
|
readonly bgtIncentiveDistributor: "0x77DA09bC82652f9A14d1b170a001e759640298e6";
|
|
@@ -209,10 +208,9 @@ declare const chainConfigs: {
|
|
|
209
208
|
readonly subgraph: {
|
|
210
209
|
readonly name: "pol-subgraph";
|
|
211
210
|
readonly uri: string;
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
readonly uri: string;
|
|
211
|
+
readonly headers: {
|
|
212
|
+
Authorization: string;
|
|
213
|
+
} | undefined;
|
|
216
214
|
};
|
|
217
215
|
readonly bribeBoostApi: string;
|
|
218
216
|
readonly bgtIncentiveDistributor: "0xb0d005Fe83E3F1ec876C1a64700c5F0d6265d9E3";
|
|
@@ -468,10 +466,9 @@ declare const config: {
|
|
|
468
466
|
readonly subgraph: {
|
|
469
467
|
readonly name: "pol-subgraph";
|
|
470
468
|
readonly uri: string;
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
readonly uri: string;
|
|
469
|
+
readonly headers: {
|
|
470
|
+
Authorization: string;
|
|
471
|
+
} | undefined;
|
|
475
472
|
};
|
|
476
473
|
readonly bribeBoostApi: string;
|
|
477
474
|
readonly bgtIncentiveDistributor: "0x77DA09bC82652f9A14d1b170a001e759640298e6";
|
|
@@ -619,10 +616,9 @@ declare const config: {
|
|
|
619
616
|
readonly subgraph: {
|
|
620
617
|
readonly name: "pol-subgraph";
|
|
621
618
|
readonly uri: string;
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
readonly uri: string;
|
|
619
|
+
readonly headers: {
|
|
620
|
+
Authorization: string;
|
|
621
|
+
} | undefined;
|
|
626
622
|
};
|
|
627
623
|
readonly bribeBoostApi: string;
|
|
628
624
|
readonly bgtIncentiveDistributor: "0xb0d005Fe83E3F1ec876C1a64700c5F0d6265d9E3";
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ChainId, a as AppName, A as Address } from '../types-
|
|
2
|
-
export { B as BeraConfig, H as HttpLink, P as ProjectName } from '../types-
|
|
1
|
+
import { C as ChainId, a as AppName, A as Address } from '../types-ClIxAUdh.js';
|
|
2
|
+
export { B as BeraConfig, H as HttpLink, P as ProjectName } from '../types-ClIxAUdh.js';
|
|
3
3
|
|
|
4
4
|
declare const defaultChainId: ChainId;
|
|
5
5
|
|
|
@@ -57,10 +57,9 @@ declare const chainConfigs: {
|
|
|
57
57
|
readonly subgraph: {
|
|
58
58
|
readonly name: "pol-subgraph";
|
|
59
59
|
readonly uri: string;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
readonly uri: string;
|
|
60
|
+
readonly headers: {
|
|
61
|
+
Authorization: string;
|
|
62
|
+
} | undefined;
|
|
64
63
|
};
|
|
65
64
|
readonly bribeBoostApi: string;
|
|
66
65
|
readonly bgtIncentiveDistributor: "0x77DA09bC82652f9A14d1b170a001e759640298e6";
|
|
@@ -209,10 +208,9 @@ declare const chainConfigs: {
|
|
|
209
208
|
readonly subgraph: {
|
|
210
209
|
readonly name: "pol-subgraph";
|
|
211
210
|
readonly uri: string;
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
readonly uri: string;
|
|
211
|
+
readonly headers: {
|
|
212
|
+
Authorization: string;
|
|
213
|
+
} | undefined;
|
|
216
214
|
};
|
|
217
215
|
readonly bribeBoostApi: string;
|
|
218
216
|
readonly bgtIncentiveDistributor: "0xb0d005Fe83E3F1ec876C1a64700c5F0d6265d9E3";
|
|
@@ -468,10 +466,9 @@ declare const config: {
|
|
|
468
466
|
readonly subgraph: {
|
|
469
467
|
readonly name: "pol-subgraph";
|
|
470
468
|
readonly uri: string;
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
readonly uri: string;
|
|
469
|
+
readonly headers: {
|
|
470
|
+
Authorization: string;
|
|
471
|
+
} | undefined;
|
|
475
472
|
};
|
|
476
473
|
readonly bribeBoostApi: string;
|
|
477
474
|
readonly bgtIncentiveDistributor: "0x77DA09bC82652f9A14d1b170a001e759640298e6";
|
|
@@ -619,10 +616,9 @@ declare const config: {
|
|
|
619
616
|
readonly subgraph: {
|
|
620
617
|
readonly name: "pol-subgraph";
|
|
621
618
|
readonly uri: string;
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
readonly uri: string;
|
|
619
|
+
readonly headers: {
|
|
620
|
+
Authorization: string;
|
|
621
|
+
} | undefined;
|
|
626
622
|
};
|
|
627
623
|
readonly bribeBoostApi: string;
|
|
628
624
|
readonly bgtIncentiveDistributor: "0xb0d005Fe83E3F1ec876C1a64700c5F0d6265d9E3";
|
package/dist/internal/index.mjs
CHANGED
|
@@ -1 +1,40 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
appConfig,
|
|
3
|
+
chainConfigs,
|
|
4
|
+
config
|
|
5
|
+
} from "../chunk-KYJQS3T5.mjs";
|
|
6
|
+
import "../chunk-SWEAJ6OD.mjs";
|
|
7
|
+
import "../chunk-JHPXZOPW.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 +1,26 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-75ZPJI57.cjs');
|
|
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 +1,26 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import "../chunk-7P6ASYW6.mjs";
|
|
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 +1,85 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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 _chunkJZA34W4Gcjs = require('../../chunk-JZA34W4G.cjs');
|
|
10
|
+
require('../../chunk-3XMRQ4AF.cjs');
|
|
11
|
+
require('../../chunk-AMUU2OH4.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://${_chunkJZA34W4Gcjs.appConfig.urls.postHog.region}-assets.i.posthog.com/static/:path*`
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
source: "/ph/:path*",
|
|
71
|
+
destination: `https://${_chunkJZA34W4Gcjs.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 +1,85 @@
|
|
|
1
|
-
import
|
|
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-KYJQS3T5.mjs";
|
|
10
|
+
import "../../chunk-SWEAJ6OD.mjs";
|
|
11
|
+
import "../../chunk-JHPXZOPW.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 +1,39 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk2JZ7QJEWcjs = require('../../../chunk-2JZ7QJEW.cjs');
|
|
4
|
+
require('../../../chunk-75ZPJI57.cjs');
|
|
5
|
+
|
|
6
|
+
// src/internal/nextjs/utils/index.ts
|
|
7
|
+
function globToRegExp(glob) {
|
|
8
|
+
let re = glob.replace(/([.+?^=!:${}()|[\]/\\])/g, "\\$1");
|
|
9
|
+
re = re.replace(/\*\*/g, "___DOUBLE_STAR___");
|
|
10
|
+
re = re.replace(/\*/g, "[^/]+");
|
|
11
|
+
re = re.replace(/___DOUBLE_STAR___/g, ".*");
|
|
12
|
+
if (!re.startsWith("^")) re = `^${re}`;
|
|
13
|
+
if (!re.endsWith("$")) re = `${re}$`;
|
|
14
|
+
return new RegExp(re);
|
|
15
|
+
}
|
|
16
|
+
var normalizeHostname = (hostname) => hostname.replace(/^https?:\/\//, "");
|
|
17
|
+
function isAllowedImageUrl(urlString) {
|
|
18
|
+
try {
|
|
19
|
+
if (!urlString) return false;
|
|
20
|
+
const url = new URL(urlString);
|
|
21
|
+
for (const pattern of _chunk2JZ7QJEWcjs.IMAGE_REMOTE_PATTERNS) {
|
|
22
|
+
if (pattern.protocol && url.protocol.replace(":", "") !== pattern.protocol)
|
|
23
|
+
continue;
|
|
24
|
+
if (normalizeHostname(url.hostname) !== normalizeHostname(pattern.hostname))
|
|
25
|
+
continue;
|
|
26
|
+
if (!pattern.pathname) return true;
|
|
27
|
+
const pathnameRegex = globToRegExp(pattern.pathname);
|
|
28
|
+
if (pathnameRegex.test(url.pathname)) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
} catch (e) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
exports.isAllowedImageUrl = isAllowedImageUrl;
|
|
@@ -1 +1,39 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
IMAGE_REMOTE_PATTERNS
|
|
3
|
+
} from "../../../chunk-AP2XG6GJ.mjs";
|
|
4
|
+
import "../../../chunk-7P6ASYW6.mjs";
|
|
5
|
+
|
|
6
|
+
// src/internal/nextjs/utils/index.ts
|
|
7
|
+
function globToRegExp(glob) {
|
|
8
|
+
let re = glob.replace(/([.+?^=!:${}()|[\]/\\])/g, "\\$1");
|
|
9
|
+
re = re.replace(/\*\*/g, "___DOUBLE_STAR___");
|
|
10
|
+
re = re.replace(/\*/g, "[^/]+");
|
|
11
|
+
re = re.replace(/___DOUBLE_STAR___/g, ".*");
|
|
12
|
+
if (!re.startsWith("^")) re = `^${re}`;
|
|
13
|
+
if (!re.endsWith("$")) re = `${re}$`;
|
|
14
|
+
return new RegExp(re);
|
|
15
|
+
}
|
|
16
|
+
var normalizeHostname = (hostname) => hostname.replace(/^https?:\/\//, "");
|
|
17
|
+
function isAllowedImageUrl(urlString) {
|
|
18
|
+
try {
|
|
19
|
+
if (!urlString) return false;
|
|
20
|
+
const url = new URL(urlString);
|
|
21
|
+
for (const pattern of IMAGE_REMOTE_PATTERNS) {
|
|
22
|
+
if (pattern.protocol && url.protocol.replace(":", "") !== pattern.protocol)
|
|
23
|
+
continue;
|
|
24
|
+
if (normalizeHostname(url.hostname) !== normalizeHostname(pattern.hostname))
|
|
25
|
+
continue;
|
|
26
|
+
if (!pattern.pathname) return true;
|
|
27
|
+
const pathnameRegex = globToRegExp(pattern.pathname);
|
|
28
|
+
if (pathnameRegex.test(url.pathname)) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
} catch {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
isAllowedImageUrl
|
|
39
|
+
};
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunk6TL5ZQOMcjs = require('../../chunk-6TL5ZQOM.cjs');
|
|
6
|
+
require('../../chunk-75ZPJI57.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.onRequestError = _chunk6TL5ZQOMcjs.onRequestError; exports.registerSentry = _chunk6TL5ZQOMcjs.registerSentry; exports.withSentryConfig = _chunk6TL5ZQOMcjs.withSentryConfig;
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import {
|
|
2
|
+
onRequestError,
|
|
3
|
+
registerSentry,
|
|
4
|
+
withSentryConfig
|
|
5
|
+
} from "../../chunk-NQ3UKQHW.mjs";
|
|
6
|
+
import "../../chunk-7P6ASYW6.mjs";
|
|
7
|
+
export {
|
|
8
|
+
onRequestError,
|
|
9
|
+
registerSentry,
|
|
10
|
+
withSentryConfig
|
|
11
|
+
};
|
|
@@ -1 +1,59 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkONKAV4AGcjs = require('../../chunk-ONKAV4AG.cjs');
|
|
6
|
+
require('../../chunk-WRTYGXJM.cjs');
|
|
7
|
+
require('../../chunk-ADH7F47T.cjs');
|
|
8
|
+
require('../../chunk-EYYJ2UZT.cjs');
|
|
9
|
+
require('../../chunk-75ZPJI57.cjs');
|
|
10
|
+
|
|
11
|
+
// src/internal/sentry/sentry.client.config.ts
|
|
12
|
+
if (_chunkONKAV4AGcjs.sentryDebug) {
|
|
13
|
+
console.log(
|
|
14
|
+
"[@berachain/config] sentryDebug init",
|
|
15
|
+
process.env.NEXT_PUBLIC_SENTRY_DSN
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
function initSentryClient(Sentry, opt = {}) {
|
|
19
|
+
return Sentry.init({
|
|
20
|
+
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
|
|
21
|
+
tunnel: "/monitoring-tunnel",
|
|
22
|
+
// Adjust this value in production, or use tracesSampler for greater control
|
|
23
|
+
tracesSampleRate: _chunkONKAV4AGcjs.tracesSampleRate,
|
|
24
|
+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
|
|
25
|
+
debug: _chunkONKAV4AGcjs.sentryDebug,
|
|
26
|
+
environment: _chunkONKAV4AGcjs.sentryEnvironment,
|
|
27
|
+
...opt,
|
|
28
|
+
// You can remove this option if you're not planning to use the Sentry Session Replay feature:
|
|
29
|
+
// integrations: [],
|
|
30
|
+
ignoreErrors: [
|
|
31
|
+
..._nullishCoalesce(opt.ignoreErrors, () => ( [])),
|
|
32
|
+
// Browser extension - window global injection conflicts (ethereum, tron, solana, etc.)
|
|
33
|
+
/Cannot (set|assign to read only) property .+ of (object )?'?#<Window>/,
|
|
34
|
+
// Browser extension - proxy trap conflicts (e.g. TronLink tronlinkParams)
|
|
35
|
+
/'set' on proxy: trap returned falsish for property/,
|
|
36
|
+
// Browser extension - property descriptor redefinition
|
|
37
|
+
/Invalid property descriptor\. Cannot both specify accessors and a value or writable attribute/,
|
|
38
|
+
// Chrome extension messaging called from page context
|
|
39
|
+
/chrome\.runtime\.sendMessage\(\) called from a webpage/,
|
|
40
|
+
// Chrome extension port errors
|
|
41
|
+
"Could not establish connection. Receiving end does not exist.",
|
|
42
|
+
"Attempting to use a disconnected port object",
|
|
43
|
+
// WalletConnect authorization / session errors
|
|
44
|
+
/The source .+ has not been authorized yet/,
|
|
45
|
+
/No matching key\. session topic doesn't exist/,
|
|
46
|
+
// Wallet connection failures
|
|
47
|
+
/Failed to connect to MetaMask/,
|
|
48
|
+
"not found rainbowkit",
|
|
49
|
+
// WalletConnect
|
|
50
|
+
"Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.",
|
|
51
|
+
// wagmi
|
|
52
|
+
"The provider is disconnected from all chains.",
|
|
53
|
+
"Cannot destructure property 'register' of 'undefined' as it is undefined."
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
exports.initSentryClient = initSentryClient;
|
|
@@ -1 +1,59 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
sentryDebug,
|
|
3
|
+
sentryEnvironment,
|
|
4
|
+
tracesSampleRate
|
|
5
|
+
} from "../../chunk-3K6IUX3G.mjs";
|
|
6
|
+
import "../../chunk-BM46XQJA.mjs";
|
|
7
|
+
import "../../chunk-CAOMAWN5.mjs";
|
|
8
|
+
import "../../chunk-KJXYSGNH.mjs";
|
|
9
|
+
import "../../chunk-7P6ASYW6.mjs";
|
|
10
|
+
|
|
11
|
+
// src/internal/sentry/sentry.client.config.ts
|
|
12
|
+
if (sentryDebug) {
|
|
13
|
+
console.log(
|
|
14
|
+
"[@berachain/config] sentryDebug init",
|
|
15
|
+
process.env.NEXT_PUBLIC_SENTRY_DSN
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
function initSentryClient(Sentry, opt = {}) {
|
|
19
|
+
return Sentry.init({
|
|
20
|
+
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
|
|
21
|
+
tunnel: "/monitoring-tunnel",
|
|
22
|
+
// Adjust this value in production, or use tracesSampler for greater control
|
|
23
|
+
tracesSampleRate,
|
|
24
|
+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
|
|
25
|
+
debug: sentryDebug,
|
|
26
|
+
environment: sentryEnvironment,
|
|
27
|
+
...opt,
|
|
28
|
+
// You can remove this option if you're not planning to use the Sentry Session Replay feature:
|
|
29
|
+
// integrations: [],
|
|
30
|
+
ignoreErrors: [
|
|
31
|
+
...opt.ignoreErrors ?? [],
|
|
32
|
+
// Browser extension - window global injection conflicts (ethereum, tron, solana, etc.)
|
|
33
|
+
/Cannot (set|assign to read only) property .+ of (object )?'?#<Window>/,
|
|
34
|
+
// Browser extension - proxy trap conflicts (e.g. TronLink tronlinkParams)
|
|
35
|
+
/'set' on proxy: trap returned falsish for property/,
|
|
36
|
+
// Browser extension - property descriptor redefinition
|
|
37
|
+
/Invalid property descriptor\. Cannot both specify accessors and a value or writable attribute/,
|
|
38
|
+
// Chrome extension messaging called from page context
|
|
39
|
+
/chrome\.runtime\.sendMessage\(\) called from a webpage/,
|
|
40
|
+
// Chrome extension port errors
|
|
41
|
+
"Could not establish connection. Receiving end does not exist.",
|
|
42
|
+
"Attempting to use a disconnected port object",
|
|
43
|
+
// WalletConnect authorization / session errors
|
|
44
|
+
/The source .+ has not been authorized yet/,
|
|
45
|
+
/No matching key\. session topic doesn't exist/,
|
|
46
|
+
// Wallet connection failures
|
|
47
|
+
/Failed to connect to MetaMask/,
|
|
48
|
+
"not found rainbowkit",
|
|
49
|
+
// WalletConnect
|
|
50
|
+
"Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.",
|
|
51
|
+
// wagmi
|
|
52
|
+
"The provider is disconnected from all chains.",
|
|
53
|
+
"Cannot destructure property 'register' of 'undefined' as it is undefined."
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
initSentryClient
|
|
59
|
+
};
|