@berachain/config 0.1.21 → 0.1.22-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 (79) hide show
  1. package/dist/bepolia.d.ts +3 -5
  2. package/dist/bepolia.d.ts.map +1 -0
  3. package/dist/index.d.ts +3 -6
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/internal/edge-config/{index.d.cts → edgeConfig.codegen.d.ts} +13 -62
  6. package/dist/internal/edge-config/edgeConfig.codegen.d.ts.map +1 -0
  7. package/dist/internal/edge-config/index.d.ts +5 -335
  8. package/dist/internal/edge-config/index.d.ts.map +1 -0
  9. package/dist/internal/edge-config/isFlagEnabled.d.ts +17 -0
  10. package/dist/internal/edge-config/isFlagEnabled.d.ts.map +1 -0
  11. package/dist/internal/edge-config/safeGetAll.d.ts +15 -0
  12. package/dist/internal/edge-config/safeGetAll.d.ts.map +1 -0
  13. package/dist/internal/edge-config/safeGetConfig.d.ts +19 -0
  14. package/dist/internal/edge-config/safeGetConfig.d.ts.map +1 -0
  15. package/dist/internal/flags/beraEdgeConfigAdapter.d.ts +9 -0
  16. package/dist/internal/flags/beraEdgeConfigAdapter.d.ts.map +1 -0
  17. package/dist/internal/flags/flags.d.ts +29 -0
  18. package/dist/internal/flags/flags.d.ts.map +1 -0
  19. package/dist/internal/flags/index.d.ts +2 -60
  20. package/dist/internal/flags/index.d.ts.map +1 -0
  21. package/dist/internal/header-sources.d.ts +5 -7
  22. package/dist/internal/header-sources.d.ts.map +1 -0
  23. package/dist/internal/index.d.ts +139 -173
  24. package/dist/internal/index.d.ts.map +1 -0
  25. package/dist/internal/maintenance.d.ts +5 -7
  26. package/dist/internal/maintenance.d.ts.map +1 -0
  27. package/dist/internal/nextjs/const.d.ts +3 -0
  28. package/dist/internal/nextjs/const.d.ts.map +1 -0
  29. package/dist/internal/nextjs/index.d.ts +5 -6
  30. package/dist/internal/nextjs/index.d.ts.map +1 -0
  31. package/dist/internal/nextjs/utils/index.d.ts +2 -3
  32. package/dist/internal/nextjs/utils/index.d.ts.map +1 -0
  33. package/dist/internal/sentry/getSentryKeys.d.ts +16 -0
  34. package/dist/internal/sentry/getSentryKeys.d.ts.map +1 -0
  35. package/dist/internal/sentry/index.d.ts +6 -8
  36. package/dist/internal/sentry/index.d.ts.map +1 -0
  37. package/dist/internal/sentry/sentry.client.config.d.ts +3 -6
  38. package/dist/internal/sentry/sentry.client.config.d.ts.map +1 -0
  39. package/dist/internal/sentry/sentry.edge.config.d.ts +3 -0
  40. package/dist/internal/sentry/sentry.edge.config.d.ts.map +1 -0
  41. package/dist/internal/sentry/sentry.server.config.d.ts +3 -0
  42. package/dist/internal/sentry/sentry.server.config.d.ts.map +1 -0
  43. package/dist/internal/sentry/sentryEnvironment.d.ts +6 -0
  44. package/dist/internal/sentry/sentryEnvironment.d.ts.map +1 -0
  45. package/dist/internal/tailwind/{index.d.cts → config.d.ts} +14 -16
  46. package/dist/internal/tailwind/config.d.ts.map +1 -0
  47. package/dist/internal/tailwind/index.d.ts +6 -8
  48. package/dist/internal/tailwind/index.d.ts.map +1 -0
  49. package/dist/internal/tsup/index.cjs +30 -4
  50. package/dist/internal/tsup/index.d.ts +3 -6
  51. package/dist/internal/tsup/index.d.ts.map +1 -0
  52. package/dist/internal/tsup/index.mjs +30 -4
  53. package/dist/internal/wagmi/index.d.ts +6 -8
  54. package/dist/internal/wagmi/index.d.ts.map +1 -0
  55. package/dist/mainnet.d.ts +3 -5
  56. package/dist/mainnet.d.ts.map +1 -0
  57. package/dist/{types-Drv0VlAi.d.cts → types.d.ts} +8 -8
  58. package/dist/types.d.ts.map +1 -0
  59. package/dist/utils/dynamicEnvVariable.d.ts +21 -0
  60. package/dist/utils/dynamicEnvVariable.d.ts.map +1 -0
  61. package/dist/utils/env.d.ts +29 -0
  62. package/dist/utils/env.d.ts.map +1 -0
  63. package/dist/utils/getUriFromLink.d.ts +3 -0
  64. package/dist/utils/getUriFromLink.d.ts.map +1 -0
  65. package/package.json +1 -1
  66. package/dist/bepolia.d.cts +0 -169
  67. package/dist/index.d.cts +0 -6
  68. package/dist/internal/flags/index.d.cts +0 -60
  69. package/dist/internal/header-sources.d.cts +0 -22
  70. package/dist/internal/index.d.cts +0 -749
  71. package/dist/internal/maintenance.d.cts +0 -11
  72. package/dist/internal/nextjs/index.d.cts +0 -34
  73. package/dist/internal/nextjs/utils/index.d.cts +0 -9
  74. package/dist/internal/sentry/index.d.cts +0 -13
  75. package/dist/internal/sentry/sentry.client.config.d.cts +0 -6
  76. package/dist/internal/tsup/index.d.cts +0 -6
  77. package/dist/internal/wagmi/index.d.cts +0 -12
  78. package/dist/mainnet.d.cts +0 -154
  79. package/dist/types-Drv0VlAi.d.ts +0 -214
@@ -1,6 +1,5 @@
1
- import { NextConfig } from 'next';
2
- import { a as AppName } from '../../types-Drv0VlAi.js';
3
-
1
+ import type { NextConfig } from "next";
2
+ import type { AppName } from "../../types";
4
3
  /**
5
4
  * The images config for Bera.
6
5
  * It's a subset of the Next.js images config.
@@ -13,7 +12,7 @@ type BeraImagesConfig = Omit<NextConfig["images"], "remotePatterns">;
13
12
  type BeraNextConfig = Omit<NextConfig, "images"> & {
14
13
  images?: BeraImagesConfig;
15
14
  };
16
- declare function withBeraConfig(config: BeraNextConfig, { withSentry, withPostHogReverseProxy, appName, }: {
15
+ export declare function withBeraConfig(config: BeraNextConfig, { withSentry, withPostHogReverseProxy, appName, }: {
17
16
  withSentry?: boolean;
18
17
  /**
19
18
  * The name of the app, it'll be set as NEXT_PUBLIC_BERA_APP_NAME in the environment variables.
@@ -30,5 +29,5 @@ declare function withBeraConfig(config: BeraNextConfig, { withSentry, withPostHo
30
29
  */
31
30
  withPostHogReverseProxy?: boolean;
32
31
  }): NextConfig;
33
-
34
- export { withBeraConfig };
32
+ export {};
33
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/nextjs/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAQ3C;;;GAGG;AACH,KAAK,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC,CAAC;AAErE;;;GAGG;AACH,KAAK,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,GAAG;IACjD,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B,CAAC;AAEF,wBAAgB,cAAc,CAC5B,MAAM,EAAE,cAAc,EACtB,EACE,UAAiB,EACjB,uBAA8B,EAC9B,OAAO,GACR,EAAE;IACD,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,GACA,UAAU,CA4DZ"}
@@ -4,6 +4,5 @@
4
4
  * @param urlString - The URL to check.
5
5
  * @returns boolean indicating if the url matches one of the allowed remote patterns.
6
6
  */
7
- declare function isAllowedImageUrl(urlString: string | undefined): boolean;
8
-
9
- export { isAllowedImageUrl };
7
+ export declare function isAllowedImageUrl(urlString: string | undefined): boolean;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/internal/nextjs/utils/index.ts"],"names":[],"mappings":"AA4BA;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAgCxE"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Parses the Sentry DSN and returns the keys and csp endpoint.
3
+ *
4
+ * NEXT_PUBLIC_SENTRY_DSN is usually set by Sentry Vercel integration.
5
+ */
6
+ export declare function getSentryKeys({ dsn, }?: {
7
+ dsn?: string;
8
+ }): {
9
+ dsn: string;
10
+ projectId: string;
11
+ deprecatedSecret: string | undefined;
12
+ cspEndpoint: URL;
13
+ org: string;
14
+ publicKey: string;
15
+ } | undefined;
16
+ //# sourceMappingURL=getSentryKeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSentryKeys.d.ts","sourceRoot":"","sources":["../../../src/internal/sentry/getSentryKeys.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,GAAwC,GACzC,GAAE;IACD,GAAG,CAAC,EAAE,MAAM,CAAC;CACT;;;;;;;cAuCL"}
@@ -1,13 +1,11 @@
1
- import * as Sentry from '@sentry/nextjs';
2
- import { NextConfig } from 'next';
3
-
1
+ import * as Sentry from "@sentry/nextjs";
2
+ import type { NextConfig } from "next";
4
3
  /**
5
4
  * This function registers Sentry in nextjs instrumentation.
6
5
  *
7
6
  * @link https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#create-initialization-config-files
8
7
  */
9
- declare function registerSentry(opt?: Parameters<typeof Sentry.init>[0]): Promise<void>;
10
- declare function withSentryConfig(config: NextConfig): NextConfig;
11
- declare const onRequestError: typeof Sentry.captureRequestError;
12
-
13
- export { onRequestError, registerSentry, withSentryConfig };
8
+ export declare function registerSentry(opt?: Parameters<typeof Sentry.init>[0]): Promise<void>;
9
+ export declare function withSentryConfig(config: NextConfig): NextConfig;
10
+ export declare const onRequestError: typeof Sentry.captureRequestError;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/sentry/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,GAAG,GAAE,UAAU,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAM,iBAa5C;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,cAoElD;AAED,eAAO,MAAM,cAAc,mCAA6B,CAAC"}
@@ -1,6 +1,3 @@
1
- import * as _sentry_core from '@sentry/core';
2
- import * as Sentry from '@sentry/nextjs';
3
-
4
- declare function initSentryClient(Sentry: typeof Sentry, opt?: Sentry.BrowserOptions): _sentry_core.Client<_sentry_core.ClientOptions<_sentry_core.BaseTransportOptions>> | undefined;
5
-
6
- export { initSentryClient };
1
+ import type * as SentryType from "@sentry/nextjs";
2
+ export declare function initSentryClient(Sentry: typeof SentryType, opt?: SentryType.BrowserOptions): import("@sentry/core").Client<import("@sentry/core").ClientOptions<import("@sentry/core").BaseTransportOptions>> | undefined;
3
+ //# sourceMappingURL=sentry.client.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry.client.config.d.ts","sourceRoot":"","sources":["../../../src/internal/sentry/sentry.client.config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,UAAU,MAAM,gBAAgB,CAAC;AAelD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,OAAO,UAAU,EACzB,GAAG,GAAE,UAAU,CAAC,cAAmB,gIAoDpC"}
@@ -0,0 +1,3 @@
1
+ import type * as SentryType from "@sentry/nextjs";
2
+ export declare function initSentryEdge(Sentry: typeof SentryType, opt?: SentryType.EdgeOptions): import("@sentry/core").Client<import("@sentry/core").ClientOptions<import("@sentry/core").BaseTransportOptions>> | undefined;
3
+ //# sourceMappingURL=sentry.edge.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry.edge.config.d.ts","sourceRoot":"","sources":["../../../src/internal/sentry/sentry.edge.config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,UAAU,MAAM,gBAAgB,CAAC;AAIlD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,OAAO,UAAU,EACzB,GAAG,GAAE,UAAU,CAAC,WAAgB,gIAajC"}
@@ -0,0 +1,3 @@
1
+ import type * as SentryType from "@sentry/nextjs";
2
+ export declare function initSentryServer(Sentry: typeof SentryType, opt?: SentryType.NodeOptions): import("@sentry/core").Client<import("@sentry/core").ClientOptions<import("@sentry/core").BaseTransportOptions>> | undefined;
3
+ //# sourceMappingURL=sentry.server.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry.server.config.d.ts","sourceRoot":"","sources":["../../../src/internal/sentry/sentry.server.config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,UAAU,MAAM,gBAAgB,CAAC;AAIlD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,OAAO,UAAU,EACzB,GAAG,GAAE,UAAU,CAAC,WAAgB,gIAcjC"}
@@ -0,0 +1,6 @@
1
+ declare let sentryEnvironment: string;
2
+ export { sentryEnvironment };
3
+ export declare const tracesSampleRate: number;
4
+ export declare const sentryRelease: string;
5
+ export declare const sentryDebug: boolean;
6
+ //# sourceMappingURL=sentryEnvironment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentryEnvironment.d.ts","sourceRoot":"","sources":["../../../src/internal/sentry/sentryEnvironment.ts"],"names":[],"mappings":"AAIA,QAAA,IAAI,iBAAiB,QAAwD,CAAC;AAU9E,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B,eAAO,MAAM,gBAAgB,QAAyB,CAAC;AAEvD,eAAO,MAAM,aAAa,QAAoC,CAAC;AAE/D,eAAO,MAAM,WAAW,SAAkD,CAAC"}
@@ -1,17 +1,13 @@
1
- import * as tailwindcss_types_config from 'tailwindcss/types/config';
2
- import typography from '@tailwindcss/typography';
3
-
4
- declare const config: {
5
- plugins: ({
6
- handler: tailwindcss_types_config.PluginCreator;
7
- config?: Partial<tailwindcss_types_config.Config> | undefined;
8
- } | typeof typography | {
9
- handler: () => void;
10
- })[];
11
- darkMode: ["class"];
12
- safelist: ["dark", "light"];
13
- content: ["src/**/*.{js,ts,jsx,tsx,mdx}", "../../packages/ui/src/*.{ts,tsx}", "../../packages/ui/src/**/*.{ts,tsx}", "../../packages/shared-ui/src/*.{ts,tsx}", "../../packages/shared-ui/src/**/*.{ts,tsx}"];
14
- theme: {
1
+ /**
2
+ * This is the tailwind config without any use of require().
3
+ * This makes it easier to import it in storybook. It should not be imported
4
+ * by projects. It still can have plugin configs though as long as `require` is not used.
5
+ */
6
+ export declare const configWithNoPlugins: {
7
+ readonly darkMode: ["class"];
8
+ readonly safelist: ["dark", "light"];
9
+ readonly content: ["src/**/*.{js,ts,jsx,tsx,mdx}", "../../packages/ui/src/*.{ts,tsx}", "../../packages/ui/src/**/*.{ts,tsx}", "../../packages/shared-ui/src/*.{ts,tsx}", "../../packages/shared-ui/src/**/*.{ts,tsx}"];
10
+ readonly theme: {
15
11
  readonly fontSize: {
16
12
  readonly xs: ["0.75rem", {
17
13
  readonly lineHeight: "1rem";
@@ -53,6 +49,9 @@ declare const config: {
53
49
  readonly "9xl": ["8rem", {
54
50
  readonly lineHeight: "1";
55
51
  }];
52
+ /**
53
+ * Typography sizes
54
+ */
56
55
  readonly h1: ["3rem", {
57
56
  readonly lineHeight: "3.5rem";
58
57
  readonly fontWeight: "700";
@@ -253,5 +252,4 @@ declare const config: {
253
252
  };
254
253
  };
255
254
  };
256
-
257
- export { config, config as default };
255
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/internal/tailwind/config.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA0B1B;;eAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8LkB,CAAC"}
@@ -1,10 +1,8 @@
1
- import * as tailwindcss_types_config from 'tailwindcss/types/config';
2
- import typography from '@tailwindcss/typography';
3
-
4
- declare const config: {
1
+ import typography from "@tailwindcss/typography";
2
+ export declare const config: {
5
3
  plugins: ({
6
- handler: tailwindcss_types_config.PluginCreator;
7
- config?: Partial<tailwindcss_types_config.Config> | undefined;
4
+ handler: import("tailwindcss/types/config").PluginCreator;
5
+ config?: Partial<import("tailwindcss/types/config").Config> | undefined;
8
6
  } | typeof typography | {
9
7
  handler: () => void;
10
8
  })[];
@@ -253,5 +251,5 @@ declare const config: {
253
251
  };
254
252
  };
255
253
  };
256
-
257
- export { config, config as default };
254
+ export default config;
255
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/tailwind/index.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,yBAAyB,CAAC;AAMjD,eAAO,MAAM,MAAM;;wBAP2B,0BACrC;gCACL,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQZ,CAAC;AAEnB,eAAe,MAAM,CAAC"}
@@ -2,6 +2,7 @@
2
2
 
3
3
  // src/internal/tsup/index.ts
4
4
  var _child_process = require('child_process');
5
+ var _fs = require('fs');
5
6
  var _tsup = require('tsup');
6
7
  function applyDefaultConfig(userConfig, opts) {
7
8
  if (Array.isArray(userConfig)) {
@@ -35,13 +36,32 @@ function applyDefaultConfig(userConfig, opts) {
35
36
  // Whether to minify the output
36
37
  sourcemap: process.env.UPLOAD_SOURCEMAPS === "true" || sourcemap,
37
38
  // Whether to generate sourcemaps
38
- // Whether to generate TypeScript declaration files.
39
- // Be careful and add this to turbo.json or some builds might fail when using turbo remote cache
40
- dts: process.env.VERCEL !== "1",
39
+ // During normal builds, disable tsup's built-in dts and use tsc in
40
+ // onSuccess to generate declaration files with declarationMap so that
41
+ // IDE "Go to Source" points to the real .ts source.
42
+ // When --dtsOnly is passed (check-types), let tsup handle it.
43
+ // Be careful and add this to turbo.json or some builds might fail when using turbo remote cache.
44
+ dts: isDeclarationOnly ? opts.dts : false,
41
45
  async onSuccess() {
46
+ if (isDeclarationOnly) return;
42
47
  _child_process.execSync.call(void 0,
43
48
  `find dist -name "*.cjs" -exec perl -pi -e 's/return await /return await /g' {} +`
44
49
  );
50
+ if (process.env.VERCEL === "1") return;
51
+ try {
52
+ const project = _fs.existsSync.call(void 0, "tsconfig.build.json") ? "tsconfig.build.json" : "tsconfig.json";
53
+ _child_process.execSync.call(void 0, "rm -f tsconfig.tsbuildinfo", { stdio: "inherit" });
54
+ _child_process.execSync.call(void 0,
55
+ `tsc --project ${project} --emitDeclarationOnly --declarationMap`,
56
+ { stdio: "inherit" }
57
+ );
58
+ _child_process.execSync.call(void 0,
59
+ "rsync -a --include='*/' --include='*.d.ts' --exclude='*' src/ dist/ 2>/dev/null || true",
60
+ { stdio: "inherit" }
61
+ );
62
+ } catch (error) {
63
+ console.error("Declaration map generation failed:", error);
64
+ }
45
65
  },
46
66
  esbuildOptions: (esbuildOptions, o) => {
47
67
  esbuildOptions.jsx = "automatic";
@@ -51,7 +71,13 @@ function applyDefaultConfig(userConfig, opts) {
51
71
  };
52
72
  return {
53
73
  ...defaultConfig,
54
- ...userConfig
74
+ ...userConfig,
75
+ onSuccess: async () => {
76
+ await _optionalChain([defaultConfig, 'access', _3 => _3.onSuccess, 'optionalCall', _4 => _4()]);
77
+ if (typeof userConfig.onSuccess === "function") {
78
+ await userConfig.onSuccess();
79
+ }
80
+ }
55
81
  };
56
82
  }
57
83
  var beraTsupConfig = (config) => {
@@ -1,6 +1,3 @@
1
- import { Options } from 'tsup';
2
-
3
- type MaybePromise<T> = T | Promise<T>;
4
- declare const beraTsupConfig: (config: Options | Options[] | ((overrideOptions: Options) => MaybePromise<Options | Options[]>)) => Options | Options[] | ((overrideOptions: Options) => MaybePromise<Options | Options[]>);
5
-
6
- export { beraTsupConfig };
1
+ import { defineConfig } from "tsup";
2
+ export declare const beraTsupConfig: typeof defineConfig;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/tsup/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAA6B,MAAM,MAAM,CAAC;AAuG/D,eAAO,MAAM,cAAc,EAAE,OAAO,YAgBnC,CAAC"}
@@ -2,6 +2,7 @@ import "../../chunk-7P6ASYW6.mjs";
2
2
 
3
3
  // src/internal/tsup/index.ts
4
4
  import { execSync } from "child_process";
5
+ import { existsSync } from "fs";
5
6
  import { defineConfig } from "tsup";
6
7
  function applyDefaultConfig(userConfig, opts) {
7
8
  if (Array.isArray(userConfig)) {
@@ -35,13 +36,32 @@ function applyDefaultConfig(userConfig, opts) {
35
36
  // Whether to minify the output
36
37
  sourcemap: process.env.UPLOAD_SOURCEMAPS === "true" || sourcemap,
37
38
  // Whether to generate sourcemaps
38
- // Whether to generate TypeScript declaration files.
39
- // Be careful and add this to turbo.json or some builds might fail when using turbo remote cache
40
- dts: process.env.VERCEL !== "1",
39
+ // During normal builds, disable tsup's built-in dts and use tsc in
40
+ // onSuccess to generate declaration files with declarationMap so that
41
+ // IDE "Go to Source" points to the real .ts source.
42
+ // When --dtsOnly is passed (check-types), let tsup handle it.
43
+ // Be careful and add this to turbo.json or some builds might fail when using turbo remote cache.
44
+ dts: isDeclarationOnly ? opts.dts : false,
41
45
  async onSuccess() {
46
+ if (isDeclarationOnly) return;
42
47
  execSync(
43
48
  `find dist -name "*.cjs" -exec perl -pi -e 's/returnawait /return await /g' {} +`
44
49
  );
50
+ if (process.env.VERCEL === "1") return;
51
+ try {
52
+ const project = existsSync("tsconfig.build.json") ? "tsconfig.build.json" : "tsconfig.json";
53
+ execSync("rm -f tsconfig.tsbuildinfo", { stdio: "inherit" });
54
+ execSync(
55
+ `tsc --project ${project} --emitDeclarationOnly --declarationMap`,
56
+ { stdio: "inherit" }
57
+ );
58
+ execSync(
59
+ "rsync -a --include='*/' --include='*.d.ts' --exclude='*' src/ dist/ 2>/dev/null || true",
60
+ { stdio: "inherit" }
61
+ );
62
+ } catch (error) {
63
+ console.error("Declaration map generation failed:", error);
64
+ }
45
65
  },
46
66
  esbuildOptions: (esbuildOptions, o) => {
47
67
  esbuildOptions.jsx = "automatic";
@@ -51,7 +71,13 @@ function applyDefaultConfig(userConfig, opts) {
51
71
  };
52
72
  return {
53
73
  ...defaultConfig,
54
- ...userConfig
74
+ ...userConfig,
75
+ onSuccess: async () => {
76
+ await defaultConfig.onSuccess?.();
77
+ if (typeof userConfig.onSuccess === "function") {
78
+ await userConfig.onSuccess();
79
+ }
80
+ }
55
81
  };
56
82
  }
57
83
  var beraTsupConfig = (config) => {
@@ -1,12 +1,10 @@
1
- import { Chain } from 'viem/chains';
2
-
3
- declare const defaultChain: Chain;
4
- declare const urls: string[];
1
+ import { type Chain } from "viem/chains";
2
+ export declare const defaultChain: Chain;
3
+ export declare const urls: string[];
5
4
  /**
6
5
  * This are the chains that have been approved by the Bera team to be used in the BeraHub,
7
6
  * for multi chain zapping.
8
7
  */
9
- declare const externalChains: Chain[];
10
- declare const chainIdToName: Record<Chain["id"], string>;
11
-
12
- export { chainIdToName, defaultChain, externalChains, urls };
8
+ export declare const externalChains: Chain[];
9
+ export declare const chainIdToName: Record<Chain["id"], string>;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/wagmi/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,KAAK,EAIX,MAAM,aAAa,CAAC;AAUrB,eAAO,MAAM,YAAY,EAAE,KACqC,CAAC;AAEjE,eAAO,MAAM,IAAI,EAKI,MAAM,EAAE,CAAC;AAC9B;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,EAQjC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,CAUrD,CAAC"}
package/dist/mainnet.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { C as ChainId } from './types-Drv0VlAi.js';
2
-
3
- declare const mainnet: {
1
+ import { ChainId } from "./types";
2
+ export declare const mainnet: {
4
3
  readonly chainId: ChainId.MAINNET;
5
4
  readonly tokens: {
6
5
  readonly wbera: "0x6969696969696969696969696969696969696969";
@@ -150,5 +149,4 @@ declare const mainnet: {
150
149
  };
151
150
  readonly faucet: null;
152
151
  };
153
-
154
- export { mainnet };
152
+ //# sourceMappingURL=mainnet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mainnet.d.ts","sourceRoot":"","sources":["../src/mainnet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,OAAO,EAAE,MAAM,SAAS,CAAC;AAGjE,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCAsJQ,KAAK,MAAM,EAAE,EAAE;oCAMf,KAAK,MAAM,EAAE,EAAE;;;;;;;;;sCAcf,KAAK,MAAM,EAAE,EAAE;oCAKf,KAAK,MAAM,EAAE,EAAE;;;;;;;;;;;;;;;;;;;CAmBZ,CAAC"}
@@ -1,15 +1,15 @@
1
- type Address = `0x${string}`;
1
+ export type Address = `0x${string}`;
2
2
  /**
3
3
  * List of app names in monobera. For a broader list of project names, see ProjectNames.
4
4
  *
5
5
  * All of these projects have a nextjs set up with `withBeraConfig` and have access to edge config.
6
6
  */
7
- type AppName = "BeraHub" | "Honey" | "Bend";
7
+ export type AppName = "BeraHub" | "Honey" | "Bend";
8
8
  /**
9
9
  * List of projects.
10
10
  */
11
- type ProjectName = AppName | "BeraBridge" | "Faucet" | "BeraBridge NFT" | "Berachain Foundation" | "Explore" | "Berascan";
12
- type HttpLink = string | {
11
+ export type ProjectName = AppName | "BeraBridge" | "Faucet" | "BeraBridge NFT" | "Berachain Foundation" | "Explore" | "Berascan";
12
+ export type HttpLink = string | {
13
13
  uri: string;
14
14
  headers?: Record<string, string>;
15
15
  /**
@@ -40,7 +40,7 @@ type BendAddresses = {
40
40
  supportedVaults: Array<Address>;
41
41
  curatorVaults: Array<Address>;
42
42
  };
43
- interface BeraConfig {
43
+ export interface BeraConfig {
44
44
  chainId: ChainId;
45
45
  /**
46
46
  * Some common token addresses available on the chain.
@@ -206,9 +206,9 @@ interface BeraConfig {
206
206
  endpoint: string;
207
207
  }) | null;
208
208
  }
209
- declare enum ChainId {
209
+ export declare enum ChainId {
210
210
  MAINNET = 80094,
211
211
  BEPOLIA = 80069
212
212
  }
213
-
214
- export { type Address as A, type BeraConfig as B, ChainId as C, type HttpLink as H, type ProjectName as P, type AppName as a };
213
+ export {};
214
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,KAAK,MAAM,EAAE,CAAC;AAEpC;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,gBAAgB,GAChB,sBAAsB,GACtB,SAAS,GACT,UAAU,C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;IACF,UAAU,EAAE;QACV,QAAQ,EAAE,OAAO,CAAC;QAClB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,MAAM,EAAE,OAAO,GAAG;QAChB,GAAG,EAAE,OAAO,GAAG;YACb,GAAG,EAAE;gBACH,QAAQ,EAAE,QAAQ,CAAC;aACpB,CAAC;YACF,SAAS,EAAE;gBACT,QAAQ,EAAE,QAAQ,CAAC;aACpB,CAAC;SACH,CAAC;KACH,CAAC;IACF,QAAQ,EAAE;QACR,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;IACF,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,OAAO,GAAG;QACd,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;QAC1B,UAAU,EAAE,aAAa,CAAC;QAC1B,OAAO,EAAE,aAAa,CAAC;KACxB,CAAC;IACF,IAAI,EAAE;QACJ,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;QAChC,sBAAsB,EAAE,OAAO,GAAG,IAAI,CAAC;KACxC,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE;QACL;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAEF;;;;OAIG;IACH,MAAM,EACF,CAAC,OAAO,GAAG;QACT;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QACnB;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,MAAM,CAAC;QACtB;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,GACF,IAAI,CAAC;CACV;AAED,oBAAY,OAAO;IACjB,OAAO,QAAQ;IACf,OAAO,QAAQ;CAChB"}
@@ -0,0 +1,21 @@
1
+ import { type AppName, ChainId } from "../types";
2
+ declare const defaultChainId: ChainId;
3
+ export { defaultChainId as chainId };
4
+ export declare const isProduction: boolean;
5
+ /**
6
+ * Environment is development if it is localhost.
7
+ */
8
+ export declare const isLocalHost: boolean;
9
+ /**
10
+ * Environment is preview if it is development or preview.
11
+ */
12
+ export declare const isPreview: boolean;
13
+ /**
14
+ * Environment is staging if it is development or staging.
15
+ */
16
+ export declare const isStaging: boolean;
17
+ /**
18
+ * Name of the current dapp. Available only if using `withBeraConfig` from @berachain/config/internal/nextjs.
19
+ */
20
+ export declare const currentDapp: AppName | undefined;
21
+ //# sourceMappingURL=dynamicEnvVariable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamicEnvVariable.d.ts","sourceRoot":"","sources":["../../src/utils/dynamicEnvVariable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAIjD,QAAA,MAAM,cAAc,EAAE,OAEH,CAAC;AASpB,OAAO,EAAE,cAAc,IAAI,OAAO,EAAE,CAAC;AAErC,eAAO,MAAM,YAAY,SAAiD,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,WAAW,SAAyC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,SAAS,SACsC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,SAAS,SAA8C,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,WAAW,EACpB,OAAO,GACP,SAAS,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Exporting here all variables that are used in the frontend.
3
+ * Avoids circular dependency with the config object.
4
+ */
5
+ import { ChainId } from "../types";
6
+ import { chainId } from "./dynamicEnvVariable";
7
+ export { chainId };
8
+ export declare const imageBaseUrl = "https://imagedelivery.net/qNj7Q3MCke89zoKzav7eDQ";
9
+ export declare const goldskyBaseUrl = "https://api.goldsky.com/api/public/project_clq1h5ct0g4a201x18tfte5iv/subgraphs/";
10
+ /**
11
+ * Returns the RPC URLs for the given chain ID. If anvil is set, it will just return the anvil RPC URLs.
12
+ */
13
+ export declare function getRpcUrls(chainId?: ChainId): {
14
+ publicJsonRpcUrl: string;
15
+ jsonRpcUrl: string;
16
+ alchemyJsonRpcUrl: string | undefined;
17
+ privateRcpUrl: string | undefined;
18
+ /**
19
+ * Whether the RPC URLs are for anvil.
20
+ */
21
+ isAnvil: boolean;
22
+ };
23
+ export declare const publicJsonRpcUrl: string, jsonRpcUrl: string, alchemyJsonRpcUrl: string | undefined,
24
+ /**
25
+ * Dedicated private RPC URL for server side with higher rate limits.
26
+ * Not available on client side.
27
+ */
28
+ privateRcpUrl: string | undefined;
29
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/utils/env.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,CAAC;AAQnB,eAAO,MAAM,YAAY,qDAAqD,CAAC;AAE/E,eAAO,MAAM,cAAc,oFACwD,CAAC;AACpF;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,OAAyB,GAAG;IAC9D,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB,CAkDA;AAED,eAAO,MACL,gBAAgB,UAChB,UAAU,UACV,iBAAiB;AACjB;;;GAGG;AACH,aAAa,oBACQ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { HttpLink } from "../types";
2
+ export declare function getUriFromLink(link: HttpLink): string;
3
+ //# sourceMappingURL=getUriFromLink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUriFromLink.d.ts","sourceRoot":"","sources":["../../src/utils/getUriFromLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAErD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@berachain/config",
3
- "version": "0.1.21",
3
+ "version": "0.1.22-beta.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",