Skip to content

Commit

Permalink
Merge branch 'release/1.0.0-alpha.34'
Browse files Browse the repository at this point in the history
  • Loading branch information
nekofar committed Mar 11, 2024
2 parents 35b3000 + 40acaf5 commit 04752f3
Show file tree
Hide file tree
Showing 18 changed files with 553 additions and 68 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable changes to this project will be documented in this file.

## [1.0.0-alpha.34] - 2024-03-11

### Bug Fixes

- Solve missing null issue on proposer id on browser screen

### Miscellaneous Tasks

- Add `dev` and `start` scripts the root package

## [1.0.0-alpha.33] - 2024-03-11

### Bug Fixes
Expand Down
3 changes: 3 additions & 0 deletions apps/nouns-camp/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.next
public/service-worker.js

# Sentry Config File
.sentryclirc
95 changes: 63 additions & 32 deletions apps/nouns-camp/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const webpack = require("webpack");
const { withSentryConfig } = require("@sentry/nextjs");

const withSerwist = require("@serwist/next").default({
swSrc: "src/app/service-worker.js",
Expand All @@ -7,6 +8,34 @@ const withSerwist = require("@serwist/next").default({
disable: process.env.NODE_ENV !== "production",
});

const withSentry = (config) =>
withSentryConfig(
config,
{
// Suppresses source map uploading logs during build
silent: true,
org: "camp",
project: "camp-main",
},
{
// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,
// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: "/monitoring",
// Hides source maps from generated client bundles
hideSourceMaps: true,
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
// Enables automatic instrumentation of Vercel Cron Monitors.
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
},
);

const BUILD_ID = process.env.VERCEL_GIT_COMMIT_SHA?.slice(0, 7) ?? "dev";

const ignoredModules = [
Expand All @@ -24,44 +53,46 @@ const ignoredModules = [
"encoding",
];

module.exports = withSerwist({
reactStrictMode: true,
compiler: {
emotion: true,
},
rewrites() {
return [{ source: "/sw.js", destination: "/service-worker.js" }];
},
headers() {
return [
{
source: "/:path*",
headers: [{ key: "x-camp-build-id", value: BUILD_ID }],
},
];
},
webpack(config) {
config.resolve.fallback = {
...config.resolve.fallback,
...Object.fromEntries(ignoredModules.map((m) => [m, false])),
};
module.exports = withSentry(
withSerwist({
reactStrictMode: true,
compiler: {
emotion: true,
},
rewrites() {
return [{ source: "/sw.js", destination: "/service-worker.js" }];
},
headers() {
return [
{
source: "/:path*",
headers: [{ key: "x-camp-build-id", value: BUILD_ID }],
},
];
},
webpack(config) {
config.resolve.fallback = {
...config.resolve.fallback,
...Object.fromEntries(ignoredModules.map((m) => [m, false])),
};

config.plugins = [
...config.plugins,
new webpack.DefinePlugin({
"process.env.BUILD_ID": JSON.stringify(BUILD_ID),
}),
];
config.plugins = [
...config.plugins,
new webpack.DefinePlugin({
"process.env.BUILD_ID": JSON.stringify(BUILD_ID),
}),
];

return config;
},
experimental: {
cpus: 4,
return config;
},
experimental: {
cpus: 4,
turbo: {
// Ignoring modules is not a thing yet
resolveAlias: Object.fromEntries(
ignoredModules.map((n) => [n, "@shades/common"]),
),
},
},
});
}),
);
1 change: 1 addition & 0 deletions apps/nouns-camp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@prophouse/sdk-react": "^1.0.31",
"@radix-ui/react-toolbar": "^1.0.3",
"@radix-ui/react-tooltip": "^1.0.5",
"@sentry/nextjs": "^7.105.0",
"@serwist/next": "^8.4.4",
"@serwist/precaching": "^8.4.4",
"@serwist/sw": "^8.4.4",
Expand Down
12 changes: 12 additions & 0 deletions apps/nouns-camp/sentry.client.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// This file configures the initialization of Sentry on the client.
// The config you add here will be used whenever a users loads a page in their browser.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 0,
replaysOnErrorSampleRate: 0,
replaysSessionSampleRate: 0,
});
11 changes: 11 additions & 0 deletions apps/nouns-camp/sentry.edge.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).
// The config you add here will be used whenever one of the edge features is loaded.
// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 0,
});
10 changes: 10 additions & 0 deletions apps/nouns-camp/sentry.server.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// This file configures the initialization of Sentry on the server.
// The config you add here will be used whenever the server handles a request.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 0,
});
23 changes: 19 additions & 4 deletions apps/nouns-camp/src/app/client-app-provider.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"use client";

import * as Sentry from "@sentry/nextjs";
import React from "react";
import { I18nProvider } from "react-aria";
import { useReconnect } from "wagmi";
import { useAccount, useReconnect } from "wagmi";
import * as Tooltip from "@shades/ui-web/tooltip";
import {
useAccountFetch,
Expand Down Expand Up @@ -32,7 +33,7 @@ const dialogs = [
},
];

const GlobalClientFetches = () => {
const GlobalClientFetcher = () => {
const { address: connectedAccountAddress } = useWallet();

useDelegatesFetch();
Expand All @@ -41,11 +42,24 @@ const GlobalClientFetches = () => {
};

const WalletReconnector = () => {
const { isConnected } = useAccount();
const { reconnect } = useReconnect();
const connectors = useConnectorsWithReadyState();
React.useEffect(() => {
if (isConnected) return;
reconnect();
}, [reconnect, connectors]);
}, [isConnected, reconnect, connectors]);
};

const SentryConfigurator = () => {
const { address } = useAccount();
React.useEffect(() => {
if (address == null) {
Sentry.setUser(null);
return;
}
Sentry.setUser({ id: address });
}, [address]);
};

export default function ClientAppProvider({ children }) {
Expand All @@ -56,8 +70,9 @@ export default function ClientAppProvider({ children }) {
<GlobalDialogsProvider dialogs={dialogs}>
<AppUpdateBanner />
{children}
<GlobalClientFetches />
<GlobalClientFetcher />
<WalletReconnector />
<SentryConfigurator />
</GlobalDialogsProvider>
</ConnectWalletDialogProvider>
</Tooltip.Provider>
Expand Down
6 changes: 6 additions & 0 deletions apps/nouns-camp/src/app/error.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
"use client";

import React from "react";
import * as Sentry from "@sentry/nextjs";
import ClientAppProvider from "./client-app-provider.js";
import ErrorScreen from "../components/error-screen.js";

export default function Error({
error,
// reset
}) {
React.useEffect(() => {
Sentry.captureException(error);
}, [error]);

return (
<ClientAppProvider>
<ErrorScreen
Expand Down
2 changes: 1 addition & 1 deletion apps/nouns-camp/src/components/account-avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const NounsAccountAvatar = React.forwardRef(
ref={ref}
url={imageUrl}
borderRadius={nounAvatarUrl == null ? "0.3rem" : undefined}
signature={ensName ?? accountAddress.slice(2)}
signature={ensName ?? accountAddress?.slice(2)}
signatureLength={2}
signatureFontSize="0.95rem"
{...props}
Expand Down
Loading

0 comments on commit 04752f3

Please sign in to comment.