Skip to content

Commit

Permalink
fix: upgrade toucan-js and @web3-storage/worker-utils (#728)
Browse files Browse the repository at this point in the history
Motivation:
* #623 
* test theory that things will work if we upgrade to toucan-js@3, which
is a rewrite that sends source maps in a new way
  • Loading branch information
gobengo authored Apr 6, 2023
1 parent d7d5e15 commit 853559d
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 92 deletions.
5 changes: 3 additions & 2 deletions packages/access-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"license": "(Apache-2.0 OR MIT)",
"dependencies": {
"@ipld/dag-ucan": "^3.2.0",
"@sentry/integrations": "^7.28.0",
"@ucanto/core": "^5.2.0",
"@ucanto/interface": "^6.2.0",
"@ucanto/principal": "^5.1.0",
Expand All @@ -28,7 +29,7 @@
"@web3-storage/access": "workspace:^",
"@web3-storage/capabilities": "workspace:^",
"@web3-storage/did-mailto": "workspace:^",
"@web3-storage/worker-utils": "0.4.3-dev",
"@web3-storage/worker-utils": "0.5.0-dev",
"dotenv": "^16.0.3",
"kysely": "^0.23.4",
"kysely-d1": "^0.3.0",
Expand All @@ -38,7 +39,7 @@
"preact-render-to-string": "^5.2.6",
"qrcode": "^1.5.1",
"streaming-iterables": "^7.1.0",
"toucan-js": "^2.7.0"
"toucan-js": "^3.1.0"
},
"devDependencies": {
"@cloudflare/workers-types": "^3.19.0",
Expand Down
17 changes: 9 additions & 8 deletions packages/access-api/src/utils/context.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Logging } from '@web3-storage/worker-utils/logging'
import Toucan from 'toucan-js'
import { Toucan, RequestData } from 'toucan-js'
import { Signer } from '@ucanto/principal/ed25519'
import pkg from '../../package.json'
import { loadConfig } from '../config.js'
import { Accounts } from '../models/accounts.js'
import { Spaces } from '../models/spaces.js'
Expand All @@ -16,6 +15,7 @@ import {
} from '../models/delegations.js'
import { createD1Database } from './d1.js'
import { DbProvisions } from '../models/provisions.js'
import { RewriteFrames } from '@sentry/integrations'

/**
* Obtains a route context object.
Expand Down Expand Up @@ -47,17 +47,18 @@ export function getContext(request, env, ctx) {
// Sentry
const sentry = new Toucan({
context: ctx,
integrations: [
new RewriteFrames({ root: '/' }),
new RequestData({
allowedHeaders: ['user-agent', 'x-client'],
allowedSearchParams: /(.*)/,
}),
],
request,
dsn: config.SENTRY_DSN,
allowedHeaders: ['user-agent', 'x-client'],
allowedSearchParams: /(.*)/,
debug: false,
environment: config.ENV,
rewriteFrames: {
root: '/',
},
release: config.VERSION,
pkg,
})

// Logging
Expand Down
142 changes: 60 additions & 82 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 853559d

Please sign in to comment.