Skip to content

Commit 9f0eed5

Browse files
authored
Merge pull request #1125 from CodeForAfrica/chore/project_setup
Update project setup
2 parents 8c377fe + 6e37996 commit 9f0eed5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+7747
-7894
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
env:
2020
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
2121
MONGO_URL: ${{ secrets.MONGO_URL }}
22-
PROMISE_TRACKER_SENTRY_DSN: ${{ secrets.PROMISE_TRACKER_SENTRY_DSN }}
2322
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
2423
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
2524
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}

.github/workflows/techlabblog-deploy-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
target: "techlabblog-runner"
2424
build_args: |
2525
SENTRY_ENVIRONMENT=development
26-
SENTRY_DSN: ${{ vars.TECHLABBLOG_SENTRY_DSN }}
26+
NEXT_PUBLIC_SENTRY_DSN: ${{ vars.TECHLABBLOG_SENTRY_DSN }}
2727
2828
push-to-dokku:
2929
name: Push to Dokku

.github/workflows/vpnmanager-deploy-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ jobs:
5252
uses: docker/build-push-action@v5
5353
with:
5454
build-args: |
55-
SENTRY_DSN=${{ secrets.VPNMANAGER_SENTRY_DSN }}
55+
API_SECRET_KEY=${{ secrets.VPNMANAGER_API_SECRET_KEY }}
56+
NEXT_PUBLIC_SENTRY_DSN=${{ secrets.VPNMANAGER_SENTRY_DSN }}
5657
SENTRY_ENVIRONMENT=${{ env.SENTRY_ENVIRONMENT }}
5758
SENTRY_ORG=${{ secrets.SENTRY_ORG }}
5859
SENTRY_PROJECT=${{ secrets.VPNMANAGER_SENTRY_PROJECT }}
59-
API_SECRET_KEY=${{ secrets.VPNMANAGER_API_SECRET_KEY }}
6060
cache-from: type=local,src=/tmp/.buildx-cache
6161
cache-to: type=local,dest=/tmp/.buildx-cache-new
6262
context: .

.husky/pre-commit

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
4-
npx lint-staged
1+
# lint-staged is part of devDependencies
2+
pnpm exec lint-staged
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// This file configures the initialization of Sentry on the client.
2+
// The added config here will be used whenever a users loads a page in their browser.
3+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
4+
5+
import * as Sentry from "@sentry/nextjs";
6+
7+
const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN;
8+
9+
Sentry.init({
10+
dsn: SENTRY_DSN,
11+
12+
// Add optional integrations for additional features
13+
integrations: [Sentry.replayIntegration()],
14+
15+
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
16+
tracesSampleRate: 1,
17+
18+
// Define how likely Replay events are sampled.
19+
// This sets the sample rate to be 10%. You may want this to be 100% while
20+
// in development and sample at a lower rate in production
21+
replaysSessionSampleRate: 0.1,
22+
23+
// Define how likely Replay events are sampled when an error occurs.
24+
replaysOnErrorSampleRate: 1.0,
25+
26+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
27+
debug: false,
28+
});
29+
30+
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
31+
32+
export default undefined;

apps/charterafrica/instrumentation.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import * as Sentry from "@sentry/nextjs";
2+
13
// Next.js requires this to be exported as register
2-
// eslint-disable-next-line import/prefer-default-export
34
export async function register() {
45
if (process.env.NEXT_RUNTIME === "nodejs") {
56
await import("./sentry.server.config");
@@ -9,3 +10,5 @@ export async function register() {
910
await import("./sentry.edge.config");
1011
}
1112
}
13+
14+
export const onRequestError = Sentry.captureRequestError;

apps/charterafrica/sentry.client.config.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

apps/charterafrica/src/components/DropdownMenu/DropdownMenu.snap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ exports[`<DropdownMenu /> renders unchanged 1`] = `
88
tabindex="-1"
99
>
1010
<a
11-
class="MuiTypography-root MuiTypography-caption MuiLink-root MuiLink-underlineNone MuiButtonBase-root MuiMenuItem-root MuiMenuItem-gutters MuiMenuItem-root MuiMenuItem-gutters css-1aut4du-MuiTypography-root-MuiLink-root-MuiButtonBase-root-MuiMenuItem-root"
11+
class="MuiTypography-root MuiTypography-caption MuiLink-root MuiLink-underlineNone Mui-focusVisible MuiButtonBase-root MuiMenuItem-root MuiMenuItem-gutters Mui-focusVisible MuiMenuItem-root MuiMenuItem-gutters css-1aut4du-MuiTypography-root-MuiLink-root-MuiButtonBase-root-MuiMenuItem-root"
1212
href="/resources/tools"
1313
tabindex="0"
1414
>

apps/charterafrica/turbo.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": ["//"],
33
"tasks": {
44
"build": {
5-
"dependsOn": ["^build", "build-next", "build-payload"]
5+
"dependsOn": ["build-next", "build-payload"]
66
},
77
"build-next": {
88
"outputs": [".next/**", "!.next/cache/**", "dist/**"],
@@ -12,12 +12,6 @@
1212
"NEXT_BUILD",
1313
"NEXT_HOSTNAME",
1414
"NEXT_MANUAL_SIG_HANDLE",
15-
"NEXT_PUBLIC_APP_URL",
16-
"NEXT_PUBLIC_DEFAULT_LOCALE",
17-
"NEXT_PUBLIC_IMAGE_DOMAINS",
18-
"NEXT_PUBLIC_LOCALES",
19-
"NEXT_PUBLIC_SENTRY_DSN",
20-
"NEXT_PUBLIC_SEO_DISABLED",
2115
"NEXT_RUNTIME",
2216
"NODE_ENV",
2317
"NODE_OPTIONS",
@@ -51,10 +45,6 @@
5145
"MONGO_URL",
5246
"NEXT_BUILD",
5347
"NEXT_HOSTNAME",
54-
"NEXT_PUBLIC_APP_NAME",
55-
"NEXT_PUBLIC_IMAGE_UNOPTIMIZED",
56-
"NEXT_PUBLIC_VERCEL_ENV",
57-
"NEXT_PUBLIC_VERCEL_URL",
5848
"NODE_ENV",
5949
"NODE_OPTIONS",
6050
"PAYLOAD_CORS",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// This file configures the initialization of Sentry on the client.
2+
// The added config here will be used whenever a users loads a page in their browser.
3+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
4+
5+
import * as Sentry from "@sentry/nextjs";
6+
7+
const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN;
8+
9+
Sentry.init({
10+
dsn: SENTRY_DSN,
11+
12+
// Add optional integrations for additional features
13+
integrations: [Sentry.replayIntegration()],
14+
15+
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
16+
tracesSampleRate: 1,
17+
18+
// Define how likely Replay events are sampled.
19+
// This sets the sample rate to be 10%. You may want this to be 100% while
20+
// in development and sample at a lower rate in production
21+
replaysSessionSampleRate: 0.1,
22+
23+
// Define how likely Replay events are sampled when an error occurs.
24+
replaysOnErrorSampleRate: 1.0,
25+
26+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
27+
debug: false,
28+
});
29+
30+
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
31+
32+
export default undefined;

apps/civicsignalblog/instrumentation.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import * as Sentry from "@sentry/nextjs";
2+
13
// Next.js requires this to be exported as register
2-
// eslint-disable-next-line import/prefer-default-export
34
export async function register() {
45
if (process.env.NEXT_RUNTIME === "nodejs") {
56
await import("./sentry.server.config");
@@ -9,3 +10,5 @@ export async function register() {
910
await import("./sentry.edge.config");
1011
}
1112
}
13+
14+
export const onRequestError = Sentry.captureRequestError;

apps/civicsignalblog/sentry.client.config.js

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).
22
// The config you add here will be used whenever one of the edge features is loaded.
3-
// Note that this config is unrelated to the Verel Edge Runtime and is also required when running locally.
3+
// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.
44
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
55

66
import * as Sentry from "@sentry/nextjs";
@@ -9,7 +9,10 @@ const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN;
99

1010
Sentry.init({
1111
dsn: SENTRY_DSN,
12-
// Note: if you want to override the automatic release value, do not set a
13-
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
14-
// that it will also get attached to your source maps
12+
13+
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
14+
tracesSampleRate: 1,
15+
16+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
17+
debug: false,
1518
});

apps/civicsignalblog/sentry.server.config.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN;
88

99
Sentry.init({
1010
dsn: SENTRY_DSN,
11-
// Note: if you want to override the automatic release value, do not set a
12-
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
13-
// that it will also get attached to your source maps
11+
12+
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
13+
tracesSampleRate: 1,
14+
15+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
16+
debug: false,
1417
});

apps/civicsignalblog/turbo.json

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,13 @@
22
"extends": ["//"],
33
"tasks": {
44
"build": {
5-
"dependsOn": ["^build", "build-next", "build-payload"]
5+
"dependsOn": ["build-next", "build-payload"]
66
},
77
"build-next": {
88
"outputs": [".next/**", "!.next/cache/**", "dist/**"],
99
"env": [
10-
"NEXT_PUBLIC_APP_LOGO_URL",
11-
"NEXT_PUBLIC_APP_NAME",
12-
"NEXT_PUBLIC_APP_URL",
13-
"NEXT_PUBLIC_IMAGE_DOMAINS",
14-
"NEXT_PUBLIC_IMAGE_UNOPTIMIZED",
15-
"NEXT_PUBLIC_SENTRY_DSN",
16-
"NEXT_PUBLIC_VERCEL_ENV",
17-
"NEXT_PUBLIC_VERCEL_URL",
18-
"NEXT_RUNTIME",
1910
"GOOGLE_API_KEY",
11+
"NEXT_RUNTIME",
2012
"PAYLOAD_PUBLIC_APP_URL",
2113
"PAYLOAD_PUBLIC_DEFAULT_LOCALE",
2214
"PAYLOAD_PUBLIC_LOCALES",
@@ -28,7 +20,6 @@
2820
"build-payload": {
2921
"outputs": ["build/**"],
3022
"env": [
31-
"NEXT_PUBLIC_SENTRY_DSN",
3223
"PAYLOAD_PUBLIC_APP_URL",
3324
"PAYLOAD_PUBLIC_DEFAULT_LOCALE",
3425
"PAYLOAD_PUBLIC_LOCALES"

apps/climatemappedafrica/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
"eslint-plugin-module-resolver": "catalog:",
120120
"graphql": "catalog:",
121121
"graphql-anywhere": "catalog:",
122-
"husky": "catalog:",
123122
"identity-obj-proxy": "catalog:",
124123
"jest": "catalog:",
125124
"jest-config-commons-ui": "workspace:*",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// This file configures the initialization of Sentry on the client.
2+
// The added config here will be used whenever a users loads a page in their browser.
3+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
4+
5+
import * as Sentry from "@sentry/nextjs";
6+
7+
const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN;
8+
9+
Sentry.init({
10+
dsn: SENTRY_DSN,
11+
12+
// Add optional integrations for additional features
13+
integrations: [Sentry.replayIntegration()],
14+
15+
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
16+
tracesSampleRate: 1,
17+
18+
// Define how likely Replay events are sampled.
19+
// This sets the sample rate to be 10%. You may want this to be 100% while
20+
// in development and sample at a lower rate in production
21+
replaysSessionSampleRate: 0.1,
22+
23+
// Define how likely Replay events are sampled when an error occurs.
24+
replaysOnErrorSampleRate: 1.0,
25+
26+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
27+
debug: false,
28+
});
29+
30+
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
31+
32+
export default undefined;

apps/codeforafrica/instrumentation.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import * as Sentry from "@sentry/nextjs";
2+
13
// Next.js requires this to be exported as register
2-
// eslint-disable-next-line import/prefer-default-export
34
export async function register() {
45
if (process.env.NEXT_RUNTIME === "nodejs") {
56
await import("./sentry.server.config");
@@ -9,3 +10,5 @@ export async function register() {
910
await import("./sentry.edge.config");
1011
}
1112
}
13+
14+
export const onRequestError = Sentry.captureRequestError;

apps/codeforafrica/next.config.js

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,38 @@ const nextConfig = {
4141
},
4242
};
4343

44+
// Injected content via Sentry wizard below
45+
4446
module.exports = withSentryConfig(nextConfig, {
45-
silent: !process.env.CI,
46-
hideSourceMaps: true,
47-
org: process.env.SENTRY_ORG,
47+
// For all available options, see:
48+
// https://www.npmjs.com/package/@sentry/webpack-plugin#options
49+
4850
authToken: process.env.SENTRY_AUTH_TOKEN,
51+
52+
org: process.env.SENTRY_ORG,
4953
project: process.env.SENTRY_PROJECT,
54+
55+
// Only print logs for uploading source maps in CI
56+
silent: !process.env.CI,
57+
58+
// For all available options, see:
59+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
60+
61+
// Upload a larger set of source maps for prettier stack traces (increases build time)
62+
widenClientFileUpload: true,
63+
64+
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
65+
// This can increase your server load as well as your hosting bill.
66+
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
67+
// side errors will fail.
68+
tunnelRoute: "/monitoring",
69+
70+
// Automatically tree-shake Sentry logger statements to reduce bundle size
71+
disableLogger: true,
72+
73+
// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
74+
// See the following for more information:
75+
// https://docs.sentry.io/product/crons/
76+
// https://vercel.com/docs/cron-jobs
77+
automaticVercelMonitors: true,
5078
});

apps/codeforafrica/sentry.client.config.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)