Skip to content

Commit

Permalink
SAVEPOINT
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewlilley committed Oct 1, 2024
1 parent a4ffe55 commit d70d913
Show file tree
Hide file tree
Showing 33 changed files with 249 additions and 667 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ on:
workflow_dispatch:

env:
CI: true
NODE_OPTIONS: --max-old-space-size=8192
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_FORCE: false

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -48,8 +47,6 @@ jobs:
env:
ANVIL_FORK_URL: ${{ secrets.ANVIL_FORK_URL }}
ANVIL_BLOCK_NUMBER: ${{ matrix.block-number }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
REDIS_URL: ${{ secrets.REDIS_URL }}
EDGE_CONFIG: ${{ secrets.EDGE_CONFIG }}
NEXT_PUBLIC_APP_ENV: 'test'
NEXT_PUBLIC_CHAIN_ID: ${{ matrix.chain-id }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
workflow_call:
workflow_dispatch:
env:
NODE_OPTIONS: --max-old-space-size=8192
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

Expand Down
51 changes: 4 additions & 47 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env
.env

# local env files
.env.local
.env.development.local
Expand All @@ -43,74 +46,28 @@ yarn-error.log*
# vercel
.vercel

# env
.env
skaffold.env

# mesh
.mesh

# graphql
.graphclient

# typechain
typechain

# exports
exports

# cache
cache

# generated
generated

# artifacts
artifacts

# artifacts zk
artifacts-zk

# cache zk
cache-zk

# workers
**/public/sw.js
**/public/workbox-*.js
**/public/worker-*.js
**/public/sw.js.map
**/public/workbox-*.js.map
**/public/worker-*.js.map

# prisma

# screenshots
screenshots

# playwright
playwright-report
test-results

# Sentry
.sentryclirc

test-results/
results/

# typescript
*.tsbuildinfo
next-env.d.ts

# storybook
storybook-static

# tines snapshots
test/snapshots/

# Sentry Config File
.env.sentry-build-plugin

# npm lock file (we use pnpm)
package-lock.json

# yarn lock file (we use pnpm)
yarn.lock
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

5 changes: 0 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
},
"typescript.tsdk": "apps/web/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
Expand All @@ -50,9 +48,6 @@
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
},
"[solidity]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"yaml.schemas": {
"https://www.artillery.io/schema.json": [
"file:///home/feedme/sushi/sushiswap/apis/router/test/load.yml"
Expand Down
7 changes: 6 additions & 1 deletion apps/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Apps

...
The `apps` directory contains all the code for the different applications that are part of the project. Each application is a separate directory with its own `README.md` file.

## [Web](web/README.md)
## [Mobile](mobile/README.md)
## [Extension](extension/README.md)
## [Desktop](desktop/README.md)
24 changes: 12 additions & 12 deletions apps/web/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import withBundleAnalyzer from '@next/bundle-analyzer'
import { withSentryConfig } from '@sentry/nextjs'
import defaultNextConfig from '@sushiswap/nextjs-config'
import { withAxiom } from 'next-axiom'

import withBundleAnalyzer from '@next/bundle-analyzer'
const bundleAnalyzer = withBundleAnalyzer({
enabled: false && process.env.NODE_ENV !== 'development',
})
Expand Down Expand Up @@ -95,15 +94,12 @@ const nextConfig = bundleAnalyzer({
},
})

export default withAxiom(withSentryConfig(nextConfig), {
export default withSentryConfig(nextConfig, {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,

// An auth token is required for uploading source maps.
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'sushi-j9',
project: 'web',

// Only print logs for uploading source maps in CI
silent: !process.env.CI,
Expand All @@ -114,6 +110,11 @@ export default withAxiom(withSentryConfig(nextConfig), {
// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Automatically annotate React components to show their full name in breadcrumbs and session replay
reactComponentAnnotation: {
enabled: true,
},

// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
Expand All @@ -124,15 +125,14 @@ export default withAxiom(withSentryConfig(nextConfig), {
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: process.NODE_ENV === 'production',
disableLogger: true,

// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,

unstable_sentryWebpackPluginOptions: {
applicationKey: 'web',
},
// Disables Sentry's telemetry features
telemetry: false,
})
1 change: 0 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
"ms": "2.1.3",
"nanoid": "4.0.0",
"next": "14.2.11",
"next-axiom": "1.5.0",
"next-themes": "0.2.1",
"octokit": "2.1.0",
"petra-plugin-wallet-adapter": "0.4.5",
Expand Down
34 changes: 2 additions & 32 deletions apps/web/sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,11 @@
import * as Sentry from '@sentry/nextjs'

Sentry.init({
dsn: 'https://28c197e66594eea8cf3014697e6fc0d3@o960777.ingest.us.sentry.io/4507941516410880',
dsn: 'https://76d7b33cc5bf60055e9ecc86faab0c64@o960777.ingest.us.sentry.io/4508045239320576',

enabled: process.env.NEXT_PUBLIC_APP_ENV !== 'test',

// Adjust this value in production, or use tracesSampler for greater control
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,

// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,

replaysOnErrorSampleRate: 1.0,

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,

// You can remove this option if you're not planning to use the Sentry Session Replay feature:
integrations: [
Sentry.thirdPartyErrorFilterIntegration({
// Specify the application keys that you specified in the Sentry bundler plugin
filterKeys: ['web'],

// Defines how to handle errors that contain third party stack frames.
// Possible values are:
// - 'drop-error-if-contains-third-party-frames'
// - 'drop-error-if-exclusively-contains-third-party-frames'
// - 'apply-tag-if-contains-third-party-frames'
// - 'apply-tag-if-exclusively-contains-third-party-frames'
behaviour: 'apply-tag-if-contains-third-party-frames',
}),
Sentry.replayIntegration({
// Additional Replay configuration goes in here, for example:
maskAllText: false,
maskAllInputs: false,
blockAllMedia: false,
}),
],
})
6 changes: 2 additions & 4 deletions apps/web/sentry.edge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
import * as Sentry from '@sentry/nextjs'

Sentry.init({
dsn: 'https://28c197e66594eea8cf3014697e6fc0d3@o960777.ingest.us.sentry.io/4507941516410880',
dsn: 'https://76d7b33cc5bf60055e9ecc86faab0c64@o960777.ingest.us.sentry.io/4508045239320576',

enabled: process.env.NEXT_PUBLIC_APP_ENV !== 'test',

// Adjust this value in production, or use tracesSampler for greater control
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,

// Setting this option to true will print useful information to the console while you're setting up Sentry.
Expand Down
9 changes: 2 additions & 7 deletions apps/web/sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@
import * as Sentry from '@sentry/nextjs'

Sentry.init({
dsn: 'https://28c197e66594eea8cf3014697e6fc0d3@o960777.ingest.us.sentry.io/4507941516410880',
dsn: 'https://76d7b33cc5bf60055e9ecc86faab0c64@o960777.ingest.us.sentry.io/4508045239320576',

enabled: process.env.NEXT_PUBLIC_APP_ENV !== 'test',

// Adjust this value in production, or use tracesSampler for greater control
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,

// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,

// Uncomment the line below to enable Spotlight (https://spotlightjs.com)
// spotlight: process.env.NODE_ENV === 'development',
})
9 changes: 0 additions & 9 deletions apps/web/src/app/(evm)/(trade)/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,16 @@ import {
classNames,
typographyVariants,
} from '@sushiswap/ui'

import { useLogger } from 'next-axiom'
import { useEffect } from 'react'

export default function SwapError({
error,
reset,
}: { error: Error & { digest?: string }; reset: () => void }) {
const log = useLogger()

useEffect(() => {
// Capture the error and send it to Sentry
Sentry.captureException(error)
}, [error])

useEffect(() => {
// Log the error to an error reporting service
log.error('swap page error', error)
}, [log, error])
return (
<>
<h1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Badge, TooltipContent } from '@sushiswap/ui'
import { Tooltip, TooltipProvider, TooltipTrigger } from '@sushiswap/ui'
import { AptosCircle } from '@sushiswap/ui/icons/network/circle/AptosCircle'
import React, { FC } from 'react'
import { ProtocolBadge } from 'src/ui/pool/PoolNameCell'
import { SushiSwapProtocol, formatNumber } from 'sushi'
// import { ProtocolBadge } from 'src/ui/pool/PoolNameCell'
import { formatNumber } from 'sushi'
import { CurrencyIcon } from '~aptos/(common)/ui/currency/currency-icon'
import { CurrencyIconList } from '~aptos/(common)/ui/currency/currency-icon-list'
import { TopPool } from '~aptos/pool/lib/use-top-pools'
Expand Down
10 changes: 10 additions & 0 deletions apps/web/src/app/api/sentry-example-api/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NextResponse } from 'next/server'

export const dynamic = 'force-dynamic'

// A faulty API route to test Sentry's error monitoring
export function GET() {
throw new Error('Sentry Example API Route Error')
// biome-ignore lint/correctness/noUnreachable: test route
return NextResponse.json({ data: 'Testing Sentry Error...' })
}
Loading

0 comments on commit d70d913

Please sign in to comment.