Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
arch1995 committed Jun 14, 2024
1 parent dd3393e commit 8143e3f
Show file tree
Hide file tree
Showing 11 changed files with 2,626 additions and 2,236 deletions.
4,682 changes: 2,541 additions & 2,141 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@
"workspaces": [
"packages/*"
],
"peerDependencies": {
"@babel/runtime": "^7.x"
},
"devDependencies": {
"@babel/register": "^7.23.7",
"@toruslabs/config": "^2.0.2",
"@toruslabs/eslint-config-typescript": "^3.2.0",
"@toruslabs/torus-scripts": "^5.3.1",
"@babel/register": "^7.24.6",
"@toruslabs/config": "^2.1.0",
"@toruslabs/eslint-config-typescript": "^3.3.1",
"@toruslabs/torus-scripts": "^6.0.1",
"@types/mocha": "^10.0.6",
"cross-env": "^7.0.3",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"husky": "^9.0.11",
"lerna": "^8.1.2",
"lint-staged": "^15.2.2",
"lerna": "^8.1.3",
"lint-staged": "^15.2.7",
"mocha": "^10.4.0",
"prettier": "^3.2.5",
"prettier": "^3.3.2",
"ts-node": "^10.9.2",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.4.5",
Expand Down Expand Up @@ -52,4 +55,4 @@
"author": "",
"license": "MIT",
"description": ""
}
}
5 changes: 3 additions & 2 deletions packages/constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"name": "@toruslabs/constants",
"version": "13.4.0",
"description": "Contains constants for torus and web3auth",
"main": "dist/constants.cjs.js",
"module": "dist/constants.esm.js",
"main": "dist/lib.cjs/index.js",
"module": "dist/lib.esm/index.js",
"unpkg": "dist/constants.umd.min.js",
"jsdelivr": "dist/constants.umd.min.js",
"types": "dist/types/index.d.ts",
"sideEffects": false,
"files": [
"dist"
],
Expand Down
7 changes: 4 additions & 3 deletions packages/fetch-node-details/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"name": "@toruslabs/fetch-node-details",
"version": "13.4.0",
"description": "Fetches the node details for torus nodes",
"main": "dist/fetchNodeDetails.cjs.js",
"module": "dist/fetchNodeDetails.esm.js",
"main": "dist/lib.cjs/index.js",
"module": "dist/lib.esm/index.js",
"unpkg": "dist/fetchNodeDetails.umd.min.js",
"jsdelivr": "dist/fetchNodeDetails.umd.min.js",
"types": "dist/types/index.d.ts",
"sideEffects": false,
"files": [
"dist"
],
Expand All @@ -24,7 +25,7 @@
"dependencies": {
"@toruslabs/constants": "^13.4.0",
"@toruslabs/fnd-base": "^13.4.0",
"@toruslabs/http-helpers": "^6.1.1",
"@toruslabs/http-helpers": "^7.0.0",
"loglevel": "^1.9.1"
},
"lint-staged": {
Expand Down
5 changes: 3 additions & 2 deletions packages/fnd-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"name": "@toruslabs/fnd-base",
"version": "13.4.0",
"description": "Contains details for sapphire nodes",
"main": "dist/fndBase.cjs.js",
"module": "dist/fndBase.esm.js",
"main": "dist/lib.cjs/index.js",
"module": "dist/lib.esm/index.js",
"unpkg": "dist/fndBase.umd.min.js",
"jsdelivr": "dist/fndBase.umd.min.js",
"types": "dist/types/index.d.ts",
"sideEffects": false,
"files": [
"dist"
],
Expand Down
18 changes: 9 additions & 9 deletions packages/fnd-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,35 @@
"down": "docker-compose -f ../../docker-compose.dev.yml down"
},
"dependencies": {
"@sentry/node": "^7.113.0",
"@sentry/tracing": "^7.113.0",
"@sentry/node": "^8.9.2",
"@sentry/tracing": "^7.114.0",
"@toruslabs/constants": "^13.4.0",
"@toruslabs/fnd-base": "^13.4.0",
"@toruslabs/http-helpers": "^6.1.1",
"@toruslabs/loglevel-sentry": "^6.1.3",
"@toruslabs/http-helpers": "^7.0.0",
"@toruslabs/loglevel-sentry": "^7.0.0",
"celebrate": "^15.0.3",
"compression": "^1.7.4",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"ethers": "^6.12.1",
"ethers": "^6.13.0",
"express": "^4.19.2",
"helmet": "^7.1.0",
"json-stable-stringify": "^1.1.1",
"loglevel": "^1.9.1",
"morgan": "^1.10.0",
"redis": "^4.6.13"
"redis": "^4.6.14"
},
"devDependencies": {
"@toruslabs/eslint-config-node": "^3.2.0",
"@toruslabs/eslint-config-node": "^3.3.1",
"@types/compression": "^1.7.5",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/json-stable-stringify": "^1.0.36",
"@types/morgan": "^1.9.9",
"assert": "^2.1.0",
"cross-env": "^7.0.3",
"nodemon": "^3.1.0",
"rimraf": "^5.0.5",
"nodemon": "^3.1.3",
"rimraf": "^5.0.7",
"wait-port": "^1.1.0"
},
"lint-staged": {
Expand Down
11 changes: 6 additions & 5 deletions packages/fnd-server/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable import/first */
import "./utils/instrument";

import * as Sentry from "@sentry/node";
import { errors } from "celebrate";
import compression from "compression";
import cors from "cors";
Expand All @@ -16,7 +18,6 @@ dotenv.config({
log.setLevel((process.env.LOG_LEVEL as log.LogLevelDesc) || "DEBUG");

import router from "./router";
import { registerSentry, registerSentryErrorHandler } from "./utils/sentry";
import { traceContextMiddleware } from "./utils/traceContext";

// setup app
Expand All @@ -32,8 +33,6 @@ const http = createServer(app);
http.keepAliveTimeout = 301 * 1000;
http.headersTimeout = 305 * 1000;

registerSentry(app);

app.set("trust proxy", 1);

// setup middleware
Expand All @@ -58,7 +57,9 @@ app.use(traceContextMiddleware);

app.use("/", router);

registerSentryErrorHandler(app);
// Add this after all routes,
// but before any and other error-handling middlewares are defined
Sentry.setupExpressErrorHandler(app);

app.use(errors());

Expand Down
32 changes: 32 additions & 0 deletions packages/fnd-server/src/utils/instrument.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import * as Sentry from "@sentry/node";
import { LoglevelSentry, redactBreadcrumbData } from "@toruslabs/loglevel-sentry";
import log from "loglevel";

import redact from "./redactSentry";

const sentryDsn = process.env.SENTRY_DSN;

if (sentryDsn) {
Sentry.init({
dsn: sentryDsn,
environment: process.env.NODE_ENV,
integrations: [
// enable HTTP calls
Sentry.httpIntegration({ breadcrumbs: true }),

// application not responding detection.
Sentry.anrIntegration({ captureStackTrace: true }),
],
tracesSampleRate: process.env.SENTRY_TRACES_SAMPLE_RATE ? Number(process.env.SENTRY_TRACES_SAMPLE_RATE) : 0.01,
sampleRate: process.env.SENTRY_SAMPLE_RATE ? Number(process.env.SENTRY_SAMPLE_RATE) : 0.1,
beforeSend(event) {
return redact(event);
},
beforeBreadcrumb(breadcrumb) {
return redactBreadcrumbData(breadcrumb);
},
});

const plugin = new LoglevelSentry(Sentry);
plugin.install(log);
}
4 changes: 2 additions & 2 deletions packages/fnd-server/src/utils/redactSentry.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Event } from "@sentry/node";
import { ErrorEvent } from "@sentry/node";
import { redactEventData } from "@toruslabs/loglevel-sentry";

export default (event: Event): Event => {
export default (event: ErrorEvent): ErrorEvent => {
if (!event.request) return event;

// Redact body for sentitive URLs.
Expand Down
61 changes: 0 additions & 61 deletions packages/fnd-server/src/utils/sentry.ts

This file was deleted.

18 changes: 15 additions & 3 deletions test/setup.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import Register from "@babel/register";
import register from "@babel/register";

Register({
import currentPkg from "../package.json" assert { type: "json" };

const runtimeVersion = currentPkg.peerDependencies["@babel/runtime"];

register({
presets: [["@babel/env", { bugfixes: true }], "@babel/typescript"],
plugins: [
"@babel/plugin-syntax-bigint",
"@babel/plugin-transform-object-rest-spread",
"@babel/plugin-transform-class-properties",
["@babel/transform-runtime", { version: runtimeVersion }],
"@babel/plugin-transform-numeric-separator",
],
sourceType: "unambiguous",
extensions: [".ts", ".js"],
rootMode: "upward",
});

0 comments on commit 8143e3f

Please sign in to comment.