@berachain/config 0.0.7 → 0.1.1-5.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.
Files changed (111) hide show
  1. package/dist/bepolia.cjs +8 -1
  2. package/dist/bepolia.d.cts +26 -7
  3. package/dist/bepolia.d.ts +26 -7
  4. package/dist/bepolia.mjs +8 -1
  5. package/dist/chunk-2JZ7QJEW.cjs +84 -0
  6. package/dist/chunk-2XYRGOX3.mjs +64 -0
  7. package/dist/chunk-3K6IUX3G.mjs +25 -0
  8. package/dist/chunk-3XMRQ4AF.cjs +169 -0
  9. package/dist/chunk-6TL5ZQOM.cjs +75 -0
  10. package/dist/chunk-75ZPJI57.cjs +9 -0
  11. package/dist/chunk-7P6ASYW6.mjs +9 -0
  12. package/dist/chunk-ADH7F47T.cjs +26 -0
  13. package/dist/chunk-AMUU2OH4.cjs +158 -0
  14. package/dist/chunk-AP2XG6GJ.mjs +84 -0
  15. package/dist/chunk-BM46XQJA.mjs +55 -0
  16. package/dist/chunk-CAOMAWN5.mjs +26 -0
  17. package/dist/chunk-EYYJ2UZT.cjs +10 -0
  18. package/dist/chunk-JHPXZOPW.mjs +158 -0
  19. package/dist/chunk-JZA34W4G.cjs +138 -0
  20. package/dist/chunk-KJXYSGNH.mjs +10 -0
  21. package/dist/chunk-KYJQS3T5.mjs +138 -0
  22. package/dist/chunk-LALEUPWL.mjs +8 -0
  23. package/dist/chunk-NQ3UKQHW.mjs +75 -0
  24. package/dist/chunk-NX4FI7G3.cjs +64 -0
  25. package/dist/chunk-ONKAV4AG.cjs +25 -0
  26. package/dist/chunk-SWEAJ6OD.mjs +169 -0
  27. package/dist/chunk-WRTYGXJM.cjs +55 -0
  28. package/dist/chunk-YT7WZDGI.cjs +8 -0
  29. package/dist/index.cjs +11 -1
  30. package/dist/index.d.cts +2 -2
  31. package/dist/index.d.ts +2 -2
  32. package/dist/index.mjs +11 -1
  33. package/dist/internal/edge-config/index.cjs +37 -1
  34. package/dist/internal/edge-config/index.d.cts +19 -2
  35. package/dist/internal/edge-config/index.d.ts +19 -2
  36. package/dist/internal/edge-config/index.mjs +37 -1
  37. package/dist/internal/flags/index.cjs +206 -1
  38. package/dist/internal/flags/index.d.cts +13 -1
  39. package/dist/internal/flags/index.d.ts +13 -1
  40. package/dist/internal/flags/index.mjs +206 -1
  41. package/dist/internal/header-sources.cjs +283 -11
  42. package/dist/internal/header-sources.mjs +283 -11
  43. package/dist/internal/index.cjs +40 -1
  44. package/dist/internal/index.d.cts +222 -140
  45. package/dist/internal/index.d.ts +222 -140
  46. package/dist/internal/index.mjs +40 -1
  47. package/dist/internal/maintenance.cjs +26 -1
  48. package/dist/internal/maintenance.mjs +26 -1
  49. package/dist/internal/nextjs/index.cjs +85 -1
  50. package/dist/internal/nextjs/index.d.cts +9 -2
  51. package/dist/internal/nextjs/index.d.ts +9 -2
  52. package/dist/internal/nextjs/index.mjs +85 -1
  53. package/dist/internal/nextjs/utils/index.cjs +39 -1
  54. package/dist/internal/nextjs/utils/index.mjs +39 -1
  55. package/dist/internal/sentry/index.cjs +11 -1
  56. package/dist/internal/sentry/index.mjs +11 -1
  57. package/dist/internal/sentry/sentry.client.config.cjs +59 -1
  58. package/dist/internal/sentry/sentry.client.config.mjs +59 -1
  59. package/dist/internal/tailwind/index.cjs +239 -1
  60. package/dist/internal/tailwind/index.d.cts +21 -11
  61. package/dist/internal/tailwind/index.d.ts +21 -11
  62. package/dist/internal/tailwind/index.mjs +239 -1
  63. package/dist/internal/tsup/index.cjs +73 -1
  64. package/dist/internal/tsup/index.d.cts +1 -1
  65. package/dist/internal/tsup/index.d.ts +1 -1
  66. package/dist/internal/tsup/index.mjs +73 -1
  67. package/dist/internal/wagmi/index.cjs +60 -0
  68. package/dist/internal/wagmi/index.d.cts +12 -0
  69. package/dist/internal/wagmi/index.d.ts +12 -0
  70. package/dist/internal/wagmi/index.mjs +60 -0
  71. package/dist/mainnet.cjs +10 -1
  72. package/dist/mainnet.d.cts +28 -8
  73. package/dist/mainnet.d.ts +28 -8
  74. package/dist/mainnet.mjs +10 -1
  75. package/dist/sentry.edge.config-F4334LEP.cjs +24 -0
  76. package/dist/sentry.edge.config-JU55FF2U.mjs +24 -0
  77. package/dist/sentry.server.config-KFRT37Q3.cjs +24 -0
  78. package/dist/sentry.server.config-M77KFJ6J.mjs +24 -0
  79. package/dist/{types-ChwOSOu9.d.cts → types-ClIxAUdh.d.cts} +25 -5
  80. package/dist/{types-ChwOSOu9.d.ts → types-ClIxAUdh.d.ts} +25 -5
  81. package/package.json +45 -38
  82. package/postcss.json +6 -0
  83. package/LICENSE +0 -21
  84. package/dist/chunk-2OLL4MUY.cjs +0 -1
  85. package/dist/chunk-3KQLFIHT.cjs +0 -2
  86. package/dist/chunk-4VDLQK6F.cjs +0 -1
  87. package/dist/chunk-DFPDQR4M.cjs +0 -1
  88. package/dist/chunk-DL645PXT.mjs +0 -1
  89. package/dist/chunk-DTPRW4VP.mjs +0 -1
  90. package/dist/chunk-DUO7UEQD.cjs +0 -1
  91. package/dist/chunk-DVULZ7ID.cjs +0 -1
  92. package/dist/chunk-EJBC2CPD.cjs +0 -1
  93. package/dist/chunk-FVNATITS.mjs +0 -1
  94. package/dist/chunk-GAUBQIRH.cjs +0 -1
  95. package/dist/chunk-JVJKB7V7.mjs +0 -1
  96. package/dist/chunk-JYSZ2GU3.cjs +0 -1
  97. package/dist/chunk-JZXLCA2E.mjs +0 -1
  98. package/dist/chunk-KB66GOT2.cjs +0 -1
  99. package/dist/chunk-MS6UGFXI.mjs +0 -1
  100. package/dist/chunk-O243TIHY.mjs +0 -1
  101. package/dist/chunk-O5LUKC6Z.mjs +0 -1
  102. package/dist/chunk-OQFLFE3X.cjs +0 -1
  103. package/dist/chunk-PGBQCBTM.mjs +0 -1
  104. package/dist/chunk-S2A3Z34I.mjs +0 -2
  105. package/dist/chunk-TLFLY32O.mjs +0 -1
  106. package/dist/chunk-V2GJ33GF.mjs +0 -1
  107. package/dist/chunk-ZJDKWYPH.cjs +0 -1
  108. package/dist/sentry.edge.config-34TBZ2J6.cjs +0 -1
  109. package/dist/sentry.edge.config-3QO3DLYV.mjs +0 -1
  110. package/dist/sentry.server.config-S53O6JTA.mjs +0 -1
  111. package/dist/sentry.server.config-WQX4KCNG.cjs +0 -1
@@ -1 +1,40 @@
1
- import{a as k,b as l,c as m}from"../chunk-DTPRW4VP.mjs";import"../chunk-V2GJ33GF.mjs";import"../chunk-PGBQCBTM.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-O5LUKC6Z.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,d as cloudinaryBaseUrl,m as config,c as currentDapp,b as defaultChainId,f as getRpcUrls,e as goldskyBaseUrl,h as jsonRpcUrl,j as privateRcpUrl,g as publicJsonRpcUrl};
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-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
+ "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-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
+ 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 }; }var _chunkEJBC2CPDcjs = require('../../chunk-EJBC2CPD.cjs');var _chunkOQFLFE3Xcjs = require('../../chunk-OQFLFE3X.cjs');require('../../chunk-4VDLQK6F.cjs');var _dotenv = require('dotenv'); var _dotenv2 = _interopRequireDefault(_dotenv);_dotenv2.default.config({path:["../../.env.local","../../.env"]});function p(e,{withSentry:o=!0,appName:n}){let t={reactStrictMode:!0,trailingSlash:!0,pageExtensions:["ts","tsx"],env:{NEXT_PUBLIC_IS_NEXTJS:"true",NEXT_PUBLIC_BERA_APP_NAME:n},turbopack:{rules:{"*.svg":{as:"*.js",loaders:["@svgr/webpack"]}}},experimental:{webpackBuildWorker:!0},eslint:{ignoreDuringBuilds:!0},typescript:{ignoreBuildErrors:!0},...e,images:{...e.images,remotePatterns:[..._chunkOQFLFE3Xcjs.a]}};return o?_chunkEJBC2CPDcjs.b.call(void 0, t):t}exports.withBeraConfig = p;
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,5 +1,5 @@
1
1
  import { NextConfig } from 'next';
2
- import { a as AppName } from '../../types-ChwOSOu9.cjs';
2
+ import { a as AppName } from '../../types-ClIxAUdh.cjs';
3
3
 
4
4
  /**
5
5
  * The images config for Bera.
@@ -13,7 +13,7 @@ type BeraImagesConfig = Omit<NextConfig["images"], "remotePatterns">;
13
13
  type BeraNextConfig = Omit<NextConfig, "images"> & {
14
14
  images?: BeraImagesConfig;
15
15
  };
16
- declare function withBeraConfig(config: BeraNextConfig, { withSentry, appName, }: {
16
+ declare function withBeraConfig(config: BeraNextConfig, { withSentry, withPostHogReverseProxy, appName, }: {
17
17
  withSentry?: boolean;
18
18
  /**
19
19
  * The name of the app, it'll be set as NEXT_PUBLIC_BERA_APP_NAME in the environment variables.
@@ -22,6 +22,13 @@ declare function withBeraConfig(config: BeraNextConfig, { withSentry, appName, }
22
22
  * Also, it's used to check if a flag is enabled for the app.
23
23
  */
24
24
  appName: AppName;
25
+ /**
26
+ * Whether to use the PostHog reverse proxy.
27
+ *
28
+ * It's used to bypass the CORS policy of the PostHog API.
29
+ * @see {@link https://posthog.com/docs/advanced/proxy/nextjs}
30
+ */
31
+ withPostHogReverseProxy?: boolean;
25
32
  }): NextConfig;
26
33
 
27
34
  export { withBeraConfig };
@@ -1,5 +1,5 @@
1
1
  import { NextConfig } from 'next';
2
- import { a as AppName } from '../../types-ChwOSOu9.js';
2
+ import { a as AppName } from '../../types-ClIxAUdh.js';
3
3
 
4
4
  /**
5
5
  * The images config for Bera.
@@ -13,7 +13,7 @@ type BeraImagesConfig = Omit<NextConfig["images"], "remotePatterns">;
13
13
  type BeraNextConfig = Omit<NextConfig, "images"> & {
14
14
  images?: BeraImagesConfig;
15
15
  };
16
- declare function withBeraConfig(config: BeraNextConfig, { withSentry, appName, }: {
16
+ declare function withBeraConfig(config: BeraNextConfig, { withSentry, withPostHogReverseProxy, appName, }: {
17
17
  withSentry?: boolean;
18
18
  /**
19
19
  * The name of the app, it'll be set as NEXT_PUBLIC_BERA_APP_NAME in the environment variables.
@@ -22,6 +22,13 @@ declare function withBeraConfig(config: BeraNextConfig, { withSentry, appName, }
22
22
  * Also, it's used to check if a flag is enabled for the app.
23
23
  */
24
24
  appName: AppName;
25
+ /**
26
+ * Whether to use the PostHog reverse proxy.
27
+ *
28
+ * It's used to bypass the CORS policy of the PostHog API.
29
+ * @see {@link https://posthog.com/docs/advanced/proxy/nextjs}
30
+ */
31
+ withPostHogReverseProxy?: boolean;
25
32
  }): NextConfig;
26
33
 
27
34
  export { withBeraConfig };
@@ -1 +1,85 @@
1
- import{b as r}from"../../chunk-TLFLY32O.mjs";import{a as i}from"../../chunk-JVJKB7V7.mjs";import"../../chunk-JZXLCA2E.mjs";import a from"dotenv";a.config({path:["../../.env.local","../../.env"]});function p(e,{withSentry:o=!0,appName:n}){let t={reactStrictMode:!0,trailingSlash:!0,pageExtensions:["ts","tsx"],env:{NEXT_PUBLIC_IS_NEXTJS:"true",NEXT_PUBLIC_BERA_APP_NAME:n},turbopack:{rules:{"*.svg":{as:"*.js",loaders:["@svgr/webpack"]}}},experimental:{webpackBuildWorker:!0},eslint:{ignoreDuringBuilds:!0},typescript:{ignoreBuildErrors:!0},...e,images:{...e.images,remotePatterns:[...i]}};return o?r(t):t}export{p as withBeraConfig};
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});var _chunkOQFLFE3Xcjs = require('../../../chunk-OQFLFE3X.cjs');require('../../../chunk-4VDLQK6F.cjs');function a(t){let e=t.replace(/([.+?^=!:${}()|[\]/\\])/g,"\\$1");return e=e.replace(/\*\*/g,"___DOUBLE_STAR___"),e=e.replace(/\*/g,"[^/]+"),e=e.replace(/___DOUBLE_STAR___/g,".*"),e.startsWith("^")||(e=`^${e}`),e.endsWith("$")||(e=`${e}$`),new RegExp(e)}var o=t=>t.replace(/^https?:\/\//,"");function i(t){try{if(!t)return!1;let e=new URL(t);for(let n of _chunkOQFLFE3Xcjs.a){if(n.protocol&&e.protocol.replace(":","")!==n.protocol||o(e.hostname)!==o(n.hostname))continue;if(!n.pathname||a(n.pathname).test(e.pathname))return!0}return!1}catch (e2){return!1}}exports.isAllowedImageUrl = i;
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{a as r}from"../../../chunk-JVJKB7V7.mjs";import"../../../chunk-JZXLCA2E.mjs";function a(t){let e=t.replace(/([.+?^=!:${}()|[\]/\\])/g,"\\$1");return e=e.replace(/\*\*/g,"___DOUBLE_STAR___"),e=e.replace(/\*/g,"[^/]+"),e=e.replace(/___DOUBLE_STAR___/g,".*"),e.startsWith("^")||(e=`^${e}`),e.endsWith("$")||(e=`${e}$`),new RegExp(e)}var o=t=>t.replace(/^https?:\/\//,"");function i(t){try{if(!t)return!1;let e=new URL(t);for(let n of r){if(n.protocol&&e.protocol.replace(":","")!==n.protocol||o(e.hostname)!==o(n.hostname))continue;if(!n.pathname||a(n.pathname).test(e.pathname))return!0}return!1}catch{return!1}}export{i as isAllowedImageUrl};
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});var _chunkEJBC2CPDcjs = require('../../chunk-EJBC2CPD.cjs');require('../../chunk-4VDLQK6F.cjs');exports.onRequestError = _chunkEJBC2CPDcjs.c; exports.registerSentry = _chunkEJBC2CPDcjs.a; exports.withSentryConfig = _chunkEJBC2CPDcjs.b;
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{a,b,c}from"../../chunk-TLFLY32O.mjs";import"../../chunk-JZXLCA2E.mjs";export{c as onRequestError,a as registerSentry,b as withSentryConfig};
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(); } }var _chunkJYSZ2GU3cjs = require('../../chunk-JYSZ2GU3.cjs');require('../../chunk-DFPDQR4M.cjs');require('../../chunk-3KQLFIHT.cjs');require('../../chunk-2OLL4MUY.cjs');require('../../chunk-4VDLQK6F.cjs');_chunkJYSZ2GU3cjs.d&&console.log("[@berachain/config] sentryDebug init",process.env.NEXT_PUBLIC_SENTRY_DSN);function s(o,n={}){return o.init({dsn:process.env.NEXT_PUBLIC_SENTRY_DSN,tunnel:"/monitoring-tunnel",tracesSampleRate:_chunkJYSZ2GU3cjs.b,debug:_chunkJYSZ2GU3cjs.d,environment:_chunkJYSZ2GU3cjs.a,...n,ignoreErrors:[..._nullishCoalesce(n.ignoreErrors, () => ([])),"Cannot set property ethereum of #<Window> which has only a getter","Cannot destructure property 'register' of 'undefined' as it is undefined.","Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing."]})}exports.initSentryClient = s;
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{a as t,b as r,d as e}from"../../chunk-DL645PXT.mjs";import"../../chunk-O5LUKC6Z.mjs";import"../../chunk-S2A3Z34I.mjs";import"../../chunk-MS6UGFXI.mjs";import"../../chunk-JZXLCA2E.mjs";e&&console.log("[@berachain/config] sentryDebug init",process.env.NEXT_PUBLIC_SENTRY_DSN);function s(o,n={}){return o.init({dsn:process.env.NEXT_PUBLIC_SENTRY_DSN,tunnel:"/monitoring-tunnel",tracesSampleRate:r,debug:e,environment:t,...n,ignoreErrors:[...n.ignoreErrors??[],"Cannot set property ethereum of #<Window> which has only a getter","Cannot destructure property 'register' of 'undefined' as it is undefined.","Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing."]})}export{s as initSentryClient};
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
+ };