From c29caa8613d5d0fe3a9c62700de67723d0f15cd7 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Tue, 28 Nov 2023 14:09:26 +0100 Subject: [PATCH 01/20] fix(nextjs): Don't match files called `middleware` in node_modules (#9686) --- packages/nextjs/src/config/webpack.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts index 5c29b2884f41..0fbf4ea5add7 100644 --- a/packages/nextjs/src/config/webpack.ts +++ b/packages/nextjs/src/config/webpack.ts @@ -172,12 +172,12 @@ export function constructWebpackConfigFunction( ); }; + const possibleMiddlewareLocations = ['js', 'jsx', 'ts', 'tsx'].map(middlewareFileEnding => { + return path.join(middlewareLocationFolder, `middleware.${middlewareFileEnding}`); + }); const isMiddlewareResource = (resourcePath: string): boolean => { const normalizedAbsoluteResourcePath = normalizeLoaderResourcePath(resourcePath); - return ( - normalizedAbsoluteResourcePath.startsWith(middlewareLocationFolder + path.sep) && - !!normalizedAbsoluteResourcePath.match(/[\\/]middleware\.(js|jsx|ts|tsx)$/) - ); + return possibleMiddlewareLocations.includes(normalizedAbsoluteResourcePath); }; const isServerComponentResource = (resourcePath: string): boolean => { From 3476772385d489b0acc210d827cd80d25bae9d2e Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Tue, 28 Nov 2023 10:17:59 -0500 Subject: [PATCH 02/20] fix(tracing): Don't attach resource size if null (#9669) Resource size can be null in some browsers, so don't set it if it's null (only set integers). --- .../src/browser/metrics/index.ts | 2 +- .../test/browser/metrics/index.test.ts | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/tracing-internal/src/browser/metrics/index.ts b/packages/tracing-internal/src/browser/metrics/index.ts index c7a37a210d80..5182897cb0b9 100644 --- a/packages/tracing-internal/src/browser/metrics/index.ts +++ b/packages/tracing-internal/src/browser/metrics/index.ts @@ -497,7 +497,7 @@ function setResourceEntrySizeData( dataKey: 'http.response_transfer_size' | 'http.response_content_length' | 'http.decoded_response_content_length', ): void { const entryVal = entry[key]; - if (entryVal !== undefined && entryVal < MAX_INT_AS_BYTES) { + if (entryVal != null && entryVal < MAX_INT_AS_BYTES) { data[dataKey] = entryVal; } } diff --git a/packages/tracing-internal/test/browser/metrics/index.test.ts b/packages/tracing-internal/test/browser/metrics/index.test.ts index a549b2549a37..20444c7bf4c8 100644 --- a/packages/tracing-internal/test/browser/metrics/index.test.ts +++ b/packages/tracing-internal/test/browser/metrics/index.test.ts @@ -189,4 +189,26 @@ describe('_addResourceSpans', () => { }), ); }); + + // resource sizes can be set as null on some browsers + // https://github.com/getsentry/sentry/pull/60601 + it('does not attach null resource sizes', () => { + const entry = { + initiatorType: 'css', + transferSize: null, + encodedBodySize: null, + decodedBodySize: null, + } as unknown as ResourceEntry; + + _addResourceSpans(transaction, entry, '/assets/to/css', 100, 23, 345); + + // eslint-disable-next-line @typescript-eslint/unbound-method + expect(transaction.startChild).toHaveBeenCalledTimes(1); + // eslint-disable-next-line @typescript-eslint/unbound-method + expect(transaction.startChild).toHaveBeenLastCalledWith( + expect.objectContaining({ + data: {}, + }), + ); + }); }); From 42e0910477473abbbd3a836235bc131716ae387c Mon Sep 17 00:00:00 2001 From: Onur Temizkan Date: Tue, 28 Nov 2023 15:18:13 +0000 Subject: [PATCH 03/20] fix(remix): Don't capture error responses that are not 5xx on Remix v2. (#9655) --- packages/remix/src/client/errors.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/remix/src/client/errors.tsx b/packages/remix/src/client/errors.tsx index c2214bd283df..ef56ce124c61 100644 --- a/packages/remix/src/client/errors.tsx +++ b/packages/remix/src/client/errors.tsx @@ -13,7 +13,8 @@ import type { ErrorResponse } from '../utils/vendor/types'; export function captureRemixErrorBoundaryError(error: unknown): string | undefined { let eventId: string | undefined; const isClientSideRuntimeError = !isNodeEnv() && error instanceof Error; - const isRemixErrorResponse = isRouteErrorResponse(error); + // We only capture `ErrorResponse`s that are 5xx errors. + const isRemixErrorResponse = isRouteErrorResponse(error) && error.status >= 500; // Server-side errors apart from `ErrorResponse`s also appear here without their stacktraces. // So, we only capture: // 1. `ErrorResponse`s From bbe88123b05f84f766522396451ac9bb2c489067 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Tue, 28 Nov 2023 16:27:36 +0100 Subject: [PATCH 04/20] fix(astro): Avoid adding the Sentry Vite plugin in dev mode (#9688) Add a guard to avoid adding the Sentry Vite plugin for source maps upload in dev mode. Reason: The vite plugin ships with a Sentry SDK. This SDK conflicts with the Astro server-side SDK. For example for some reason, it skews up the line numbers of stack frames. Not exactly sure why that's happening but my best guess is that the plugin SDK somehow changes code (maybe we even inject debugIds or release values or something like this) that mixes up line numbers. Anyway, I think it's generally more correct to not use the plugin in dev mode. --- packages/astro/src/integration/index.ts | 4 ++-- packages/astro/test/integration/index.test.ts | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/astro/src/integration/index.ts b/packages/astro/src/integration/index.ts index 213fae64ed7a..e2d177e2b575 100644 --- a/packages/astro/src/integration/index.ts +++ b/packages/astro/src/integration/index.ts @@ -14,7 +14,7 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => { name: PKG_NAME, hooks: { // eslint-disable-next-line complexity - 'astro:config:setup': async ({ updateConfig, injectScript, addMiddleware, config }) => { + 'astro:config:setup': async ({ updateConfig, injectScript, addMiddleware, config, command }) => { // The third param here enables loading of all env vars, regardless of prefix // see: https://main.vitejs.dev/config/#using-environment-variables-in-config @@ -29,7 +29,7 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => { const shouldUploadSourcemaps = uploadOptions?.enabled ?? true; // We don't need to check for AUTH_TOKEN here, because the plugin will pick it up from the env - if (shouldUploadSourcemaps) { + if (shouldUploadSourcemaps && command !== 'dev') { updateConfig({ vite: { build: { diff --git a/packages/astro/test/integration/index.test.ts b/packages/astro/test/integration/index.test.ts index 7dba9a0ef347..5b8be17496c0 100644 --- a/packages/astro/test/integration/index.test.ts +++ b/packages/astro/test/integration/index.test.ts @@ -155,6 +155,19 @@ describe('sentryAstro integration', () => { expect(sentryVitePluginSpy).toHaveBeenCalledTimes(0); }); + it("doesn't add the Vite plugin in dev mode", async () => { + const integration = sentryAstro({ + sourceMapsUploadOptions: { enabled: true }, + }); + + expect(integration.hooks['astro:config:setup']).toBeDefined(); + // @ts-expect-error - the hook exists and we only need to pass what we actually use + await integration.hooks['astro:config:setup']({ updateConfig, injectScript, config, command: 'dev' }); + + expect(updateConfig).toHaveBeenCalledTimes(0); + expect(sentryVitePluginSpy).toHaveBeenCalledTimes(0); + }); + it('injects client and server init scripts', async () => { const integration = sentryAstro({}); From dd34361cda0f267e7d96afbb051a108d567d21c9 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Tue, 28 Nov 2023 11:10:58 -0500 Subject: [PATCH 05/20] fix(utils): regex match port to stop accidental replace (#9676) --- packages/utils/src/url.ts | 5 +++-- packages/utils/test/url.test.ts | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/utils/src/url.ts b/packages/utils/src/url.ts index 71ce23e63a57..d5d773e27389 100644 --- a/packages/utils/src/url.ts +++ b/packages/utils/src/url.ts @@ -70,8 +70,9 @@ export function getSanitizedUrlString(url: PartialURL): string { // Always filter out authority .replace(/^.*@/, '[filtered]:[filtered]@') // Don't show standard :80 (http) and :443 (https) ports to reduce the noise - .replace(':80', '') - .replace(':443', '')) || + // TODO: Use new URL global if it exists + .replace(/(:80)$/, '') + .replace(/(:443)$/, '')) || ''; return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`; diff --git a/packages/utils/test/url.test.ts b/packages/utils/test/url.test.ts index 9caad36f572b..d58f7cf205a8 100644 --- a/packages/utils/test/url.test.ts +++ b/packages/utils/test/url.test.ts @@ -74,6 +74,10 @@ describe('getSanitizedUrlString', () => { ['same-origin url', '/api/v4/users?id=123', '/api/v4/users'], ['url without a protocol', 'example.com', 'example.com'], ['url without a protocol with a path', 'example.com/sub/path?id=123', 'example.com/sub/path'], + ['url with port 8080', 'http://172.31.12.144:8080/test', 'http://172.31.12.144:8080/test'], + ['url with port 4433', 'http://172.31.12.144:4433/test', 'http://172.31.12.144:4433/test'], + ['url with port 443', 'http://172.31.12.144:443/test', 'http://172.31.12.144/test'], + ['url with IP and port 80', 'http://172.31.12.144:80/test', 'http://172.31.12.144/test'], ])('returns a sanitized URL for a %s', (_, rawUrl: string, sanitizedURL: string) => { const urlObject = parseUrl(rawUrl); expect(getSanitizedUrlString(urlObject)).toEqual(sanitizedURL); From 76cc1ec579cb0677e93aa00d447b8f64e756abed Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 27 Nov 2023 13:54:27 -0500 Subject: [PATCH 06/20] feat: replace prettier with biome --- .prettierignore | 3 -- .prettierrc.json | 7 --- .vscode/extensions.json | 2 +- biome.json | 44 +++++++++++++++++ package.json | 3 +- packages/angular-ivy/package.json | 8 ++-- packages/angular/package.json | 8 ++-- packages/astro/package.json | 8 ++-- .../browser-integration-tests/.prettierignore | 2 - .../browser-integration-tests/package.json | 8 ++-- packages/browser/package.json | 8 ++-- packages/bun/package.json | 6 +-- packages/core/package.json | 6 +-- packages/deno/package.json | 8 ++-- packages/e2e-tests/package.json | 8 ++-- packages/ember/.npmignore | 2 - packages/ember/package.json | 7 +-- packages/eslint-plugin-sdk/package.json | 8 ++-- packages/feedback/package.json | 8 ++-- packages/gatsby/package.json | 8 ++-- packages/hub/package.json | 8 ++-- packages/integration-shims/package.json | 8 ++-- packages/integrations/package.json | 8 ++-- packages/nextjs/package.json | 8 ++-- packages/node-experimental/package.json | 8 ++-- packages/node-integration-tests/package.json | 8 ++-- packages/node/package.json | 8 ++-- packages/opentelemetry-node/package.json | 8 ++-- packages/opentelemetry/package.json | 8 ++-- packages/overhead-metrics/package.json | 8 ++-- packages/react/package.json | 8 ++-- packages/remix/package.json | 8 ++-- packages/replay-worker/package.json | 8 ++-- packages/replay/package.json | 4 +- packages/serverless/package.json | 8 ++-- packages/svelte/package.json | 8 ++-- packages/sveltekit/package.json | 8 ++-- packages/tracing-internal/package.json | 8 ++-- packages/tracing/package.json | 8 ++-- packages/types/package.json | 8 ++-- packages/utils/package.json | 6 +-- packages/vercel-edge/package.json | 8 ++-- packages/vue/package.json | 8 ++-- packages/wasm/package.json | 8 ++-- yarn.lock | 47 +++++++++++++++++-- 45 files changed, 232 insertions(+), 163 deletions(-) delete mode 100644 .prettierignore delete mode 100644 .prettierrc.json create mode 100644 biome.json delete mode 100644 packages/browser-integration-tests/.prettierignore diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index f616ea97e557..000000000000 --- a/.prettierignore +++ /dev/null @@ -1,3 +0,0 @@ -*.md -.nxcache -packages/browser-integration-tests/fixtures/loader.js diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index ba9a3dc2c246..000000000000 --- a/.prettierrc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "arrowParens": "avoid", - "printWidth": 120, - "proseWrap": "always", - "singleQuote": true, - "trailingComma": "all" -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 3ad96b1733d5..cf9ee54f8ea5 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,7 +2,7 @@ // See http://go.microsoft.com/fwlink/?LinkId=827846 // for the documentation about the extensions.json format "recommendations": [ - "esbenp.prettier-vscode", + "biomejs.biome", "dbaeumer.vscode-eslint", "augustocdias.tasks-shell-input", "denoland.vscode-deno" diff --git a/biome.json b/biome.json new file mode 100644 index 000000000000..8e23fac824fe --- /dev/null +++ b/biome.json @@ -0,0 +1,44 @@ +{ + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + }, + "organizeImports": { + "enabled": false + }, + "linter": { + "enabled": false + }, + "files": { + "ignoreUnknown": true + }, + "formatter": { + "enabled": true, + "formatWithErrors": true, + "indentStyle": "space", + "indentWidth": 2, + "lineWidth": 120, + "ignore": [ + "*.md", + ".nxcache", + "packages/browser-integration-tests/fixtures/loader.js", + "packages/browser/examples/bundle.js" + ] + }, + "javascript": { + "formatter": { + "enabled": true, + "quoteStyle": "single", + "arrowParentheses": "asNeeded", + "trailingComma": "all", + "lineEnding": "lf" + } + }, + "json": { + "formatter": { + "enabled": true + } + } +} diff --git a/package.json b/package.json index 59ebf856ed09..5763b96f5efc 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "link:yarn": "lerna exec yarn link", "lint": "lerna run lint", "lint:eslint": "lerna run lint:eslint", + "lint:biome": "biome format --verbose .", "validate:es5": "lerna run validate:es5", "postpublish": "lerna run --stream --concurrency 1 postpublish", "test": "lerna run --ignore \"@sentry-internal/{browser-integration-tests,e2e-tests,integration-shims,node-integration-tests,overhead-metrics}\" test", @@ -79,6 +80,7 @@ "packages/wasm" ], "devDependencies": { + "@biomejs/biome": "^1.4.0", "@rollup/plugin-commonjs": "^21.0.1", "@rollup/plugin-node-resolve": "^13.1.3", "@rollup/plugin-replace": "^3.0.1", @@ -112,7 +114,6 @@ "mocha": "^6.1.4", "nodemon": "^2.0.16", "npm-run-all": "^4.1.5", - "prettier": "2.8.7", "recast": "^0.20.5", "replace-in-file": "^4.0.0", "rimraf": "^3.0.2", diff --git a/packages/angular-ivy/package.json b/packages/angular-ivy/package.json index 4ef21a1d9624..f76336aef645 100644 --- a/packages/angular-ivy/package.json +++ b/packages/angular-ivy/package.json @@ -50,12 +50,12 @@ "build:syncSymlinks": "ts-node ./scripts/syncSourceFiles.ts", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-angular-ivy-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "yalc:publish": "ts-node ./scripts/prepack.ts && yalc publish build --push --sig" }, "volta": { diff --git a/packages/angular/package.json b/packages/angular/package.json index 0623abb8623b..e612ebecafd2 100644 --- a/packages/angular/package.json +++ b/packages/angular/package.json @@ -51,12 +51,12 @@ "build:tarball": "npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-angular-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "yarn test:unit", "test:unit": "jest", "test:unit:watch": "jest --watch", diff --git a/packages/astro/package.json b/packages/astro/package.json index bfa58876b91b..098a019ec624 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -67,12 +67,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts", "clean": "rimraf build coverage sentry-astro-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "yarn test:unit", "test:unit": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/browser-integration-tests/.prettierignore b/packages/browser-integration-tests/.prettierignore deleted file mode 100644 index af2405d11b29..000000000000 --- a/packages/browser-integration-tests/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -tmp -fixtures diff --git a/packages/browser-integration-tests/package.json b/packages/browser-integration-tests/package.json index f185d6142cdc..f20a4def89ce 100644 --- a/packages/browser-integration-tests/package.json +++ b/packages/browser-integration-tests/package.json @@ -10,12 +10,12 @@ "scripts": { "clean": "rimraf -g suites/**/dist loader-suites/**/dist tmp", "install-browsers": "playwright install --with-deps", - "lint": "run-s lint:prettier lint:eslint", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{suites,utils}/**/*.ts\"", - "fix": "run-s fix:eslint fix:prettier", + "lint:biome": "biome format .", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{suites,utils}/**/*.ts\"", + "fix:biome": "biome format --fix .", "type-check": "tsc", "pretest": "yarn clean && yarn type-check", "test": "playwright test ./suites --project='chromium'", diff --git a/packages/browser/package.json b/packages/browser/package.json index e2ea69b2834a..bae7b9f787b7 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -70,12 +70,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage .rpt2_cache sentry-browser-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "validate:es5": "es-check es5 'build/bundles/*.es5*.js'", "size:check": "run-p size:check:es5 size:check:es6", "size:check:es5": "cat build/bundles/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES5: \",$1,\"kB\";}'", diff --git a/packages/bun/package.json b/packages/bun/package.json index 67330f08ea7b..fd5f4d4a4bb7 100644 --- a/packages/bun/package.json +++ b/packages/bun/package.json @@ -47,10 +47,10 @@ "clean": "rimraf build coverage sentry-bun-*.tgz", "fix": "run-s fix:eslint fix:prettier", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:prettier": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "install:bun": "node ./scripts/install-bun.js", "test": "run-s install:bun test:bun", "test:bun": "bun test", diff --git a/packages/core/package.json b/packages/core/package.json index 7167cd9512db..d873bc77f6d8 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -42,10 +42,10 @@ "clean": "rimraf build coverage sentry-core-*.tgz", "fix": "run-s fix:eslint fix:prettier", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:prettier": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "jest", "test:watch": "jest --watch", "version": "node ../../scripts/versionbump.js src/version.ts", diff --git a/packages/deno/package.json b/packages/deno/package.json index f842a9a515c2..bbe95c2266fd 100644 --- a/packages/deno/package.json +++ b/packages/deno/package.json @@ -39,13 +39,13 @@ "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build build-types build-test coverage", "prefix": "yarn deno-types", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", + "fix:biome": "biome format --write .", "prelint": "yarn deno-types", - "lint": "run-s lint:prettier lint:eslint", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "install:deno": "node ./scripts/install-deno.mjs", "pretest": "run-s deno-types test:build", "test": "run-s install:deno test:types test:unit", diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index bbea2e2e368b..e83288de6181 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -4,12 +4,12 @@ "license": "MIT", "private": true, "scripts": { - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --config ../../.prettierrc.json --write . ", - "lint": "run-s lint:prettier lint:eslint lint:ts", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint lint:ts", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --config ../../.prettierrc.json --check .", + "lint:biome": "biome format .", "lint:ts": "tsc --noEmit", "test:e2e": "run-s test:validate-configuration test:validate-test-app-setups test:run", "test:run": "ts-node run.ts", diff --git a/packages/ember/.npmignore b/packages/ember/.npmignore index 3f07eeada96e..ff9862207d8e 100644 --- a/packages/ember/.npmignore +++ b/packages/ember/.npmignore @@ -18,8 +18,6 @@ /.git/ /.github/ /.gitignore -/.prettierignore -/.prettierrc.js /.template-lintrc.js /.travis.yml /.watchmanconfig diff --git a/packages/ember/package.json b/packages/ember/package.json index 54763f3a2d19..ae65bbb67b4a 100644 --- a/packages/ember/package.json +++ b/packages/ember/package.json @@ -19,13 +19,14 @@ "scripts": { "build:tarball": "ember ts:precompile && npm pack && ember ts:clean", "clean": "yarn rimraf sentry-ember-*.tgz dist tmp build .node_modules.ember-try package.json.ember-try instance-initializers index.d.ts runloop.d.ts types.d.ts", - "lint": "run-p lint:js lint:hbs lint:ts", + "lint": "run-p lint:js lint:hbs lint:ts lint:biome", "lint:hbs": "ember-template-lint .", "lint:js": "eslint .", "lint:ts": "tsc", - "fix": "run-s fix:eslint fix:prettier", + "lint:biome": "biome format .", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{addon,app,tests,config}/**/**.{ts,js}\"", + "fix:biome": "biome format --write .", "start": "ember serve", "test": "ember b --prod && ember test", "test:all": "ember try:each", diff --git a/packages/eslint-plugin-sdk/package.json b/packages/eslint-plugin-sdk/package.json index e83ce6d5b32c..c8311a94796e 100644 --- a/packages/eslint-plugin-sdk/package.json +++ b/packages/eslint-plugin-sdk/package.json @@ -26,12 +26,12 @@ }, "scripts": { "clean": "yarn rimraf sentry-internal-eslint-plugin-sdk-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test}/**/*.js\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test}/**/*.js\"", + "lint:biome": "biome format .", "test": "mocha test --recursive", "build:tarball": "npm pack", "circularDepCheck": "madge --circular src/index.js" diff --git a/packages/feedback/package.json b/packages/feedback/package.json index 9a85edd38467..e237cc0227fc 100644 --- a/packages/feedback/package.json +++ b/packages/feedback/package.json @@ -43,12 +43,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build sentry-replay-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"", + "lint:biome": "biome format .", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts --bundles && yalc publish ./build/npm --push --sig" diff --git a/packages/gatsby/package.json b/packages/gatsby/package.json index 8b1fefd32a80..243ba576762b 100644 --- a/packages/gatsby/package.json +++ b/packages/gatsby/package.json @@ -57,12 +57,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage *.d.ts sentry-gatsby-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.{ts,tsx,js}\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.{ts,tsx,js}\"", + "lint:biome": "biome format .", "test": "yarn ts-node scripts/pretest.ts && yarn jest", "test:watch": "yarn ts-node scripts/pretest.ts && yarn jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig" diff --git a/packages/hub/package.json b/packages/hub/package.json index f57b33569e3d..13a36828121b 100644 --- a/packages/hub/package.json +++ b/packages/hub/package.json @@ -41,12 +41,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-hub-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig" diff --git a/packages/integration-shims/package.json b/packages/integration-shims/package.json index 57d19e6d38cc..c258e27c7de6 100644 --- a/packages/integration-shims/package.json +++ b/packages/integration-shims/package.json @@ -26,12 +26,12 @@ "build:transpile:watch": "yarn build:transpile --watch", "build:types:watch": "tsc -p tsconfig.types.json --watch", "clean": "rimraf build", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test}/**/*.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test}/**/*.ts\"" + "lint:biome": "biome format ." }, "repository": { "type": "git", diff --git a/packages/integrations/package.json b/packages/integrations/package.json index aeb3c20f0afc..745592bf664c 100644 --- a/packages/integrations/package.json +++ b/packages/integrations/package.json @@ -47,12 +47,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage .rpt2_cache sentry-integrations-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "validate:es5": "es-check es5 'build/bundles/*.es5*.js'", "test": "jest", "test:watch": "jest --watch", diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 5dec380bd673..45c397ed418d 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -68,12 +68,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/edge/index.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts", "clean": "rimraf build coverage sentry-nextjs-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "yarn test:unit", "test:all": "run-s test:unit test:integration test:build", "test:build": "yarn ts-node test/buildProcess/runTest.ts", diff --git a/packages/node-experimental/package.json b/packages/node-experimental/package.json index 49c009c4e585..0b73b8eab810 100644 --- a/packages/node-experimental/package.json +++ b/packages/node-experimental/package.json @@ -65,12 +65,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-node-experimental-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "yarn test:jest", "test:jest": "jest", "test:watch": "jest --watch", diff --git a/packages/node-integration-tests/package.json b/packages/node-integration-tests/package.json index fa4d4ae7f905..c66f9825ccc6 100644 --- a/packages/node-integration-tests/package.json +++ b/packages/node-integration-tests/package.json @@ -10,12 +10,12 @@ "clean": "rimraf -g **/node_modules", "prisma:init": "(cd suites/tracing/prisma-orm && ts-node ./setup.ts)", "prisma:init:new": "(cd suites/tracing-new/prisma-orm && ts-node ./setup.ts)", - "lint": "run-s lint:prettier lint:eslint", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{suites,utils}/**/*.ts\"", - "fix": "run-s fix:eslint fix:prettier", + "lint:biome": "biome format .", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{suites,utils}/**/*.ts\"", + "fix:biome": "biome format --write .", "type-check": "tsc", "pretest": "run-s --silent prisma:init prisma:init:new", "test": "ts-node ./utils/run-tests.ts", diff --git a/packages/node/package.json b/packages/node/package.json index efdb4126a5a9..ed748d8d669f 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -52,12 +52,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-node-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "run-s test:jest test:express test:webpack test:release-health", "test:express": "node test/manual/express-scope-separation/start.js", "test:jest": "jest", diff --git a/packages/opentelemetry-node/package.json b/packages/opentelemetry-node/package.json index ea7c58b97ce1..9b286500f7c7 100644 --- a/packages/opentelemetry-node/package.json +++ b/packages/opentelemetry-node/package.json @@ -55,12 +55,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-opentelemetry-node-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "yarn test:jest", "test:jest": "jest", "test:watch": "jest --watch", diff --git a/packages/opentelemetry/package.json b/packages/opentelemetry/package.json index fbc531ed7d56..f3c580ade2d5 100644 --- a/packages/opentelemetry/package.json +++ b/packages/opentelemetry/package.json @@ -55,12 +55,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-opentelemetry-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "yarn test:jest", "test:jest": "jest", "test:watch": "jest --watch", diff --git a/packages/overhead-metrics/package.json b/packages/overhead-metrics/package.json index ed0ed4b4f31c..fec2f9932f7f 100644 --- a/packages/overhead-metrics/package.json +++ b/packages/overhead-metrics/package.json @@ -13,12 +13,12 @@ "dev:run:replay": "npx chrome ./test-apps/booking-app/with-replay.html", "ci:collect": "ts-node-esm ./configs/ci/collect.ts", "ci:process": "ts-node-esm ./configs/ci/process.ts", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test-apps,configs}/**/*.{ts,js,html,css}\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test-apps,configs}/**/*.{ts,js,html,css}\"" + "lint:biome": "biome format ." }, "dependencies": { "@octokit/rest": "^19.0.5", diff --git a/packages/react/package.json b/packages/react/package.json index bdc6034b7a5d..8c08ac42b917 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -70,12 +70,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-react-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig" diff --git a/packages/remix/package.json b/packages/remix/package.json index 276e1362537c..ac83b4af91db 100644 --- a/packages/remix/package.json +++ b/packages/remix/package.json @@ -60,12 +60,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.server.ts", "clean": "rimraf build coverage sentry-remix-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "yarn test:unit", "test:integration": "run-s test:integration:v1 test:integration:v2", "test:integration:v1": "run-s test:integration:clean test:integration:prepare test:integration:client test:integration:server", diff --git a/packages/replay-worker/package.json b/packages/replay-worker/package.json index 057a8dd40946..a430af599a5a 100644 --- a/packages/replay-worker/package.json +++ b/packages/replay-worker/package.json @@ -27,12 +27,12 @@ "build:transpile:watch": "yarn build:transpile --watch", "build:types:watch": "tsc -p tsconfig.types.json --watch", "clean": "rimraf build", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test}/**/*.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test}/**/*.ts\"", + "lint:biome": "biome format .", "test": "jest", "test:watch": "jest --watch" }, diff --git a/packages/replay/package.json b/packages/replay/package.json index a1192b9a73e7..a8f25a78bfcc 100644 --- a/packages/replay/package.json +++ b/packages/replay/package.json @@ -32,9 +32,9 @@ "fix": "run-s fix:eslint fix:prettier", "fix:eslint": "eslint . --format stylish --fix", "fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"", + "lint:biome": "prettier --check \"{src,test,scripts}/**/*.ts\"", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts --bundles && yalc publish ./build/npm --push --sig" diff --git a/packages/serverless/package.json b/packages/serverless/package.json index 2fd12e1477f9..f330165febcc 100644 --- a/packages/serverless/package.json +++ b/packages/serverless/package.json @@ -57,12 +57,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build dist-awslambda-layer coverage sentry-serverless-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts --bundles && yalc publish ./build/npm --push --sig" diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 976601ea3416..4af944be06a0 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -50,12 +50,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-svelte-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig" diff --git a/packages/sveltekit/package.json b/packages/sveltekit/package.json index fe04dba4efa0..afa053251736 100644 --- a/packages/sveltekit/package.json +++ b/packages/sveltekit/package.json @@ -49,12 +49,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts", "clean": "rimraf build coverage sentry-sveltekit-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "yarn test:unit", "test:unit": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/tracing-internal/package.json b/packages/tracing-internal/package.json index 8aef67a0eca8..9156d2ccc518 100644 --- a/packages/tracing-internal/package.json +++ b/packages/tracing-internal/package.json @@ -43,12 +43,12 @@ "build:types:watch": "tsc -p tsconfig.types.json --watch", "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "clean": "rimraf build coverage sentry-internal-tracing-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test:unit": "jest", "test": "jest", "test:watch": "jest --watch", diff --git a/packages/tracing/package.json b/packages/tracing/package.json index 48afeeea2a80..4c3fc00e0d01 100644 --- a/packages/tracing/package.json +++ b/packages/tracing/package.json @@ -47,12 +47,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm", "clean": "rimraf build coverage sentry-tracing-*.tgz", "circularDepCheck": "madge --circular src/index.ts", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test:unit": "jest", "test": "jest", "test:watch": "jest --watch", diff --git a/packages/types/package.json b/packages/types/package.json index c213bb648266..1f5ec29cfb70 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -35,12 +35,12 @@ "build:types:watch": "tsc -p tsconfig.types.json --watch", "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "clean": "rimraf build sentry-types-*.tgz", - "lint": "run-s lint:prettier lint:eslint", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", - "fix": "run-s fix:eslint fix:prettier", + "lint:biome": "biome format .", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", + "fix:biome": "biome format --write .", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig" }, "volta": { diff --git a/packages/utils/package.json b/packages/utils/package.json index d9d167cdc299..0e03c5170eaf 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -46,10 +46,10 @@ "clean": "rimraf build coverage cjs esm sentry-utils-*.tgz", "fix": "run-s fix:eslint fix:prettier", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:prettier": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "prettier --check \"{src,test,scripts}/**/**.ts\"", "test": "jest", "test:watch": "jest --watch", "test:package": "node test/types/index.js", diff --git a/packages/vercel-edge/package.json b/packages/vercel-edge/package.json index c5bd42ad5f75..79e570473cf9 100644 --- a/packages/vercel-edge/package.json +++ b/packages/vercel-edge/package.json @@ -46,12 +46,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-vercel-edge-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig" diff --git a/packages/vue/package.json b/packages/vue/package.json index 70dd6219b7e3..1745214de344 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -48,12 +48,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-vue-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig" diff --git a/packages/wasm/package.json b/packages/wasm/package.json index afc817fe8b27..8d4e38ee9473 100644 --- a/packages/wasm/package.json +++ b/packages/wasm/package.json @@ -43,12 +43,12 @@ "build:tarball": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-wasm-*.tgz", - "fix": "run-s fix:eslint fix:prettier", + "fix": "run-s fix:eslint fix:biome", "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"", - "lint": "run-s lint:prettier lint:eslint", + "fix:biome": "biome format --write .", + "lint": "run-s lint:biome lint:eslint", "lint:eslint": "eslint . --format stylish", - "lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "lint:biome": "biome format .", "yalc:publish": "ts-node ../../scripts/prepack.ts --bundles && yalc publish ./build/npm --push --sig" }, "volta": { diff --git a/yarn.lock b/yarn.lock index 81d72c38f57f..7f5cfc15d4f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2477,6 +2477,48 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@biomejs/biome@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-1.4.0.tgz#b512e1e7a4f3ec0bc0aceaa99fab8eded2bd95c9" + integrity sha512-/rDlao6ra38nhxo4IYCqWCzfTJcpMk4YHjSVBI9yN/ifdhnzSwirL25xDVH7G9hZdNhpF9g78FaPJhFa9DX0Cw== + optionalDependencies: + "@biomejs/cli-darwin-arm64" "1.4.0" + "@biomejs/cli-darwin-x64" "1.4.0" + "@biomejs/cli-linux-arm64" "1.4.0" + "@biomejs/cli-linux-x64" "1.4.0" + "@biomejs/cli-win32-arm64" "1.4.0" + "@biomejs/cli-win32-x64" "1.4.0" + +"@biomejs/cli-darwin-arm64@1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.4.0.tgz#08e9e19ae72fd980be65307844a71cd7ba96f4f2" + integrity sha512-nBrtVRwr4IlTtxLOHwBwLv1sWvggf9/DnT5/ALIANJZOpoING6u8jHWipods69wK8kGa8Ld7iwHm3W5BrJJFFQ== + +"@biomejs/cli-darwin-x64@1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.4.0.tgz#ae04f06a4446fa718dfeba863af6250a0b4185e6" + integrity sha512-nny0VgOj3ksUGzU5GblgtQEvrAZFgFe1IJBoYOP978OQdDrg7BpS+GX5udfof87Dl4ZlHPRBU951ceHOxF7BTg== + +"@biomejs/cli-linux-arm64@1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.4.0.tgz#40fbd94cff2c8437d18136d25801ead441ac6739" + integrity sha512-gyLkT/Yh9xfW1T9yjQs/2txkCeG0e+LRs0adLugMwN0ptcNTRyusBvUoiHnpB+9rS6hWu9ZCedGMNmKQ8v2GSw== + +"@biomejs/cli-linux-x64@1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-1.4.0.tgz#813d191b020a90aa829a5fc37dfeea393696a0f1" + integrity sha512-LIxTuU2zSbIHM9XDYjQphJ5UU8h2eS7yR8uIvGYSba7Qt9AKqfbenyVJTsVnoj1CXxxgKNVSc/wVmlOlGz5DBQ== + +"@biomejs/cli-win32-arm64@1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.4.0.tgz#a6edb984d48d9a9db5971e13c3047ab19fd592c2" + integrity sha512-U2jT1/0wZLJIRqnU8qHAfi/A/+yUwlL3sYJgqs+wO0BbR22WGQZlj03u5FdpEoyLXdsLv1pbeIcjNp+V0NYXWA== + +"@biomejs/cli-win32-x64@1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-1.4.0.tgz#0bb1292c5e279198912b6ec35649124ba8349b72" + integrity sha512-gN6DgyyBxIwoCovAUFJHFWVallb0cLosayDRtNyxU3MDv/atZxSXOWQezfVKBIbgmFPxYWJObd+awvbPYXwwww== + "@cnakazawa/watch@^1.0.3": version "1.0.4" resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" @@ -25317,11 +25359,6 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= -prettier@2.8.7: - version "2.8.7" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" - integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== - prettier@^2.5.1: version "2.7.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" From 109acf8e4f0cb11c592f846341b8bb15c61bbd6a Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 27 Nov 2023 13:59:01 -0500 Subject: [PATCH 07/20] style: fix styling errors --- biome.json | 9 +- packages/astro/src/integration/snippets.ts | 4 +- packages/astro/src/server/meta.ts | 8 +- .../utils/helpers.ts | 11 +- packages/browser/examples/app.js | 4 +- packages/browser/src/integrations/trycatch.ts | 2 +- packages/browser/src/loader.js | 3 +- packages/browser/src/profiling/utils.ts | 4 +- packages/browser/test/integration/.prettierrc | 7 - .../test/integration/polyfills/fetch.js | 4 +- .../test/integration/polyfills/promise.js | 18 +- packages/browser/test/integration/run.js | 10 +- .../browser/test/integration/suites/api.js | 2 +- .../test/integration/suites/breadcrumbs.js | 8 +- .../test/integration/suites/builtins.js | 8 +- .../test/integration/suites/onerror.js | 14 +- .../suites/onunhandledrejection.js | 18 +- .../browser/test/integration/suites/shell.js | 16 +- .../sentry-performance.ts | 6 +- .../tests/dummy/config/ember-cli-update.json | 4 +- packages/gatsby/gatsby-node.js | 8 +- packages/hub/test/exports.test.ts | 4 +- .../test/reportingobserver.test.ts | 2 +- packages/nextjs/src/config/webpack.ts | 8 +- .../webpack/constructWebpackConfig.test.ts | 2 +- .../nextjs/test/config/withSentry.test.ts | 2 +- packages/nextjs/test/config/wrappers.test.ts | 2 +- .../pagesRouterInstrumentation.test.ts | 2 +- .../node-integration-tests/utils/index.ts | 21 +- packages/node/src/handlers.ts | 6 +- .../test/manual/release-health/test-utils.js | 8 +- .../manual/webpack-async-context/npm-build.js | 2 +- packages/opentelemetry/src/custom/client.ts | 8 +- .../overhead-metrics/configs/ci/process.ts | 4 +- packages/react/src/reactrouter.tsx | 4 +- packages/replay-worker/examples/worker.js | 1502 +++++++++-------- packages/replay-worker/src/worker.ts | 2 +- packages/serverless/src/google-cloud-grpc.ts | 8 +- packages/sveltekit/rollup.npm.config.js | 2 +- packages/tracing-internal/src/common/fetch.ts | 4 +- packages/utils/src/instrument/index.ts | 1 - packages/utils/src/object.ts | 4 +- scripts/prepack.ts | 9 +- 43 files changed, 905 insertions(+), 870 deletions(-) delete mode 100644 packages/browser/test/integration/.prettierrc diff --git a/biome.json b/biome.json index 8e23fac824fe..4950ee06f24c 100644 --- a/biome.json +++ b/biome.json @@ -21,10 +21,13 @@ "indentWidth": 2, "lineWidth": 120, "ignore": [ - "*.md", - ".nxcache", "packages/browser-integration-tests/fixtures/loader.js", - "packages/browser/examples/bundle.js" + "packages/browser-integration-tests/suites/**/*.json", + "packages/browser-integration-tests/loader-suites/**/*.js", + "packages/browser-integration-tests/suites/stacktraces/**/*.js", + "**/fixtures/*/*.json", + "packages/browser/examples/bundle.js", + "**/*.min.js" ] }, "javascript": { diff --git a/packages/astro/src/integration/snippets.ts b/packages/astro/src/integration/snippets.ts index 2cf309ea1cb2..ad5047e9954a 100644 --- a/packages/astro/src/integration/snippets.ts +++ b/packages/astro/src/integration/snippets.ts @@ -43,8 +43,8 @@ const buildCommonInitOptions = (options: SentryOptions): string => `dsn: ${ environment: ${options.environment ? JSON.stringify(options.environment) : 'import.meta.env.PUBLIC_VERCEL_ENV'}, release: ${options.release ? JSON.stringify(options.release) : 'import.meta.env.PUBLIC_VERCEL_GIT_COMMIT_SHA'}, tracesSampleRate: ${options.tracesSampleRate ?? 1.0},${ - options.sampleRate ? `\n sampleRate: ${options.sampleRate},` : '' -}`; + options.sampleRate ? `\n sampleRate: ${options.sampleRate},` : '' + }`; /** * We don't include the `BrowserTracing` integration if the tracesSampleRate is set to 0. diff --git a/packages/astro/src/server/meta.ts b/packages/astro/src/server/meta.ts index 7257cf01db51..03406fd3d23c 100644 --- a/packages/astro/src/server/meta.ts +++ b/packages/astro/src/server/meta.ts @@ -33,10 +33,10 @@ export function getTracingMetaTags(span: Span | undefined, hub: Hub): { sentryTr const dynamicSamplingContext = transaction ? transaction.getDynamicSamplingContext() : dsc - ? dsc - : client - ? getDynamicSamplingContextFromClient(traceId, client, scope) - : undefined; + ? dsc + : client + ? getDynamicSamplingContextFromClient(traceId, client, scope) + : undefined; const baggage = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext); diff --git a/packages/browser-integration-tests/utils/helpers.ts b/packages/browser-integration-tests/utils/helpers.ts index 25ea6cf07e80..d00f125a90c1 100644 --- a/packages/browser-integration-tests/utils/helpers.ts +++ b/packages/browser-integration-tests/utils/helpers.ts @@ -68,10 +68,13 @@ export const countEnvelopes = async ( page.on('request', requestHandler); - setTimeout(() => { - page.off('request', requestHandler); - resolve(reqCount); - }, options?.timeout || 1000); + setTimeout( + () => { + page.off('request', requestHandler); + resolve(reqCount); + }, + options?.timeout || 1000, + ); }); if (options?.url) { diff --git a/packages/browser/examples/app.js b/packages/browser/examples/app.js index f9e9e54a338e..e081cc4aec14 100644 --- a/packages/browser/examples/app.js +++ b/packages/browser/examples/app.js @@ -31,11 +31,11 @@ function makeHappyTransport(options) { method: 'POST', referrerPolicy: 'origin', headers: options.headers, - ...options.fetchOptions + ...options.fetchOptions, }; // you define how `sendMyCustomRequest` works - const sendMyCustomRequest = (r) => fetch(options.url, r); + const sendMyCustomRequest = r => fetch(options.url, r); return sendMyCustomRequest(myCustomRequest).then(response => ({ statusCode: response.status, headers: { diff --git a/packages/browser/src/integrations/trycatch.ts b/packages/browser/src/integrations/trycatch.ts index 56e414f46e64..03dc1fcd2a80 100644 --- a/packages/browser/src/integrations/trycatch.ts +++ b/packages/browser/src/integrations/trycatch.ts @@ -195,7 +195,7 @@ function _wrapEventTarget(target: string): void { return; } - fill(proto, 'addEventListener', function (original: () => void): ( + fill(proto, 'addEventListener', function (original: VoidFunction,): ( eventName: string, fn: EventListenerObject, options?: boolean | AddEventListenerOptions, diff --git a/packages/browser/src/loader.js b/packages/browser/src/loader.js index 4289d96a8fc7..19d7bfb5a7e9 100644 --- a/packages/browser/src/loader.js +++ b/packages/browser/src/loader.js @@ -1,5 +1,4 @@ -// prettier-ignore -// Prettier disabled due to trailing comma not working in IE10/11 +// biome-ignore format: Disabled due to trailing comma not working in IE10/11 (function( _window, _document, diff --git a/packages/browser/src/profiling/utils.ts b/packages/browser/src/profiling/utils.ts index ddf966d86deb..9bd1c7f8e859 100644 --- a/packages/browser/src/profiling/utils.ts +++ b/packages/browser/src/profiling/utils.ts @@ -143,8 +143,8 @@ export function createProfilePayload( const transactionStartMs = start_timestamp ? start_timestamp : typeof event.start_timestamp === 'number' - ? event.start_timestamp * 1000 - : Date.now(); + ? event.start_timestamp * 1000 + : Date.now(); const transactionEndMs = typeof event.timestamp === 'number' ? event.timestamp * 1000 : Date.now(); const profile: Profile = { diff --git a/packages/browser/test/integration/.prettierrc b/packages/browser/test/integration/.prettierrc deleted file mode 100644 index 369aaabb2dae..000000000000 --- a/packages/browser/test/integration/.prettierrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "arrowParens": "avoid", - "printWidth": 120, - "proseWrap": "always", - "singleQuote": true, - "trailingComma": "es5" -} diff --git a/packages/browser/test/integration/polyfills/fetch.js b/packages/browser/test/integration/polyfills/fetch.js index 97186e4236bb..602e96b4977e 100644 --- a/packages/browser/test/integration/polyfills/fetch.js +++ b/packages/browser/test/integration/polyfills/fetch.js @@ -10,8 +10,8 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd - ? define(['exports'], factory) - : factory((global.WHATWGFetch = {})); + ? define(['exports'], factory) + : factory((global.WHATWGFetch = {})); })(this, function (exports) { 'use strict'; diff --git a/packages/browser/test/integration/polyfills/promise.js b/packages/browser/test/integration/polyfills/promise.js index 5aae1ad18649..8fff504045da 100644 --- a/packages/browser/test/integration/polyfills/promise.js +++ b/packages/browser/test/integration/polyfills/promise.js @@ -10,8 +10,8 @@ typeof exports === 'object' && typeof module !== 'undefined' ? (module.exports = factory()) : typeof define === 'function' && define.amd - ? define(factory) - : (global.ES6Promise = factory()); + ? define(factory) + : (global.ES6Promise = factory()); })(this, function () { 'use strict'; @@ -279,7 +279,7 @@ reject(promise, reason); }, - 'Settle: ' + (promise._label || ' unknown promise') + 'Settle: ' + (promise._label || ' unknown promise'), ); if (!sealed && error) { @@ -303,7 +303,7 @@ }, function (reason) { return reject(promise, reason); - } + }, ); } } @@ -458,7 +458,7 @@ }, function rejectPromise(reason) { reject(promise, reason); - } + }, ); } catch (e) { reject(promise, e); @@ -549,7 +549,7 @@ new c(function (resolve$$1) { return resolve$$1(entry); }), - i + i, ); } } else { @@ -586,7 +586,7 @@ }, function (reason) { return enumerator._settledAt(REJECTED, i, reason); - } + }, ); }; @@ -775,7 +775,7 @@ function needsNew() { throw new TypeError( - "Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function." + "Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.", ); } @@ -1138,7 +1138,7 @@ return constructor.resolve(callback()).then(function () { throw reason; }); - } + }, ); } diff --git a/packages/browser/test/integration/run.js b/packages/browser/test/integration/run.js index 38ff9975b81a..abca77887ddf 100755 --- a/packages/browser/test/integration/run.js +++ b/packages/browser/test/integration/run.js @@ -73,23 +73,25 @@ function build() { writeFile( 'artifacts/dedupe.js', - readFile('../../../integrations/build/bundles/dedupe.js').replace('//# sourceMappingURL=dedupe.js.map', '') + readFile('../../../integrations/build/bundles/dedupe.js').replace('//# sourceMappingURL=dedupe.js.map', ''), ); concatFiles('artifacts/setup.js', ['artifacts/dedupe.js', 'common/utils.js', 'common/triggers.js', 'common/init.js']); rmdir('artifacts/dedupe.js'); writeFile( 'artifacts/sdk.js', - readFile('../../build/bundles/bundle.js').replace('//# sourceMappingURL=bundle.js.map', '') + readFile('../../build/bundles/bundle.js').replace('//# sourceMappingURL=bundle.js.map', ''), ); writeFile( 'artifacts/loader.js', - readFile('../../src/loader.js').replace('../../build/bundles/bundle.js', '/base/artifacts/sdk.js') + readFile('../../src/loader.js').replace('../../build/bundles/bundle.js', '/base/artifacts/sdk.js'), ); writeFile( 'artifacts/tests.js', - [readFile('polyfills/promise.js'), readFile('suites/helpers.js'), replacePlaceholders('suites/shell.js')].join('\n') + [readFile('polyfills/promise.js'), readFile('suites/helpers.js'), replacePlaceholders('suites/shell.js')].join( + '\n', + ), ); } diff --git a/packages/browser/test/integration/suites/api.js b/packages/browser/test/integration/suites/api.js index 00ea7d58cd0d..9cb59277c6e0 100644 --- a/packages/browser/test/integration/suites/api.js +++ b/packages/browser/test/integration/suites/api.js @@ -82,7 +82,7 @@ describe('API', function () { summary.events[0].exception.values[0].stacktrace.frames[ summary.events[0].exception.values[0].stacktrace.frames.length - 1 ].function, - 'bar' + 'bar', ); assert.isAtLeast(summary.events[0].exception.values[0].stacktrace.frames.length, 2); assert.isAtMost(summary.events[0].exception.values[0].stacktrace.frames.length, 4); diff --git a/packages/browser/test/integration/suites/breadcrumbs.js b/packages/browser/test/integration/suites/breadcrumbs.js index 5e5c2973efc7..f0a0395bbe3f 100644 --- a/packages/browser/test/integration/suites/breadcrumbs.js +++ b/packages/browser/test/integration/suites/breadcrumbs.js @@ -106,7 +106,7 @@ describe('breadcrumbs', function () { }, function () { Sentry.captureMessage('test'); - } + }, ) .then(function () { window.finalizeManualTest(); @@ -146,7 +146,7 @@ describe('breadcrumbs', function () { }, function () { Sentry.captureMessage('test'); - } + }, ) .then(function () { window.finalizeManualTest(); @@ -187,7 +187,7 @@ describe('breadcrumbs', function () { }, function () { Sentry.captureMessage('test'); - } + }, ) .then(function () { window.finalizeManualTest(); @@ -734,7 +734,7 @@ describe('breadcrumbs', function () { assert.ok(/\[object Object\]$/.test(summary.breadcrumbs[3].data.from), "'from' url is incorrect"); assert.ok(/\/bar\?a=1#fragment/.test(summary.breadcrumbs[3].data.to), "'to' url is incorrect"); }); - } + }, ); it(optional('should preserve native code detection compatibility', IS_LOADER), function () { diff --git a/packages/browser/test/integration/suites/builtins.js b/packages/browser/test/integration/suites/builtins.js index 7a7760d9f689..54f86cd4f636 100644 --- a/packages/browser/test/integration/suites/builtins.js +++ b/packages/browser/test/integration/suites/builtins.js @@ -10,7 +10,7 @@ describe('wrapped built-ins', function () { window.context = this; foo(); }, - false + false, ); var click = new MouseEvent('click'); div.dispatchEvent(click); @@ -252,7 +252,7 @@ describe('wrapped built-ins', function () { function namedFunction() { foo(); }, - false + false, ); var click = new MouseEvent('click'); div.dispatchEvent(click); @@ -297,7 +297,7 @@ describe('wrapped built-ins', function () { function () { foo(); }, - false + false, ); var click = new MouseEvent('click'); div.dispatchEvent(click); @@ -321,6 +321,6 @@ describe('wrapped built-ins', function () { }); } }); - } + }, ); }); diff --git a/packages/browser/test/integration/suites/onerror.js b/packages/browser/test/integration/suites/onerror.js index 3db1a755061a..1352d51e0484 100644 --- a/packages/browser/test/integration/suites/onerror.js +++ b/packages/browser/test/integration/suites/onerror.js @@ -32,11 +32,11 @@ describe('window.onerror', function () { // but not all - falls back to frame url assert.match( summary.events[0].exception.values[0].stacktrace.frames[0].filename, - /(\/subjects\/throw-string.js|\/base\/variants\/)/ + /(\/subjects\/throw-string.js|\/base\/variants\/)/, ); assert.match( summary.events[0].exception.values[0].stacktrace.frames[0]['function'], - /throwStringError|\?|global code/i + /throwStringError|\?|global code/i, ); }); }); @@ -61,7 +61,7 @@ describe('window.onerror', function () { } else { assert.equal( summary.events[0].exception.values[0].value, - 'Object captured as exception with keys: error, somekey' + 'Object captured as exception with keys: error, somekey', ); } assert.equal(summary.events[0].exception.values[0].stacktrace.frames.length, 1); // always 1 because thrown objects can't provide > 1 frame @@ -70,11 +70,11 @@ describe('window.onerror', function () { // but not all - falls back to frame url assert.match( summary.events[0].exception.values[0].stacktrace.frames[0].filename, - /(\/subjects\/throw-object.js|\/base\/variants\/)/ + /(\/subjects\/throw-object.js|\/base\/variants\/)/, ); assert.match( summary.events[0].exception.values[0].stacktrace.frames[0]['function'], - /throwStringError|\?|global code/i + /throwStringError|\?|global code/i, ); }); }); @@ -104,7 +104,7 @@ describe('window.onerror', function () { assert.match(summary.events[0].exception.values[0].stacktrace.frames[0].filename, /\/subjects\/throw-error\.js/); assert.match( summary.events[0].exception.values[0].stacktrace.frames[0]['function'], - /\?|global code|throwRealError/i + /\?|global code|throwRealError/i, ); }); }); @@ -119,7 +119,7 @@ describe('window.onerror', function () { assert.equal(summary.events[0].exception.values[0].type, 'Error'); assert.equal( summary.events[0].exception.values[0].value, - 'Object captured as exception with keys: otherKey, type' + 'Object captured as exception with keys: otherKey, type', ); assert.deepEqual(summary.events[0].extra.__serialized__, { type: 'error', diff --git a/packages/browser/test/integration/suites/onunhandledrejection.js b/packages/browser/test/integration/suites/onunhandledrejection.js index 8099fbbaa68e..5c57ed228d77 100644 --- a/packages/browser/test/integration/suites/onunhandledrejection.js +++ b/packages/browser/test/integration/suites/onunhandledrejection.js @@ -40,7 +40,7 @@ describe('window.onunhandledrejection', function () { // all we're testing is that it gets dug out correctly reason: new Error('test2'), }, - }) + }), ); } else { window.resolveTest({ window: window }); @@ -77,7 +77,7 @@ describe('window.onunhandledrejection', function () { // non-error rejections don't provide stacktraces so we can skip that assertion assert.equal( summary.events[0].exception.values[0].value, - 'Event `Event` (type=unhandledrejection) captured as promise rejection' + 'Event `Event` (type=unhandledrejection) captured as promise rejection', ); assert.equal(summary.events[0].exception.values[0].type, 'Event'); assert.equal(summary.events[0].exception.values[0].mechanism.handled, false); @@ -101,7 +101,7 @@ describe('window.onunhandledrejection', function () { // non-error rejections don't provide stacktraces so we can skip that assertion assert.equal( summary.events[0].exception.values[0].value, - 'Non-Error promise rejection captured with value: test' + 'Non-Error promise rejection captured with value: test', ); assert.equal(summary.events[0].exception.values[0].type, 'UnhandledRejection'); assert.equal(summary.events[0].exception.values[0].mechanism.handled, false); @@ -123,7 +123,7 @@ describe('window.onunhandledrejection', function () { assert.equal(summary.events[0].exception.values[0].value.length, 253); assert.include( summary.events[0].exception.values[0].value, - 'Non-Error promise rejection captured with value: ' + 'Non-Error promise rejection captured with value: ', ); assert.equal(summary.events[0].exception.values[0].type, 'UnhandledRejection'); assert.equal(summary.events[0].exception.values[0].mechanism.handled, false); @@ -144,7 +144,7 @@ describe('window.onunhandledrejection', function () { // non-error rejections don't provide stacktraces so we can skip that assertion assert.equal( summary.events[0].exception.values[0].value, - 'Object captured as promise rejection with keys: a, b, c' + 'Object captured as promise rejection with keys: a, b, c', ); assert.equal(summary.events[0].exception.values[0].type, 'UnhandledRejection'); assert.equal(summary.events[0].exception.values[0].mechanism.handled, false); @@ -172,7 +172,7 @@ describe('window.onunhandledrejection', function () { // non-error rejections don't provide stacktraces so we can skip that assertion assert.equal( summary.events[0].exception.values[0].value, - 'Object captured as promise rejection with keys: a, b, c, d, e' + 'Object captured as promise rejection with keys: a, b, c, d, e', ); assert.equal(summary.events[0].exception.values[0].type, 'UnhandledRejection'); assert.equal(summary.events[0].exception.values[0].mechanism.handled, false); @@ -193,7 +193,7 @@ describe('window.onunhandledrejection', function () { // non-error rejections don't provide stacktraces so we can skip that assertion assert.equal( summary.events[0].exception.values[0].value, - 'Non-Error promise rejection captured with value: 1337' + 'Non-Error promise rejection captured with value: 1337', ); assert.equal(summary.events[0].exception.values[0].type, 'UnhandledRejection'); assert.equal(summary.events[0].exception.values[0].mechanism.handled, false); @@ -214,7 +214,7 @@ describe('window.onunhandledrejection', function () { // non-error rejections don't provide stacktraces so we can skip that assertion assert.equal( summary.events[0].exception.values[0].value, - 'Non-Error promise rejection captured with value: null' + 'Non-Error promise rejection captured with value: null', ); assert.equal(summary.events[0].exception.values[0].type, 'UnhandledRejection'); assert.equal(summary.events[0].exception.values[0].mechanism.handled, false); @@ -235,7 +235,7 @@ describe('window.onunhandledrejection', function () { // non-error rejections don't provide stacktraces so we can skip that assertion assert.equal( summary.events[0].exception.values[0].value, - 'Non-Error promise rejection captured with value: undefined' + 'Non-Error promise rejection captured with value: undefined', ); assert.equal(summary.events[0].exception.values[0].type, 'UnhandledRejection'); assert.equal(summary.events[0].exception.values[0].mechanism.handled, false); diff --git a/packages/browser/test/integration/suites/shell.js b/packages/browser/test/integration/suites/shell.js index 2ba7e2bd8c79..d3d89ed4b798 100644 --- a/packages/browser/test/integration/suites/shell.js +++ b/packages/browser/test/integration/suites/shell.js @@ -22,13 +22,13 @@ function runVariant(variant) { /** * The test runner will replace each of these placeholders with the contents of the corresponding file. */ - {{ suites/config.js }} // prettier-ignore - {{ suites/api.js }} // prettier-ignore - {{ suites/onerror.js }} // prettier-ignore - {{ suites/onunhandledrejection.js }} // prettier-ignore - {{ suites/builtins.js }} // prettier-ignore - {{ suites/breadcrumbs.js }} // prettier-ignore - {{ suites/loader.js }} // prettier-ignore + {{ suites/config.js }} // biome-ignore format: No trailing commas + {{ suites/api.js }} // biome-ignore format: No trailing commas + {{ suites/onerror.js }} // biome-ignore format: No trailing commas + {{ suites/onunhandledrejection.js }} // biome-ignore format: No trailing commas + {{ suites/builtins.js }} // biome-ignore format: No trailing commas + {{ suites/breadcrumbs.js }} // biome-ignore format: No trailing commas + {{ suites/loader.js }} // biome-ignore format: No trailing commas }); } @@ -38,4 +38,4 @@ for (var idx in variants) { })(); } -{{ suites/loader-specific.js }} // prettier-ignore +{{ suites/loader-specific.js }} // biome-ignore format: No trailing commas diff --git a/packages/ember/addon/instance-initializers/sentry-performance.ts b/packages/ember/addon/instance-initializers/sentry-performance.ts index 0f00a6cec1fd..2e6f88046acc 100644 --- a/packages/ember/addon/instance-initializers/sentry-performance.ts +++ b/packages/ember/addon/instance-initializers/sentry-performance.ts @@ -418,8 +418,10 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance) routingInstrumentation: (customStartTransaction, startTransactionOnPageLoad) => { // eslint-disable-next-line ember/no-private-routing-service const routerMain = appInstance.lookup('router:main') as EmberRouterMain; - let routerService = appInstance.lookup('service:router') as - | RouterService & { externalRouter?: RouterService; _hasMountedSentryPerformanceRouting?: boolean }; + let routerService = appInstance.lookup('service:router') as RouterService & { + externalRouter?: RouterService; + _hasMountedSentryPerformanceRouting?: boolean; + }; if (routerService.externalRouter) { // Using ember-engines-router-service in an engine. diff --git a/packages/ember/tests/dummy/config/ember-cli-update.json b/packages/ember/tests/dummy/config/ember-cli-update.json index 1231b8f94ed7..c60252667d22 100644 --- a/packages/ember/tests/dummy/config/ember-cli-update.json +++ b/packages/ember/tests/dummy/config/ember-cli-update.json @@ -10,9 +10,7 @@ "outputRepo": "https://github.com/ember-cli/ember-addon-output", "codemodsSource": "ember-addon-codemods-manifest@1", "isBaseBlueprint": true, - "options": [ - "--no-welcome" - ] + "options": ["--no-welcome"] } ] } diff --git a/packages/gatsby/gatsby-node.js b/packages/gatsby/gatsby-node.js index e7e0776fa26f..460e338de991 100644 --- a/packages/gatsby/gatsby-node.js +++ b/packages/gatsby/gatsby-node.js @@ -46,15 +46,17 @@ exports.onCreateWebpackConfig = ({ plugins, getConfig, actions }) => { // Handle sentry-cli configuration errors when the user has not done it not to break // the build. errorHandler(err, invokeErr) { - const message = err.message && err.message.toLowerCase() || ''; + const message = (err.message && err.message.toLowerCase()) || ''; if (message.includes('organization slug is required') || message.includes('project slug is required')) { // eslint-disable-next-line no-console - console.log('Sentry [Info]: Not uploading source maps due to missing SENTRY_ORG and SENTRY_PROJECT env variables.') + console.log( + 'Sentry [Info]: Not uploading source maps due to missing SENTRY_ORG and SENTRY_PROJECT env variables.', + ); return; } if (message.includes('authentication credentials were not provided')) { // eslint-disable-next-line no-console - console.warn('Sentry [Warn]: Cannot upload source maps due to missing SENTRY_AUTH_TOKEN env variable.') + console.warn('Sentry [Warn]: Cannot upload source maps due to missing SENTRY_AUTH_TOKEN env variable.'); return; } invokeErr(err); diff --git a/packages/hub/test/exports.test.ts b/packages/hub/test/exports.test.ts index c2b71f84ca47..0b48e38a9c49 100644 --- a/packages/hub/test/exports.test.ts +++ b/packages/hub/test/exports.test.ts @@ -288,14 +288,14 @@ describe('Top Level API', () => { test('setExtra', () => { init({}); setExtra('a', 'b'); - // prettier-ignore + // biome-ignore format: Follow-up for prettier expect(global.__SENTRY__.hub._stack[0].scope._extra).toEqual({ 'a': 'b' }); }); test('setTag', () => { init({}); setTag('a', 'b'); - // prettier-ignore + // biome-ignore format: Follow-up for prettier expect(global.__SENTRY__.hub._stack[0].scope._tags).toEqual({ 'a': 'b' }); }); diff --git a/packages/integrations/test/reportingobserver.test.ts b/packages/integrations/test/reportingobserver.test.ts index 1298fb617e56..1a8759fda23e 100644 --- a/packages/integrations/test/reportingobserver.test.ts +++ b/packages/integrations/test/reportingobserver.test.ts @@ -17,7 +17,7 @@ const getMockHubWithIntegration = (integration: Integration) => ({ ...mockHub, getIntegration: jest.fn(() => integration), - } as unknown as Hub); + }) as unknown as Hub; const mockReportingObserverConstructor = jest.fn(); const mockObserve = jest.fn(); diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts index 0fbf4ea5add7..45c8f3a0b4e3 100644 --- a/packages/nextjs/src/config/webpack.ts +++ b/packages/nextjs/src/config/webpack.ts @@ -122,8 +122,8 @@ export function constructWebpackConfigFunction( const middlewareLocationFolder = pagesDirPath ? path.join(pagesDirPath, '..') : appDirPath - ? path.join(appDirPath, '..') - : projectDir; + ? path.join(appDirPath, '..') + : projectDir; // Default page extensions per https://github.com/vercel/next.js/blob/f1dbc9260d48c7995f6c52f8fbcc65f08e627992/packages/next/server/config-shared.ts#L161 const pageExtensions = userNextConfig.pageExtensions || ['tsx', 'ts', 'jsx', 'js']; @@ -511,8 +511,8 @@ async function addSentryToEntryProperty( nextRuntime === 'edge' ? getUserConfigFile(projectDir, 'edge') : isServer - ? getUserConfigFile(projectDir, 'server') - : getUserConfigFile(projectDir, 'client'); + ? getUserConfigFile(projectDir, 'server') + : getUserConfigFile(projectDir, 'client'); // we need to turn the filename into a path so webpack can find it const filesToInject = userConfigFile ? [`./${userConfigFile}`] : []; diff --git a/packages/nextjs/test/config/webpack/constructWebpackConfig.test.ts b/packages/nextjs/test/config/webpack/constructWebpackConfig.test.ts index 9ac4645630e5..b70e6d3d642e 100644 --- a/packages/nextjs/test/config/webpack/constructWebpackConfig.test.ts +++ b/packages/nextjs/test/config/webpack/constructWebpackConfig.test.ts @@ -54,7 +54,7 @@ describe('constructWebpackConfigFunction()', () => { ({ ...serverWebpackConfig, devtool: 'something-besides-source-map', - } as any), + }) as any, sentry: { disableServerWebpackPlugin: true }, }); const finalWebpackConfig = finalNextConfig.webpack?.(serverWebpackConfig, serverBuildContext); diff --git a/packages/nextjs/test/config/withSentry.test.ts b/packages/nextjs/test/config/withSentry.test.ts index ba7c5fb3e865..d997419a88a2 100644 --- a/packages/nextjs/test/config/withSentry.test.ts +++ b/packages/nextjs/test/config/withSentry.test.ts @@ -71,7 +71,7 @@ describe('withSentry', () => { describe('tracing', () => { it('starts a transaction and sets metadata when tracing is enabled', async () => { jest.spyOn(SentryCore.Hub.prototype, 'getClient').mockReturnValueOnce({ - getOptions: () => ({ tracesSampleRate: 1, instrumenter: 'sentry' } as ClientOptions), + getOptions: () => ({ tracesSampleRate: 1, instrumenter: 'sentry' }) as ClientOptions, } as Client); await callWrappedHandler(wrappedHandlerNoError, req, res); diff --git a/packages/nextjs/test/config/wrappers.test.ts b/packages/nextjs/test/config/wrappers.test.ts index 44528ec17cc1..5f776bc0ea4d 100644 --- a/packages/nextjs/test/config/wrappers.test.ts +++ b/packages/nextjs/test/config/wrappers.test.ts @@ -29,7 +29,7 @@ describe('data-fetching function wrappers', () => { ({ getOptions: () => ({ instrumenter: 'sentry' }), getDsn: () => {}, - } as any); + }) as any; return hub; }); diff --git a/packages/nextjs/test/performance/pagesRouterInstrumentation.test.ts b/packages/nextjs/test/performance/pagesRouterInstrumentation.test.ts index 6db342fb426c..107f02eb9af6 100644 --- a/packages/nextjs/test/performance/pagesRouterInstrumentation.test.ts +++ b/packages/nextjs/test/performance/pagesRouterInstrumentation.test.ts @@ -53,7 +53,7 @@ function createMockStartTransaction() { finish: () => undefined, }), finish: () => undefined, - } as Transaction), + }) as Transaction, ); } diff --git a/packages/node-integration-tests/utils/index.ts b/packages/node-integration-tests/utils/index.ts index 3bca893c34b3..a30689a45d11 100644 --- a/packages/node-integration-tests/utils/index.ts +++ b/packages/node-integration-tests/utils/index.ts @@ -299,15 +299,18 @@ export class TestEnv { return false; }); - setTimeout(() => { - nock.removeInterceptor(mock); - - nock.cleanAll(); - - void this._closeServer().then(() => { - resolve(reqCount); - }); - }, options.timeout || 1000); + setTimeout( + () => { + nock.removeInterceptor(mock); + + nock.cleanAll(); + + void this._closeServer().then(() => { + resolve(reqCount); + }); + }, + options.timeout || 1000, + ); }); } diff --git a/packages/node/src/handlers.ts b/packages/node/src/handlers.ts index 339c9553bf26..b266a22e7f1d 100644 --- a/packages/node/src/handlers.ts +++ b/packages/node/src/handlers.ts @@ -112,9 +112,9 @@ export function tracingHandler(): ( export type RequestHandlerOptions = // TODO (v8 / XXX) Remove ParseRequestOptions type and eslint override // eslint-disable-next-line deprecation/deprecation - | (ParseRequestOptions | AddRequestDataToEventOptions) & { - flushTimeout?: number; - }; + (ParseRequestOptions | AddRequestDataToEventOptions) & { + flushTimeout?: number; + }; /** * Backwards compatibility shim which can be removed in v8. Forces the given options to follow the diff --git a/packages/node/test/manual/release-health/test-utils.js b/packages/node/test/manual/release-health/test-utils.js index 2b3f88a440b9..2d22a760c76f 100644 --- a/packages/node/test/manual/release-health/test-utils.js +++ b/packages/node/test/manual/release-health/test-utils.js @@ -8,7 +8,13 @@ function assertSessions(actual, expected) { } function constructStrippedSessionObject(actual) { - const { init, status, errors, attrs: { release }, did } = actual; + const { + init, + status, + errors, + attrs: { release }, + did, + } = actual; return { init, status, errors, release, did }; } diff --git a/packages/node/test/manual/webpack-async-context/npm-build.js b/packages/node/test/manual/webpack-async-context/npm-build.js index 03db46e84955..289cdd683dd2 100644 --- a/packages/node/test/manual/webpack-async-context/npm-build.js +++ b/packages/node/test/manual/webpack-async-context/npm-build.js @@ -7,7 +7,7 @@ if (Number(process.versions.node.split('.')[0]) >= 18) { return; } -// prettier-ignore +// biome-ignore format: Follow-up for prettier webpack( { entry: './index.js', diff --git a/packages/opentelemetry/src/custom/client.ts b/packages/opentelemetry/src/custom/client.ts index adf348da60e1..36648b63c22f 100644 --- a/packages/opentelemetry/src/custom/client.ts +++ b/packages/opentelemetry/src/custom/client.ts @@ -20,8 +20,12 @@ import { OpenTelemetryScope } from './scope'; * const client = new OpenTelemetryClient(options); */ export function wrapClientClass< - ClassConstructor extends new (...args: any[]) => Client & BaseClient, - WrappedClassConstructor extends new (...args: any[]) => Client & BaseClient & OpenTelemetryClientInterface, + ClassConstructor extends new ( + ...args: any[] + ) => Client & BaseClient, + WrappedClassConstructor extends new ( + ...args: any[] + ) => Client & BaseClient & OpenTelemetryClientInterface, >(ClientClass: ClassConstructor): WrappedClassConstructor { class OpenTelemetryClient extends ClientClass implements OpenTelemetryClientInterface { public traceProvider: BasicTracerProvider | undefined; diff --git a/packages/overhead-metrics/configs/ci/process.ts b/packages/overhead-metrics/configs/ci/process.ts index 39bb69699955..0af2f12d8f39 100644 --- a/packages/overhead-metrics/configs/ci/process.ts +++ b/packages/overhead-metrics/configs/ci/process.ts @@ -35,7 +35,9 @@ if (baseBranch != branch) { await prComment.addAdditionalResultsSet( `Baseline results on branch: ${baseBranch}`, // We skip the first one here because it's already included as `Baseline` column above in addCurrentResult(). - baseResults.items().slice(1, 10), + baseResults + .items() + .slice(1, 10), ); } else { await prComment.addCurrentResult(await ResultsAnalyzer.analyze(latestResult, previousResults), 'Previous'); diff --git a/packages/react/src/reactrouter.tsx b/packages/react/src/reactrouter.tsx index 769c17b611a0..9e7077c59898 100644 --- a/packages/react/src/reactrouter.tsx +++ b/packages/react/src/reactrouter.tsx @@ -138,8 +138,8 @@ function matchRoutes( const match = route.path ? matchPath(pathname, route) : branch.length - ? branch[branch.length - 1].match // use parent match - : computeRootMatch(pathname); // use default "root" match + ? branch[branch.length - 1].match // use parent match + : computeRootMatch(pathname); // use default "root" match if (match) { branch.push({ route, match }); diff --git a/packages/replay-worker/examples/worker.js b/packages/replay-worker/examples/worker.js index 6504e06936ad..4b618dfbab61 100644 --- a/packages/replay-worker/examples/worker.js +++ b/packages/replay-worker/examples/worker.js @@ -2,373 +2,379 @@ // DEFLATE is a complex format; to read this code, you should probably check the RFC first: // aliases for shorter compressed code (most minifers don't do this) -var u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array; +var u8 = Uint8Array, + u16 = Uint16Array, + i32 = Int32Array; // fixed length extra bits -var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]); +var fleb = new u8([ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, + /* impossible */ 0, +]); // fixed distance extra bits -var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]); +var fdeb = new u8([ + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0, +]); // code length index map var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); // get base, reverse index map from extra bits var freb = function (eb, start) { - var b = new u16(31); - for (var i = 0; i < 31; ++i) { - b[i] = start += 1 << eb[i - 1]; - } - // numbers here are at max 18 bits - var r = new i32(b[30]); - for (var i = 1; i < 30; ++i) { - for (var j = b[i]; j < b[i + 1]; ++j) { - r[j] = ((j - b[i]) << 5) | i; - } - } - return { b: b, r: r }; + var b = new u16(31); + for (var i = 0; i < 31; ++i) { + b[i] = start += 1 << eb[i - 1]; + } + // numbers here are at max 18 bits + var r = new i32(b[30]); + for (var i = 1; i < 30; ++i) { + for (var j = b[i]; j < b[i + 1]; ++j) { + r[j] = ((j - b[i]) << 5) | i; + } + } + return { b: b, r: r }; }; -var _a = freb(fleb, 2), fl = _a.b, revfl = _a.r; +var _a = freb(fleb, 2), + fl = _a.b, + revfl = _a.r; // we can ignore the fact that the other numbers are wrong; they never happen anyway -fl[28] = 258, revfl[258] = 28; -var _b = freb(fdeb, 0), revfd = _b.r; +(fl[28] = 258), (revfl[258] = 28); +var _b = freb(fdeb, 0), + revfd = _b.r; // map of value to reverse (assuming 16 bits) var rev = new u16(32768); for (var i = 0; i < 32768; ++i) { - // reverse table algorithm from SO - var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1); - x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2); - x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4); - rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1; + // reverse table algorithm from SO + var x = ((i & 0xaaaa) >> 1) | ((i & 0x5555) << 1); + x = ((x & 0xcccc) >> 2) | ((x & 0x3333) << 2); + x = ((x & 0xf0f0) >> 4) | ((x & 0x0f0f) << 4); + rev[i] = (((x & 0xff00) >> 8) | ((x & 0x00ff) << 8)) >> 1; } // create huffman tree from u8 "map": index -> code length for code index // mb (max bits) must be at most 15 // TODO: optimize/split up? -var hMap = (function (cd, mb, r) { - var s = cd.length; - // index - var i = 0; - // u16 "map": index -> # of codes with bit length = index - var l = new u16(mb); - // length of cd must be 288 (total # of codes) - for (; i < s; ++i) { - if (cd[i]) - ++l[cd[i] - 1]; - } - // u16 "map": index -> minimum code for bit length = index - var le = new u16(mb); - for (i = 1; i < mb; ++i) { - le[i] = (le[i - 1] + l[i - 1]) << 1; - } - var co; - if (r) { - // u16 "map": index -> number of actual bits, symbol for code - co = new u16(1 << mb); - // bits to remove for reverser - var rvb = 15 - mb; - for (i = 0; i < s; ++i) { - // ignore 0 lengths - if (cd[i]) { - // num encoding both symbol and bits read - var sv = (i << 4) | cd[i]; - // free bits - var r_1 = mb - cd[i]; - // start value - var v = le[cd[i] - 1]++ << r_1; - // m is end value - for (var m = v | ((1 << r_1) - 1); v <= m; ++v) { - // every 16 bit value starting with the code yields the same result - co[rev[v] >> rvb] = sv; - } - } +var hMap = function (cd, mb, r) { + var s = cd.length; + // index + var i = 0; + // u16 "map": index -> # of codes with bit length = index + var l = new u16(mb); + // length of cd must be 288 (total # of codes) + for (; i < s; ++i) { + if (cd[i]) ++l[cd[i] - 1]; + } + // u16 "map": index -> minimum code for bit length = index + var le = new u16(mb); + for (i = 1; i < mb; ++i) { + le[i] = (le[i - 1] + l[i - 1]) << 1; + } + var co; + if (r) { + // u16 "map": index -> number of actual bits, symbol for code + co = new u16(1 << mb); + // bits to remove for reverser + var rvb = 15 - mb; + for (i = 0; i < s; ++i) { + // ignore 0 lengths + if (cd[i]) { + // num encoding both symbol and bits read + var sv = (i << 4) | cd[i]; + // free bits + var r_1 = mb - cd[i]; + // start value + var v = le[cd[i] - 1]++ << r_1; + // m is end value + for (var m = v | ((1 << r_1) - 1); v <= m; ++v) { + // every 16 bit value starting with the code yields the same result + co[rev[v] >> rvb] = sv; } + } } - else { - co = new u16(s); - for (i = 0; i < s; ++i) { - if (cd[i]) { - co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]); - } - } + } else { + co = new u16(s); + for (i = 0; i < s; ++i) { + if (cd[i]) { + co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]); + } } - return co; -}); + } + return co; +}; // fixed length tree var flt = new u8(288); -for (var i = 0; i < 144; ++i) - flt[i] = 8; -for (var i = 144; i < 256; ++i) - flt[i] = 9; -for (var i = 256; i < 280; ++i) - flt[i] = 7; -for (var i = 280; i < 288; ++i) - flt[i] = 8; +for (var i = 0; i < 144; ++i) flt[i] = 8; +for (var i = 144; i < 256; ++i) flt[i] = 9; +for (var i = 256; i < 280; ++i) flt[i] = 7; +for (var i = 280; i < 288; ++i) flt[i] = 8; // fixed distance tree var fdt = new u8(32); -for (var i = 0; i < 32; ++i) - fdt[i] = 5; +for (var i = 0; i < 32; ++i) fdt[i] = 5; // fixed length map var flm = /*#__PURE__*/ hMap(flt, 9, 0); // fixed distance map var fdm = /*#__PURE__*/ hMap(fdt, 5, 0); // get end of byte -var shft = function (p) { return ((p + 7) / 8) | 0; }; +var shft = function (p) { + return ((p + 7) / 8) | 0; +}; // typed array slice - allows garbage collector to free original reference, // while being more compatible than .slice var slc = function (v, s, e) { - if (s == null || s < 0) - s = 0; - if (e == null || e > v.length) - e = v.length; - // can't use .constructor in case user-supplied - return new u8(v.subarray(s, e)); + if (s == null || s < 0) s = 0; + if (e == null || e > v.length) e = v.length; + // can't use .constructor in case user-supplied + return new u8(v.subarray(s, e)); }; // error codes var ec = [ - 'unexpected EOF', - 'invalid block type', - 'invalid length/literal', - 'invalid distance', - 'stream finished', - 'no stream handler', - , - 'no callback', - 'invalid UTF-8 data', - 'extra field too long', - 'date not in range 1980-2099', - 'filename too long', - 'stream finishing', - 'invalid zip data' - // determined by unknown compression method + 'unexpected EOF', + 'invalid block type', + 'invalid length/literal', + 'invalid distance', + 'stream finished', + 'no stream handler', + , + 'no callback', + 'invalid UTF-8 data', + 'extra field too long', + 'date not in range 1980-2099', + 'filename too long', + 'stream finishing', + 'invalid zip data', + // determined by unknown compression method ]; var err = function (ind, msg, nt) { - var e = new Error(msg || ec[ind]); - e.code = ind; - if (Error.captureStackTrace) - Error.captureStackTrace(e, err); - if (!nt) - throw e; - return e; + var e = new Error(msg || ec[ind]); + e.code = ind; + if (Error.captureStackTrace) Error.captureStackTrace(e, err); + if (!nt) throw e; + return e; }; // starting at p, write the minimum number of bits that can hold v to d var wbits = function (d, p, v) { - v <<= p & 7; - var o = (p / 8) | 0; - d[o] |= v; - d[o + 1] |= v >> 8; + v <<= p & 7; + var o = (p / 8) | 0; + d[o] |= v; + d[o + 1] |= v >> 8; }; // starting at p, write the minimum number of bits (>8) that can hold v to d var wbits16 = function (d, p, v) { - v <<= p & 7; - var o = (p / 8) | 0; - d[o] |= v; - d[o + 1] |= v >> 8; - d[o + 2] |= v >> 16; + v <<= p & 7; + var o = (p / 8) | 0; + d[o] |= v; + d[o + 1] |= v >> 8; + d[o + 2] |= v >> 16; }; // creates code lengths from a frequency table var hTree = function (d, mb) { - // Need extra info to make a tree - var t = []; - for (var i = 0; i < d.length; ++i) { - if (d[i]) - t.push({ s: i, f: d[i] }); - } - var s = t.length; - var t2 = t.slice(); - if (!s) - return { t: et, l: 0 }; - if (s == 1) { - var v = new u8(t[0].s + 1); - v[t[0].s] = 1; - return { t: v, l: 1 }; - } - t.sort(function (a, b) { return a.f - b.f; }); - // after i2 reaches last ind, will be stopped - // freq must be greater than largest possible number of symbols - t.push({ s: -1, f: 25001 }); - var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2; - t[0] = { s: -1, f: l.f + r.f, l: l, r: r }; - // efficient algorithm from UZIP.js - // i0 is lookbehind, i2 is lookahead - after processing two low-freq - // symbols that combined have high freq, will start processing i2 (high-freq, - // non-composite) symbols instead - // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/ - while (i1 != s - 1) { - l = t[t[i0].f < t[i2].f ? i0++ : i2++]; - r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++]; - t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r }; - } - var maxSym = t2[0].s; - for (var i = 1; i < s; ++i) { - if (t2[i].s > maxSym) - maxSym = t2[i].s; - } - // code lengths - var tr = new u16(maxSym + 1); - // max bits in tree - var mbt = ln(t[i1 - 1], tr, 0); - if (mbt > mb) { - // more algorithms from UZIP.js - // TODO: find out how this code works (debt) - // ind debt - var i = 0, dt = 0; - // left cost - var lft = mbt - mb, cst = 1 << lft; - t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; }); - for (; i < s; ++i) { - var i2_1 = t2[i].s; - if (tr[i2_1] > mb) { - dt += cst - (1 << (mbt - tr[i2_1])); - tr[i2_1] = mb; - } - else - break; - } - dt >>= lft; - while (dt > 0) { - var i2_2 = t2[i].s; - if (tr[i2_2] < mb) - dt -= 1 << (mb - tr[i2_2]++ - 1); - else - ++i; - } - for (; i >= 0 && dt; --i) { - var i2_3 = t2[i].s; - if (tr[i2_3] == mb) { - --tr[i2_3]; - ++dt; - } - } - mbt = mb; - } - return { t: new u8(tr), l: mbt }; + // Need extra info to make a tree + var t = []; + for (var i = 0; i < d.length; ++i) { + if (d[i]) t.push({ s: i, f: d[i] }); + } + var s = t.length; + var t2 = t.slice(); + if (!s) return { t: et, l: 0 }; + if (s == 1) { + var v = new u8(t[0].s + 1); + v[t[0].s] = 1; + return { t: v, l: 1 }; + } + t.sort(function (a, b) { + return a.f - b.f; + }); + // after i2 reaches last ind, will be stopped + // freq must be greater than largest possible number of symbols + t.push({ s: -1, f: 25001 }); + var l = t[0], + r = t[1], + i0 = 0, + i1 = 1, + i2 = 2; + t[0] = { s: -1, f: l.f + r.f, l: l, r: r }; + // efficient algorithm from UZIP.js + // i0 is lookbehind, i2 is lookahead - after processing two low-freq + // symbols that combined have high freq, will start processing i2 (high-freq, + // non-composite) symbols instead + // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/ + while (i1 != s - 1) { + l = t[t[i0].f < t[i2].f ? i0++ : i2++]; + r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++]; + t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r }; + } + var maxSym = t2[0].s; + for (var i = 1; i < s; ++i) { + if (t2[i].s > maxSym) maxSym = t2[i].s; + } + // code lengths + var tr = new u16(maxSym + 1); + // max bits in tree + var mbt = ln(t[i1 - 1], tr, 0); + if (mbt > mb) { + // more algorithms from UZIP.js + // TODO: find out how this code works (debt) + // ind debt + var i = 0, + dt = 0; + // left cost + var lft = mbt - mb, + cst = 1 << lft; + t2.sort(function (a, b) { + return tr[b.s] - tr[a.s] || a.f - b.f; + }); + for (; i < s; ++i) { + var i2_1 = t2[i].s; + if (tr[i2_1] > mb) { + dt += cst - (1 << (mbt - tr[i2_1])); + tr[i2_1] = mb; + } else break; + } + dt >>= lft; + while (dt > 0) { + var i2_2 = t2[i].s; + if (tr[i2_2] < mb) dt -= 1 << (mb - tr[i2_2]++ - 1); + else ++i; + } + for (; i >= 0 && dt; --i) { + var i2_3 = t2[i].s; + if (tr[i2_3] == mb) { + --tr[i2_3]; + ++dt; + } + } + mbt = mb; + } + return { t: new u8(tr), l: mbt }; }; // get the max length and assign length codes var ln = function (n, l, d) { - return n.s == -1 - ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) - : (l[n.s] = d); + return n.s == -1 ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) : (l[n.s] = d); }; // length codes generation var lc = function (c) { - var s = c.length; - // Note that the semicolon was intentional - while (s && !c[--s]) - ; - var cl = new u16(++s); - // ind num streak - var cli = 0, cln = c[0], cls = 1; - var w = function (v) { cl[cli++] = v; }; - for (var i = 1; i <= s; ++i) { - if (c[i] == cln && i != s) - ++cls; - else { - if (!cln && cls > 2) { - for (; cls > 138; cls -= 138) - w(32754); - if (cls > 2) { - w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305); - cls = 0; - } - } - else if (cls > 3) { - w(cln), --cls; - for (; cls > 6; cls -= 6) - w(8304); - if (cls > 2) - w(((cls - 3) << 5) | 8208), cls = 0; - } - while (cls--) - w(cln); - cls = 1; - cln = c[i]; + var s = c.length; + // Note that the semicolon was intentional + while (s && !c[--s]); + var cl = new u16(++s); + // ind num streak + var cli = 0, + cln = c[0], + cls = 1; + var w = function (v) { + cl[cli++] = v; + }; + for (var i = 1; i <= s; ++i) { + if (c[i] == cln && i != s) ++cls; + else { + if (!cln && cls > 2) { + for (; cls > 138; cls -= 138) w(32754); + if (cls > 2) { + w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305); + cls = 0; } - } - return { c: cl.subarray(0, cli), n: s }; + } else if (cls > 3) { + w(cln), --cls; + for (; cls > 6; cls -= 6) w(8304); + if (cls > 2) w(((cls - 3) << 5) | 8208), (cls = 0); + } + while (cls--) w(cln); + cls = 1; + cln = c[i]; + } + } + return { c: cl.subarray(0, cli), n: s }; }; // calculate the length of output from tree, code lengths var clen = function (cf, cl) { - var l = 0; - for (var i = 0; i < cl.length; ++i) - l += cf[i] * cl[i]; - return l; + var l = 0; + for (var i = 0; i < cl.length; ++i) l += cf[i] * cl[i]; + return l; }; // writes a fixed block // returns the new bit pos var wfblk = function (out, pos, dat) { - // no need to write 00 as type: TypedArray defaults to 0 - var s = dat.length; - var o = shft(pos + 2); - out[o] = s & 255; - out[o + 1] = s >> 8; - out[o + 2] = out[o] ^ 255; - out[o + 3] = out[o + 1] ^ 255; - for (var i = 0; i < s; ++i) - out[o + i + 4] = dat[i]; - return (o + 4 + s) * 8; + // no need to write 00 as type: TypedArray defaults to 0 + var s = dat.length; + var o = shft(pos + 2); + out[o] = s & 255; + out[o + 1] = s >> 8; + out[o + 2] = out[o] ^ 255; + out[o + 3] = out[o + 1] ^ 255; + for (var i = 0; i < s; ++i) out[o + i + 4] = dat[i]; + return (o + 4 + s) * 8; }; // writes a block var wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) { - wbits(out, p++, final); - ++lf[256]; - var _a = hTree(lf, 15), dlt = _a.t, mlb = _a.l; - var _b = hTree(df, 15), ddt = _b.t, mdb = _b.l; - var _c = lc(dlt), lclt = _c.c, nlc = _c.n; - var _d = lc(ddt), lcdt = _d.c, ndc = _d.n; - var lcfreq = new u16(19); - for (var i = 0; i < lclt.length; ++i) - ++lcfreq[lclt[i] & 31]; - for (var i = 0; i < lcdt.length; ++i) - ++lcfreq[lcdt[i] & 31]; - var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l; - var nlcc = 19; - for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc) - ; - var flen = (bl + 5) << 3; - var ftlen = clen(lf, flt) + clen(df, fdt) + eb; - var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]; - if (bs >= 0 && flen <= ftlen && flen <= dtlen) - return wfblk(out, p, dat.subarray(bs, bs + bl)); - var lm, ll, dm, dl; - wbits(out, p, 1 + (dtlen < ftlen)), p += 2; - if (dtlen < ftlen) { - lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt; - var llm = hMap(lct, mlcb, 0); - wbits(out, p, nlc - 257); - wbits(out, p + 5, ndc - 1); - wbits(out, p + 10, nlcc - 4); - p += 14; - for (var i = 0; i < nlcc; ++i) - wbits(out, p + 3 * i, lct[clim[i]]); - p += 3 * nlcc; - var lcts = [lclt, lcdt]; - for (var it = 0; it < 2; ++it) { - var clct = lcts[it]; - for (var i = 0; i < clct.length; ++i) { - var len = clct[i] & 31; - wbits(out, p, llm[len]), p += lct[len]; - if (len > 15) - wbits(out, p, (clct[i] >> 5) & 127), p += clct[i] >> 12; - } - } - } - else { - lm = flm, ll = flt, dm = fdm, dl = fdt; - } - for (var i = 0; i < li; ++i) { - var sym = syms[i]; - if (sym > 255) { - var len = (sym >> 18) & 31; - wbits16(out, p, lm[len + 257]), p += ll[len + 257]; - if (len > 7) - wbits(out, p, (sym >> 23) & 31), p += fleb[len]; - var dst = sym & 31; - wbits16(out, p, dm[dst]), p += dl[dst]; - if (dst > 3) - wbits16(out, p, (sym >> 5) & 8191), p += fdeb[dst]; - } - else { - wbits16(out, p, lm[sym]), p += ll[sym]; - } - } - wbits16(out, p, lm[256]); - return p + ll[256]; + wbits(out, p++, final); + ++lf[256]; + var _a = hTree(lf, 15), + dlt = _a.t, + mlb = _a.l; + var _b = hTree(df, 15), + ddt = _b.t, + mdb = _b.l; + var _c = lc(dlt), + lclt = _c.c, + nlc = _c.n; + var _d = lc(ddt), + lcdt = _d.c, + ndc = _d.n; + var lcfreq = new u16(19); + for (var i = 0; i < lclt.length; ++i) ++lcfreq[lclt[i] & 31]; + for (var i = 0; i < lcdt.length; ++i) ++lcfreq[lcdt[i] & 31]; + var _e = hTree(lcfreq, 7), + lct = _e.t, + mlcb = _e.l; + var nlcc = 19; + for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc); + var flen = (bl + 5) << 3; + var ftlen = clen(lf, flt) + clen(df, fdt) + eb; + var dtlen = + clen(lf, dlt) + + clen(df, ddt) + + eb + + 14 + + 3 * nlcc + + clen(lcfreq, lct) + + 2 * lcfreq[16] + + 3 * lcfreq[17] + + 7 * lcfreq[18]; + if (bs >= 0 && flen <= ftlen && flen <= dtlen) return wfblk(out, p, dat.subarray(bs, bs + bl)); + var lm, ll, dm, dl; + wbits(out, p, 1 + (dtlen < ftlen)), (p += 2); + if (dtlen < ftlen) { + (lm = hMap(dlt, mlb, 0)), (ll = dlt), (dm = hMap(ddt, mdb, 0)), (dl = ddt); + var llm = hMap(lct, mlcb, 0); + wbits(out, p, nlc - 257); + wbits(out, p + 5, ndc - 1); + wbits(out, p + 10, nlcc - 4); + p += 14; + for (var i = 0; i < nlcc; ++i) wbits(out, p + 3 * i, lct[clim[i]]); + p += 3 * nlcc; + var lcts = [lclt, lcdt]; + for (var it = 0; it < 2; ++it) { + var clct = lcts[it]; + for (var i = 0; i < clct.length; ++i) { + var len = clct[i] & 31; + wbits(out, p, llm[len]), (p += lct[len]); + if (len > 15) wbits(out, p, (clct[i] >> 5) & 127), (p += clct[i] >> 12); + } + } + } else { + (lm = flm), (ll = flt), (dm = fdm), (dl = fdt); + } + for (var i = 0; i < li; ++i) { + var sym = syms[i]; + if (sym > 255) { + var len = (sym >> 18) & 31; + wbits16(out, p, lm[len + 257]), (p += ll[len + 257]); + if (len > 7) wbits(out, p, (sym >> 23) & 31), (p += fleb[len]); + var dst = sym & 31; + wbits16(out, p, dm[dst]), (p += dl[dst]); + if (dst > 3) wbits16(out, p, (sym >> 5) & 8191), (p += fdeb[dst]); + } else { + wbits16(out, p, lm[sym]), (p += ll[sym]); + } + } + wbits16(out, p, lm[256]); + return p + ll[256]; }; // deflate options (nice << 13) | chain var deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]); @@ -376,285 +382,298 @@ var deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, var et = /*#__PURE__*/ new u8(0); // compresses data into a raw DEFLATE buffer var dflt = function (dat, lvl, plvl, pre, post, st) { - var s = st.z || dat.length; - var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post); - // writing to this writes to the output buffer - var w = o.subarray(pre, o.length - post); - var lst = st.l; - var pos = (st.r || 0) & 7; - if (lvl) { - if (pos) - w[0] = st.r >> 3; - var opt = deo[lvl - 1]; - var n = opt >> 13, c = opt & 8191; - var msk_1 = (1 << plvl) - 1; - // prev 2-byte val map curr 2-byte val map - var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1); - var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1; - var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; }; - // 24576 is an arbitrary number of maximum symbols per block - // 424 buffer for last block - var syms = new i32(25000); - // length/literal freq distance freq - var lf = new u16(288), df = new u16(32); - // l/lcnt exbits index l/lind waitdx blkpos - var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0; - for (; i + 2 < s; ++i) { - // hash value - var hv = hsh(i); - // index mod 32768 previous index mod - var imod = i & 32767, pimod = head[hv]; - prev[imod] = pimod; - head[hv] = imod; - // We always should modify head and prev, but only add symbols if - // this data is not yet processed ("wait" for wait index) - if (wi <= i) { - // bytes remaining - var rem = s - i; - if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) { - pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos); - li = lc_1 = eb = 0, bs = i; - for (var j = 0; j < 286; ++j) - lf[j] = 0; - for (var j = 0; j < 30; ++j) - df[j] = 0; - } - // len dist chain - var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767; - if (rem > 2 && hv == hsh(i - dif)) { - var maxn = Math.min(n, rem) - 1; - var maxd = Math.min(32767, i); - // max possible length - // not capped at dif because decompressors implement "rolling" index population - var ml = Math.min(258, rem); - while (dif <= maxd && --ch_1 && imod != pimod) { - if (dat[i + l] == dat[i + l - dif]) { - var nl = 0; - for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl) - ; - if (nl > l) { - l = nl, d = dif; - // break out early when we reach "nice" (we are satisfied enough) - if (nl > maxn) - break; - // now, find the rarest 2-byte sequence within this - // length of literals and search for that instead. - // Much faster than just using the start - var mmd = Math.min(dif, nl - 2); - var md = 0; - for (var j = 0; j < mmd; ++j) { - var ti = i - dif + j & 32767; - var pti = prev[ti]; - var cd = ti - pti & 32767; - if (cd > md) - md = cd, pimod = ti; - } - } - } - // check the previous match - imod = pimod, pimod = prev[imod]; - dif += imod - pimod & 32767; - } - } - // d will be nonzero only when a match was found - if (d) { - // store both dist and len data in one int32 - // Make sure this is recognized as a len/dist with 28th bit (2^28) - syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d]; - var lin = revfl[l] & 31, din = revfd[d] & 31; - eb += fleb[lin] + fdeb[din]; - ++lf[257 + lin]; - ++df[din]; - wi = i + l; - ++lc_1; - } - else { - syms[li++] = dat[i]; - ++lf[dat[i]]; + var s = st.z || dat.length; + var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post); + // writing to this writes to the output buffer + var w = o.subarray(pre, o.length - post); + var lst = st.l; + var pos = (st.r || 0) & 7; + if (lvl) { + if (pos) w[0] = st.r >> 3; + var opt = deo[lvl - 1]; + var n = opt >> 13, + c = opt & 8191; + var msk_1 = (1 << plvl) - 1; + // prev 2-byte val map curr 2-byte val map + var prev = st.p || new u16(32768), + head = st.h || new u16(msk_1 + 1); + var bs1_1 = Math.ceil(plvl / 3), + bs2_1 = 2 * bs1_1; + var hsh = function (i) { + return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; + }; + // 24576 is an arbitrary number of maximum symbols per block + // 424 buffer for last block + var syms = new i32(25000); + // length/literal freq distance freq + var lf = new u16(288), + df = new u16(32); + // l/lcnt exbits index l/lind waitdx blkpos + var lc_1 = 0, + eb = 0, + i = st.i || 0, + li = 0, + wi = st.w || 0, + bs = 0; + for (; i + 2 < s; ++i) { + // hash value + var hv = hsh(i); + // index mod 32768 previous index mod + var imod = i & 32767, + pimod = head[hv]; + prev[imod] = pimod; + head[hv] = imod; + // We always should modify head and prev, but only add symbols if + // this data is not yet processed ("wait" for wait index) + if (wi <= i) { + // bytes remaining + var rem = s - i; + if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) { + pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos); + (li = lc_1 = eb = 0), (bs = i); + for (var j = 0; j < 286; ++j) lf[j] = 0; + for (var j = 0; j < 30; ++j) df[j] = 0; + } + // len dist chain + var l = 2, + d = 0, + ch_1 = c, + dif = (imod - pimod) & 32767; + if (rem > 2 && hv == hsh(i - dif)) { + var maxn = Math.min(n, rem) - 1; + var maxd = Math.min(32767, i); + // max possible length + // not capped at dif because decompressors implement "rolling" index population + var ml = Math.min(258, rem); + while (dif <= maxd && --ch_1 && imod != pimod) { + if (dat[i + l] == dat[i + l - dif]) { + var nl = 0; + for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl); + if (nl > l) { + (l = nl), (d = dif); + // break out early when we reach "nice" (we are satisfied enough) + if (nl > maxn) break; + // now, find the rarest 2-byte sequence within this + // length of literals and search for that instead. + // Much faster than just using the start + var mmd = Math.min(dif, nl - 2); + var md = 0; + for (var j = 0; j < mmd; ++j) { + var ti = (i - dif + j) & 32767; + var pti = prev[ti]; + var cd = (ti - pti) & 32767; + if (cd > md) (md = cd), (pimod = ti); } + } } + // check the previous match + (imod = pimod), (pimod = prev[imod]); + dif += (imod - pimod) & 32767; + } } - for (i = Math.max(i, wi); i < s; ++i) { - syms[li++] = dat[i]; - ++lf[dat[i]]; - } - pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos); - if (!lst) { - st.r = (pos & 7) | w[(pos / 8) | 0] << 3; - // shft(pos) now 1 less if pos & 7 != 0 - pos -= 7; - st.h = head, st.p = prev, st.i = i, st.w = wi; - } - } - else { - for (var i = st.w || 0; i < s + lst; i += 65535) { - // end - var e = i + 65535; - if (e >= s) { - // write final block - w[(pos / 8) | 0] = lst; - e = s; - } - pos = wfblk(w, pos + 1, dat.subarray(i, e)); + // d will be nonzero only when a match was found + if (d) { + // store both dist and len data in one int32 + // Make sure this is recognized as a len/dist with 28th bit (2^28) + syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d]; + var lin = revfl[l] & 31, + din = revfd[d] & 31; + eb += fleb[lin] + fdeb[din]; + ++lf[257 + lin]; + ++df[din]; + wi = i + l; + ++lc_1; + } else { + syms[li++] = dat[i]; + ++lf[dat[i]]; } - st.i = s; - } - return slc(o, 0, pre + shft(pos) + post); + } + } + for (i = Math.max(i, wi); i < s; ++i) { + syms[li++] = dat[i]; + ++lf[dat[i]]; + } + pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos); + if (!lst) { + st.r = (pos & 7) | (w[(pos / 8) | 0] << 3); + // shft(pos) now 1 less if pos & 7 != 0 + pos -= 7; + (st.h = head), (st.p = prev), (st.i = i), (st.w = wi); + } + } else { + for (var i = st.w || 0; i < s + lst; i += 65535) { + // end + var e = i + 65535; + if (e >= s) { + // write final block + w[(pos / 8) | 0] = lst; + e = s; + } + pos = wfblk(w, pos + 1, dat.subarray(i, e)); + } + st.i = s; + } + return slc(o, 0, pre + shft(pos) + post); }; // CRC32 table var crct = /*#__PURE__*/ (function () { - var t = new Int32Array(256); - for (var i = 0; i < 256; ++i) { - var c = i, k = 9; - while (--k) - c = ((c & 1) && -306674912) ^ (c >>> 1); - t[i] = c; - } - return t; + var t = new Int32Array(256); + for (var i = 0; i < 256; ++i) { + var c = i, + k = 9; + while (--k) c = (c & 1 && -306674912) ^ (c >>> 1); + t[i] = c; + } + return t; })(); // CRC32 var crc = function () { - var c = -1; - return { - p: function (d) { - // closures have awful performance - var cr = c; - for (var i = 0; i < d.length; ++i) - cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8); - c = cr; - }, - d: function () { return ~c; } - }; + var c = -1; + return { + p: function (d) { + // closures have awful performance + var cr = c; + for (var i = 0; i < d.length; ++i) cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8); + c = cr; + }, + d: function () { + return ~c; + }, + }; }; // Adler32 var adler = function () { - var a = 1, b = 0; - return { - p: function (d) { - // closures have awful performance - var n = a, m = b; - var l = d.length | 0; - for (var i = 0; i != l;) { - var e = Math.min(i + 2655, l); - for (; i < e; ++i) - m += n += d[i]; - n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16); - } - a = n, b = m; - }, - d: function () { - a %= 65521, b %= 65521; - return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | (b >> 8); - } - }; + var a = 1, + b = 0; + return { + p: function (d) { + // closures have awful performance + var n = a, + m = b; + var l = d.length | 0; + for (var i = 0; i != l; ) { + var e = Math.min(i + 2655, l); + for (; i < e; ++i) m += n += d[i]; + (n = (n & 65535) + 15 * (n >> 16)), (m = (m & 65535) + 15 * (m >> 16)); + } + (a = n), (b = m); + }, + d: function () { + (a %= 65521), (b %= 65521); + return ((a & 255) << 24) | ((a & 0xff00) << 8) | ((b & 255) << 8) | (b >> 8); + }, + }; }; // deflate with opts var dopt = function (dat, opt, pre, post, st) { - if (!st) { - st = { l: 1 }; - if (opt.dictionary) { - var dict = opt.dictionary.subarray(-32768); - var newDat = new u8(dict.length + dat.length); - newDat.set(dict); - newDat.set(dat, dict.length); - dat = newDat; - st.w = dict.length; - } - } - return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, st); + if (!st) { + st = { l: 1 }; + if (opt.dictionary) { + var dict = opt.dictionary.subarray(-32768); + var newDat = new u8(dict.length + dat.length); + newDat.set(dict); + newDat.set(dat, dict.length); + dat = newDat; + st.w = dict.length; + } + } + return dflt( + dat, + opt.level == null ? 6 : opt.level, + opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 12 + opt.mem, + pre, + post, + st, + ); }; // write bytes var wbytes = function (d, b, v) { - for (; v; ++b) - d[b] = v, v >>>= 8; + for (; v; ++b) (d[b] = v), (v >>>= 8); }; // gzip header var gzh = function (c, o) { - var fn = o.filename; - c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix - if (o.mtime != 0) - wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000)); - if (fn) { - c[3] = 8; - for (var i = 0; i <= fn.length; ++i) - c[i + 10] = fn.charCodeAt(i); - } + var fn = o.filename; + (c[0] = 31), (c[1] = 139), (c[2] = 8), (c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0), (c[9] = 3); // assume Unix + if (o.mtime != 0) wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000)); + if (fn) { + c[3] = 8; + for (var i = 0; i <= fn.length; ++i) c[i + 10] = fn.charCodeAt(i); + } }; // gzip header length -var gzhl = function (o) { return 10 + (o.filename ? o.filename.length + 1 : 0); }; +var gzhl = function (o) { + return 10 + (o.filename ? o.filename.length + 1 : 0); +}; // zlib header var zlh = function (c, o) { - var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2; - c[0] = 120, c[1] = (fl << 6) | (o.dictionary && 32); - c[1] |= 31 - ((c[0] << 8) | c[1]) % 31; - if (o.dictionary) { - var h = adler(); - h.p(o.dictionary); - wbytes(c, 2, h.d()); - } + var lv = o.level, + fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2; + (c[0] = 120), (c[1] = (fl << 6) | (o.dictionary && 32)); + c[1] |= 31 - (((c[0] << 8) | c[1]) % 31); + if (o.dictionary) { + var h = adler(); + h.p(o.dictionary); + wbytes(c, 2, h.d()); + } }; /** * Streaming DEFLATE compression */ var Deflate = /*#__PURE__*/ (function () { - function Deflate(opts, cb) { - if (typeof opts == 'function') - cb = opts, opts = {}; - this.ondata = cb; - this.o = opts || {}; - this.s = { l: 0, i: 32768, w: 32768, z: 32768 }; - // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev - // 98304 = 32768 (lookback) + 65536 (common chunk size) - this.b = new u8(98304); - if (this.o.dictionary) { - var dict = this.o.dictionary.subarray(-32768); - this.b.set(dict, 32768 - dict.length); - this.s.i = 32768 - dict.length; - } - } - Deflate.prototype.p = function (c, f) { - this.ondata(dopt(c, this.o, 0, 0, this.s), f); - }; - /** - * Pushes a chunk to be deflated - * @param chunk The chunk to push - * @param final Whether this is the last chunk - */ - Deflate.prototype.push = function (chunk, final) { - if (!this.ondata) - err(5); - if (this.s.l) - err(4); - var endLen = chunk.length + this.s.z; - if (endLen > this.b.length) { - if (endLen > 2 * this.b.length - 32768) { - var newBuf = new u8(endLen & -32768); - newBuf.set(this.b.subarray(0, this.s.z)); - this.b = newBuf; - } - var split = this.b.length - this.s.z; - if (split) { - this.b.set(chunk.subarray(0, split), this.s.z); - this.s.z = this.b.length; - this.p(this.b, false); - } - this.b.set(this.b.subarray(-32768)); - this.b.set(chunk.subarray(split), 32768); - this.s.z = chunk.length - split + 32768; - this.s.i = 32766, this.s.w = 32768; - } - else { - this.b.set(chunk, this.s.z); - this.s.z += chunk.length; - } - this.s.l = final & 1; - if (this.s.z > this.s.w + 8191 || final) { - this.p(this.b, final || false); - this.s.w = this.s.i, this.s.i -= 2; - } - }; - return Deflate; -}()); + function Deflate(opts, cb) { + if (typeof opts == 'function') (cb = opts), (opts = {}); + this.ondata = cb; + this.o = opts || {}; + this.s = { l: 0, i: 32768, w: 32768, z: 32768 }; + // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev + // 98304 = 32768 (lookback) + 65536 (common chunk size) + this.b = new u8(98304); + if (this.o.dictionary) { + var dict = this.o.dictionary.subarray(-32768); + this.b.set(dict, 32768 - dict.length); + this.s.i = 32768 - dict.length; + } + } + Deflate.prototype.p = function (c, f) { + this.ondata(dopt(c, this.o, 0, 0, this.s), f); + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Deflate.prototype.push = function (chunk, final) { + if (!this.ondata) err(5); + if (this.s.l) err(4); + var endLen = chunk.length + this.s.z; + if (endLen > this.b.length) { + if (endLen > 2 * this.b.length - 32768) { + var newBuf = new u8(endLen & -32768); + newBuf.set(this.b.subarray(0, this.s.z)); + this.b = newBuf; + } + var split = this.b.length - this.s.z; + if (split) { + this.b.set(chunk.subarray(0, split), this.s.z); + this.s.z = this.b.length; + this.p(this.b, false); + } + this.b.set(this.b.subarray(-32768)); + this.b.set(chunk.subarray(split), 32768); + this.s.z = chunk.length - split + 32768; + (this.s.i = 32766), (this.s.w = 32768); + } else { + this.b.set(chunk, this.s.z); + this.s.z += chunk.length; + } + this.s.l = final & 1; + if (this.s.z > this.s.w + 8191 || final) { + this.p(this.b, final || false); + (this.s.w = this.s.i), (this.s.i -= 2); + } + }; + return Deflate; +})(); /** * Compresses data with GZIP * @param data The data to compress @@ -662,74 +681,70 @@ var Deflate = /*#__PURE__*/ (function () { * @returns The gzipped version of the data */ function gzipSync(data, opts) { - if (!opts) - opts = {}; - var c = crc(), l = data.length; - c.p(data); - var d = dopt(data, opts, gzhl(opts), 8), s = d.length; - return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d; + if (!opts) opts = {}; + var c = crc(), + l = data.length; + c.p(data); + var d = dopt(data, opts, gzhl(opts), 8), + s = d.length; + return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d; } /** * Streaming Zlib compression */ var Zlib = /*#__PURE__*/ (function () { - function Zlib(opts, cb) { - this.c = adler(); - this.v = 1; - Deflate.call(this, opts, cb); - } - /** - * Pushes a chunk to be zlibbed - * @param chunk The chunk to push - * @param final Whether this is the last chunk - */ - Zlib.prototype.push = function (chunk, final) { - this.c.p(chunk); - Deflate.prototype.push.call(this, chunk, final); - }; - Zlib.prototype.p = function (c, f) { - var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s); - if (this.v) - zlh(raw, this.o), this.v = 0; - if (f) - wbytes(raw, raw.length - 4, this.c.d()); - this.ondata(raw, f); - }; - return Zlib; -}()); + function Zlib(opts, cb) { + this.c = adler(); + this.v = 1; + Deflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be zlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Zlib.prototype.push = function (chunk, final) { + this.c.p(chunk); + Deflate.prototype.push.call(this, chunk, final); + }; + Zlib.prototype.p = function (c, f) { + var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s); + if (this.v) zlh(raw, this.o), (this.v = 0); + if (f) wbytes(raw, raw.length - 4, this.c.d()); + this.ondata(raw, f); + }; + return Zlib; +})(); // text encoder var te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder(); // text decoder var td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder(); try { - td.decode(et, { stream: true }); -} -catch (e) { } + td.decode(et, { stream: true }); +} catch (e) {} /** * Streaming UTF-8 encoding */ var EncodeUTF8 = /*#__PURE__*/ (function () { - /** - * Creates a UTF-8 decoding stream - * @param cb The callback to call whenever data is encoded - */ - function EncodeUTF8(cb) { - this.ondata = cb; - } - /** - * Pushes a chunk to be encoded to UTF-8 - * @param chunk The string data to push - * @param final Whether this is the last chunk - */ - EncodeUTF8.prototype.push = function (chunk, final) { - if (!this.ondata) - err(5); - if (this.d) - err(4); - this.ondata(strToU8(chunk), this.d = final || false); - }; - return EncodeUTF8; -}()); + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is encoded + */ + function EncodeUTF8(cb) { + this.ondata = cb; + } + /** + * Pushes a chunk to be encoded to UTF-8 + * @param chunk The string data to push + * @param final Whether this is the last chunk + */ + EncodeUTF8.prototype.push = function (chunk, final) { + if (!this.ondata) err(5); + if (this.d) err(4); + this.ondata(strToU8(chunk), (this.d = final || false)); + }; + return EncodeUTF8; +})(); /** * Converts a string into a Uint8Array for use with compression/decompression methods * @param str The string to encode @@ -738,168 +753,167 @@ var EncodeUTF8 = /*#__PURE__*/ (function () { * @returns The string encoded in UTF-8/Latin-1 binary */ function strToU8(str, latin1) { - if (latin1) { - var ar_1 = new u8(str.length); - for (var i = 0; i < str.length; ++i) - ar_1[i] = str.charCodeAt(i); - return ar_1; - } - if (te) - return te.encode(str); - var l = str.length; - var ar = new u8(str.length + (str.length >> 1)); - var ai = 0; - var w = function (v) { ar[ai++] = v; }; - for (var i = 0; i < l; ++i) { - if (ai + 5 > ar.length) { - var n = new u8(ai + 8 + ((l - i) << 1)); - n.set(ar); - ar = n; - } - var c = str.charCodeAt(i); - if (c < 128 || latin1) - w(c); - else if (c < 2048) - w(192 | (c >> 6)), w(128 | (c & 63)); - else if (c > 55295 && c < 57344) - c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023), - w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63)); - else - w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63)); - } - return slc(ar, 0, ai); + if (latin1) { + var ar_1 = new u8(str.length); + for (var i = 0; i < str.length; ++i) ar_1[i] = str.charCodeAt(i); + return ar_1; + } + if (te) return te.encode(str); + var l = str.length; + var ar = new u8(str.length + (str.length >> 1)); + var ai = 0; + var w = function (v) { + ar[ai++] = v; + }; + for (var i = 0; i < l; ++i) { + if (ai + 5 > ar.length) { + var n = new u8(ai + 8 + ((l - i) << 1)); + n.set(ar); + ar = n; + } + var c = str.charCodeAt(i); + if (c < 128 || latin1) w(c); + else if (c < 2048) w(192 | (c >> 6)), w(128 | (c & 63)); + else if (c > 55295 && c < 57344) + (c = (65536 + (c & (1023 << 10))) | (str.charCodeAt(++i) & 1023)), + w(240 | (c >> 18)), + w(128 | ((c >> 12) & 63)), + w(128 | ((c >> 6) & 63)), + w(128 | (c & 63)); + else w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63)); + } + return slc(ar, 0, ai); } /** * A stateful compressor that can be used to batch compress events. */ class Compressor { - constructor() { - this._init(); - } - /** - * Clear the compressor buffer. - */ - clear() { - this._init(); - } - /** - * Add an event to the compressor buffer. - */ - addEvent(data) { - if (!data) { - throw new Error('Adding invalid event'); - } - // If the event is not the first event, we need to prefix it with a `,` so - // that we end up with a list of events - const prefix = this._hasEvents ? ',' : ''; - this.stream.push(prefix + data); - this._hasEvents = true; - } - /** - * Finish compression of the current buffer. - */ - finish() { - // We should always have a list, it can be empty - this.stream.push(']', true); - // Copy result before we create a new deflator and return the compressed - // result - const result = mergeUInt8Arrays(this._deflatedData); - this._init(); - return result; - } - /** - * Re-initialize the compressor buffer. - */ - _init() { - this._hasEvents = false; - this._deflatedData = []; - this.deflate = new Zlib(); - this.deflate.ondata = (data, _final) => { - this._deflatedData.push(data); - }; - this.stream = new EncodeUTF8((data, final) => { - this.deflate.push(data, final); - }); - // Fake an array by adding a `[` - this.stream.push('['); - } + constructor() { + this._init(); + } + /** + * Clear the compressor buffer. + */ + clear() { + this._init(); + } + /** + * Add an event to the compressor buffer. + */ + addEvent(data) { + if (!data) { + throw new Error('Adding invalid event'); + } + // If the event is not the first event, we need to prefix it with a `,` so + // that we end up with a list of events + const prefix = this._hasEvents ? ',' : ''; + this.stream.push(prefix + data); + this._hasEvents = true; + } + /** + * Finish compression of the current buffer. + */ + finish() { + // We should always have a list, it can be empty + this.stream.push(']', true); + // Copy result before we create a new deflator and return the compressed + // result + const result = mergeUInt8Arrays(this._deflatedData); + this._init(); + return result; + } + /** + * Re-initialize the compressor buffer. + */ + _init() { + this._hasEvents = false; + this._deflatedData = []; + this.deflate = new Zlib(); + this.deflate.ondata = (data, _final) => { + this._deflatedData.push(data); + }; + this.stream = new EncodeUTF8((data, final) => { + this.deflate.push(data, final); + }); + // Fake an array by adding a `[` + this.stream.push('['); + } } /** * Compress a string. */ function compress(data) { - return gzipSync(strToU8(data)); + return gzipSync(strToU8(data)); } function mergeUInt8Arrays(chunks) { - // calculate data length - let len = 0; - for (let i = 0, l = chunks.length; i < l; i++) { - len += chunks[i].length; - } - // join chunks - const result = new Uint8Array(len); - for (let i = 0, pos = 0, l = chunks.length; i < l; i++) { - const chunk = chunks[i]; - result.set(chunk, pos); - pos += chunk.length; - } - return result; + // calculate data length + let len = 0; + for (let i = 0, l = chunks.length; i < l; i++) { + len += chunks[i].length; + } + // join chunks + const result = new Uint8Array(len); + for (let i = 0, pos = 0, l = chunks.length; i < l; i++) { + const chunk = chunks[i]; + result.set(chunk, pos); + pos += chunk.length; + } + return result; } /* eslint-disable @typescript-eslint/no-unsafe-member-access */ const compressor = new Compressor(); const handlers = { - clear: () => { - compressor.clear(); - }, - addEvent: (data) => { - return compressor.addEvent(data); - }, - finish: () => { - return compressor.finish(); - }, - compress: (data) => { - return compress(data); - }, + clear: () => { + compressor.clear(); + }, + addEvent: data => { + return compressor.addEvent(data); + }, + finish: () => { + return compressor.finish(); + }, + compress: data => { + return compress(data); + }, }; /** * Handler for worker messages. */ function handleMessage(e) { - const method = e.data.method; - const id = e.data.id; - const data = e.data.arg; - // @ts-expect-error this syntax is actually fine - if (method in handlers && typeof handlers[method] === 'function') { - try { - // @ts-expect-error this syntax is actually fine - const response = handlers[method](data); - postMessage({ - id, - method, - success: true, - response, - }); - } - catch (err) { - postMessage({ - id, - method, - success: false, - response: err.message, - }); - // eslint-disable-next-line no-console - console.error(err); - } - } + const method = e.data.method; + const id = e.data.id; + const data = e.data.arg; + // @ts-expect-error this syntax is actually fine + if (method in handlers && typeof handlers[method] === 'function') { + try { + // @ts-expect-error this syntax is actually fine + const response = handlers[method](data); + postMessage({ + id, + method, + success: true, + response, + }); + } catch (err) { + postMessage({ + id, + method, + success: false, + response: err.message, + }); + // eslint-disable-next-line no-console + console.error(err); + } + } } addEventListener('message', handleMessage); // Immediately send a message when worker loads, so we know the worker is ready postMessage({ - id: undefined, - method: 'init', - success: true, - response: undefined, + id: undefined, + method: 'init', + success: true, + response: undefined, }); diff --git a/packages/replay-worker/src/worker.ts b/packages/replay-worker/src/worker.ts index e31356388d35..e9da044b976b 100644 --- a/packages/replay-worker/src/worker.ts +++ b/packages/replay-worker/src/worker.ts @@ -1,3 +1,3 @@ // This is replaced at build-time with the content from _worker.ts, wrapped as a string. // This is just a placeholder so that types etc. are correct. -export default '' as string; +export default ('' as string); diff --git a/packages/serverless/src/google-cloud-grpc.ts b/packages/serverless/src/google-cloud-grpc.ts index 7e3810300826..276fc4e44b55 100644 --- a/packages/serverless/src/google-cloud-grpc.ts +++ b/packages/serverless/src/google-cloud-grpc.ts @@ -91,10 +91,10 @@ function fillGrpcFunction(stub: Stub, serviceIdentifier: string, methodName: str !funcObj.requestStream && !funcObj.responseStream ? 'unary call' : funcObj.requestStream && !funcObj.responseStream - ? 'client stream' - : !funcObj.requestStream && funcObj.responseStream - ? 'server stream' - : 'bidi stream'; + ? 'client stream' + : !funcObj.requestStream && funcObj.responseStream + ? 'server stream' + : 'bidi stream'; if (callType != 'unary call') { return; } diff --git a/packages/sveltekit/rollup.npm.config.js b/packages/sveltekit/rollup.npm.config.js index d18b0c102d19..8e562f3d5168 100644 --- a/packages/sveltekit/rollup.npm.config.js +++ b/packages/sveltekit/rollup.npm.config.js @@ -7,7 +7,7 @@ export default makeNPMConfigVariants( external: ['$app/stores'], output: { dynamicImportInCjs: true, - } + }, }, }), ); diff --git a/packages/tracing-internal/src/common/fetch.ts b/packages/tracing-internal/src/common/fetch.ts index 95e63d983935..9c45da8adfa3 100644 --- a/packages/tracing-internal/src/common/fetch.ts +++ b/packages/tracing-internal/src/common/fetch.ts @@ -133,8 +133,8 @@ export function addTracingHeadersToFetchRequest( const dynamicSamplingContext = transaction ? transaction.getDynamicSamplingContext() : dsc - ? dsc - : getDynamicSamplingContextFromClient(traceId, client, scope); + ? dsc + : getDynamicSamplingContextFromClient(traceId, client, scope); const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext); diff --git a/packages/utils/src/instrument/index.ts b/packages/utils/src/instrument/index.ts index 2e2255496dd2..bc200e6230ff 100644 --- a/packages/utils/src/instrument/index.ts +++ b/packages/utils/src/instrument/index.ts @@ -64,7 +64,6 @@ export { addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, SENTRY_XHR_DATA_KEY, - // Only exported for tests resetInstrumentationHandlers, }; diff --git a/packages/utils/src/object.ts b/packages/utils/src/object.ts index f6dd9a1a7166..6dbe15488325 100644 --- a/packages/utils/src/object.ts +++ b/packages/utils/src/object.ts @@ -102,7 +102,9 @@ export function urlEncode(object: { [key: string]: any }): string { * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor * an Error. */ -export function convertToPlainObject(value: V): +export function convertToPlainObject( + value: V, +): | { [ownProps: string]: unknown; type: string; diff --git a/scripts/prepack.ts b/scripts/prepack.ts index ed280c45d088..941c6e6f6218 100644 --- a/scripts/prepack.ts +++ b/scripts/prepack.ts @@ -77,9 +77,12 @@ ENTRY_POINTS.filter(entryPoint => newPkgJson[entryPoint]).forEach(entryPoint => if (newPkgJson[EXPORT_MAP_ENTRY_POINT]) { Object.entries(newPkgJson[EXPORT_MAP_ENTRY_POINT]).forEach(([key, val]) => { - newPkgJson[EXPORT_MAP_ENTRY_POINT][key] = Object.entries(val).reduce((acc, [key, val]) => { - return { ...acc, [key]: val.replace(`${buildDir}/`, '') }; - }, {} as typeof val); + newPkgJson[EXPORT_MAP_ENTRY_POINT][key] = Object.entries(val).reduce( + (acc, [key, val]) => { + return { ...acc, [key]: val.replace(`${buildDir}/`, '') }; + }, + {} as typeof val, + ); }); } From 5658aff81776c52c9219d9c02342c8a59d197a4a Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 27 Nov 2023 14:40:39 -0500 Subject: [PATCH 08/20] perf: remove lerna parallel execution on formatter --- package.json | 8 +++++--- packages/angular-ivy/package.json | 8 ++------ packages/angular/package.json | 8 ++------ packages/astro/package.json | 8 ++------ packages/browser-integration-tests/package.json | 8 ++------ packages/browser/package.json | 8 ++------ packages/bun/package.json | 8 ++------ packages/core/package.json | 8 ++------ packages/deno/package.json | 8 ++------ packages/e2e-tests/package.json | 8 ++------ packages/ember/package.json | 7 ++----- packages/eslint-plugin-sdk/package.json | 8 ++------ packages/feedback/package.json | 8 ++------ packages/gatsby/package.json | 8 ++------ packages/hub/package.json | 8 ++------ packages/integration-shims/package.json | 8 ++------ packages/integrations/package.json | 8 ++------ packages/nextjs/package.json | 8 ++------ packages/node-experimental/package.json | 8 ++------ packages/node-integration-tests/package.json | 8 ++------ packages/node/package.json | 8 ++------ packages/opentelemetry-node/package.json | 8 ++------ packages/opentelemetry/package.json | 8 ++------ packages/overhead-metrics/package.json | 8 ++------ packages/react/package.json | 8 ++------ packages/remix/package.json | 8 ++------ packages/replay-worker/package.json | 8 ++------ packages/replay/package.json | 8 ++------ packages/serverless/package.json | 8 ++------ packages/svelte/package.json | 8 ++------ packages/sveltekit/package.json | 8 ++------ packages/tracing-internal/package.json | 8 ++------ packages/tracing/package.json | 8 ++------ packages/types/package.json | 8 ++------ packages/utils/package.json | 8 ++------ packages/vercel-edge/package.json | 8 ++------ packages/vue/package.json | 8 ++------ packages/wasm/package.json | 8 ++------ 38 files changed, 79 insertions(+), 224 deletions(-) diff --git a/package.json b/package.json index 5763b96f5efc..813828391fbc 100644 --- a/package.json +++ b/package.json @@ -18,11 +18,13 @@ "clean:deps": "lerna clean --yes && rm -rf node_modules && yarn", "clean:all": "run-s clean:build clean:caches clean:deps", "codecov": "codecov", - "fix": "lerna run fix", + "fix": "run-s fix:lerna fix:biome", + "fix:lerna": "lerna run fix", + "fix:biome": "biome format --write .", "changelog": "ts-node ./scripts/get-commit-list.ts", "link:yarn": "lerna exec yarn link", - "lint": "lerna run lint", - "lint:eslint": "lerna run lint:eslint", + "lint": "run-s lint:lerna lint:biome", + "lint:lerna": "lerna run lint", "lint:biome": "biome format --verbose .", "validate:es5": "lerna run validate:es5", "postpublish": "lerna run --stream --concurrency 1 postpublish", diff --git a/packages/angular-ivy/package.json b/packages/angular-ivy/package.json index f76336aef645..a81cc5623dd1 100644 --- a/packages/angular-ivy/package.json +++ b/packages/angular-ivy/package.json @@ -50,12 +50,8 @@ "build:syncSymlinks": "ts-node ./scripts/syncSourceFiles.ts", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-angular-ivy-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "yalc:publish": "ts-node ./scripts/prepack.ts && yalc publish build --push --sig" }, "volta": { diff --git a/packages/angular/package.json b/packages/angular/package.json index e612ebecafd2..b38d802f7241 100644 --- a/packages/angular/package.json +++ b/packages/angular/package.json @@ -51,12 +51,8 @@ "build:tarball": "npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-angular-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "yarn test:unit", "test:unit": "jest", "test:unit:watch": "jest --watch", diff --git a/packages/astro/package.json b/packages/astro/package.json index 098a019ec624..1998947423ce 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -67,12 +67,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts", "clean": "rimraf build coverage sentry-astro-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "yarn test:unit", "test:unit": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/browser-integration-tests/package.json b/packages/browser-integration-tests/package.json index f20a4def89ce..a3a0e4a82051 100644 --- a/packages/browser-integration-tests/package.json +++ b/packages/browser-integration-tests/package.json @@ -10,12 +10,8 @@ "scripts": { "clean": "rimraf -g suites/**/dist loader-suites/**/dist tmp", "install-browsers": "playwright install --with-deps", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --fix .", + "lint": "eslint . --format stylish", + "fix": "eslint . --format stylish --fix", "type-check": "tsc", "pretest": "yarn clean && yarn type-check", "test": "playwright test ./suites --project='chromium'", diff --git a/packages/browser/package.json b/packages/browser/package.json index bae7b9f787b7..78995d0bc5bd 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -70,12 +70,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage .rpt2_cache sentry-browser-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "validate:es5": "es-check es5 'build/bundles/*.es5*.js'", "size:check": "run-p size:check:es5 size:check:es6", "size:check:es5": "cat build/bundles/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES5: \",$1,\"kB\";}'", diff --git a/packages/bun/package.json b/packages/bun/package.json index fd5f4d4a4bb7..c91893e82e49 100644 --- a/packages/bun/package.json +++ b/packages/bun/package.json @@ -45,12 +45,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-bun-*.tgz", - "fix": "run-s fix:eslint fix:prettier", - "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "install:bun": "node ./scripts/install-bun.js", "test": "run-s install:bun test:bun", "test:bun": "bun test", diff --git a/packages/core/package.json b/packages/core/package.json index d873bc77f6d8..487276fbb8de 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -40,12 +40,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-core-*.tgz", - "fix": "run-s fix:eslint fix:prettier", - "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "jest", "test:watch": "jest --watch", "version": "node ../../scripts/versionbump.js src/version.ts", diff --git a/packages/deno/package.json b/packages/deno/package.json index bbe95c2266fd..fdc99f21a3ad 100644 --- a/packages/deno/package.json +++ b/packages/deno/package.json @@ -39,13 +39,9 @@ "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build build-types build-test coverage", "prefix": "yarn deno-types", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", + "fix": "eslint . --format stylish --fix", "prelint": "yarn deno-types", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "lint": "eslint . --format stylish", "install:deno": "node ./scripts/install-deno.mjs", "pretest": "run-s deno-types test:build", "test": "run-s install:deno test:types test:unit", diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index e83288de6181..0e523ce8a72f 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -4,12 +4,8 @@ "license": "MIT", "private": true, "scripts": { - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint lint:ts", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "lint:ts": "tsc --noEmit", "test:e2e": "run-s test:validate-configuration test:validate-test-app-setups test:run", "test:run": "ts-node run.ts", diff --git a/packages/ember/package.json b/packages/ember/package.json index ae65bbb67b4a..a3f090eb8d8c 100644 --- a/packages/ember/package.json +++ b/packages/ember/package.json @@ -19,14 +19,11 @@ "scripts": { "build:tarball": "ember ts:precompile && npm pack && ember ts:clean", "clean": "yarn rimraf sentry-ember-*.tgz dist tmp build .node_modules.ember-try package.json.ember-try instance-initializers index.d.ts runloop.d.ts types.d.ts", - "lint": "run-p lint:js lint:hbs lint:ts lint:biome", + "lint": "run-p lint:js lint:hbs lint:ts", "lint:hbs": "ember-template-lint .", "lint:js": "eslint .", "lint:ts": "tsc", - "lint:biome": "biome format .", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", + "fix": "eslint . --format stylish --fix", "start": "ember serve", "test": "ember b --prod && ember test", "test:all": "ember try:each", diff --git a/packages/eslint-plugin-sdk/package.json b/packages/eslint-plugin-sdk/package.json index c8311a94796e..f8f5b2c845df 100644 --- a/packages/eslint-plugin-sdk/package.json +++ b/packages/eslint-plugin-sdk/package.json @@ -26,12 +26,8 @@ }, "scripts": { "clean": "yarn rimraf sentry-internal-eslint-plugin-sdk-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "mocha test --recursive", "build:tarball": "npm pack", "circularDepCheck": "madge --circular src/index.js" diff --git a/packages/feedback/package.json b/packages/feedback/package.json index e237cc0227fc..cdaa2f21d4a6 100644 --- a/packages/feedback/package.json +++ b/packages/feedback/package.json @@ -43,12 +43,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build sentry-replay-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts --bundles && yalc publish ./build/npm --push --sig" diff --git a/packages/gatsby/package.json b/packages/gatsby/package.json index 243ba576762b..f64fa5efdffd 100644 --- a/packages/gatsby/package.json +++ b/packages/gatsby/package.json @@ -57,12 +57,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage *.d.ts sentry-gatsby-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "yarn ts-node scripts/pretest.ts && yarn jest", "test:watch": "yarn ts-node scripts/pretest.ts && yarn jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig" diff --git a/packages/hub/package.json b/packages/hub/package.json index 13a36828121b..1a2d6ebf6676 100644 --- a/packages/hub/package.json +++ b/packages/hub/package.json @@ -41,12 +41,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-hub-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig" diff --git a/packages/integration-shims/package.json b/packages/integration-shims/package.json index c258e27c7de6..c7c62af93358 100644 --- a/packages/integration-shims/package.json +++ b/packages/integration-shims/package.json @@ -26,12 +26,8 @@ "build:transpile:watch": "yarn build:transpile --watch", "build:types:watch": "tsc -p tsconfig.types.json --watch", "clean": "rimraf build", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format ." + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish" }, "repository": { "type": "git", diff --git a/packages/integrations/package.json b/packages/integrations/package.json index 745592bf664c..25ca41b812f1 100644 --- a/packages/integrations/package.json +++ b/packages/integrations/package.json @@ -47,12 +47,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage .rpt2_cache sentry-integrations-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "validate:es5": "es-check es5 'build/bundles/*.es5*.js'", "test": "jest", "test:watch": "jest --watch", diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 45c397ed418d..45afde89eb63 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -68,12 +68,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/edge/index.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts", "clean": "rimraf build coverage sentry-nextjs-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "yarn test:unit", "test:all": "run-s test:unit test:integration test:build", "test:build": "yarn ts-node test/buildProcess/runTest.ts", diff --git a/packages/node-experimental/package.json b/packages/node-experimental/package.json index 0b73b8eab810..b241f05406c5 100644 --- a/packages/node-experimental/package.json +++ b/packages/node-experimental/package.json @@ -65,12 +65,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-node-experimental-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "yarn test:jest", "test:jest": "jest", "test:watch": "jest --watch", diff --git a/packages/node-integration-tests/package.json b/packages/node-integration-tests/package.json index c66f9825ccc6..340bf814d536 100644 --- a/packages/node-integration-tests/package.json +++ b/packages/node-integration-tests/package.json @@ -10,12 +10,8 @@ "clean": "rimraf -g **/node_modules", "prisma:init": "(cd suites/tracing/prisma-orm && ts-node ./setup.ts)", "prisma:init:new": "(cd suites/tracing-new/prisma-orm && ts-node ./setup.ts)", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", + "lint": "eslint . --format stylish", + "fix": "eslint . --format stylish --fix", "type-check": "tsc", "pretest": "run-s --silent prisma:init prisma:init:new", "test": "ts-node ./utils/run-tests.ts", diff --git a/packages/node/package.json b/packages/node/package.json index ed748d8d669f..17bc883d43aa 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -52,12 +52,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-node-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "run-s test:jest test:express test:webpack test:release-health", "test:express": "node test/manual/express-scope-separation/start.js", "test:jest": "jest", diff --git a/packages/opentelemetry-node/package.json b/packages/opentelemetry-node/package.json index 9b286500f7c7..578a8653de50 100644 --- a/packages/opentelemetry-node/package.json +++ b/packages/opentelemetry-node/package.json @@ -55,12 +55,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-opentelemetry-node-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "yarn test:jest", "test:jest": "jest", "test:watch": "jest --watch", diff --git a/packages/opentelemetry/package.json b/packages/opentelemetry/package.json index f3c580ade2d5..927c3b8df119 100644 --- a/packages/opentelemetry/package.json +++ b/packages/opentelemetry/package.json @@ -55,12 +55,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-opentelemetry-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "yarn test:jest", "test:jest": "jest", "test:watch": "jest --watch", diff --git a/packages/overhead-metrics/package.json b/packages/overhead-metrics/package.json index fec2f9932f7f..da6bbc233f94 100644 --- a/packages/overhead-metrics/package.json +++ b/packages/overhead-metrics/package.json @@ -13,12 +13,8 @@ "dev:run:replay": "npx chrome ./test-apps/booking-app/with-replay.html", "ci:collect": "ts-node-esm ./configs/ci/collect.ts", "ci:process": "ts-node-esm ./configs/ci/process.ts", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format ." + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish" }, "dependencies": { "@octokit/rest": "^19.0.5", diff --git a/packages/react/package.json b/packages/react/package.json index 8c08ac42b917..84e335b4a468 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -70,12 +70,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-react-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig" diff --git a/packages/remix/package.json b/packages/remix/package.json index ac83b4af91db..78872efcc515 100644 --- a/packages/remix/package.json +++ b/packages/remix/package.json @@ -60,12 +60,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.server.ts", "clean": "rimraf build coverage sentry-remix-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "yarn test:unit", "test:integration": "run-s test:integration:v1 test:integration:v2", "test:integration:v1": "run-s test:integration:clean test:integration:prepare test:integration:client test:integration:server", diff --git a/packages/replay-worker/package.json b/packages/replay-worker/package.json index a430af599a5a..8fa6c5ae0c6c 100644 --- a/packages/replay-worker/package.json +++ b/packages/replay-worker/package.json @@ -27,12 +27,8 @@ "build:transpile:watch": "yarn build:transpile --watch", "build:types:watch": "tsc -p tsconfig.types.json --watch", "clean": "rimraf build", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "jest", "test:watch": "jest --watch" }, diff --git a/packages/replay/package.json b/packages/replay/package.json index a8f25a78bfcc..7d6f35e9e409 100644 --- a/packages/replay/package.json +++ b/packages/replay/package.json @@ -29,12 +29,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build sentry-replay-*.tgz", - "fix": "run-s fix:eslint fix:prettier", - "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "prettier --check \"{src,test,scripts}/**/*.ts\"", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts --bundles && yalc publish ./build/npm --push --sig" diff --git a/packages/serverless/package.json b/packages/serverless/package.json index f330165febcc..f1ad36863341 100644 --- a/packages/serverless/package.json +++ b/packages/serverless/package.json @@ -57,12 +57,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build dist-awslambda-layer coverage sentry-serverless-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts --bundles && yalc publish ./build/npm --push --sig" diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 4af944be06a0..8d9668bcb805 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -50,12 +50,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-svelte-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig" diff --git a/packages/sveltekit/package.json b/packages/sveltekit/package.json index afa053251736..d908c75a5d29 100644 --- a/packages/sveltekit/package.json +++ b/packages/sveltekit/package.json @@ -49,12 +49,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts", "clean": "rimraf build coverage sentry-sveltekit-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "yarn test:unit", "test:unit": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/tracing-internal/package.json b/packages/tracing-internal/package.json index 9156d2ccc518..47ad998af9a8 100644 --- a/packages/tracing-internal/package.json +++ b/packages/tracing-internal/package.json @@ -43,12 +43,8 @@ "build:types:watch": "tsc -p tsconfig.types.json --watch", "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "clean": "rimraf build coverage sentry-internal-tracing-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test:unit": "jest", "test": "jest", "test:watch": "jest --watch", diff --git a/packages/tracing/package.json b/packages/tracing/package.json index 4c3fc00e0d01..c961bbceabb6 100644 --- a/packages/tracing/package.json +++ b/packages/tracing/package.json @@ -47,12 +47,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm", "clean": "rimraf build coverage sentry-tracing-*.tgz", "circularDepCheck": "madge --circular src/index.ts", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test:unit": "jest", "test": "jest", "test:watch": "jest --watch", diff --git a/packages/types/package.json b/packages/types/package.json index 1f5ec29cfb70..d412f3802b51 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -35,12 +35,8 @@ "build:types:watch": "tsc -p tsconfig.types.json --watch", "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "clean": "rimraf build sentry-types-*.tgz", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", + "lint": "eslint . --format stylish", + "fix": "eslint . --format stylish --fix", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig" }, "volta": { diff --git a/packages/utils/package.json b/packages/utils/package.json index 0e03c5170eaf..cc0437f85d50 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -44,12 +44,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage cjs esm sentry-utils-*.tgz", - "fix": "run-s fix:eslint fix:prettier", - "fix:eslint": "eslint . --format stylish --fix", - "fix:prettier": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "prettier --check \"{src,test,scripts}/**/**.ts\"", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "jest", "test:watch": "jest --watch", "test:package": "node test/types/index.js", diff --git a/packages/vercel-edge/package.json b/packages/vercel-edge/package.json index 79e570473cf9..f5a21dc4a6d2 100644 --- a/packages/vercel-edge/package.json +++ b/packages/vercel-edge/package.json @@ -46,12 +46,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-vercel-edge-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig" diff --git a/packages/vue/package.json b/packages/vue/package.json index 1745214de344..4d5bbd8b05f5 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -48,12 +48,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-vue-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "test": "jest", "test:watch": "jest --watch", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig" diff --git a/packages/wasm/package.json b/packages/wasm/package.json index 8d4e38ee9473..6049bf038515 100644 --- a/packages/wasm/package.json +++ b/packages/wasm/package.json @@ -43,12 +43,8 @@ "build:tarball": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf build coverage sentry-wasm-*.tgz", - "fix": "run-s fix:eslint fix:biome", - "fix:eslint": "eslint . --format stylish --fix", - "fix:biome": "biome format --write .", - "lint": "run-s lint:biome lint:eslint", - "lint:eslint": "eslint . --format stylish", - "lint:biome": "biome format .", + "fix": "eslint . --format stylish --fix", + "lint": "eslint . --format stylish", "yalc:publish": "ts-node ../../scripts/prepack.ts --bundles && yalc publish ./build/npm --push --sig" }, "volta": { From 4ce0289e65c93366ff1bf3b56fae78164724176c Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 27 Nov 2023 14:56:52 -0500 Subject: [PATCH 09/20] fix: remove unnecessary gitignores --- .gitignore | 9 +++++++++ packages/deno/.gitignore | 3 --- packages/eslint-config-sdk/package.json | 2 -- packages/gatsby/.gitignore | 2 -- 4 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 packages/deno/.gitignore delete mode 100644 packages/gatsby/.gitignore diff --git a/.gitignore b/.gitignore index 777b23658572..07ba84c00e9e 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,12 @@ tmp.js # eslint .eslintcache **/eslintcache/* + +# deno +packages/deno/build-types +packages/deno/build-test +packages/deno/lib.deno.d.ts + +# gatsby +packages/gatsby/gatsby-browser.d.ts +packages/gatsby/gatsby-node.d.ts diff --git a/packages/deno/.gitignore b/packages/deno/.gitignore deleted file mode 100644 index d2de144a353c..000000000000 --- a/packages/deno/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -build-types -build-test -lib.deno.d.ts diff --git a/packages/eslint-config-sdk/package.json b/packages/eslint-config-sdk/package.json index 221ec431afbb..f02a778ff00a 100644 --- a/packages/eslint-config-sdk/package.json +++ b/packages/eslint-config-sdk/package.json @@ -38,8 +38,6 @@ }, "scripts": { "clean": "yarn rimraf sentry-internal-eslint-config-sdk-*.tgz", - "lint": "prettier --check \"**/*.js\"", - "fix": "prettier --write \"**/*.js\"", "build:tarball": "npm pack", "circularDepCheck": "madge --circular src/index.js" }, diff --git a/packages/gatsby/.gitignore b/packages/gatsby/.gitignore deleted file mode 100644 index c318d0bec1a6..000000000000 --- a/packages/gatsby/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -gatsby-browser.d.ts -gatsby-node.d.ts From 332b231b0d2b80f53f341f3c5a2e38df3c20f286 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 27 Nov 2023 14:58:23 -0500 Subject: [PATCH 10/20] build: remove verbose logging from biome --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 813828391fbc..39e6505dd8f3 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "link:yarn": "lerna exec yarn link", "lint": "run-s lint:lerna lint:biome", "lint:lerna": "lerna run lint", - "lint:biome": "biome format --verbose .", + "lint:biome": "biome format .", "validate:es5": "lerna run validate:es5", "postpublish": "lerna run --stream --concurrency 1 postpublish", "test": "lerna run --ignore \"@sentry-internal/{browser-integration-tests,e2e-tests,integration-shims,node-integration-tests,overhead-metrics}\" test", From 762a6cebd7a3c92c4c26102ce24ef0855c2c0a5a Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 27 Nov 2023 16:17:17 -0500 Subject: [PATCH 11/20] perf: improve organize imports performance --- .eslintrc.js | 2 +- package.json | 4 +- packages/angular/src/tracing.ts | 3 +- packages/astro/src/index.types.ts | 2 - .../bun/test/integrations/bunserver.test.ts | 1 - packages/bun/test/sdk.test.ts | 1 - packages/core/src/tracing/spanstatus.ts | 1 - packages/deno/.eslintrc.js | 8 - packages/eslint-config-sdk/src/base.js | 267 ++++++++++++++++ packages/eslint-config-sdk/src/import.js | 35 +++ packages/eslint-config-sdk/src/index.js | 285 +----------------- packages/eslint-config-sdk/src/prettier.js | 11 + .../config/templates/apiWrapperTemplate.ts | 3 - .../templates/middlewareWrapperTemplate.ts | 3 - .../config/templates/pageWrapperTemplate.ts | 3 - .../templates/routeHandlerWrapperTemplate.ts | 5 - .../templates/sentryInitWrapperTemplate.ts | 3 - .../serverComponentWrapperTemplate.ts | 4 - packages/nextjs/src/edge/index.ts | 4 +- packages/nextjs/src/index.types.ts | 1 - packages/overhead-metrics/.eslintrc.cjs | 1 - packages/remix/src/index.client.tsx | 1 - packages/remix/src/index.server.ts | 1 - packages/remix/src/index.types.ts | 2 - packages/serverless/src/awslambda.ts | 1 - packages/serverless/test/awslambda.test.ts | 2 - packages/svelte/test/performance.test.ts | 1 - packages/sveltekit/.eslintrc.js | 7 - packages/sveltekit/src/client/handleError.ts | 4 - packages/sveltekit/src/index.types.ts | 3 - packages/sveltekit/src/server/handleError.ts | 4 - packages/sveltekit/src/vite/sourceMaps.ts | 1 - 32 files changed, 319 insertions(+), 355 deletions(-) create mode 100644 packages/eslint-config-sdk/src/base.js create mode 100644 packages/eslint-config-sdk/src/import.js create mode 100644 packages/eslint-config-sdk/src/prettier.js diff --git a/.eslintrc.js b/.eslintrc.js index 746c3d474c24..6682e4b537d6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,7 +11,7 @@ module.exports = { parserOptions: { ecmaVersion: 2018, }, - extends: ['@sentry-internal/sdk'], + extends: ['@sentry-internal/sdk/src/base'], ignorePatterns: [ 'coverage/**', 'build/**', diff --git a/package.json b/package.json index 39e6505dd8f3..8902b1dbf4e0 100644 --- a/package.json +++ b/package.json @@ -20,12 +20,12 @@ "codecov": "codecov", "fix": "run-s fix:lerna fix:biome", "fix:lerna": "lerna run fix", - "fix:biome": "biome format --write .", + "fix:biome": "biome check --apply-unsafe .", "changelog": "ts-node ./scripts/get-commit-list.ts", "link:yarn": "lerna exec yarn link", "lint": "run-s lint:lerna lint:biome", "lint:lerna": "lerna run lint", - "lint:biome": "biome format .", + "lint:biome": "biome check .", "validate:es5": "lerna run validate:es5", "postpublish": "lerna run --stream --concurrency 1 postpublish", "test": "lerna run --ignore \"@sentry-internal/{browser-integration-tests,e2e-tests,integration-shims,node-integration-tests,overhead-metrics}\" test", diff --git a/packages/angular/src/tracing.ts b/packages/angular/src/tracing.ts index 10b3f3f254f1..6facf143c3e6 100644 --- a/packages/angular/src/tracing.ts +++ b/packages/angular/src/tracing.ts @@ -4,9 +4,8 @@ import { Directive, Injectable, Input, NgModule } from '@angular/core'; import type { ActivatedRouteSnapshot, Event, RouterState } from '@angular/router'; // Duplicated import to work around a TypeScript bug where it'd complain that `Router` isn't imported as a type. // We need to import it as a value to satisfy Angular dependency injection. So: -// eslint-disable-next-line @typescript-eslint/consistent-type-imports, import/no-duplicates +// eslint-disable-next-line @typescript-eslint/consistent-type-imports import { NavigationCancel, NavigationError, Router } from '@angular/router'; -// eslint-disable-next-line import/no-duplicates import { NavigationEnd, NavigationStart, ResolveEnd } from '@angular/router'; import { getCurrentHub, WINDOW } from '@sentry/browser'; import type { Span, Transaction, TransactionContext } from '@sentry/types'; diff --git a/packages/astro/src/index.types.ts b/packages/astro/src/index.types.ts index d1d04f3a4bb8..b69206b0dd0c 100644 --- a/packages/astro/src/index.types.ts +++ b/packages/astro/src/index.types.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/export */ - // We export everything from both the client part of the SDK and from the server part. // Some of the exports collide, which is not allowed, unless we redifine the colliding // exports in this file - which we do below. diff --git a/packages/bun/test/integrations/bunserver.test.ts b/packages/bun/test/integrations/bunserver.test.ts index 23253c729590..4965c40a187f 100644 --- a/packages/bun/test/integrations/bunserver.test.ts +++ b/packages/bun/test/integrations/bunserver.test.ts @@ -1,5 +1,4 @@ import { Hub, makeMain } from '@sentry/core'; -// eslint-disable-next-line import/no-unresolved import { beforeAll, beforeEach, describe, expect, test } from 'bun:test'; import { BunClient } from '../../src/client'; diff --git a/packages/bun/test/sdk.test.ts b/packages/bun/test/sdk.test.ts index f92ff4c59b13..6eb562c0c4e1 100644 --- a/packages/bun/test/sdk.test.ts +++ b/packages/bun/test/sdk.test.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line import/no-unresolved import { expect, test } from 'bun:test'; import { init } from '../src/index'; diff --git a/packages/core/src/tracing/spanstatus.ts b/packages/core/src/tracing/spanstatus.ts index fdf322fdeaa1..6a758d95ee84 100644 --- a/packages/core/src/tracing/spanstatus.ts +++ b/packages/core/src/tracing/spanstatus.ts @@ -2,7 +2,6 @@ * * @deprecated Use string literals - if you require type casting, cast to SpanStatusType type */ -// eslint-disable-next-line import/export export enum SpanStatus { /** The operation completed successfully. */ Ok = 'ok', diff --git a/packages/deno/.eslintrc.js b/packages/deno/.eslintrc.js index 06993a46276f..0dabc2227a0d 100644 --- a/packages/deno/.eslintrc.js +++ b/packages/deno/.eslintrc.js @@ -7,12 +7,4 @@ module.exports = { '@sentry-internal/sdk/no-unsupported-es6-methods': 'off', '@sentry-internal/sdk/no-class-field-initializers': 'off', }, - overrides: [ - { - files: ['./test/*.ts'], - rules: { - 'import/no-unresolved': 'off', - }, - }, - ], }; diff --git a/packages/eslint-config-sdk/src/base.js b/packages/eslint-config-sdk/src/base.js new file mode 100644 index 000000000000..982d5887c51d --- /dev/null +++ b/packages/eslint-config-sdk/src/base.js @@ -0,0 +1,267 @@ +module.exports = { + env: { + node: true, + }, + extends: ['eslint:recommended'], + plugins: ['@sentry-internal/eslint-plugin-sdk'], + overrides: [ + { + // Configuration for JavaScript files + files: ['*.js'], + rules: { + 'no-unused-vars': ['error', { argsIgnorePattern: '^_' }], + }, + }, + { + // Configuration for typescript files + files: ['*.ts', '*.tsx', '*.d.ts'], + extends: ['plugin:@typescript-eslint/recommended', 'plugin:deprecation/recommended'], + plugins: ['@typescript-eslint', 'jsdoc'], + parser: '@typescript-eslint/parser', + rules: { + // We want to guard against using the equality operator with empty arrays + '@sentry-internal/sdk/no-eq-empty': 'error', + + // Unused variables should be removed unless they are marked with and underscore (ex. _varName). + '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], + + // Do not use ts-ignore, use ts-expect-error instead. + // Also make sure that all ts-expect-error comments are given a description. + '@typescript-eslint/ban-ts-comment': 'error', + + // Types usage should be explicit as possible, so we prevent usage of inferrable types. + // This is especially important because we have a public API, so usage needs to be as + // easy to understand as possible. + '@typescript-eslint/no-inferrable-types': 'off', + + // Enforce type annotations to maintain consistency. This is especially important as + // we have a public API, so we want changes to be very explicit. + '@typescript-eslint/typedef': ['error', { arrowParameter: false }], + + // Although for most codebases inferencing the return type is fine, we explicitly ask to annotate + // all functions with a return type. This is so that intent is as clear as possible. We are guarding against + // cases where you accidently refactor a function's return type to be the wrong type. + '@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }], + + // Consistent ordering of fields, methods and constructors for classes should be enforced + '@typescript-eslint/member-ordering': 'error', + + // Enforce that unbound methods are called within an expected scope. As we frequently pass data between classes + // in SDKs, we should make sure that we are correctly preserving class scope. + '@typescript-eslint/unbound-method': 'error', + + '@typescript-eslint/consistent-type-imports': 'error', + + // Private and protected members of a class should be prefixed with a leading underscore. + // typeLike declarations (class, interface, typeAlias, enum, typeParameter) should be + // PascalCase. + '@typescript-eslint/naming-convention': [ + 'error', + { + selector: 'memberLike', + modifiers: ['private'], + format: ['camelCase'], + leadingUnderscore: 'require', + }, + { + selector: 'memberLike', + modifiers: ['protected'], + format: ['camelCase'], + leadingUnderscore: 'require', + }, + { + selector: 'typeLike', + format: ['PascalCase'], + }, + ], + + // Prefer for-of loop over for loop if index is only used to access array + '@typescript-eslint/prefer-for-of': 'error', + + // Make sure all expressions are used. Turned off in tests + // Must disable base rule to prevent false positives + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true }], + + // Make sure Promises are handled appropriately + '@typescript-eslint/no-floating-promises': 'error', + + // Disallow delete operator. We should make this operation opt in (by disabling this rule). + '@typescript-eslint/no-dynamic-delete': 'error', + + // We should prevent against overloads unless necessary. + '@typescript-eslint/unified-signatures': 'error', + + // Disallow unsafe any usage. We should enforce that types be used as possible, or unknown be used + // instead of any. This is especially important for methods that expose a public API, as users + // should know exactly what they have to provide to use those methods. Turned off in tests. + '@typescript-eslint/no-unsafe-member-access': 'error', + + // Be explicit about class member accessibility (public, private, protected). Turned off + // on tests for ease of use. + '@typescript-eslint/explicit-member-accessibility': ['error'], + }, + }, + { + // Configuration for files under src + files: ['src/**/*'], + rules: { + 'no-restricted-globals': [ + 'error', + { + name: 'window', + message: + 'Some global variables are not available in environments like WebWorker or Node.js. Use getGlobalObject() instead.', + }, + { + name: 'document', + message: + 'Some global variables are not available in environments like WebWorker or Node.js. Use getGlobalObject() instead.', + }, + { + name: 'location', + message: + 'Some global variables are not available in environments like WebWorker or Node.js. Use getGlobalObject() instead.', + }, + { + name: 'navigator', + message: + 'Some global variables are not available in environments like WebWorker or Node.js. Use getGlobalObject() instead.', + }, + ], + + // We want to prevent optional chaining & nullish coalescing usage in our files + // to prevent uncessary bundle size. Turned off in tests. + '@sentry-internal/sdk/no-optional-chaining': 'error', + '@sentry-internal/sdk/no-nullish-coalescing': 'error', + + // JSDOC comments are required for classes and methods. As we have a public facing codebase, documentation, + // even if it may seems excessive at times, is important to emphasize. Turned off in tests. + 'jsdoc/require-jsdoc': [ + 'error', + { + require: { ClassDeclaration: true, MethodDefinition: true }, + checkConstructors: false, + publicOnly: true, + }, + ], + + // Do not allow usage of functions we do not polyfill for ES5 + '@sentry-internal/sdk/no-unsupported-es6-methods': 'error', + + // Do not allow usage of class field initializers + '@sentry-internal/sdk/no-class-field-initializers': 'error', + }, + }, + { + // Configuration for files in test directories + env: { + jest: true, + }, + files: ['test.ts', '*.test.ts', '*.test.tsx', '*.test.js', '*.test.jsx', 'test/**/*.ts', 'test/**/*.js'], + rules: { + 'max-lines': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/explicit-member-accessibility': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-empty-function': 'off', + '@sentry-internal/sdk/no-optional-chaining': 'off', + '@sentry-internal/sdk/no-nullish-coalescing': 'off', + }, + }, + { + // Configuration only for test files (this won't apply to utils or other files in test directories) + plugins: ['jest'], + env: { + jest: true, + }, + files: ['test.ts', '*.test.ts', '*.test.tsx', '*.test.js', '*.test.jsx'], + rules: { + // Prevent permanent usage of `it.only`, `fit`, `test.only` etc + // We want to avoid debugging leftovers making their way into the codebase + 'jest/no-focused-tests': 'error', + + // Prevent permanent usage of `it.skip`, `xit`, `test.skip` etc + // We want to avoid debugging leftovers making their way into the codebase + // If there's a good reason to skip a test (e.g. bad flakiness), just add an ignore comment + 'jest/no-disabled-tests': 'error', + }, + }, + { + // Configuration for config files like webpack/rollup + files: ['*.config.js'], + parserOptions: { + sourceType: 'module', + ecmaVersion: 2018, + }, + }, + { + // Configuration for jsx and tsx files + files: ['*.tsx', '*.jsx', '*.test.tsx', '*.test.jsx'], + parserOptions: { + jsx: true, + }, + }, + ], + + rules: { + // Disallow usage of console and alert + 'no-console': 'error', + 'no-alert': 'error', + + // Prevent reassignment of function parameters, but still allow object properties to be + // reassigned. We want to enforce immutability when possible, but we shouldn't sacrifice + // too much efficiency + 'no-param-reassign': ['error', { props: false }], + + // Prefer use of template expression over string literal concatenation + 'prefer-template': 'error', + + // Limit maximum file size to reduce complexity. Turned off in tests. + 'max-lines': ['error', { max: 300, skipComments: true, skipBlankLines: true }], + + // We should require a whitespace beginning a comment + 'spaced-comment': [ + 'error', + 'always', + { + line: { + // this lets us use triple-slash directives + markers: ['/'], + }, + block: { + // comments of the form /* ..... */ should always have whitespace before the closing `*/` marker... + balanced: true, + // ... unless they're jsdoc-style block comments, which end with `**/` + exceptions: ['*'], + }, + }, + ], + + // Disallow usage of bitwise operators - this makes it an opt in operation + 'no-bitwise': 'error', + + // Limit cyclomatic complexity + complexity: 'error', + + // Make sure all expressions are used. Turn off on tests. + 'no-unused-expressions': 'error', + + // Make sure for in loops check for properties + 'guard-for-in': 'error', + + // Make sure that we are returning in the callbacks passed into `.map`, + // `.filter` and `.reduce`. If we are not, we should be using + // `.forEach()` or an explicit for loop. + 'array-callback-return': ['error', { allowImplicit: true }], + + quotes: ['error', 'single', { avoidEscape: true }], + + // Remove uncessary usages of async await to prevent extra micro-tasks + 'no-return-await': 'error', + }, +}; diff --git a/packages/eslint-config-sdk/src/import.js b/packages/eslint-config-sdk/src/import.js new file mode 100644 index 000000000000..2a0ab6ba2629 --- /dev/null +++ b/packages/eslint-config-sdk/src/import.js @@ -0,0 +1,35 @@ +module.exports = { + extends: ['plugin:import/errors', 'plugin:import/warnings'], + plugins: ['simple-import-sort'], + overrides: [ + { + // Configuration for typescript files + files: ['*.ts', '*.tsx', '*.d.ts'], + extends: ['plugin:import/typescript'], + plugins: ['@typescript-eslint', 'jsdoc'], + parser: '@typescript-eslint/parser', + rules: { + // sort imports + 'simple-import-sort/sort': 'error', + 'sort-imports': 'off', + 'import/order': 'off', + }, + }, + { + // Configuration for files under src + files: ['src/**/*'], + rules: { + // All imports should be accounted for + 'import/no-extraneous-dependencies': 'error', + }, + }, + ], + + rules: { + // We shouldn't make assumptions about imports/exports being dereferenced. + 'import/namespace': 'off', + + // imports should be ordered. + 'import/order': ['error', { 'newlines-between': 'always' }], + }, +}; diff --git a/packages/eslint-config-sdk/src/index.js b/packages/eslint-config-sdk/src/index.js index efbeb3047a33..596aca5f8515 100644 --- a/packages/eslint-config-sdk/src/index.js +++ b/packages/eslint-config-sdk/src/index.js @@ -1,287 +1,4 @@ module.exports = { root: true, - env: { - node: true, - }, - extends: ['prettier', 'eslint:recommended', 'plugin:import/errors', 'plugin:import/warnings'], - plugins: ['@sentry-internal/eslint-plugin-sdk', 'simple-import-sort'], - overrides: [ - { - // Configuration for JavaScript files - files: ['*.js'], - rules: { - 'no-unused-vars': ['error', { argsIgnorePattern: '^_' }], - }, - }, - { - // Configuration for typescript files - files: ['*.ts', '*.tsx', '*.d.ts'], - extends: [ - 'plugin:@typescript-eslint/recommended', - 'prettier/@typescript-eslint', - 'plugin:import/typescript', - 'plugin:deprecation/recommended', - ], - plugins: ['@typescript-eslint', 'jsdoc'], - parser: '@typescript-eslint/parser', - rules: { - // We want to guard against using the equality operator with empty arrays - '@sentry-internal/sdk/no-eq-empty': 'error', - - // Unused variables should be removed unless they are marked with and underscore (ex. _varName). - '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], - - // Do not use ts-ignore, use ts-expect-error instead. - // Also make sure that all ts-expect-error comments are given a description. - '@typescript-eslint/ban-ts-comment': 'error', - - // Types usage should be explicit as possible, so we prevent usage of inferrable types. - // This is especially important because we have a public API, so usage needs to be as - // easy to understand as possible. - '@typescript-eslint/no-inferrable-types': 'off', - - // Enforce type annotations to maintain consistency. This is especially important as - // we have a public API, so we want changes to be very explicit. - '@typescript-eslint/typedef': ['error', { arrowParameter: false }], - - // Although for most codebases inferencing the return type is fine, we explicitly ask to annotate - // all functions with a return type. This is so that intent is as clear as possible. We are guarding against - // cases where you accidently refactor a function's return type to be the wrong type. - '@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }], - - // Consistent ordering of fields, methods and constructors for classes should be enforced - '@typescript-eslint/member-ordering': 'error', - - // Enforce that unbound methods are called within an expected scope. As we frequently pass data between classes - // in SDKs, we should make sure that we are correctly preserving class scope. - '@typescript-eslint/unbound-method': 'error', - - '@typescript-eslint/consistent-type-imports': 'error', - - // Private and protected members of a class should be prefixed with a leading underscore. - // typeLike declarations (class, interface, typeAlias, enum, typeParameter) should be - // PascalCase. - '@typescript-eslint/naming-convention': [ - 'error', - { - selector: 'memberLike', - modifiers: ['private'], - format: ['camelCase'], - leadingUnderscore: 'require', - }, - { - selector: 'memberLike', - modifiers: ['protected'], - format: ['camelCase'], - leadingUnderscore: 'require', - }, - { - selector: 'typeLike', - format: ['PascalCase'], - }, - ], - - // Prefer for-of loop over for loop if index is only used to access array - '@typescript-eslint/prefer-for-of': 'error', - - // Make sure all expressions are used. Turned off in tests - // Must disable base rule to prevent false positives - 'no-unused-expressions': 'off', - '@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true }], - - // Make sure Promises are handled appropriately - '@typescript-eslint/no-floating-promises': 'error', - - // sort imports - 'simple-import-sort/sort': 'error', - 'sort-imports': 'off', - 'import/order': 'off', - - // Disallow delete operator. We should make this operation opt in (by disabling this rule). - '@typescript-eslint/no-dynamic-delete': 'error', - - // We should prevent against overloads unless necessary. - '@typescript-eslint/unified-signatures': 'error', - - // Disallow unsafe any usage. We should enforce that types be used as possible, or unknown be used - // instead of any. This is especially important for methods that expose a public API, as users - // should know exactly what they have to provide to use those methods. Turned off in tests. - '@typescript-eslint/no-unsafe-member-access': 'error', - - // Be explicit about class member accessibility (public, private, protected). Turned off - // on tests for ease of use. - '@typescript-eslint/explicit-member-accessibility': ['error'], - }, - }, - { - // Configuration for files under src - files: ['src/**/*'], - rules: { - 'no-restricted-globals': [ - 'error', - { - name: 'window', - message: - 'Some global variables are not available in environments like WebWorker or Node.js. Use getGlobalObject() instead.', - }, - { - name: 'document', - message: - 'Some global variables are not available in environments like WebWorker or Node.js. Use getGlobalObject() instead.', - }, - { - name: 'location', - message: - 'Some global variables are not available in environments like WebWorker or Node.js. Use getGlobalObject() instead.', - }, - { - name: 'navigator', - message: - 'Some global variables are not available in environments like WebWorker or Node.js. Use getGlobalObject() instead.', - }, - ], - - // We want to prevent optional chaining & nullish coalescing usage in our files - // to prevent uncessary bundle size. Turned off in tests. - '@sentry-internal/sdk/no-optional-chaining': 'error', - '@sentry-internal/sdk/no-nullish-coalescing': 'error', - - // JSDOC comments are required for classes and methods. As we have a public facing codebase, documentation, - // even if it may seems excessive at times, is important to emphasize. Turned off in tests. - 'jsdoc/require-jsdoc': [ - 'error', - { - require: { ClassDeclaration: true, MethodDefinition: true }, - checkConstructors: false, - publicOnly: true, - }, - ], - - // All imports should be accounted for - 'import/no-extraneous-dependencies': 'error', - - // Do not allow usage of functions we do not polyfill for ES5 - '@sentry-internal/sdk/no-unsupported-es6-methods': 'error', - - // Do not allow usage of class field initializers - '@sentry-internal/sdk/no-class-field-initializers': 'error', - }, - }, - { - // Configuration for files in test directories - env: { - jest: true, - }, - files: ['test.ts', '*.test.ts', '*.test.tsx', '*.test.js', '*.test.jsx', 'test/**/*.ts', 'test/**/*.js'], - rules: { - 'max-lines': 'off', - '@typescript-eslint/explicit-function-return-type': 'off', - 'no-unused-expressions': 'off', - '@typescript-eslint/no-unused-expressions': 'off', - '@typescript-eslint/no-unsafe-member-access': 'off', - '@typescript-eslint/explicit-member-accessibility': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-empty-function': 'off', - '@sentry-internal/sdk/no-optional-chaining': 'off', - '@sentry-internal/sdk/no-nullish-coalescing': 'off', - }, - }, - { - // Configuration only for test files (this won't apply to utils or other files in test directories) - plugins: ['jest'], - env: { - jest: true, - }, - files: ['test.ts', '*.test.ts', '*.test.tsx', '*.test.js', '*.test.jsx'], - rules: { - // Prevent permanent usage of `it.only`, `fit`, `test.only` etc - // We want to avoid debugging leftovers making their way into the codebase - 'jest/no-focused-tests': 'error', - - // Prevent permanent usage of `it.skip`, `xit`, `test.skip` etc - // We want to avoid debugging leftovers making their way into the codebase - // If there's a good reason to skip a test (e.g. bad flakiness), just add an ignore comment - 'jest/no-disabled-tests': 'error', - }, - }, - { - // Configuration for config files like webpack/rollup - files: ['*.config.js'], - parserOptions: { - sourceType: 'module', - ecmaVersion: 2018, - }, - }, - { - // Configuration for jsx and tsx files - files: ['*.tsx', '*.jsx', '*.test.tsx', '*.test.jsx'], - parserOptions: { - jsx: true, - }, - }, - ], - - rules: { - // Disallow usage of console and alert - 'no-console': 'error', - 'no-alert': 'error', - - // Prevent reassignment of function parameters, but still allow object properties to be - // reassigned. We want to enforce immutability when possible, but we shouldn't sacrifice - // too much efficiency - 'no-param-reassign': ['error', { props: false }], - - // Prefer use of template expression over string literal concatenation - 'prefer-template': 'error', - - // Limit maximum file size to reduce complexity. Turned off in tests. - 'max-lines': ['error', { max: 300, skipComments: true, skipBlankLines: true }], - - // We should require a whitespace beginning a comment - 'spaced-comment': [ - 'error', - 'always', - { - line: { - // this lets us use triple-slash directives - markers: ['/'], - }, - block: { - // comments of the form /* ..... */ should always have whitespace before the closing `*/` marker... - balanced: true, - // ... unless they're jsdoc-style block comments, which end with `**/` - exceptions: ['*'], - }, - }, - ], - - // Disallow usage of bitwise operators - this makes it an opt in operation - 'no-bitwise': 'error', - - // Limit cyclomatic complexity - complexity: 'error', - - // Make sure all expressions are used. Turn off on tests. - 'no-unused-expressions': 'error', - - // We shouldn't make assumptions about imports/exports being dereferenced. - 'import/namespace': 'off', - - // imports should be ordered. - 'import/order': ['error', { 'newlines-between': 'always' }], - - // Make sure for in loops check for properties - 'guard-for-in': 'error', - - // Make sure that we are returning in the callbacks passed into `.map`, - // `.filter` and `.reduce`. If we are not, we should be using - // `.forEach()` or an explicit for loop. - 'array-callback-return': ['error', { allowImplicit: true }], - - quotes: ['error', 'single', { avoidEscape: true }], - - // Remove uncessary usages of async await to prevent extra micro-tasks - 'no-return-await': 'error', - }, + extends: ['./base.js', './import.js', './prettier.js'], }; diff --git a/packages/eslint-config-sdk/src/prettier.js b/packages/eslint-config-sdk/src/prettier.js new file mode 100644 index 000000000000..4875e99a283d --- /dev/null +++ b/packages/eslint-config-sdk/src/prettier.js @@ -0,0 +1,11 @@ +module.exports = { + extends: ['prettier'], + overrides: [ + { + // Configuration for typescript files + files: ['*.ts', '*.tsx', '*.d.ts'], + extends: ['prettier/@typescript-eslint'], + parser: '@typescript-eslint/parser', + }, + ], +}; diff --git a/packages/nextjs/src/config/templates/apiWrapperTemplate.ts b/packages/nextjs/src/config/templates/apiWrapperTemplate.ts index 4869d0c0d6e6..d8072b470715 100644 --- a/packages/nextjs/src/config/templates/apiWrapperTemplate.ts +++ b/packages/nextjs/src/config/templates/apiWrapperTemplate.ts @@ -7,9 +7,7 @@ */ // @ts-expect-error See above -// eslint-disable-next-line import/no-unresolved import * as origModule from '__SENTRY_WRAPPING_TARGET_FILE__'; -// eslint-disable-next-line import/no-extraneous-dependencies import * as Sentry from '@sentry/nextjs'; import type { PageConfig } from 'next'; @@ -69,5 +67,4 @@ export default wrappedHandler; // Re-export anything exported by the page module we're wrapping. When processing this code, Rollup is smart enough to // not include anything whose name matchs something we've explicitly exported above. // @ts-expect-error See above -// eslint-disable-next-line import/no-unresolved export * from '__SENTRY_WRAPPING_TARGET_FILE__'; diff --git a/packages/nextjs/src/config/templates/middlewareWrapperTemplate.ts b/packages/nextjs/src/config/templates/middlewareWrapperTemplate.ts index bd01f47ba236..42809c104db7 100644 --- a/packages/nextjs/src/config/templates/middlewareWrapperTemplate.ts +++ b/packages/nextjs/src/config/templates/middlewareWrapperTemplate.ts @@ -6,9 +6,7 @@ */ // @ts-expect-error See above -// eslint-disable-next-line import/no-unresolved import * as origModule from '__SENTRY_WRAPPING_TARGET_FILE__'; -// eslint-disable-next-line import/no-extraneous-dependencies import * as Sentry from '@sentry/nextjs'; import type { EdgeRouteHandler } from '../../edge/types'; @@ -48,5 +46,4 @@ export default userProvidedDefaultHandler ? Sentry.wrapMiddlewareWithSentry(user // Re-export anything exported by the page module we're wrapping. When processing this code, Rollup is smart enough to // not include anything whose name matchs something we've explicitly exported above. // @ts-expect-error See above -// eslint-disable-next-line import/no-unresolved export * from '__SENTRY_WRAPPING_TARGET_FILE__'; diff --git a/packages/nextjs/src/config/templates/pageWrapperTemplate.ts b/packages/nextjs/src/config/templates/pageWrapperTemplate.ts index c383503f42cf..d5fba5ca24e9 100644 --- a/packages/nextjs/src/config/templates/pageWrapperTemplate.ts +++ b/packages/nextjs/src/config/templates/pageWrapperTemplate.ts @@ -7,9 +7,7 @@ */ // @ts-expect-error See above -// eslint-disable-next-line import/no-unresolved import * as wrapee from '__SENTRY_WRAPPING_TARGET_FILE__'; -// eslint-disable-next-line import/no-extraneous-dependencies import * as Sentry from '@sentry/nextjs'; import type { GetServerSideProps, GetStaticProps, NextPage as NextPageComponent } from 'next'; @@ -54,5 +52,4 @@ export default pageComponent ? Sentry.wrapPageComponentWithSentry(pageComponent // Re-export anything exported by the page module we're wrapping. When processing this code, Rollup is smart enough to // not include anything whose name matchs something we've explicitly exported above. // @ts-expect-error See above -// eslint-disable-next-line import/no-unresolved export * from '__SENTRY_WRAPPING_TARGET_FILE__'; diff --git a/packages/nextjs/src/config/templates/routeHandlerWrapperTemplate.ts b/packages/nextjs/src/config/templates/routeHandlerWrapperTemplate.ts index 930ab21eaadd..d40874b19f4b 100644 --- a/packages/nextjs/src/config/templates/routeHandlerWrapperTemplate.ts +++ b/packages/nextjs/src/config/templates/routeHandlerWrapperTemplate.ts @@ -1,11 +1,8 @@ // @ts-expect-error Because we cannot be sure if the RequestAsyncStorage module exists (it is not part of the Next.js public // API) we use a shim if it doesn't exist. The logic for this is in the wrapping loader. -// eslint-disable-next-line import/no-unresolved import { requestAsyncStorage } from '__SENTRY_NEXTJS_REQUEST_ASYNC_STORAGE_SHIM__'; // @ts-expect-error See above -// eslint-disable-next-line import/no-unresolved import * as routeModule from '__SENTRY_WRAPPING_TARGET_FILE__'; -// eslint-disable-next-line import/no-extraneous-dependencies import * as Sentry from '@sentry/nextjs'; import type { RequestAsyncStorage } from './requestAsyncStorageShim'; @@ -59,11 +56,9 @@ function wrapHandler(handler: T, method: 'GET' | 'POST' | 'PUT' | 'PATCH' | ' } // @ts-expect-error See above -// eslint-disable-next-line import/no-unresolved export * from '__SENTRY_WRAPPING_TARGET_FILE__'; // @ts-expect-error This is the file we're wrapping -// eslint-disable-next-line import/no-unresolved export { default } from '__SENTRY_WRAPPING_TARGET_FILE__'; export const GET = wrapHandler(routeModule.GET, 'GET'); diff --git a/packages/nextjs/src/config/templates/sentryInitWrapperTemplate.ts b/packages/nextjs/src/config/templates/sentryInitWrapperTemplate.ts index 085154b18faa..3be1b07d6bc5 100644 --- a/packages/nextjs/src/config/templates/sentryInitWrapperTemplate.ts +++ b/packages/nextjs/src/config/templates/sentryInitWrapperTemplate.ts @@ -1,11 +1,8 @@ // @ts-expect-error This will be replaced with the user's sentry config gile -// eslint-disable-next-line import/no-unresolved import '__SENTRY_CONFIG_IMPORT_PATH__'; // @ts-expect-error This is the file we're wrapping -// eslint-disable-next-line import/no-unresolved export * from '__SENTRY_WRAPPING_TARGET_FILE__'; // @ts-expect-error This is the file we're wrapping -// eslint-disable-next-line import/no-unresolved export { default } from '__SENTRY_WRAPPING_TARGET_FILE__'; diff --git a/packages/nextjs/src/config/templates/serverComponentWrapperTemplate.ts b/packages/nextjs/src/config/templates/serverComponentWrapperTemplate.ts index d4251c5a521a..687e72e02fde 100644 --- a/packages/nextjs/src/config/templates/serverComponentWrapperTemplate.ts +++ b/packages/nextjs/src/config/templates/serverComponentWrapperTemplate.ts @@ -1,11 +1,8 @@ // @ts-expect-error Because we cannot be sure if the RequestAsyncStorage module exists (it is not part of the Next.js public // API) we use a shim if it doesn't exist. The logic for this is in the wrapping loader. -// eslint-disable-next-line import/no-unresolved import { requestAsyncStorage } from '__SENTRY_NEXTJS_REQUEST_ASYNC_STORAGE_SHIM__'; // @ts-expect-error We use `__SENTRY_WRAPPING_TARGET_FILE__` as a placeholder for the path to the file being wrapped. -// eslint-disable-next-line import/no-unresolved import * as serverComponentModule from '__SENTRY_WRAPPING_TARGET_FILE__'; -// eslint-disable-next-line import/no-extraneous-dependencies import * as Sentry from '@sentry/nextjs'; import type { WebFetchHeaders } from '@sentry/types'; @@ -56,7 +53,6 @@ if (typeof serverComponent === 'function') { // Re-export anything exported by the page module we're wrapping. When processing this code, Rollup is smart enough to // not include anything whose name matchs something we've explicitly exported above. // @ts-expect-error See above -// eslint-disable-next-line import/no-unresolved export * from '__SENTRY_WRAPPING_TARGET_FILE__'; export default wrappedServerComponent; diff --git a/packages/nextjs/src/edge/index.ts b/packages/nextjs/src/edge/index.ts index 09005785d335..250aa2c31c24 100644 --- a/packages/nextjs/src/edge/index.ts +++ b/packages/nextjs/src/edge/index.ts @@ -75,12 +75,10 @@ export function withSentryConfig(exportedUserNextConfig: T): T { export * from '@sentry/vercel-edge'; export { Span, Transaction } from '@sentry/core'; -// eslint-disable-next-line import/export export * from '../common'; export { - // eslint-disable-next-line deprecation/deprecation, import/export + // eslint-disable-next-line deprecation/deprecation withSentryAPI, - // eslint-disable-next-line import/export wrapApiHandlerWithSentry, } from './wrapApiHandlerWithSentry'; diff --git a/packages/nextjs/src/index.types.ts b/packages/nextjs/src/index.types.ts index 804c8f2b3e35..50c1a747b599 100644 --- a/packages/nextjs/src/index.types.ts +++ b/packages/nextjs/src/index.types.ts @@ -1,5 +1,4 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable import/export */ // We export everything from both the client part of the SDK and from the server part. Some of the exports collide, // which is not allowed, unless we redifine the colliding exports in this file - which we do below. diff --git a/packages/overhead-metrics/.eslintrc.cjs b/packages/overhead-metrics/.eslintrc.cjs index 281d09c16ab2..a4f2d4fdd936 100644 --- a/packages/overhead-metrics/.eslintrc.cjs +++ b/packages/overhead-metrics/.eslintrc.cjs @@ -7,7 +7,6 @@ module.exports = { rules: { 'no-console': 'off', '@typescript-eslint/no-non-null-assertion': 'off', - 'import/no-unresolved': 'off', '@sentry-internal/sdk/no-optional-chaining': 'off', '@sentry-internal/sdk/no-nullish-coalescing': 'off', '@sentry-internal/sdk/no-unsupported-es6-methods': 'off', diff --git a/packages/remix/src/index.client.tsx b/packages/remix/src/index.client.tsx index 64951a3f10cd..fd37f3001d83 100644 --- a/packages/remix/src/index.client.tsx +++ b/packages/remix/src/index.client.tsx @@ -1,4 +1,3 @@ -/* eslint-disable import/export */ import { configureScope, init as reactInit } from '@sentry/react'; import { buildMetadata } from './utils/metadata'; diff --git a/packages/remix/src/index.server.ts b/packages/remix/src/index.server.ts index 747634603bc0..a68e417924e9 100644 --- a/packages/remix/src/index.server.ts +++ b/packages/remix/src/index.server.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/export */ import type { NodeOptions } from '@sentry/node'; import { configureScope, getCurrentHub, init as nodeInit } from '@sentry/node'; import { logger } from '@sentry/utils'; diff --git a/packages/remix/src/index.types.ts b/packages/remix/src/index.types.ts index c04fc7a394de..dc042dfdb762 100644 --- a/packages/remix/src/index.types.ts +++ b/packages/remix/src/index.types.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/export */ - // We export everything from both the client part of the SDK and from the server part. Some of the exports collide, // which is not allowed, unless we redifine the colliding exports in this file - which we do below. export * from './index.client'; diff --git a/packages/serverless/src/awslambda.ts b/packages/serverless/src/awslambda.ts index 97dec35a6113..6d8d8628e32f 100644 --- a/packages/serverless/src/awslambda.ts +++ b/packages/serverless/src/awslambda.ts @@ -5,7 +5,6 @@ import { captureException, captureMessage, flush, getCurrentHub, withScope } fro import type { Integration, SdkMetadata } from '@sentry/types'; import { isString, logger, tracingContextFromHeaders } from '@sentry/utils'; // NOTE: I have no idea how to fix this right now, and don't want to waste more time, as it builds just fine — Kamil -// eslint-disable-next-line import/no-unresolved import type { Context, Handler } from 'aws-lambda'; import { existsSync } from 'fs'; import { hostname } from 'os'; diff --git a/packages/serverless/test/awslambda.test.ts b/packages/serverless/test/awslambda.test.ts index a3542d058121..a3085c8b0f65 100644 --- a/packages/serverless/test/awslambda.test.ts +++ b/packages/serverless/test/awslambda.test.ts @@ -1,8 +1,6 @@ // NOTE: I have no idea how to fix this right now, and don't want to waste more time, as it builds just fine — Kamil -// eslint-disable-next-line import/no-unresolved import * as SentryNode from '@sentry/node'; import type { Event } from '@sentry/types'; -// eslint-disable-next-line import/no-unresolved import type { Callback, Handler } from 'aws-lambda'; import * as Sentry from '../src'; diff --git a/packages/svelte/test/performance.test.ts b/packages/svelte/test/performance.test.ts index c92492d0d943..aabf4462e8cb 100644 --- a/packages/svelte/test/performance.test.ts +++ b/packages/svelte/test/performance.test.ts @@ -2,7 +2,6 @@ import type { Scope } from '@sentry/core'; import { act, render } from '@testing-library/svelte'; // linter doesn't like Svelte component imports -// eslint-disable-next-line import/no-unresolved import DummyComponent from './components/Dummy.svelte'; let returnUndefinedTransaction = false; diff --git a/packages/sveltekit/.eslintrc.js b/packages/sveltekit/.eslintrc.js index 4a8474637698..c1f55c94aadf 100644 --- a/packages/sveltekit/.eslintrc.js +++ b/packages/sveltekit/.eslintrc.js @@ -4,13 +4,6 @@ module.exports = { node: true, }, overrides: [ - { - files: ['*.ts'], - rules: { - // Turning this off because it's not working with @sveltejs/kit - 'import/no-unresolved': 'off', - }, - }, { files: ['vite.config.ts'], parserOptions: { diff --git a/packages/sveltekit/src/client/handleError.ts b/packages/sveltekit/src/client/handleError.ts index 6c16cee0ebbd..ae5cd84f17c8 100644 --- a/packages/sveltekit/src/client/handleError.ts +++ b/packages/sveltekit/src/client/handleError.ts @@ -1,9 +1,5 @@ import { captureException } from '@sentry/svelte'; import { consoleSandbox } from '@sentry/utils'; -// For now disable the import/no-unresolved rule, because we don't have a way to -// tell eslint that we are only importing types from the @sveltejs/kit package without -// adding a custom resolver, which will take too much time. -// eslint-disable-next-line import/no-unresolved import type { HandleClientError, NavigationEvent } from '@sveltejs/kit'; // The SvelteKit default error handler just logs the error to the console diff --git a/packages/sveltekit/src/index.types.ts b/packages/sveltekit/src/index.types.ts index 3b2393ea4d15..8a3b0870ed8e 100644 --- a/packages/sveltekit/src/index.types.ts +++ b/packages/sveltekit/src/index.types.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/export */ - // We export everything from both the client part of the SDK and from the server part. // Some of the exports collide, which is not allowed, unless we redifine the colliding // exports in this file - which we do below. @@ -8,7 +6,6 @@ export * from './vite'; export * from './server'; import type { Integration, Options, StackParser } from '@sentry/types'; -// eslint-disable-next-line import/no-unresolved import type { HandleClientError, HandleServerError } from '@sveltejs/kit'; import type * as clientSdk from './client'; diff --git a/packages/sveltekit/src/server/handleError.ts b/packages/sveltekit/src/server/handleError.ts index c0f27d181928..c89cbaaecc0f 100644 --- a/packages/sveltekit/src/server/handleError.ts +++ b/packages/sveltekit/src/server/handleError.ts @@ -1,8 +1,4 @@ import { captureException } from '@sentry/node'; -// For now disable the import/no-unresolved rule, because we don't have a way to -// tell eslint that we are only importing types from the @sveltejs/kit package without -// adding a custom resolver, which will take too much time. -// eslint-disable-next-line import/no-unresolved import type { HandleServerError, RequestEvent } from '@sveltejs/kit'; import { flushIfServerless } from './utils'; diff --git a/packages/sveltekit/src/vite/sourceMaps.ts b/packages/sveltekit/src/vite/sourceMaps.ts index c3a4c86e70ad..42a46d38d649 100644 --- a/packages/sveltekit/src/vite/sourceMaps.ts +++ b/packages/sveltekit/src/vite/sourceMaps.ts @@ -6,7 +6,6 @@ import * as child_process from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; // @ts-expect-error -sorcery has no types :( -// eslint-disable-next-line import/default import * as sorcery from 'sorcery'; import type { Plugin } from 'vite'; From f97020fa5df140de6b3f2861f5cc1d25f670ddca Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Tue, 28 Nov 2023 11:24:41 -0500 Subject: [PATCH 12/20] chore: update node.js to v20 (#9672) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8902b1dbf4e0..f8bdaced8cbe 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "yalc:publish": "lerna run yalc:publish" }, "volta": { - "node": "18.17.0", + "node": "20.10.0", "yarn": "1.22.19" }, "workspaces": [ From 28450adc81fa24a07d3ecd5eb7d10de0a7c58e2d Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Tue, 28 Nov 2023 11:34:01 -0500 Subject: [PATCH 13/20] fix(utils): Try catch new URL when extracting query params (#9675) --- packages/utils/src/requestdata.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/utils/src/requestdata.ts b/packages/utils/src/requestdata.ts index 7106a42a5a60..43be67f265f9 100644 --- a/packages/utils/src/requestdata.ts +++ b/packages/utils/src/requestdata.ts @@ -357,13 +357,17 @@ function extractQueryParams( originalUrl = `http://dogs.are.great${originalUrl}`; } - return ( - req.query || - (typeof URL !== undefined && new URL(originalUrl).search.replace('?', '')) || - // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node - (deps && deps.url && deps.url.parse(originalUrl).query) || - undefined - ); + try { + return ( + req.query || + (typeof URL !== undefined && new URL(originalUrl).search.slice(1)) || + // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node + (deps && deps.url && deps.url.parse(originalUrl).query) || + undefined + ); + } catch { + return undefined; + } } /** From 61e905604719896ad3ca3be963803114904286b2 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Tue, 28 Nov 2023 12:17:24 -0500 Subject: [PATCH 14/20] feat(web-vitals): Vendor in INP from web-vitals library (#9690) vendored in from https://github.com/GoogleChrome/web-vitals/tree/7f0ed0bfb03c356e348a558a3eda111b498a2a11 Note that this is on web vitals `v3.0.4`. We need to update to latest web vitals version - will do this in a follow up PR. --- .../src/browser/web-vitals/getINP.ts | 215 ++++++++++++++++++ .../lib/polyfills/interactionCountPolyfill.ts | 62 +++++ .../src/browser/web-vitals/types/inp.ts | 80 +++++++ 3 files changed, 357 insertions(+) create mode 100644 packages/tracing-internal/src/browser/web-vitals/getINP.ts create mode 100644 packages/tracing-internal/src/browser/web-vitals/lib/polyfills/interactionCountPolyfill.ts create mode 100644 packages/tracing-internal/src/browser/web-vitals/types/inp.ts diff --git a/packages/tracing-internal/src/browser/web-vitals/getINP.ts b/packages/tracing-internal/src/browser/web-vitals/getINP.ts new file mode 100644 index 000000000000..546838bff15d --- /dev/null +++ b/packages/tracing-internal/src/browser/web-vitals/getINP.ts @@ -0,0 +1,215 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { bindReporter } from './lib/bindReporter'; +import { initMetric } from './lib/initMetric'; +import { observe } from './lib/observe'; +import { onHidden } from './lib/onHidden'; +import { getInteractionCount, initInteractionCountPolyfill } from './lib/polyfills/interactionCountPolyfill'; +import type { ReportCallback, ReportOpts } from './types'; +import type { INPMetric } from './types/inp'; + +interface Interaction { + id: number; + latency: number; + entries: PerformanceEventTiming[]; +} + +/** + * Returns the interaction count since the last bfcache restore (or for the + * full page lifecycle if there were no bfcache restores). + */ +const getInteractionCountForNavigation = (): number => { + return getInteractionCount(); +}; + +// To prevent unnecessary memory usage on pages with lots of interactions, +// store at most 10 of the longest interactions to consider as INP candidates. +const MAX_INTERACTIONS_TO_CONSIDER = 10; + +// A list of longest interactions on the page (by latency) sorted so the +// longest one is first. The list is as most MAX_INTERACTIONS_TO_CONSIDER long. +const longestInteractionList: Interaction[] = []; + +// A mapping of longest interactions by their interaction ID. +// This is used for faster lookup. +const longestInteractionMap: { [interactionId: string]: Interaction } = {}; + +/** + * Takes a performance entry and adds it to the list of worst interactions + * if its duration is long enough to make it among the worst. If the + * entry is part of an existing interaction, it is merged and the latency + * and entries list is updated as needed. + */ +const processEntry = (entry: PerformanceEventTiming): void => { + // The least-long of the 10 longest interactions. + const minLongestInteraction = longestInteractionList[longestInteractionList.length - 1]; + + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const existingInteraction = longestInteractionMap[entry.interactionId!]; + + // Only process the entry if it's possibly one of the ten longest, + // or if it's part of an existing interaction. + if ( + existingInteraction || + longestInteractionList.length < MAX_INTERACTIONS_TO_CONSIDER || + entry.duration > minLongestInteraction.latency + ) { + // If the interaction already exists, update it. Otherwise create one. + if (existingInteraction) { + existingInteraction.entries.push(entry); + existingInteraction.latency = Math.max(existingInteraction.latency, entry.duration); + } else { + const interaction = { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + id: entry.interactionId!, + latency: entry.duration, + entries: [entry], + }; + longestInteractionMap[interaction.id] = interaction; + longestInteractionList.push(interaction); + } + + // Sort the entries by latency (descending) and keep only the top ten. + longestInteractionList.sort((a, b) => b.latency - a.latency); + longestInteractionList.splice(MAX_INTERACTIONS_TO_CONSIDER).forEach(i => { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete longestInteractionMap[i.id]; + }); + } +}; + +/** + * Returns the estimated p98 longest interaction based on the stored + * interaction candidates and the interaction count for the current page. + */ +const estimateP98LongestInteraction = (): Interaction => { + const candidateInteractionIndex = Math.min( + longestInteractionList.length - 1, + Math.floor(getInteractionCountForNavigation() / 50), + ); + + return longestInteractionList[candidateInteractionIndex]; +}; + +/** + * Calculates the [INP](https://web.dev/responsiveness/) value for the current + * page and calls the `callback` function once the value is ready, along with + * the `event` performance entries reported for that interaction. The reported + * value is a `DOMHighResTimeStamp`. + * + * A custom `durationThreshold` configuration option can optionally be passed to + * control what `event-timing` entries are considered for INP reporting. The + * default threshold is `40`, which means INP scores of less than 40 are + * reported as 0. Note that this will not affect your 75th percentile INP value + * unless that value is also less than 40 (well below the recommended + * [good](https://web.dev/inp/#what-is-a-good-inp-score) threshold). + * + * If the `reportAllChanges` configuration option is set to `true`, the + * `callback` function will be called as soon as the value is initially + * determined as well as any time the value changes throughout the page + * lifespan. + * + * _**Important:** INP should be continually monitored for changes throughout + * the entire lifespan of a page—including if the user returns to the page after + * it's been hidden/backgrounded. However, since browsers often [will not fire + * additional callbacks once the user has backgrounded a + * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden), + * `callback` is always called when the page's visibility state changes to + * hidden. As a result, the `callback` function might be called multiple times + * during the same page load._ + */ +export const onINP = (onReport: ReportCallback, opts?: ReportOpts): void => { + // Set defaults + // eslint-disable-next-line no-param-reassign + opts = opts || {}; + + // https://web.dev/inp/#what's-a-%22good%22-inp-value + // const thresholds = [200, 500]; + + // TODO(philipwalton): remove once the polyfill is no longer needed. + initInteractionCountPolyfill(); + + const metric = initMetric('INP'); + // eslint-disable-next-line prefer-const + let report: ReturnType; + + const handleEntries = (entries: INPMetric['entries']): void => { + entries.forEach(entry => { + if (entry.interactionId) { + processEntry(entry); + } + + // Entries of type `first-input` don't currently have an `interactionId`, + // so to consider them in INP we have to first check that an existing + // entry doesn't match the `duration` and `startTime`. + // Note that this logic assumes that `event` entries are dispatched + // before `first-input` entries. This is true in Chrome but it is not + // true in Firefox; however, Firefox doesn't support interactionId, so + // it's not an issue at the moment. + // TODO(philipwalton): remove once crbug.com/1325826 is fixed. + if (entry.entryType === 'first-input') { + const noMatchingEntry = !longestInteractionList.some(interaction => { + return interaction.entries.some(prevEntry => { + return entry.duration === prevEntry.duration && entry.startTime === prevEntry.startTime; + }); + }); + if (noMatchingEntry) { + processEntry(entry); + } + } + }); + + const inp = estimateP98LongestInteraction(); + + if (inp && inp.latency !== metric.value) { + metric.value = inp.latency; + metric.entries = inp.entries; + report(); + } + }; + + const po = observe('event', handleEntries, { + // Event Timing entries have their durations rounded to the nearest 8ms, + // so a duration of 40ms would be any event that spans 2.5 or more frames + // at 60Hz. This threshold is chosen to strike a balance between usefulness + // and performance. Running this callback for any interaction that spans + // just one or two frames is likely not worth the insight that could be + // gained. + durationThreshold: opts.durationThreshold || 40, + } as PerformanceObserverInit); + + report = bindReporter(onReport, metric, opts.reportAllChanges); + + if (po) { + // Also observe entries of type `first-input`. This is useful in cases + // where the first interaction is less than the `durationThreshold`. + po.observe({ type: 'first-input', buffered: true }); + + onHidden(() => { + handleEntries(po.takeRecords() as INPMetric['entries']); + + // If the interaction count shows that there were interactions but + // none were captured by the PerformanceObserver, report a latency of 0. + if (metric.value < 0 && getInteractionCountForNavigation() > 0) { + metric.value = 0; + metric.entries = []; + } + + report(true); + }); + } +}; diff --git a/packages/tracing-internal/src/browser/web-vitals/lib/polyfills/interactionCountPolyfill.ts b/packages/tracing-internal/src/browser/web-vitals/lib/polyfills/interactionCountPolyfill.ts new file mode 100644 index 000000000000..f6f02c04817b --- /dev/null +++ b/packages/tracing-internal/src/browser/web-vitals/lib/polyfills/interactionCountPolyfill.ts @@ -0,0 +1,62 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { Metric } from '../../types'; +import { observe } from '../observe'; + +declare global { + interface Performance { + interactionCount: number; + } +} + +let interactionCountEstimate = 0; +let minKnownInteractionId = Infinity; +let maxKnownInteractionId = 0; + +const updateEstimate = (entries: Metric['entries']): void => { + (entries as PerformanceEventTiming[]).forEach(e => { + if (e.interactionId) { + minKnownInteractionId = Math.min(minKnownInteractionId, e.interactionId); + maxKnownInteractionId = Math.max(maxKnownInteractionId, e.interactionId); + + interactionCountEstimate = maxKnownInteractionId ? (maxKnownInteractionId - minKnownInteractionId) / 7 + 1 : 0; + } + }); +}; + +let po: PerformanceObserver | undefined; + +/** + * Returns the `interactionCount` value using the native API (if available) + * or the polyfill estimate in this module. + */ +export const getInteractionCount = (): number => { + return po ? interactionCountEstimate : performance.interactionCount || 0; +}; + +/** + * Feature detects native support or initializes the polyfill if needed. + */ +export const initInteractionCountPolyfill = (): void => { + if ('interactionCount' in performance || po) return; + + po = observe('event', updateEstimate, { + type: 'event', + buffered: true, + durationThreshold: 0, + } as PerformanceObserverInit); +}; diff --git a/packages/tracing-internal/src/browser/web-vitals/types/inp.ts b/packages/tracing-internal/src/browser/web-vitals/types/inp.ts new file mode 100644 index 000000000000..37e8333fb2d8 --- /dev/null +++ b/packages/tracing-internal/src/browser/web-vitals/types/inp.ts @@ -0,0 +1,80 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { LoadState, Metric, ReportCallback } from './base'; + +/** + * An INP-specific version of the Metric object. + */ +export interface INPMetric extends Metric { + name: 'INP'; + entries: PerformanceEventTiming[]; +} + +/** + * An object containing potentially-helpful debugging information that + * can be sent along with the INP value for the current page visit in order + * to help identify issues happening to real-users in the field. + */ +export interface INPAttribution { + /** + * A selector identifying the element that the user interacted with for + * the event corresponding to INP. This element will be the `target` of the + * `event` dispatched. + */ + eventTarget?: string; + /** + * The time when the user interacted for the event corresponding to INP. + * This time will match the `timeStamp` value of the `event` dispatched. + */ + eventTime?: number; + /** + * The `type` of the `event` dispatched corresponding to INP. + */ + eventType?: string; + /** + * The `PerformanceEventTiming` entry corresponding to INP. + */ + eventEntry?: PerformanceEventTiming; + /** + * The loading state of the document at the time when the even corresponding + * to INP occurred (see `LoadState` for details). If the interaction occurred + * while the document was loading and executing script (e.g. usually in the + * `dom-interactive` phase) it can result in long delays. + */ + loadState?: LoadState; +} + +/** + * An INP-specific version of the Metric object with attribution. + */ +export interface INPMetricWithAttribution extends INPMetric { + attribution: INPAttribution; +} + +/** + * An INP-specific version of the ReportCallback function. + */ +export interface INPReportCallback extends ReportCallback { + (metric: INPMetric): void; +} + +/** + * An INP-specific version of the ReportCallback function with attribution. + */ +export interface INPReportCallbackWithAttribution extends INPReportCallback { + (metric: INPMetricWithAttribution): void; +} From 8c3665957f6881b0d5c3608d7e4ed7787d522a5d Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Tue, 28 Nov 2023 16:25:56 -0500 Subject: [PATCH 15/20] build: add node.js v21 to test matrix (#9680) --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 690e076ce309..be11f358dc08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -466,7 +466,7 @@ jobs: strategy: fail-fast: false matrix: - node: [8, 10, 12, 14, 16, 18, 20] + node: [8, 10, 12, 14, 16, 18, 20, 21] steps: - name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }}) uses: actions/checkout@v4 @@ -498,7 +498,7 @@ jobs: strategy: fail-fast: false matrix: - node: [10, 12, 14, 16, 18, 20] + node: [10, 12, 14, 16, 18, 20, 21] steps: - name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }}) uses: actions/checkout@v4 @@ -733,7 +733,7 @@ jobs: strategy: fail-fast: false matrix: - node: [10, 12, 14, 16, 18, 20] + node: [10, 12, 14, 16, 18, 20, 21] typescript: - false include: @@ -774,7 +774,7 @@ jobs: strategy: fail-fast: false matrix: - node: [14, 16, 18, 20] + node: [14, 16, 18, 20, 21] remix: [1, 2] steps: - name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }}) From f500ac72477e8e7460982835d6ce8fa433d9eb03 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 29 Nov 2023 11:13:40 +0100 Subject: [PATCH 16/20] chore(astro): Add 4.0.0 preview versions to `astro` peer dependency range (#9696) --- packages/astro/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/package.json b/packages/astro/package.json index 1998947423ce..c4488f6a4028 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -40,7 +40,7 @@ "access": "public" }, "peerDependencies": { - "astro": ">=3.x" + "astro": ">=3.x || >=4.0.0-beta" }, "dependencies": { "@sentry/browser": "7.83.0", From 462ea441bbea3a8b2b4be378e8fced56fdc6a2c7 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Wed, 29 Nov 2023 14:51:45 +0100 Subject: [PATCH 17/20] ref(nextjs): Set `automaticVercelMonitors` to be `false` by default (#9697) --- packages/nextjs/src/config/types.ts | 2 +- packages/nextjs/src/config/webpack.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nextjs/src/config/types.ts b/packages/nextjs/src/config/types.ts index 7b439a3c5d44..c74990cb6a69 100644 --- a/packages/nextjs/src/config/types.ts +++ b/packages/nextjs/src/config/types.ts @@ -139,7 +139,7 @@ export type UserSentryOptions = { /** * Automatically create cron monitors in Sentry for your Vercel Cron Jobs if configured via `vercel.json`. * - * Defaults to `true`. + * Defaults to `false`. */ automaticVercelMonitors?: boolean; }; diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts index 45c8f3a0b4e3..63a4a8f27d86 100644 --- a/packages/nextjs/src/config/webpack.ts +++ b/packages/nextjs/src/config/webpack.ts @@ -220,7 +220,7 @@ export function constructWebpackConfigFunction( let vercelCronsConfig: VercelCronsConfig = undefined; try { - if (process.env.VERCEL && userSentryOptions.automaticVercelMonitors !== false) { + if (process.env.VERCEL && userSentryOptions.automaticVercelMonitors) { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access vercelCronsConfig = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'vercel.json'), 'utf8')).crons; if (vercelCronsConfig) { From 27f6ae1ed33a20b2129d00ef25ad4486d00b515e Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Wed, 29 Nov 2023 10:50:34 -0500 Subject: [PATCH 18/20] build: enable biome `organizeImports` feature (#9693) --- biome.json | 2 +- packages/angular-ivy/src/sdk.ts | 2 +- packages/angular/src/sdk.ts | 2 +- packages/angular/src/tracing.ts | 2 +- packages/angular/test/errorhandler.test.ts | 2 +- packages/angular/test/ivy-synced.test.ts | 2 +- packages/angular/test/tracing.test.ts | 2 +- packages/angular/test/utils/index.ts | 2 +- packages/astro/scripts/syncIntegration.ts | 2 +- packages/astro/src/integration/index.ts | 4 ++-- packages/astro/src/server/meta.ts | 2 +- packages/astro/test/client/sdk.test.ts | 2 +- .../loader/noOnLoad/sdkLoadedInMeanwhile/test.ts | 4 ++-- .../scripts/detectFlakyTests.ts | 4 ++-- .../suites/feedback/captureFeedback/init.js | 2 +- .../feedback/captureFeedbackAndReplay/init.js | 2 +- .../suites/manual-client/browser-context/init.js | 4 ++-- .../suites/replay/compressionWorkerUrl/test.ts | 4 ++-- .../suites/replay/errorResponse/test.ts | 2 +- .../suites/replay/eventBufferError/test.ts | 2 +- .../suites/wasm/test.ts | 2 +- .../browser-integration-tests/utils/fixtures.ts | 4 ++-- .../utils/generatePlugin.ts | 4 ++-- packages/browser/src/helpers.ts | 2 +- packages/browser/src/index.bundle.replay.ts | 2 +- .../browser/src/index.bundle.tracing.replay.ts | 2 +- packages/browser/src/index.bundle.tracing.ts | 2 +- packages/browser/src/index.bundle.ts | 2 +- packages/browser/src/integrations/breadcrumbs.ts | 2 +- packages/browser/src/profiling/hubextensions.ts | 2 +- packages/browser/src/profiling/utils.ts | 4 ++-- packages/browser/src/sdk.ts | 2 +- packages/browser/test/unit/index.test.ts | 10 +++++----- .../test/unit/integrations/breadcrumbs.test.ts | 2 +- packages/browser/test/unit/sdk.test.ts | 2 +- .../browser/test/unit/transports/fetch.test.ts | 2 +- .../browser/test/unit/transports/offline.test.ts | 2 +- .../browser/test/unit/transports/xhr.test.ts | 2 +- packages/bun/src/client.ts | 2 +- packages/bun/src/integrations/bunserver.ts | 2 +- packages/bun/src/sdk.ts | 2 +- packages/bun/test/integrations/bunserver.test.ts | 2 +- packages/core/src/baseclient.ts | 4 ++-- packages/core/src/eventProcessors.ts | 2 +- packages/core/src/hub.ts | 2 +- packages/core/src/tracing/transaction.ts | 2 +- packages/core/src/transports/base.ts | 2 +- packages/core/src/utils/prepareEvent.ts | 2 +- packages/core/test/lib/attachments.test.ts | 4 ++-- packages/core/test/lib/base.test.ts | 6 +++--- packages/core/test/lib/hint.test.ts | 2 +- packages/core/test/lib/integration.test.ts | 2 +- .../test/lib/integrations/inboundfilters.test.ts | 2 +- .../core/test/lib/integrations/metadata.test.ts | 8 ++++---- .../test/lib/integrations/requestdata.test.ts | 6 +++--- packages/core/test/lib/metadata.test.ts | 2 +- packages/core/test/lib/prepareEvent.test.ts | 2 +- packages/core/test/lib/sdk.test.ts | 2 +- packages/core/test/lib/tracing/errors.test.ts | 2 +- packages/core/test/lib/tracing/trace.test.ts | 4 ++-- packages/core/test/lib/transports/base.test.ts | 2 +- .../core/test/lib/transports/multiplexed.test.ts | 2 +- .../core/test/lib/transports/offline.test.ts | 4 ++-- packages/core/test/mocks/client.ts | 2 +- packages/core/test/mocks/transport.ts | 2 +- packages/deno/rollup.test.config.js | 4 ++-- packages/deno/rollup.types.config.js | 2 +- packages/deno/scripts/download-deno-types.mjs | 2 +- packages/deno/src/integrations/contextlines.ts | 2 +- packages/deno/src/sdk.ts | 2 +- packages/deno/test/mod.test.ts | 2 +- packages/e2e-tests/publish-packages.ts | 2 +- packages/e2e-tests/run.ts | 2 +- .../create-next-app/pages/_document.tsx | 2 +- .../create-next-app/pages/_error.tsx | 2 +- .../create-next-app/pages/api/success.ts | 2 +- .../create-next-app/pages/index.tsx | 2 +- .../tests/behaviour-client.test.ts | 2 +- .../tests/behaviour-server.test.ts | 2 +- .../create-react-app/src/App.tsx | 4 ++-- .../create-react-app/src/index.tsx | 6 +++--- .../create-remix-app-v2/app/entry.client.tsx | 4 ++-- .../create-remix-app-v2/app/entry.server.tsx | 6 +++--- .../create-remix-app-v2/app/root.tsx | 2 +- .../create-remix-app-v2/app/routes/_index.tsx | 2 +- .../tests/behaviour-client.test.ts | 2 +- .../create-remix-app/app/entry.client.tsx | 4 ++-- .../create-remix-app/app/entry.server.tsx | 4 ++-- .../create-remix-app/app/root.tsx | 2 +- .../create-remix-app/app/routes/_index.tsx | 2 +- .../tests/behaviour-client.test.ts | 2 +- .../debug-id-sourcemaps/rollup.config.mjs | 2 +- .../debug-id-sourcemaps/tests/server.test.ts | 2 +- .../nextjs-app-dir/app/layout.tsx | 2 +- .../components/client-error-debug-tools.tsx | 2 +- .../components/transaction-context.tsx | 4 ++-- .../nextjs-app-dir/event-proxy-server.ts | 4 ++-- .../tests/async-context-edge.test.ts | 4 ++-- .../client-app-routing-instrumentation.test.ts | 2 +- .../tests/devErrorSymbolification.test.ts | 2 +- .../nextjs-app-dir/tests/edge-route.test.ts | 4 ++-- .../nextjs-app-dir/tests/edge.test.ts | 2 +- .../nextjs-app-dir/tests/exceptions.test.ts | 4 ++-- .../nextjs-app-dir/tests/middleware.test.ts | 4 ++-- .../tests/pages-ssr-errors.test.ts | 2 +- .../nextjs-app-dir/tests/route-handlers.test.ts | 4 ++-- .../nextjs-app-dir/tests/transactions.test.ts | 4 ++-- .../event-proxy-server.ts | 4 ++-- .../tests/errors.test.ts | 2 +- .../tests/propagation.test.ts | 2 +- .../tests/transactions.test.ts | 4 ++-- .../node-express-app/event-proxy-server.ts | 4 ++-- .../node-express-app/src/app.ts | 2 +- .../node-express-app/tests/server.test.ts | 2 +- .../react-create-hash-router/src/index.tsx | 10 +++++----- .../react-create-hash-router/src/pages/Index.tsx | 2 +- .../tests/behaviour-test.spec.ts | 2 +- .../react-router-6-use-routes/src/index.tsx | 6 +++--- .../src/pages/Index.tsx | 2 +- .../tests/behaviour-test.spec.ts | 2 +- .../src/index.tsx | 12 ++++++------ .../src/pages/Index.tsx | 2 +- .../tests/behaviour-test.spec.ts | 2 +- .../standard-frontend-react/src/index.tsx | 10 +++++----- .../standard-frontend-react/src/pages/Index.tsx | 2 +- .../tests/behaviour-test.spec.ts | 2 +- .../sveltekit/event-proxy-server.ts | 4 ++-- .../sveltekit/test/transaction.test.ts | 4 ++-- .../test-applications/sveltekit/vite.config.js | 2 +- packages/e2e-tests/validate-test-app-setups.ts | 2 +- .../validate-verdaccio-configuration.ts | 2 +- .../instance-initializers/sentry-performance.ts | 2 +- .../test/unit/util/prepareFeedbackEvent.test.ts | 2 +- packages/gatsby/src/sdk.ts | 2 +- packages/gatsby/test/integration.test.tsx | 2 +- packages/gatsby/test/sdk.test.ts | 2 +- packages/hub/src/index.ts | 6 +++--- packages/hub/test/global.test.ts | 2 +- packages/hub/test/hub.test.ts | 2 +- packages/hub/test/scope.test.ts | 2 +- packages/integrations/src/captureconsole.ts | 4 ++-- packages/integrations/src/contextlines.ts | 2 +- packages/integrations/src/httpclient.ts | 4 ++-- .../integrations/test/captureconsole.test.ts | 2 +- packages/integrations/test/dedupe.test.ts | 2 +- packages/nextjs/playwright.config.ts | 2 +- packages/nextjs/src/client/index.ts | 2 +- .../routing/pagesRouterRoutingInstrumentation.ts | 2 +- packages/nextjs/src/common/utils/responseEnd.ts | 2 +- packages/nextjs/src/common/utils/wrapperUtils.ts | 2 +- .../nextjs/src/config/loaders/prefixLoader.ts | 2 +- .../nextjs/src/config/loaders/wrappingLoader.ts | 4 ++-- .../src/config/templates/apiWrapperTemplate.ts | 2 +- .../templates/middlewareWrapperTemplate.ts | 2 +- .../src/config/templates/pageWrapperTemplate.ts | 2 +- .../templates/routeHandlerWrapperTemplate.ts | 2 +- .../templates/serverComponentWrapperTemplate.ts | 4 ++-- packages/nextjs/src/config/webpack.ts | 4 ++-- packages/nextjs/src/edge/index.ts | 4 ++-- packages/nextjs/src/server/index.ts | 4 ++-- packages/nextjs/test/clientSdk.test.ts | 2 +- .../config/webpack/sentryWebpackPlugin.test.ts | 2 +- packages/nextjs/test/config/wrappers.test.ts | 2 +- .../test/integration/components/Layout.tsx | 4 ++-- .../nextjs/test/integration/components/List.tsx | 2 +- .../test/integration/components/ListItem.tsx | 2 +- .../test/integration/pages/api/requireTest.ts | 2 +- .../nextjs/test/integration/pages/users/[id].tsx | 6 +++--- .../test/integration/pages/users/index.tsx | 4 ++-- .../appDirTracingPageloadClientcomponent.test.ts | 4 ++-- .../appDirTracingPageloadServercomponent.test.ts | 4 ++-- .../integration/test/client/errorClick.test.ts | 4 ++-- .../integration/test/client/errorGlobal.test.ts | 4 ++-- ...faultyAppGetInitialPropsConfiguration.test.ts | 2 +- .../integration/test/client/reportDialog.test.ts | 2 +- .../test/client/sessionCrashed.test.ts | 4 ++-- .../test/client/sessionHealthy.test.ts | 4 ++-- .../test/client/sessionNavigate.test.ts | 4 ++-- .../client/tracingClientGetInitialProps.test.ts | 4 ++-- .../tracingClientGetServerSideProps.test.ts | 4 ++-- .../test/client/tracingDynamicRoute.test.ts | 4 ++-- .../integration/test/client/tracingFetch.test.ts | 4 ++-- .../test/client/tracingNavigate.test.ts | 4 ++-- .../test/client/tracingPageLoad.test.ts | 4 ++-- .../integration/test/server/tracingHttp.test.ts | 2 +- .../integration/test/server/utils/helpers.ts | 6 +++--- packages/nextjs/test/serverSdk.test.ts | 2 +- packages/nextjs/test/types/test.ts | 2 +- .../getAutoPerformanceIntegrations.ts | 2 +- .../node-experimental/src/integrations/http.ts | 2 +- packages/node-experimental/src/sdk/initOtel.ts | 4 ++-- .../node-experimental/src/sdk/spanProcessor.ts | 2 +- .../test/helpers/mockSdkInit.ts | 2 +- .../test/integration/transactions.test.ts | 4 ++-- .../node-integration-tests/suites/anr/test.ts | 4 ++-- .../suites/express/handle-error/test.ts | 2 +- .../common-infix-parameterized/test.ts | 2 +- .../multiple-routers/common-infix/test.ts | 2 +- .../common-prefix-parameterized-reverse/test.ts | 2 +- .../common-prefix-parameterized/test.ts | 2 +- .../test.ts | 2 +- .../test.ts | 2 +- .../multiple-routers/common-prefix/test.ts | 2 +- .../multiple-routers/complex-router/test.ts | 2 +- .../middle-layer-parameterized/test.ts | 2 +- .../sentry-trace/baggage-header-out/server.ts | 2 +- .../server.ts | 2 +- .../sentry-trace/baggage-other-vendors/server.ts | 2 +- .../baggage-transaction-name/server.ts | 2 +- .../suites/express/sentry-trace/server.ts | 2 +- .../sentry-trace/trace-header-assign/test.ts | 2 +- .../sentry-trace/trace-header-out/test.ts | 2 +- .../suites/express/tracing/test.ts | 2 +- .../suites/public-api/LocalVariables/test.ts | 2 +- .../public-api/addBreadcrumb/empty-obj/test.ts | 2 +- .../addBreadcrumb/multiple_breadcrumbs/test.ts | 2 +- .../addBreadcrumb/simple_breadcrumb/test.ts | 2 +- .../captureException/catched-error/test.ts | 2 +- .../captureException/empty-obj/test.ts | 2 +- .../captureException/simple-error/test.ts | 2 +- .../captureMessage/simple_message/test.ts | 2 +- .../public-api/captureMessage/with_level/test.ts | 2 +- .../configureScope/clear_scope/test.ts | 2 +- .../configureScope/set_properties/test.ts | 2 +- .../setContext/multiple-contexts/test.ts | 2 +- .../setContext/non-serializable-context/test.ts | 2 +- .../public-api/setContext/simple-context/test.ts | 2 +- .../public-api/setExtra/multiple-extras/test.ts | 2 +- .../setExtra/non-serializable-extra/test.ts | 2 +- .../public-api/setExtra/simple-extra/test.ts | 2 +- .../setExtras/consecutive-calls/test.ts | 2 +- .../public-api/setExtras/multiple-extras/test.ts | 2 +- .../public-api/setTag/with-primitives/test.ts | 2 +- .../public-api/setTags/with-primitives/test.ts | 2 +- .../suites/public-api/setUser/unset_user/test.ts | 2 +- .../public-api/setUser/update_user/test.ts | 2 +- .../startTransaction/basic-usage/test.ts | 2 +- .../startTransaction/with-nested-spans/test.ts | 2 +- .../public-api/withScope/nested-scopes/test.ts | 2 +- .../sessions/crashed-session-aggregate/test.ts | 2 +- .../sessions/exited-session-aggregate/test.ts | 2 +- .../suites/tracing-new/apollo-graphql/test.ts | 2 +- .../tracing-new/auto-instrument/mongodb/test.ts | 2 +- .../auto-instrument/mysql/withConnect/test.ts | 2 +- .../mysql/withoutCallback/test.ts | 2 +- .../auto-instrument/mysql/withoutConnect/test.ts | 2 +- .../tracing-new/auto-instrument/pg/test.ts | 2 +- .../suites/tracing-new/prisma-orm/scenario.ts | 2 +- .../suites/tracing-new/prisma-orm/setup.ts | 2 +- .../suites/tracing-new/prisma-orm/test.ts | 2 +- .../tracePropagationTargets/scenario.ts | 2 +- .../tracing-new/tracePropagationTargets/test.ts | 2 +- .../suites/tracing/apollo-graphql/test.ts | 2 +- .../tracing/auto-instrument/mongodb/test.ts | 2 +- .../suites/tracing/auto-instrument/mysql/test.ts | 2 +- .../suites/tracing/auto-instrument/pg/test.ts | 2 +- .../suites/tracing/prisma-orm/scenario.ts | 2 +- .../suites/tracing/prisma-orm/setup.ts | 2 +- .../suites/tracing/prisma-orm/test.ts | 2 +- .../tracing/tracePropagationTargets/scenario.ts | 2 +- .../tracing/tracePropagationTargets/test.ts | 2 +- packages/node-integration-tests/utils/index.ts | 6 +++--- packages/node/src/anr/index.ts | 2 +- packages/node/src/async/domain.ts | 2 +- packages/node/src/client.ts | 4 ++-- packages/node/src/handlers.ts | 2 +- packages/node/src/integrations/console.ts | 2 +- packages/node/src/integrations/context.ts | 10 +++++----- packages/node/src/integrations/contextlines.ts | 4 ++-- packages/node/src/integrations/http.ts | 6 +++--- packages/node/src/integrations/localvariables.ts | 2 +- packages/node/src/integrations/modules.ts | 2 +- packages/node/src/integrations/spotlight.ts | 4 ++-- packages/node/src/integrations/undici/index.ts | 2 +- packages/node/src/integrations/undici/types.ts | 2 +- packages/node/src/sdk.ts | 4 ++-- packages/node/src/transports/http.ts | 10 +++++----- packages/node/test/client.test.ts | 2 +- packages/node/test/context-lines.test.ts | 2 +- packages/node/test/eventbuilders.test.ts | 2 +- packages/node/test/handlers.test.ts | 4 ++-- packages/node/test/index.test.ts | 4 ++-- packages/node/test/integrations/http.test.ts | 8 ++++---- .../test/integrations/localvariables.test.ts | 2 +- .../node/test/integrations/requestdata.test.ts | 4 ++-- .../node/test/integrations/spotlight.test.ts | 2 +- packages/node/test/integrations/undici.test.ts | 2 +- packages/node/test/requestdata.test.ts | 2 +- packages/node/test/transports/http.test.ts | 6 +++--- packages/node/test/transports/https.test.ts | 6 +++--- packages/opentelemetry-node/src/propagator.ts | 6 +++--- packages/opentelemetry-node/src/spanprocessor.ts | 4 ++-- .../src/utils/parseOtelSpanDescription.ts | 2 +- .../opentelemetry-node/test/propagator.test.ts | 8 ++++---- .../test/spanprocessor.test.ts | 8 ++++---- packages/opentelemetry/src/custom/hub.ts | 2 +- packages/opentelemetry/src/propagator.ts | 6 +++--- packages/opentelemetry/src/sampler.ts | 2 +- .../src/utils/parseSpanDescription.ts | 2 +- .../test/asyncContextStrategy.test.ts | 2 +- .../opentelemetry/test/custom/client.test.ts | 2 +- packages/opentelemetry/test/custom/hub.test.ts | 2 +- .../test/custom/hubextensions.test.ts | 2 +- .../test/custom/transaction.test.ts | 2 +- packages/opentelemetry/test/helpers/initOtel.ts | 2 +- .../opentelemetry/test/helpers/mockSdkInit.ts | 4 ++-- .../test/integration/breadcrumbs.test.ts | 4 ++-- .../test/integration/otelTimedEvents.test.ts | 2 +- .../opentelemetry/test/integration/scope.test.ts | 4 ++-- .../test/integration/transactions.test.ts | 4 ++-- packages/opentelemetry/test/propagator.test.ts | 6 +++--- packages/opentelemetry/test/trace.test.ts | 2 +- .../test/utils/getActiveSpan.test.ts | 2 +- .../test/utils/setupEventContextTrace.test.ts | 4 ++-- packages/overhead-metrics/configs/ci/process.ts | 2 +- packages/overhead-metrics/src/util/github.ts | 4 ++-- packages/react/src/sdk.ts | 2 +- packages/react/test/errorboundary.test.tsx | 4 ++-- packages/react/test/reactrouterv3.test.tsx | 2 +- packages/react/test/reactrouterv4.test.tsx | 2 +- packages/react/test/reactrouterv5.test.tsx | 2 +- packages/react/test/reactrouterv6.4.test.tsx | 4 ++-- packages/react/test/reactrouterv6.test.tsx | 6 +++--- packages/remix/src/utils/vendor/types.ts | 2 +- packages/remix/test/index.server.test.ts | 2 +- .../test/integration/app_v1/entry.client.tsx | 2 +- .../test/integration/app_v1/entry.server.tsx | 2 +- packages/remix/test/integration/app_v1/root.tsx | 2 +- .../test/integration/app_v2/entry.client.tsx | 2 +- .../test/integration/app_v2/entry.server.tsx | 4 ++-- packages/remix/test/integration/app_v2/root.tsx | 2 +- .../common/routes/action-json-response.$id.tsx | 2 +- .../common/routes/loader-defer-response.$id.tsx | 2 +- .../common/routes/loader-json-response.$id.tsx | 2 +- .../common/routes/scope-bleed.$id.tsx | 2 +- .../test/client/capture-exception.test.ts | 4 ++-- .../test/client/capture-message.test.ts | 4 ++-- .../test/client/deferred-response.test.ts | 2 +- .../test/client/errorboundary.test.ts | 4 ++-- .../test/client/manualtracing.test.ts | 4 ++-- .../integration/test/client/meta-tags.test.ts | 4 ++-- .../integration/test/client/pageload.test.ts | 4 ++-- .../integration/test/client/root-loader.test.ts | 2 +- .../test/integration/test/server/action.test.ts | 2 +- .../test/integration/test/server/loader.test.ts | 2 +- .../integration/test/server/utils/helpers.ts | 6 +++--- packages/replay-worker/rollup.examples.config.js | 2 +- packages/replay-worker/rollup.worker.config.js | 2 +- packages/replay-worker/src/Compressor.ts | 2 +- packages/replay-worker/src/handleMessage.ts | 2 +- packages/replay/jest.setup.ts | 2 +- .../replay/src/coreHandlers/util/xhrUtils.ts | 2 +- .../eventBuffer/EventBufferCompressionWorker.ts | 2 +- packages/replay/src/replay.ts | 2 +- packages/replay/src/session/createSession.ts | 2 +- packages/replay/src/util/sendReplay.ts | 2 +- .../handleNetworkBreadcrumbs.test.ts | 2 +- .../EventBufferCompressionWorker.test.ts | 2 +- .../unit/session/loadOrCreateSession.test.ts | 2 +- .../replay/test/unit/session/saveSession.test.ts | 2 +- .../test/unit/session/sessionSampling.test.ts | 2 +- .../test/unit/util/prepareReplayEvent.test.ts | 2 +- packages/replay/test/unit/util/throttle.test.ts | 2 +- packages/serverless/rollup.aws.config.js | 2 +- packages/serverless/src/awslambda.ts | 8 ++++---- packages/serverless/src/google-cloud-grpc.ts | 2 +- packages/serverless/test/gcpfunction.test.ts | 2 +- .../serverless/test/google-cloud-grpc.test.ts | 6 +++--- .../serverless/test/google-cloud-http.test.ts | 4 ++-- packages/svelte/src/sdk.ts | 2 +- packages/svelte/test/config.test.ts | 2 +- packages/svelte/test/preprocessors.test.ts | 2 +- packages/sveltekit/src/client/sdk.ts | 2 +- packages/sveltekit/src/server/utils.ts | 2 +- packages/sveltekit/src/vite/autoInstrument.ts | 4 ++-- packages/sveltekit/src/vite/detectAdapter.ts | 2 +- packages/sveltekit/src/vite/sourceMaps.ts | 8 ++++---- packages/sveltekit/src/vite/svelteConfig.ts | 2 +- packages/sveltekit/test/server/handle.test.ts | 2 +- .../src/browser/browsertracing.ts | 2 +- packages/tracing-internal/src/browser/request.ts | 4 ++-- .../src/node/integrations/express.ts | 2 +- .../test/browser/browsertracing.test.ts | 2 +- .../test/browser/request.test.ts | 2 +- packages/tracing/src/index.ts | 16 ++++++++-------- packages/tracing/test/hub.test.ts | 2 +- packages/tracing/test/span.test.ts | 2 +- packages/tracing/test/transaction.test.ts | 2 +- packages/utils/src/instrument/index.ts | 4 ++-- packages/utils/src/promisebuffer.ts | 2 +- packages/utils/test/clientreport.test.ts | 2 +- packages/utils/test/envelope.test.ts | 2 +- packages/utils/test/syncpromise.test.ts | 2 +- .../src/integrations/wintercg-fetch.ts | 2 +- packages/vercel-edge/src/sdk.ts | 4 ++-- .../vercel-edge/test/transports/index.test.ts | 2 +- packages/vue/src/integration.ts | 2 +- packages/vue/src/router.ts | 2 +- packages/vue/src/sdk.ts | 2 +- rollup/bundleHelpers.js | 10 +++++----- rollup/npmHelpers.js | 6 +++--- rollup/plugins/bundlePlugins.js | 6 +++--- rollup/plugins/npmPlugins.js | 2 +- 403 files changed, 580 insertions(+), 580 deletions(-) diff --git a/biome.json b/biome.json index 4950ee06f24c..4a6857b2325c 100644 --- a/biome.json +++ b/biome.json @@ -6,7 +6,7 @@ "useIgnoreFile": true }, "organizeImports": { - "enabled": false + "enabled": true }, "linter": { "enabled": false diff --git a/packages/angular-ivy/src/sdk.ts b/packages/angular-ivy/src/sdk.ts index b2dc1f5f34d8..0b222339f45d 100644 --- a/packages/angular-ivy/src/sdk.ts +++ b/packages/angular-ivy/src/sdk.ts @@ -1,6 +1,6 @@ import { VERSION } from '@angular/core'; import type { BrowserOptions } from '@sentry/browser'; -import { defaultIntegrations, init as browserInit, SDK_VERSION, setContext } from '@sentry/browser'; +import { SDK_VERSION, defaultIntegrations, init as browserInit, setContext } from '@sentry/browser'; import type { SdkMetadata } from '@sentry/types'; import { logger } from '@sentry/utils'; diff --git a/packages/angular/src/sdk.ts b/packages/angular/src/sdk.ts index 975ec24e38d3..c448daa037d7 100755 --- a/packages/angular/src/sdk.ts +++ b/packages/angular/src/sdk.ts @@ -1,6 +1,6 @@ import { VERSION } from '@angular/core'; import type { BrowserOptions } from '@sentry/browser'; -import { defaultIntegrations, init as browserInit, SDK_VERSION, setContext } from '@sentry/browser'; +import { SDK_VERSION, defaultIntegrations, init as browserInit, setContext } from '@sentry/browser'; import type { SdkMetadata } from '@sentry/types'; import { logger } from '@sentry/utils'; diff --git a/packages/angular/src/tracing.ts b/packages/angular/src/tracing.ts index 6facf143c3e6..88a2490c1d58 100644 --- a/packages/angular/src/tracing.ts +++ b/packages/angular/src/tracing.ts @@ -7,7 +7,7 @@ import type { ActivatedRouteSnapshot, Event, RouterState } from '@angular/router // eslint-disable-next-line @typescript-eslint/consistent-type-imports import { NavigationCancel, NavigationError, Router } from '@angular/router'; import { NavigationEnd, NavigationStart, ResolveEnd } from '@angular/router'; -import { getCurrentHub, WINDOW } from '@sentry/browser'; +import { WINDOW, getCurrentHub } from '@sentry/browser'; import type { Span, Transaction, TransactionContext } from '@sentry/types'; import { logger, stripUrlQueryAndFragment, timestampInSeconds } from '@sentry/utils'; import type { Observable } from 'rxjs'; diff --git a/packages/angular/test/errorhandler.test.ts b/packages/angular/test/errorhandler.test.ts index a4e16a4e9c66..bba65056cba8 100644 --- a/packages/angular/test/errorhandler.test.ts +++ b/packages/angular/test/errorhandler.test.ts @@ -2,7 +2,7 @@ import { HttpErrorResponse } from '@angular/common/http'; import * as SentryBrowser from '@sentry/browser'; import type { Client, Event } from '@sentry/types'; -import { createErrorHandler, SentryErrorHandler } from '../src/errorhandler'; +import { SentryErrorHandler, createErrorHandler } from '../src/errorhandler'; const captureExceptionSpy = jest.spyOn(SentryBrowser, 'captureException'); diff --git a/packages/angular/test/ivy-synced.test.ts b/packages/angular/test/ivy-synced.test.ts index be0c6463c3ec..4f074d4792e0 100644 --- a/packages/angular/test/ivy-synced.test.ts +++ b/packages/angular/test/ivy-synced.test.ts @@ -1,6 +1,6 @@ import * as fs from 'fs'; -import * as glob from 'glob'; import * as path from 'path'; +import * as glob from 'glob'; describe('@sentry/angular-ivy', () => { /* diff --git a/packages/angular/test/tracing.test.ts b/packages/angular/test/tracing.test.ts index e1796f617150..e290850241c8 100644 --- a/packages/angular/test/tracing.test.ts +++ b/packages/angular/test/tracing.test.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import type { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot } from '@angular/router'; import type { Hub } from '@sentry/types'; -import { instrumentAngularRouting, TraceClassDecorator, TraceDirective, TraceMethodDecorator } from '../src'; +import { TraceClassDecorator, TraceDirective, TraceMethodDecorator, instrumentAngularRouting } from '../src'; import { getParameterizedRouteFromSnapshot } from '../src/tracing'; import { AppComponent, TestEnv } from './utils/index'; diff --git a/packages/angular/test/utils/index.ts b/packages/angular/test/utils/index.ts index daa23155d931..83a416ca2a03 100644 --- a/packages/angular/test/utils/index.ts +++ b/packages/angular/test/utils/index.ts @@ -7,7 +7,7 @@ import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import type { Transaction } from '@sentry/types'; -import { instrumentAngularRouting, TraceService } from '../../src'; +import { TraceService, instrumentAngularRouting } from '../../src'; @Component({ template: '', diff --git a/packages/astro/scripts/syncIntegration.ts b/packages/astro/scripts/syncIntegration.ts index 006d9b3237ac..2273147f7ed7 100644 --- a/packages/astro/scripts/syncIntegration.ts +++ b/packages/astro/scripts/syncIntegration.ts @@ -1,7 +1,7 @@ /* eslint-disable no-console */ -import * as fse from 'fs-extra'; import * as path from 'path'; +import * as fse from 'fs-extra'; const buildDir = path.resolve('build'); const srcIntegrationDir = path.resolve(path.join('src', 'integration')); diff --git a/packages/astro/src/integration/index.ts b/packages/astro/src/integration/index.ts index e2d177e2b575..303251b9a933 100644 --- a/packages/astro/src/integration/index.ts +++ b/packages/astro/src/integration/index.ts @@ -1,8 +1,8 @@ +import * as fs from 'fs'; +import * as path from 'path'; /* eslint-disable no-console */ import { sentryVitePlugin } from '@sentry/vite-plugin'; import type { AstroConfig, AstroIntegration } from 'astro'; -import * as fs from 'fs'; -import * as path from 'path'; import { buildClientSnippet, buildSdkInitFileImportSnippet, buildServerSnippet } from './snippets'; import type { SentryOptions } from './types'; diff --git a/packages/astro/src/server/meta.ts b/packages/astro/src/server/meta.ts index 03406fd3d23c..4264be2733f5 100644 --- a/packages/astro/src/server/meta.ts +++ b/packages/astro/src/server/meta.ts @@ -1,10 +1,10 @@ import { getDynamicSamplingContextFromClient } from '@sentry/core'; import type { Hub, Span } from '@sentry/types'; import { + TRACEPARENT_REGEXP, dynamicSamplingContextToSentryBaggageHeader, generateSentryTraceHeader, logger, - TRACEPARENT_REGEXP, } from '@sentry/utils'; /** diff --git a/packages/astro/test/client/sdk.test.ts b/packages/astro/test/client/sdk.test.ts index d35c501415c7..d2f745c55a89 100644 --- a/packages/astro/test/client/sdk.test.ts +++ b/packages/astro/test/client/sdk.test.ts @@ -1,6 +1,6 @@ import type { BrowserClient } from '@sentry/browser'; import * as SentryBrowser from '@sentry/browser'; -import { BrowserTracing, getClient, getCurrentHub, SDK_VERSION, WINDOW } from '@sentry/browser'; +import { BrowserTracing, SDK_VERSION, WINDOW, getClient, getCurrentHub } from '@sentry/browser'; import { vi } from 'vitest'; import { init } from '../../../astro/src/client/sdk'; diff --git a/packages/browser-integration-tests/loader-suites/loader/noOnLoad/sdkLoadedInMeanwhile/test.ts b/packages/browser-integration-tests/loader-suites/loader/noOnLoad/sdkLoadedInMeanwhile/test.ts index 84f8d7869f60..db832e2aa9f1 100644 --- a/packages/browser-integration-tests/loader-suites/loader/noOnLoad/sdkLoadedInMeanwhile/test.ts +++ b/packages/browser-integration-tests/loader-suites/loader/noOnLoad/sdkLoadedInMeanwhile/test.ts @@ -1,8 +1,8 @@ -import { expect } from '@playwright/test'; import fs from 'fs'; import path from 'path'; +import { expect } from '@playwright/test'; -import { sentryTest, TEST_HOST } from '../../../../utils/fixtures'; +import { TEST_HOST, sentryTest } from '../../../../utils/fixtures'; import { LOADER_CONFIGS } from '../../../../utils/generatePlugin'; import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers'; diff --git a/packages/browser-integration-tests/scripts/detectFlakyTests.ts b/packages/browser-integration-tests/scripts/detectFlakyTests.ts index 9fcf2baea7f9..8059b4841176 100644 --- a/packages/browser-integration-tests/scripts/detectFlakyTests.ts +++ b/packages/browser-integration-tests/scripts/detectFlakyTests.ts @@ -1,6 +1,6 @@ -import * as glob from 'glob'; -import * as path from 'path'; import * as childProcess from 'child_process'; +import * as path from 'path'; +import * as glob from 'glob'; async function run(): Promise { let testPaths: string[] = []; diff --git a/packages/browser-integration-tests/suites/feedback/captureFeedback/init.js b/packages/browser-integration-tests/suites/feedback/captureFeedback/init.js index 6c9382f04575..e64314facd79 100644 --- a/packages/browser-integration-tests/suites/feedback/captureFeedback/init.js +++ b/packages/browser-integration-tests/suites/feedback/captureFeedback/init.js @@ -1,5 +1,5 @@ -import * as Sentry from '@sentry/browser'; import { Feedback } from '@sentry-internal/feedback'; +import * as Sentry from '@sentry/browser'; window.Sentry = Sentry; diff --git a/packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/init.js b/packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/init.js index cceaaea1a373..9428907f51e7 100644 --- a/packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/init.js +++ b/packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/init.js @@ -1,5 +1,5 @@ -import * as Sentry from '@sentry/browser'; import { Feedback } from '@sentry-internal/feedback'; +import * as Sentry from '@sentry/browser'; window.Sentry = Sentry; diff --git a/packages/browser-integration-tests/suites/manual-client/browser-context/init.js b/packages/browser-integration-tests/suites/manual-client/browser-context/init.js index 62c9d3843161..d176abb81e23 100644 --- a/packages/browser-integration-tests/suites/manual-client/browser-context/init.js +++ b/packages/browser-integration-tests/suites/manual-client/browser-context/init.js @@ -1,14 +1,14 @@ import { - BrowserClient, Breadcrumbs, + BrowserClient, Dedupe, FunctionToString, HttpContext, + Hub, InboundFilters, LinkedErrors, defaultStackParser, makeFetchTransport, - Hub, } from '@sentry/browser'; const integrations = [ diff --git a/packages/browser-integration-tests/suites/replay/compressionWorkerUrl/test.ts b/packages/browser-integration-tests/suites/replay/compressionWorkerUrl/test.ts index 006e70bed4ee..f9474f7ae4c4 100644 --- a/packages/browser-integration-tests/suites/replay/compressionWorkerUrl/test.ts +++ b/packages/browser-integration-tests/suites/replay/compressionWorkerUrl/test.ts @@ -1,8 +1,8 @@ -import { expect } from '@playwright/test'; import fs from 'fs'; import path from 'path'; +import { expect } from '@playwright/test'; -import { sentryTest, TEST_HOST } from '../../../utils/fixtures'; +import { TEST_HOST, sentryTest } from '../../../utils/fixtures'; import { getExpectedReplayEvent } from '../../../utils/replayEventTemplates'; import { getFullRecordingSnapshots, diff --git a/packages/browser-integration-tests/suites/replay/errorResponse/test.ts b/packages/browser-integration-tests/suites/replay/errorResponse/test.ts index 2c40666096ee..2037f67c4530 100644 --- a/packages/browser-integration-tests/suites/replay/errorResponse/test.ts +++ b/packages/browser-integration-tests/suites/replay/errorResponse/test.ts @@ -2,8 +2,8 @@ import { expect } from '@playwright/test'; import { sentryTest } from '../../../utils/fixtures'; import { - getReplaySnapshot, REPLAY_DEFAULT_FLUSH_MAX_DELAY, + getReplaySnapshot, shouldSkipReplayTest, waitForReplayRequest, } from '../../../utils/replayHelpers'; diff --git a/packages/browser-integration-tests/suites/replay/eventBufferError/test.ts b/packages/browser-integration-tests/suites/replay/eventBufferError/test.ts index 954d257bf202..639df9d91401 100644 --- a/packages/browser-integration-tests/suites/replay/eventBufferError/test.ts +++ b/packages/browser-integration-tests/suites/replay/eventBufferError/test.ts @@ -3,11 +3,11 @@ import { expect } from '@playwright/test'; import { sentryTest } from '../../../utils/fixtures'; import { envelopeRequestParser } from '../../../utils/helpers'; import { + REPLAY_DEFAULT_FLUSH_MAX_DELAY, getDecompressedRecordingEvents, getReplaySnapshot, isCustomSnapshot, isReplayEvent, - REPLAY_DEFAULT_FLUSH_MAX_DELAY, shouldSkipReplayTest, waitForReplayRequest, } from '../../../utils/replayHelpers'; diff --git a/packages/browser-integration-tests/suites/wasm/test.ts b/packages/browser-integration-tests/suites/wasm/test.ts index 9ecad4c8b5cf..702b22a77a74 100644 --- a/packages/browser-integration-tests/suites/wasm/test.ts +++ b/packages/browser-integration-tests/suites/wasm/test.ts @@ -1,6 +1,6 @@ -import { expect } from '@playwright/test'; import fs from 'fs'; import path from 'path'; +import { expect } from '@playwright/test'; import { sentryTest } from '../../utils/fixtures'; import { shouldSkipWASMTests } from '../../utils/wasmHelpers'; diff --git a/packages/browser-integration-tests/utils/fixtures.ts b/packages/browser-integration-tests/utils/fixtures.ts index ae0c8eab3df7..0b5943514a3e 100644 --- a/packages/browser-integration-tests/utils/fixtures.ts +++ b/packages/browser-integration-tests/utils/fixtures.ts @@ -1,7 +1,7 @@ -/* eslint-disable no-empty-pattern */ -import { test as base } from '@playwright/test'; import fs from 'fs'; import path from 'path'; +/* eslint-disable no-empty-pattern */ +import { test as base } from '@playwright/test'; import { generatePage } from './generatePage'; diff --git a/packages/browser-integration-tests/utils/generatePlugin.ts b/packages/browser-integration-tests/utils/generatePlugin.ts index 45fe1cfb9a94..af4da2e8b2b8 100644 --- a/packages/browser-integration-tests/utils/generatePlugin.ts +++ b/packages/browser-integration-tests/utils/generatePlugin.ts @@ -1,7 +1,7 @@ -import type { Package } from '@sentry/types'; import fs from 'fs'; -import HtmlWebpackPlugin, { createHtmlTagObject } from 'html-webpack-plugin'; import path from 'path'; +import type { Package } from '@sentry/types'; +import HtmlWebpackPlugin, { createHtmlTagObject } from 'html-webpack-plugin'; import type { Compiler } from 'webpack'; import { addStaticAsset, addStaticAssetSymlink } from './staticAssets'; diff --git a/packages/browser/src/helpers.ts b/packages/browser/src/helpers.ts index a804508a0832..2ba47baa0c3b 100644 --- a/packages/browser/src/helpers.ts +++ b/packages/browser/src/helpers.ts @@ -1,11 +1,11 @@ import { captureException, withScope } from '@sentry/core'; import type { DsnLike, Mechanism, WrappedFunction } from '@sentry/types'; import { + GLOBAL_OBJ, addExceptionMechanism, addExceptionTypeValue, addNonEnumerableProperty, getOriginalFunction, - GLOBAL_OBJ, markFunctionWrapped, } from '@sentry/utils'; diff --git a/packages/browser/src/index.bundle.replay.ts b/packages/browser/src/index.bundle.replay.ts index affadece35da..d6fdaf26ceb0 100644 --- a/packages/browser/src/index.bundle.replay.ts +++ b/packages/browser/src/index.bundle.replay.ts @@ -1,5 +1,5 @@ // This is exported so the loader does not fail when switching off Replay/Tracing -import { addTracingExtensions, BrowserTracing } from '@sentry-internal/integration-shims'; +import { BrowserTracing, addTracingExtensions } from '@sentry-internal/integration-shims'; import { Replay } from '@sentry/replay'; import * as Sentry from './index.bundle.base'; diff --git a/packages/browser/src/index.bundle.tracing.replay.ts b/packages/browser/src/index.bundle.tracing.replay.ts index 418aeb61bd18..ee9100e53a8d 100644 --- a/packages/browser/src/index.bundle.tracing.replay.ts +++ b/packages/browser/src/index.bundle.tracing.replay.ts @@ -1,4 +1,4 @@ -import { addExtensionMethods, BrowserTracing, Span } from '@sentry-internal/tracing'; +import { BrowserTracing, Span, addExtensionMethods } from '@sentry-internal/tracing'; import { Replay } from '@sentry/replay'; import * as Sentry from './index.bundle.base'; diff --git a/packages/browser/src/index.bundle.tracing.ts b/packages/browser/src/index.bundle.tracing.ts index 3aa5d960d19a..167df17380b5 100644 --- a/packages/browser/src/index.bundle.tracing.ts +++ b/packages/browser/src/index.bundle.tracing.ts @@ -1,6 +1,6 @@ // This is exported so the loader does not fail when switching off Replay import { Replay } from '@sentry-internal/integration-shims'; -import { addExtensionMethods, BrowserTracing, Span } from '@sentry-internal/tracing'; +import { BrowserTracing, Span, addExtensionMethods } from '@sentry-internal/tracing'; import * as Sentry from './index.bundle.base'; diff --git a/packages/browser/src/index.bundle.ts b/packages/browser/src/index.bundle.ts index 869139e7e591..4bb272b5cc49 100644 --- a/packages/browser/src/index.bundle.ts +++ b/packages/browser/src/index.bundle.ts @@ -1,5 +1,5 @@ // This is exported so the loader does not fail when switching off Replay/Tracing -import { addTracingExtensions, BrowserTracing, Replay } from '@sentry-internal/integration-shims'; +import { BrowserTracing, Replay, addTracingExtensions } from '@sentry-internal/integration-shims'; import * as Sentry from './index.bundle.base'; diff --git a/packages/browser/src/integrations/breadcrumbs.ts b/packages/browser/src/integrations/breadcrumbs.ts index 2679cabed5f5..1a817cceb5b5 100644 --- a/packages/browser/src/integrations/breadcrumbs.ts +++ b/packages/browser/src/integrations/breadcrumbs.ts @@ -16,6 +16,7 @@ import type { XhrBreadcrumbHint, } from '@sentry/types/build/types/breadcrumb'; import { + SENTRY_XHR_DATA_KEY, addClickKeypressInstrumentationHandler, addConsoleInstrumentationHandler, addFetchInstrumentationHandler, @@ -26,7 +27,6 @@ import { logger, parseUrl, safeJoin, - SENTRY_XHR_DATA_KEY, severityLevelFromString, } from '@sentry/utils'; diff --git a/packages/browser/src/profiling/hubextensions.ts b/packages/browser/src/profiling/hubextensions.ts index 82492081b924..99e2772c8f25 100644 --- a/packages/browser/src/profiling/hubextensions.ts +++ b/packages/browser/src/profiling/hubextensions.ts @@ -6,9 +6,9 @@ import { DEBUG_BUILD } from '../debug-build'; import { WINDOW } from '../helpers'; import type { JSSelfProfile } from './jsSelfProfiling'; import { + MAX_PROFILE_DURATION_MS, addProfileToGlobalCache, isAutomatedPageLoadTransaction, - MAX_PROFILE_DURATION_MS, shouldProfileTransaction, startJSSelfProfile, } from './utils'; diff --git a/packages/browser/src/profiling/utils.ts b/packages/browser/src/profiling/utils.ts index 9bd1c7f8e859..c7f056868732 100644 --- a/packages/browser/src/profiling/utils.ts +++ b/packages/browser/src/profiling/utils.ts @@ -3,12 +3,12 @@ import { DEFAULT_ENVIRONMENT, getCurrentHub } from '@sentry/core'; import type { DebugImage, Envelope, Event, StackFrame, StackParser, Transaction } from '@sentry/types'; import type { Profile, ThreadCpuProfile } from '@sentry/types/src/profiling'; -import { browserPerformanceTimeOrigin, forEachEnvelopeItem, GLOBAL_OBJ, logger, uuid4 } from '@sentry/utils'; +import { GLOBAL_OBJ, browserPerformanceTimeOrigin, forEachEnvelopeItem, logger, uuid4 } from '@sentry/utils'; import { DEBUG_BUILD } from '../debug-build'; import { getClient } from '../exports'; import { WINDOW } from '../helpers'; -import type { JSSelfProfile, JSSelfProfiler, JSSelfProfilerConstructor, JSSelfProfileStack } from './jsSelfProfiling'; +import type { JSSelfProfile, JSSelfProfileStack, JSSelfProfiler, JSSelfProfilerConstructor } from './jsSelfProfiling'; const MS_TO_NS = 1e6; // Use 0 as main thread id which is identical to threadId in node:worker_threads diff --git a/packages/browser/src/sdk.ts b/packages/browser/src/sdk.ts index 2bee5912e15e..fd21a8da7500 100644 --- a/packages/browser/src/sdk.ts +++ b/packages/browser/src/sdk.ts @@ -1,11 +1,11 @@ import type { Hub } from '@sentry/core'; import { + Integrations as CoreIntegrations, getClient, getCurrentHub, getIntegrationsToSetup, getReportDialogEndpoint, initAndBind, - Integrations as CoreIntegrations, } from '@sentry/core'; import type { UserFeedback } from '@sentry/types'; import { diff --git a/packages/browser/test/unit/index.test.ts b/packages/browser/test/unit/index.test.ts index 75ab0f294f66..bc0058ba7d16 100644 --- a/packages/browser/test/unit/index.test.ts +++ b/packages/browser/test/unit/index.test.ts @@ -1,11 +1,14 @@ -import { getReportDialogEndpoint, SDK_VERSION } from '@sentry/core'; +import { SDK_VERSION, getReportDialogEndpoint } from '@sentry/core'; import type { WrappedFunction } from '@sentry/types'; import * as utils from '@sentry/utils'; import type { Event } from '../../src'; import { - addBreadcrumb, BrowserClient, + Integrations, + Scope, + WINDOW, + addBreadcrumb, captureEvent, captureException, captureMessage, @@ -14,10 +17,7 @@ import { getClient, getCurrentHub, init, - Integrations, - Scope, showReportDialog, - WINDOW, wrap, } from '../../src'; import { getDefaultBrowserClientOptions } from './helper/browser-client-options'; diff --git a/packages/browser/test/unit/integrations/breadcrumbs.test.ts b/packages/browser/test/unit/integrations/breadcrumbs.test.ts index 04025e472ecc..d81107a69c38 100644 --- a/packages/browser/test/unit/integrations/breadcrumbs.test.ts +++ b/packages/browser/test/unit/integrations/breadcrumbs.test.ts @@ -1,7 +1,7 @@ import { getCurrentHub } from '@sentry/core'; import type { Client } from '@sentry/types'; -import { Breadcrumbs, BrowserClient, flush, Hub } from '../../../src'; +import { Breadcrumbs, BrowserClient, Hub, flush } from '../../../src'; import { getDefaultBrowserClientOptions } from '../helper/browser-client-options'; const hub = new Hub(); diff --git a/packages/browser/test/unit/sdk.test.ts b/packages/browser/test/unit/sdk.test.ts index 75b10d5c3ed3..fe977707920b 100644 --- a/packages/browser/test/unit/sdk.test.ts +++ b/packages/browser/test/unit/sdk.test.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/unbound-method */ -import { createTransport, Scope } from '@sentry/core'; +import { Scope, createTransport } from '@sentry/core'; import type { Client, Integration } from '@sentry/types'; import { resolvedSyncPromise } from '@sentry/utils'; diff --git a/packages/browser/test/unit/transports/fetch.test.ts b/packages/browser/test/unit/transports/fetch.test.ts index e6b58eeaa110..01a063d19e2d 100644 --- a/packages/browser/test/unit/transports/fetch.test.ts +++ b/packages/browser/test/unit/transports/fetch.test.ts @@ -1,6 +1,6 @@ +import { TextEncoder } from 'util'; import type { EventEnvelope, EventItem } from '@sentry/types'; import { createEnvelope, serializeEnvelope } from '@sentry/utils'; -import { TextEncoder } from 'util'; import { makeFetchTransport } from '../../../src/transports/fetch'; import type { BrowserTransportOptions } from '../../../src/transports/types'; diff --git a/packages/browser/test/unit/transports/offline.test.ts b/packages/browser/test/unit/transports/offline.test.ts index aa5819fe155a..a4f91d40efff 100644 --- a/packages/browser/test/unit/transports/offline.test.ts +++ b/packages/browser/test/unit/transports/offline.test.ts @@ -1,5 +1,6 @@ import 'fake-indexeddb/auto'; +import { TextDecoder, TextEncoder } from 'util'; import { createTransport } from '@sentry/core'; import type { EventEnvelope, @@ -8,7 +9,6 @@ import type { TransportMakeRequestResponse, } from '@sentry/types'; import { createEnvelope } from '@sentry/utils'; -import { TextDecoder, TextEncoder } from 'util'; import { MIN_DELAY } from '../../../../core/src/transports/offline'; import { createStore, insert, makeBrowserOfflineTransport, pop } from '../../../src/transports/offline'; diff --git a/packages/browser/test/unit/transports/xhr.test.ts b/packages/browser/test/unit/transports/xhr.test.ts index 07ca7f4e07dc..9e5290d224c2 100644 --- a/packages/browser/test/unit/transports/xhr.test.ts +++ b/packages/browser/test/unit/transports/xhr.test.ts @@ -1,6 +1,6 @@ +import { TextEncoder } from 'util'; import type { EventEnvelope, EventItem } from '@sentry/types'; import { createEnvelope, serializeEnvelope } from '@sentry/utils'; -import { TextEncoder } from 'util'; import type { BrowserTransportOptions } from '../../../src/transports/types'; import { makeXHRTransport } from '../../../src/transports/xhr'; diff --git a/packages/bun/src/client.ts b/packages/bun/src/client.ts index 27d6cebd0630..cb77b37b1111 100644 --- a/packages/bun/src/client.ts +++ b/packages/bun/src/client.ts @@ -1,6 +1,6 @@ +import * as os from 'os'; import type { ServerRuntimeClientOptions } from '@sentry/core'; import { SDK_VERSION, ServerRuntimeClient } from '@sentry/core'; -import * as os from 'os'; import type { BunClientOptions } from './types'; diff --git a/packages/bun/src/integrations/bunserver.ts b/packages/bun/src/integrations/bunserver.ts index f7cd8cd8cbb9..6644728c19b3 100644 --- a/packages/bun/src/integrations/bunserver.ts +++ b/packages/bun/src/integrations/bunserver.ts @@ -1,4 +1,4 @@ -import { captureException, continueTrace, runWithAsyncContext, startSpan, Transaction } from '@sentry/core'; +import { Transaction, captureException, continueTrace, runWithAsyncContext, startSpan } from '@sentry/core'; import type { Integration } from '@sentry/types'; import { getSanitizedUrlString, parseUrl } from '@sentry/utils'; diff --git a/packages/bun/src/sdk.ts b/packages/bun/src/sdk.ts index ea4702b6b19b..8604ace1962d 100644 --- a/packages/bun/src/sdk.ts +++ b/packages/bun/src/sdk.ts @@ -1,6 +1,6 @@ /* eslint-disable max-lines */ import { Integrations as CoreIntegrations } from '@sentry/core'; -import { init as initNode, Integrations as NodeIntegrations } from '@sentry/node'; +import { Integrations as NodeIntegrations, init as initNode } from '@sentry/node'; import { BunClient } from './client'; import { BunServer } from './integrations'; diff --git a/packages/bun/test/integrations/bunserver.test.ts b/packages/bun/test/integrations/bunserver.test.ts index 4965c40a187f..1113612ace81 100644 --- a/packages/bun/test/integrations/bunserver.test.ts +++ b/packages/bun/test/integrations/bunserver.test.ts @@ -1,5 +1,5 @@ -import { Hub, makeMain } from '@sentry/core'; import { beforeAll, beforeEach, describe, expect, test } from 'bun:test'; +import { Hub, makeMain } from '@sentry/core'; import { BunClient } from '../../src/client'; import { instrumentBunServe } from '../../src/integrations/bunserver'; diff --git a/packages/core/src/baseclient.ts b/packages/core/src/baseclient.ts index df3444126e8d..3d97e2b056a6 100644 --- a/packages/core/src/baseclient.ts +++ b/packages/core/src/baseclient.ts @@ -29,6 +29,8 @@ import type { TransportMakeRequestResponse, } from '@sentry/types'; import { + SentryError, + SyncPromise, addItemToEnvelope, checkOrSetAlreadyCaught, createAttachmentEnvelopeItem, @@ -39,8 +41,6 @@ import { makeDsn, rejectedSyncPromise, resolvedSyncPromise, - SentryError, - SyncPromise, } from '@sentry/utils'; import { getEnvelopeEndpointWithUrlEncodedAuth } from './api'; diff --git a/packages/core/src/eventProcessors.ts b/packages/core/src/eventProcessors.ts index cc4a39cc84ea..2300afa7d8c0 100644 --- a/packages/core/src/eventProcessors.ts +++ b/packages/core/src/eventProcessors.ts @@ -1,5 +1,5 @@ import type { Event, EventHint, EventProcessor } from '@sentry/types'; -import { getGlobalSingleton, isThenable, logger, SyncPromise } from '@sentry/utils'; +import { SyncPromise, getGlobalSingleton, isThenable, logger } from '@sentry/utils'; import { DEBUG_BUILD } from './debug-build'; diff --git a/packages/core/src/hub.ts b/packages/core/src/hub.ts index 6d19b463b73b..b4a69364d04a 100644 --- a/packages/core/src/hub.ts +++ b/packages/core/src/hub.ts @@ -20,7 +20,7 @@ import type { TransactionContext, User, } from '@sentry/types'; -import { consoleSandbox, dateTimestampInSeconds, getGlobalSingleton, GLOBAL_OBJ, logger, uuid4 } from '@sentry/utils'; +import { GLOBAL_OBJ, consoleSandbox, dateTimestampInSeconds, getGlobalSingleton, logger, uuid4 } from '@sentry/utils'; import { DEFAULT_ENVIRONMENT } from './constants'; import { DEBUG_BUILD } from './debug-build'; diff --git a/packages/core/src/tracing/transaction.ts b/packages/core/src/tracing/transaction.ts index da2ccb32d30b..be2e7324769a 100644 --- a/packages/core/src/tracing/transaction.ts +++ b/packages/core/src/tracing/transaction.ts @@ -2,8 +2,8 @@ import type { Context, Contexts, DynamicSamplingContext, - Measurements, MeasurementUnit, + Measurements, Transaction as TransactionInterface, TransactionContext, TransactionEvent, diff --git a/packages/core/src/transports/base.ts b/packages/core/src/transports/base.ts index 199cad6c545b..68e4522267db 100644 --- a/packages/core/src/transports/base.ts +++ b/packages/core/src/transports/base.ts @@ -12,6 +12,7 @@ import type { } from '@sentry/types'; import type { PromiseBuffer, RateLimits } from '@sentry/utils'; import { + SentryError, createEnvelope, envelopeItemTypeToDataCategory, forEachEnvelopeItem, @@ -19,7 +20,6 @@ import { logger, makePromiseBuffer, resolvedSyncPromise, - SentryError, serializeEnvelope, updateRateLimits, } from '@sentry/utils'; diff --git a/packages/core/src/utils/prepareEvent.ts b/packages/core/src/utils/prepareEvent.ts index 33e9eca33ef1..cf263e9366ee 100644 --- a/packages/core/src/utils/prepareEvent.ts +++ b/packages/core/src/utils/prepareEvent.ts @@ -10,9 +10,9 @@ import type { StackParser, } from '@sentry/types'; import { + GLOBAL_OBJ, addExceptionMechanism, dateTimestampInSeconds, - GLOBAL_OBJ, normalize, resolvedSyncPromise, truncate, diff --git a/packages/core/test/lib/attachments.test.ts b/packages/core/test/lib/attachments.test.ts index 34385bc61123..31ca5d0f6eaa 100644 --- a/packages/core/test/lib/attachments.test.ts +++ b/packages/core/test/lib/attachments.test.ts @@ -1,8 +1,8 @@ -import { parseEnvelope } from '@sentry/utils'; import { TextDecoder, TextEncoder } from 'util'; +import { parseEnvelope } from '@sentry/utils'; import { createTransport } from '../../src/transports/base'; -import { getDefaultTestClientOptions, TestClient } from '../mocks/client'; +import { TestClient, getDefaultTestClientOptions } from '../mocks/client'; describe('Attachments', () => { beforeEach(() => { diff --git a/packages/core/test/lib/base.test.ts b/packages/core/test/lib/base.test.ts index 2d5f8ff05db8..baeb8bfd0044 100644 --- a/packages/core/test/lib/base.test.ts +++ b/packages/core/test/lib/base.test.ts @@ -1,9 +1,9 @@ import type { Client, Envelope, Event, Span, Transaction } from '@sentry/types'; -import { dsnToString, logger, SentryError, SyncPromise } from '@sentry/utils'; +import { SentryError, SyncPromise, dsnToString, logger } from '@sentry/utils'; -import { Hub, makeSession, Scope } from '../../src'; +import { Hub, Scope, makeSession } from '../../src'; import * as integrationModule from '../../src/integration'; -import { getDefaultTestClientOptions, TestClient } from '../mocks/client'; +import { TestClient, getDefaultTestClientOptions } from '../mocks/client'; import { AdHocIntegration, TestIntegration } from '../mocks/integration'; import { makeFakeTransport } from '../mocks/transport'; diff --git a/packages/core/test/lib/hint.test.ts b/packages/core/test/lib/hint.test.ts index 656a70ab1a1d..cdcfa9368cbe 100644 --- a/packages/core/test/lib/hint.test.ts +++ b/packages/core/test/lib/hint.test.ts @@ -2,7 +2,7 @@ import { captureEvent, configureScope } from '@sentry/core'; import { GLOBAL_OBJ } from '@sentry/utils'; import { initAndBind } from '../../src/sdk'; -import { getDefaultTestClientOptions, TestClient } from '../mocks/client'; +import { TestClient, getDefaultTestClientOptions } from '../mocks/client'; import { AddAttachmentTestIntegration } from '../mocks/integration'; const PUBLIC_DSN = 'https://username@domain/123'; diff --git a/packages/core/test/lib/integration.test.ts b/packages/core/test/lib/integration.test.ts index 37e604527f29..54bd426abb5c 100644 --- a/packages/core/test/lib/integration.test.ts +++ b/packages/core/test/lib/integration.test.ts @@ -3,7 +3,7 @@ import { logger } from '@sentry/utils'; import { Hub, makeMain } from '../../src/hub'; import { addIntegration, getIntegrationsToSetup, installedIntegrations, setupIntegration } from '../../src/integration'; -import { getDefaultTestClientOptions, TestClient } from '../mocks/client'; +import { TestClient, getDefaultTestClientOptions } from '../mocks/client'; function getTestClient(): TestClient { return new TestClient( diff --git a/packages/core/test/lib/integrations/inboundfilters.test.ts b/packages/core/test/lib/integrations/inboundfilters.test.ts index dad4606a7c80..c8df79cd22fe 100644 --- a/packages/core/test/lib/integrations/inboundfilters.test.ts +++ b/packages/core/test/lib/integrations/inboundfilters.test.ts @@ -2,7 +2,7 @@ import type { Event, EventProcessor } from '@sentry/types'; import type { InboundFiltersOptions } from '../../../src/integrations/inboundfilters'; import { InboundFilters } from '../../../src/integrations/inboundfilters'; -import { getDefaultTestClientOptions, TestClient } from '../../mocks/client'; +import { TestClient, getDefaultTestClientOptions } from '../../mocks/client'; const PUBLIC_DSN = 'https://username@domain/123'; diff --git a/packages/core/test/lib/integrations/metadata.test.ts b/packages/core/test/lib/integrations/metadata.test.ts index 464da2d97fbb..15678a66fdb6 100644 --- a/packages/core/test/lib/integrations/metadata.test.ts +++ b/packages/core/test/lib/integrations/metadata.test.ts @@ -1,9 +1,9 @@ -import type { Event } from '@sentry/types'; -import { createStackParser, GLOBAL_OBJ, nodeStackLineParser, parseEnvelope } from '@sentry/utils'; import { TextDecoder, TextEncoder } from 'util'; +import type { Event } from '@sentry/types'; +import { GLOBAL_OBJ, createStackParser, nodeStackLineParser, parseEnvelope } from '@sentry/utils'; -import { createTransport, getCurrentHub, ModuleMetadata } from '../../../src'; -import { getDefaultTestClientOptions, TestClient } from '../../mocks/client'; +import { ModuleMetadata, createTransport, getCurrentHub } from '../../../src'; +import { TestClient, getDefaultTestClientOptions } from '../../mocks/client'; const stackParser = createStackParser(nodeStackLineParser()); diff --git a/packages/core/test/lib/integrations/requestdata.test.ts b/packages/core/test/lib/integrations/requestdata.test.ts index bfa6a3caf62d..982d5f57566d 100644 --- a/packages/core/test/lib/integrations/requestdata.test.ts +++ b/packages/core/test/lib/integrations/requestdata.test.ts @@ -1,10 +1,10 @@ +import type { IncomingMessage } from 'http'; import type { RequestDataIntegrationOptions } from '@sentry/core'; -import { getCurrentHub, Hub, makeMain, RequestData } from '@sentry/core'; +import { Hub, RequestData, getCurrentHub, makeMain } from '@sentry/core'; import type { Event, EventProcessor } from '@sentry/types'; import * as sentryUtils from '@sentry/utils'; -import type { IncomingMessage } from 'http'; -import { getDefaultTestClientOptions, TestClient } from '../../mocks/client'; +import { TestClient, getDefaultTestClientOptions } from '../../mocks/client'; const addRequestDataToEventSpy = jest.spyOn(sentryUtils, 'addRequestDataToEvent'); const requestDataEventProcessor = jest.fn(); diff --git a/packages/core/test/lib/metadata.test.ts b/packages/core/test/lib/metadata.test.ts index 64b3fd7310ad..14d64efdf2c9 100644 --- a/packages/core/test/lib/metadata.test.ts +++ b/packages/core/test/lib/metadata.test.ts @@ -1,5 +1,5 @@ import type { Event } from '@sentry/types'; -import { createStackParser, GLOBAL_OBJ, nodeStackLineParser } from '@sentry/utils'; +import { GLOBAL_OBJ, createStackParser, nodeStackLineParser } from '@sentry/utils'; import { addMetadataToStackFrames, getMetadataForUrl, stripMetadataFromStackFrames } from '../../src/metadata'; diff --git a/packages/core/test/lib/prepareEvent.test.ts b/packages/core/test/lib/prepareEvent.test.ts index 9d00df469112..b98305dea604 100644 --- a/packages/core/test/lib/prepareEvent.test.ts +++ b/packages/core/test/lib/prepareEvent.test.ts @@ -1,5 +1,5 @@ import type { Event, EventHint, ScopeContext } from '@sentry/types'; -import { createStackParser, GLOBAL_OBJ } from '@sentry/utils'; +import { GLOBAL_OBJ, createStackParser } from '@sentry/utils'; import { Scope } from '../../src/scope'; import { applyDebugIds, applyDebugMeta, parseEventHintOrCaptureContext } from '../../src/utils/prepareEvent'; diff --git a/packages/core/test/lib/sdk.test.ts b/packages/core/test/lib/sdk.test.ts index afb1987262d9..bd254f7348c2 100644 --- a/packages/core/test/lib/sdk.test.ts +++ b/packages/core/test/lib/sdk.test.ts @@ -3,7 +3,7 @@ import type { Client, Integration } from '@sentry/types'; import { installedIntegrations } from '../../src/integration'; import { initAndBind } from '../../src/sdk'; -import { getDefaultTestClientOptions, TestClient } from '../mocks/client'; +import { TestClient, getDefaultTestClientOptions } from '../mocks/client'; // eslint-disable-next-line no-var declare var global: any; diff --git a/packages/core/test/lib/tracing/errors.test.ts b/packages/core/test/lib/tracing/errors.test.ts index 4f72e7f74658..f4de76234ca2 100644 --- a/packages/core/test/lib/tracing/errors.test.ts +++ b/packages/core/test/lib/tracing/errors.test.ts @@ -1,5 +1,5 @@ import { BrowserClient } from '@sentry/browser'; -import { addTracingExtensions, Hub, makeMain } from '@sentry/core'; +import { Hub, addTracingExtensions, makeMain } from '@sentry/core'; import type { HandlerDataError, HandlerDataUnhandledRejection } from '@sentry/types'; import { getDefaultBrowserClientOptions } from '../../../../tracing/test/testutils'; diff --git a/packages/core/test/lib/tracing/trace.test.ts b/packages/core/test/lib/tracing/trace.test.ts index b8f2d584434e..a9ea12ef89c0 100644 --- a/packages/core/test/lib/tracing/trace.test.ts +++ b/packages/core/test/lib/tracing/trace.test.ts @@ -1,6 +1,6 @@ -import { addTracingExtensions, Hub, makeMain } from '../../../src'; +import { Hub, addTracingExtensions, makeMain } from '../../../src'; import { continueTrace, startSpan } from '../../../src/tracing'; -import { getDefaultTestClientOptions, TestClient } from '../../mocks/client'; +import { TestClient, getDefaultTestClientOptions } from '../../mocks/client'; beforeAll(() => { addTracingExtensions(); diff --git a/packages/core/test/lib/transports/base.test.ts b/packages/core/test/lib/transports/base.test.ts index 4f4072803f7b..5e6b504d9f6e 100644 --- a/packages/core/test/lib/transports/base.test.ts +++ b/packages/core/test/lib/transports/base.test.ts @@ -1,7 +1,7 @@ +import { TextEncoder } from 'util'; import type { AttachmentItem, EventEnvelope, EventItem, TransportMakeRequestResponse } from '@sentry/types'; import type { PromiseBuffer } from '@sentry/utils'; import { createEnvelope, resolvedSyncPromise, serializeEnvelope } from '@sentry/utils'; -import { TextEncoder } from 'util'; import { createTransport } from '../../../src/transports/base'; diff --git a/packages/core/test/lib/transports/multiplexed.test.ts b/packages/core/test/lib/transports/multiplexed.test.ts index bcfb65736c5e..097b3428805b 100644 --- a/packages/core/test/lib/transports/multiplexed.test.ts +++ b/packages/core/test/lib/transports/multiplexed.test.ts @@ -1,3 +1,4 @@ +import { TextDecoder, TextEncoder } from 'util'; import type { BaseTransportOptions, ClientReport, @@ -7,7 +8,6 @@ import type { Transport, } from '@sentry/types'; import { createClientReportEnvelope, createEnvelope, dsnFromString, parseEnvelope } from '@sentry/utils'; -import { TextDecoder, TextEncoder } from 'util'; import { createTransport, getEnvelopeEndpointWithUrlEncodedAuth, makeMultiplexedTransport } from '../../../src'; import { eventFromEnvelope } from '../../../src/transports/multiplexed'; diff --git a/packages/core/test/lib/transports/offline.test.ts b/packages/core/test/lib/transports/offline.test.ts index cdaf092fca5d..172c890e8049 100644 --- a/packages/core/test/lib/transports/offline.test.ts +++ b/packages/core/test/lib/transports/offline.test.ts @@ -1,3 +1,4 @@ +import { TextEncoder } from 'util'; import type { ClientReport, Envelope, @@ -16,11 +17,10 @@ import { dsnFromString, getSdkMetadataForEnvelopeHeader, } from '@sentry/utils'; -import { TextEncoder } from 'util'; import { createTransport } from '../../../src'; import type { CreateOfflineStore, OfflineTransportOptions } from '../../../src/transports/offline'; -import { makeOfflineTransport, START_DELAY } from '../../../src/transports/offline'; +import { START_DELAY, makeOfflineTransport } from '../../../src/transports/offline'; const ERROR_ENVELOPE = createEnvelope({ event_id: 'aa3ff046696b4bc6b609ce6d28fde9e2', sent_at: '123' }, [ [{ type: 'event' }, { event_id: 'aa3ff046696b4bc6b609ce6d28fde9e2' }] as EventItem, diff --git a/packages/core/test/mocks/client.ts b/packages/core/test/mocks/client.ts index f7d8830a1402..3fe26f9d0bec 100644 --- a/packages/core/test/mocks/client.ts +++ b/packages/core/test/mocks/client.ts @@ -1,3 +1,4 @@ +import { TextEncoder } from 'util'; import type { ClientOptions, Event, @@ -9,7 +10,6 @@ import type { SeverityLevel, } from '@sentry/types'; import { resolvedSyncPromise } from '@sentry/utils'; -import { TextEncoder } from 'util'; import { BaseClient } from '../../src/baseclient'; import { initAndBind } from '../../src/sdk'; diff --git a/packages/core/test/mocks/transport.ts b/packages/core/test/mocks/transport.ts index 2559e6e2cf2e..e2338327be16 100644 --- a/packages/core/test/mocks/transport.ts +++ b/packages/core/test/mocks/transport.ts @@ -1,6 +1,6 @@ +import { TextEncoder } from 'util'; import type { Transport } from '@sentry/types'; import { SyncPromise } from '@sentry/utils'; -import { TextEncoder } from 'util'; import { createTransport } from '../../src/transports/base'; diff --git a/packages/deno/rollup.test.config.js b/packages/deno/rollup.test.config.js index 3947d0e94b16..8b3393ae2dd4 100644 --- a/packages/deno/rollup.test.config.js +++ b/packages/deno/rollup.test.config.js @@ -1,8 +1,8 @@ -// @ts-check -import dts from 'rollup-plugin-dts'; import nodeResolve from '@rollup/plugin-node-resolve'; import sucrase from '@rollup/plugin-sucrase'; import { defineConfig } from 'rollup'; +// @ts-check +import dts from 'rollup-plugin-dts'; export default [ defineConfig({ diff --git a/packages/deno/rollup.types.config.js b/packages/deno/rollup.types.config.js index a14c531d555f..ccfb62251351 100644 --- a/packages/deno/rollup.types.config.js +++ b/packages/deno/rollup.types.config.js @@ -1,6 +1,6 @@ +import { defineConfig } from 'rollup'; // @ts-check import dts from 'rollup-plugin-dts'; -import { defineConfig } from 'rollup'; export default defineConfig({ input: './build-types/index.d.ts', diff --git a/packages/deno/scripts/download-deno-types.mjs b/packages/deno/scripts/download-deno-types.mjs index 33bdfcf5ebb7..40c8261300c3 100644 --- a/packages/deno/scripts/download-deno-types.mjs +++ b/packages/deno/scripts/download-deno-types.mjs @@ -1,4 +1,4 @@ -import { writeFileSync, existsSync } from 'fs'; +import { existsSync, writeFileSync } from 'fs'; import { download } from './download.mjs'; if (!existsSync('lib.deno.d.ts')) { diff --git a/packages/deno/src/integrations/contextlines.ts b/packages/deno/src/integrations/contextlines.ts index ab6db13f5ef2..10131b77ca27 100644 --- a/packages/deno/src/integrations/contextlines.ts +++ b/packages/deno/src/integrations/contextlines.ts @@ -1,5 +1,5 @@ import type { Event, EventProcessor, Integration, StackFrame } from '@sentry/types'; -import { addContextToFrame, LRUMap } from '@sentry/utils'; +import { LRUMap, addContextToFrame } from '@sentry/utils'; const FILE_CONTENT_CACHE = new LRUMap(100); const DEFAULT_LINES_OF_CONTEXT = 7; diff --git a/packages/deno/src/sdk.ts b/packages/deno/src/sdk.ts index 52de20ffd6fd..af33449edafd 100644 --- a/packages/deno/src/sdk.ts +++ b/packages/deno/src/sdk.ts @@ -1,6 +1,6 @@ import { Breadcrumbs, Dedupe } from '@sentry/browser'; import type { ServerRuntimeClientOptions } from '@sentry/core'; -import { getIntegrationsToSetup, initAndBind, Integrations as CoreIntegrations } from '@sentry/core'; +import { Integrations as CoreIntegrations, getIntegrationsToSetup, initAndBind } from '@sentry/core'; import type { StackParser } from '@sentry/types'; import { createStackParser, nodeStackLineParser, stackParserFromStackParserOptions } from '@sentry/utils'; diff --git a/packages/deno/test/mod.test.ts b/packages/deno/test/mod.test.ts index cf093af034fe..a14e04b61ff9 100644 --- a/packages/deno/test/mod.test.ts +++ b/packages/deno/test/mod.test.ts @@ -3,7 +3,7 @@ import { assertSnapshot } from 'https://deno.land/std@0.202.0/testing/snapshot.t import type { sentryTypes } from '../build-test/index.js'; import { sentryUtils } from '../build-test/index.js'; -import { defaultIntegrations, DenoClient, Hub, Scope } from '../build/index.mjs'; +import { DenoClient, Hub, Scope, defaultIntegrations } from '../build/index.mjs'; import { getNormalizedEvent } from './normalize.ts'; import { makeTestTransport } from './transport.ts'; diff --git a/packages/e2e-tests/publish-packages.ts b/packages/e2e-tests/publish-packages.ts index 4715b3258771..b3978d18002a 100644 --- a/packages/e2e-tests/publish-packages.ts +++ b/packages/e2e-tests/publish-packages.ts @@ -1,7 +1,7 @@ /* eslint-disable no-console */ import * as childProcess from 'child_process'; -import * as glob from 'glob'; import * as path from 'path'; +import * as glob from 'glob'; const repositoryRoot = path.resolve(__dirname, '../..'); diff --git a/packages/e2e-tests/run.ts b/packages/e2e-tests/run.ts index 68263f79c4c9..bdc269a867a8 100644 --- a/packages/e2e-tests/run.ts +++ b/packages/e2e-tests/run.ts @@ -1,9 +1,9 @@ /* eslint-disable max-lines */ /* eslint-disable no-console */ import { spawn } from 'child_process'; +import { resolve } from 'path'; import * as dotenv from 'dotenv'; import { sync as globSync } from 'glob'; -import { resolve } from 'path'; import { validate } from './lib/validate'; import { registrySetup } from './registrySetup'; diff --git a/packages/e2e-tests/test-applications/create-next-app/pages/_document.tsx b/packages/e2e-tests/test-applications/create-next-app/pages/_document.tsx index e1e9cbbb75aa..af2f1aba391f 100644 --- a/packages/e2e-tests/test-applications/create-next-app/pages/_document.tsx +++ b/packages/e2e-tests/test-applications/create-next-app/pages/_document.tsx @@ -1,4 +1,4 @@ -import { Html, Head, Main, NextScript } from 'next/document'; +import { Head, Html, Main, NextScript } from 'next/document'; export default function Document() { return ( diff --git a/packages/e2e-tests/test-applications/create-next-app/pages/_error.tsx b/packages/e2e-tests/test-applications/create-next-app/pages/_error.tsx index 031553bc20a2..fb1fca2a0ad7 100644 --- a/packages/e2e-tests/test-applications/create-next-app/pages/_error.tsx +++ b/packages/e2e-tests/test-applications/create-next-app/pages/_error.tsx @@ -17,8 +17,8 @@ */ import * as Sentry from '@sentry/nextjs'; -import NextErrorComponent from 'next/error'; import { NextPageContext } from 'next'; +import NextErrorComponent from 'next/error'; const CustomErrorComponent = (props: { statusCode: any }) => { // If you're using a Nextjs version prior to 12.2.1, uncomment this to diff --git a/packages/e2e-tests/test-applications/create-next-app/pages/api/success.ts b/packages/e2e-tests/test-applications/create-next-app/pages/api/success.ts index 847d0ae4821c..ed4372065792 100644 --- a/packages/e2e-tests/test-applications/create-next-app/pages/api/success.ts +++ b/packages/e2e-tests/test-applications/create-next-app/pages/api/success.ts @@ -1,6 +1,6 @@ +import * as Sentry from '@sentry/nextjs'; // Next.js API route support: https://nextjs.org/docs/api-routes/introduction import type { NextApiRequest, NextApiResponse } from 'next'; -import * as Sentry from '@sentry/nextjs'; export default function handler(req: NextApiRequest, res: NextApiResponse) { const transaction = Sentry.startTransaction({ name: 'test-transaction', op: 'e2e-test' }); diff --git a/packages/e2e-tests/test-applications/create-next-app/pages/index.tsx b/packages/e2e-tests/test-applications/create-next-app/pages/index.tsx index 807b48f3a9d3..059230d236a5 100644 --- a/packages/e2e-tests/test-applications/create-next-app/pages/index.tsx +++ b/packages/e2e-tests/test-applications/create-next-app/pages/index.tsx @@ -1,6 +1,6 @@ +import * as Sentry from '@sentry/nextjs'; import Head from 'next/head'; import Link from 'next/link'; -import * as Sentry from '@sentry/nextjs'; export default function Home() { return ( diff --git a/packages/e2e-tests/test-applications/create-next-app/tests/behaviour-client.test.ts b/packages/e2e-tests/test-applications/create-next-app/tests/behaviour-client.test.ts index 54d52d32172b..d994f13b7060 100644 --- a/packages/e2e-tests/test-applications/create-next-app/tests/behaviour-client.test.ts +++ b/packages/e2e-tests/test-applications/create-next-app/tests/behaviour-client.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import axios, { AxiosError } from 'axios'; const authToken = process.env.E2E_TEST_AUTH_TOKEN; diff --git a/packages/e2e-tests/test-applications/create-next-app/tests/behaviour-server.test.ts b/packages/e2e-tests/test-applications/create-next-app/tests/behaviour-server.test.ts index a864701afa9b..becf9bf9bce7 100644 --- a/packages/e2e-tests/test-applications/create-next-app/tests/behaviour-server.test.ts +++ b/packages/e2e-tests/test-applications/create-next-app/tests/behaviour-server.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import axios, { AxiosError } from 'axios'; const authToken = process.env.E2E_TEST_AUTH_TOKEN; diff --git a/packages/e2e-tests/test-applications/create-react-app/src/App.tsx b/packages/e2e-tests/test-applications/create-react-app/src/App.tsx index aa2efcf44946..76b10d9085e2 100644 --- a/packages/e2e-tests/test-applications/create-react-app/src/App.tsx +++ b/packages/e2e-tests/test-applications/create-react-app/src/App.tsx @@ -1,7 +1,7 @@ -import React from 'react'; -import logo from './logo.svg'; import * as Sentry from '@sentry/react'; +import React from 'react'; import './App.css'; +import logo from './logo.svg'; function App() { return ( diff --git a/packages/e2e-tests/test-applications/create-react-app/src/index.tsx b/packages/e2e-tests/test-applications/create-react-app/src/index.tsx index b0532433d7be..f4f58b689b9e 100644 --- a/packages/e2e-tests/test-applications/create-react-app/src/index.tsx +++ b/packages/e2e-tests/test-applications/create-react-app/src/index.tsx @@ -1,10 +1,10 @@ +import * as Sentry from '@sentry/react'; +import { BrowserTracing } from '@sentry/tracing'; import React from 'react'; import ReactDOM from 'react-dom/client'; -import './index.css'; import App from './App'; +import './index.css'; import reportWebVitals from './reportWebVitals'; -import * as Sentry from '@sentry/react'; -import { BrowserTracing } from '@sentry/tracing'; Sentry.init({ environment: 'qa', // dynamic sampling bias to keep transactions diff --git a/packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.client.tsx b/packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.client.tsx index 605d8e792d23..c0134c08c451 100644 --- a/packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.client.tsx +++ b/packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.client.tsx @@ -5,9 +5,9 @@ */ import { RemixBrowser, useLocation, useMatches } from '@remix-run/react'; -import { startTransition, StrictMode, useEffect } from 'react'; -import { hydrateRoot } from 'react-dom/client'; import * as Sentry from '@sentry/remix'; +import { StrictMode, startTransition, useEffect } from 'react'; +import { hydrateRoot } from 'react-dom/client'; Sentry.init({ dsn: window.ENV.SENTRY_DSN, diff --git a/packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.server.tsx b/packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.server.tsx index bce3f38ae7f8..f4e586f2e557 100644 --- a/packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.server.tsx +++ b/packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.server.tsx @@ -6,13 +6,13 @@ import { PassThrough } from 'node:stream'; -import type { AppLoadContext, EntryContext, DataFunctionArgs } from '@remix-run/node'; +import type { AppLoadContext, DataFunctionArgs, EntryContext } from '@remix-run/node'; import { createReadableStreamFromReadable } from '@remix-run/node'; +import { installGlobals } from '@remix-run/node'; import { RemixServer } from '@remix-run/react'; -import { renderToPipeableStream } from 'react-dom/server'; import * as Sentry from '@sentry/remix'; -import { installGlobals } from '@remix-run/node'; import isbot from 'isbot'; +import { renderToPipeableStream } from 'react-dom/server'; installGlobals(); diff --git a/packages/e2e-tests/test-applications/create-remix-app-v2/app/root.tsx b/packages/e2e-tests/test-applications/create-remix-app-v2/app/root.tsx index cf8d185866a9..517a37a9d76b 100644 --- a/packages/e2e-tests/test-applications/create-remix-app-v2/app/root.tsx +++ b/packages/e2e-tests/test-applications/create-remix-app-v2/app/root.tsx @@ -1,5 +1,5 @@ import { cssBundleHref } from '@remix-run/css-bundle'; -import { json, LinksFunction, MetaFunction } from '@remix-run/node'; +import { LinksFunction, MetaFunction, json } from '@remix-run/node'; import { Links, LiveReload, diff --git a/packages/e2e-tests/test-applications/create-remix-app-v2/app/routes/_index.tsx b/packages/e2e-tests/test-applications/create-remix-app-v2/app/routes/_index.tsx index c3fcc989f49b..8907ef7816fd 100644 --- a/packages/e2e-tests/test-applications/create-remix-app-v2/app/routes/_index.tsx +++ b/packages/e2e-tests/test-applications/create-remix-app-v2/app/routes/_index.tsx @@ -1,5 +1,5 @@ -import * as Sentry from '@sentry/remix'; import { Link } from '@remix-run/react'; +import * as Sentry from '@sentry/remix'; export default function Index() { return ( diff --git a/packages/e2e-tests/test-applications/create-remix-app-v2/tests/behaviour-client.test.ts b/packages/e2e-tests/test-applications/create-remix-app-v2/tests/behaviour-client.test.ts index 3b39c9a4ca0b..944dcb07b4bd 100644 --- a/packages/e2e-tests/test-applications/create-remix-app-v2/tests/behaviour-client.test.ts +++ b/packages/e2e-tests/test-applications/create-remix-app-v2/tests/behaviour-client.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import axios, { AxiosError } from 'axios'; const EVENT_POLLING_TIMEOUT = 90_000; diff --git a/packages/e2e-tests/test-applications/create-remix-app/app/entry.client.tsx b/packages/e2e-tests/test-applications/create-remix-app/app/entry.client.tsx index 605d8e792d23..c0134c08c451 100644 --- a/packages/e2e-tests/test-applications/create-remix-app/app/entry.client.tsx +++ b/packages/e2e-tests/test-applications/create-remix-app/app/entry.client.tsx @@ -5,9 +5,9 @@ */ import { RemixBrowser, useLocation, useMatches } from '@remix-run/react'; -import { startTransition, StrictMode, useEffect } from 'react'; -import { hydrateRoot } from 'react-dom/client'; import * as Sentry from '@sentry/remix'; +import { StrictMode, startTransition, useEffect } from 'react'; +import { hydrateRoot } from 'react-dom/client'; Sentry.init({ dsn: window.ENV.SENTRY_DSN, diff --git a/packages/e2e-tests/test-applications/create-remix-app/app/entry.server.tsx b/packages/e2e-tests/test-applications/create-remix-app/app/entry.server.tsx index d8679d2074b1..3d618e754244 100644 --- a/packages/e2e-tests/test-applications/create-remix-app/app/entry.server.tsx +++ b/packages/e2e-tests/test-applications/create-remix-app/app/entry.server.tsx @@ -6,12 +6,12 @@ import { PassThrough } from 'node:stream'; -import type { AppLoadContext, EntryContext, DataFunctionArgs } from '@remix-run/node'; +import type { AppLoadContext, DataFunctionArgs, EntryContext } from '@remix-run/node'; import { Response } from '@remix-run/node'; import { RemixServer } from '@remix-run/react'; +import * as Sentry from '@sentry/remix'; import isbot from 'isbot'; import { renderToPipeableStream } from 'react-dom/server'; -import * as Sentry from '@sentry/remix'; const ABORT_DELAY = 5_000; diff --git a/packages/e2e-tests/test-applications/create-remix-app/app/root.tsx b/packages/e2e-tests/test-applications/create-remix-app/app/root.tsx index a015aba78f6c..e99991f5994d 100644 --- a/packages/e2e-tests/test-applications/create-remix-app/app/root.tsx +++ b/packages/e2e-tests/test-applications/create-remix-app/app/root.tsx @@ -1,5 +1,5 @@ import { cssBundleHref } from '@remix-run/css-bundle'; -import { json, LinksFunction, MetaFunction } from '@remix-run/node'; +import { LinksFunction, MetaFunction, json } from '@remix-run/node'; import { Links, LiveReload, diff --git a/packages/e2e-tests/test-applications/create-remix-app/app/routes/_index.tsx b/packages/e2e-tests/test-applications/create-remix-app/app/routes/_index.tsx index c3fcc989f49b..8907ef7816fd 100644 --- a/packages/e2e-tests/test-applications/create-remix-app/app/routes/_index.tsx +++ b/packages/e2e-tests/test-applications/create-remix-app/app/routes/_index.tsx @@ -1,5 +1,5 @@ -import * as Sentry from '@sentry/remix'; import { Link } from '@remix-run/react'; +import * as Sentry from '@sentry/remix'; export default function Index() { return ( diff --git a/packages/e2e-tests/test-applications/create-remix-app/tests/behaviour-client.test.ts b/packages/e2e-tests/test-applications/create-remix-app/tests/behaviour-client.test.ts index 3b39c9a4ca0b..944dcb07b4bd 100644 --- a/packages/e2e-tests/test-applications/create-remix-app/tests/behaviour-client.test.ts +++ b/packages/e2e-tests/test-applications/create-remix-app/tests/behaviour-client.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import axios, { AxiosError } from 'axios'; const EVENT_POLLING_TIMEOUT = 90_000; diff --git a/packages/e2e-tests/test-applications/debug-id-sourcemaps/rollup.config.mjs b/packages/e2e-tests/test-applications/debug-id-sourcemaps/rollup.config.mjs index 47273c79ea9d..e9d8f066727d 100644 --- a/packages/e2e-tests/test-applications/debug-id-sourcemaps/rollup.config.mjs +++ b/packages/e2e-tests/test-applications/debug-id-sourcemaps/rollup.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'rollup'; import { sentryRollupPlugin } from '@sentry/rollup-plugin'; +import { defineConfig } from 'rollup'; export default defineConfig({ input: './src/app.js', diff --git a/packages/e2e-tests/test-applications/debug-id-sourcemaps/tests/server.test.ts b/packages/e2e-tests/test-applications/debug-id-sourcemaps/tests/server.test.ts index 51f272fa514a..b42a556757b3 100644 --- a/packages/e2e-tests/test-applications/debug-id-sourcemaps/tests/server.test.ts +++ b/packages/e2e-tests/test-applications/debug-id-sourcemaps/tests/server.test.ts @@ -1,6 +1,6 @@ -import { test } from 'vitest'; import childProcess from 'child_process'; import path from 'path'; +import { test } from 'vitest'; const authToken = process.env.E2E_TEST_AUTH_TOKEN; const sentryTestOrgSlug = process.env.E2E_TEST_SENTRY_ORG_SLUG; diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/app/layout.tsx b/packages/e2e-tests/test-applications/nextjs-app-dir/app/layout.tsx index b93ad29e53cb..984df38d86c9 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/app/layout.tsx +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/app/layout.tsx @@ -1,5 +1,5 @@ -import { TransactionContextProvider } from '../components/transaction-context'; import Link from 'next/link'; +import { TransactionContextProvider } from '../components/transaction-context'; export default function Layout({ children }: { children: React.ReactNode }) { return ( diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/components/client-error-debug-tools.tsx b/packages/e2e-tests/test-applications/nextjs-app-dir/components/client-error-debug-tools.tsx index 9eeaa227996f..42aabe3e4475 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/components/client-error-debug-tools.tsx +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/components/client-error-debug-tools.tsx @@ -1,8 +1,8 @@ 'use client'; +import { captureException } from '@sentry/nextjs'; import { useContext, useState } from 'react'; import { TransactionContext } from './transaction-context'; -import { captureException } from '@sentry/nextjs'; export function ClientErrorDebugTools() { const transactionContextValue = useContext(TransactionContext); diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/components/transaction-context.tsx b/packages/e2e-tests/test-applications/nextjs-app-dir/components/transaction-context.tsx index 384b06ab5528..4102a1a422a8 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/components/transaction-context.tsx +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/components/transaction-context.tsx @@ -1,8 +1,8 @@ 'use client'; -import { createContext, PropsWithChildren, useState } from 'react'; +import { getCurrentHub, startTransaction } from '@sentry/nextjs'; import { Transaction } from '@sentry/types'; -import { startTransaction, getCurrentHub } from '@sentry/nextjs'; +import { PropsWithChildren, createContext, useState } from 'react'; export const TransactionContext = createContext< { transactionActive: false; start: (transactionName: string) => void } | { transactionActive: true; stop: () => void } diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/event-proxy-server.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/event-proxy-server.ts index 67cf80b4dabf..9dee679c71e4 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/event-proxy-server.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/event-proxy-server.ts @@ -1,5 +1,3 @@ -import type { Envelope, EnvelopeItem, Event } from '@sentry/types'; -import { parseEnvelope } from '@sentry/utils'; import * as fs from 'fs'; import * as http from 'http'; import * as https from 'https'; @@ -8,6 +6,8 @@ import * as os from 'os'; import * as path from 'path'; import * as util from 'util'; import * as zlib from 'zlib'; +import type { Envelope, EnvelopeItem, Event } from '@sentry/types'; +import { parseEnvelope } from '@sentry/utils'; const readFile = util.promisify(fs.readFile); const writeFile = util.promisify(fs.writeFile); diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/async-context-edge.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/async-context-edge.test.ts index 1d784b31c0e9..7ff7116af5d9 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/async-context-edge.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/async-context-edge.test.ts @@ -1,5 +1,5 @@ -import { test, expect } from '@playwright/test'; -import { waitForTransaction, waitForError } from '../event-proxy-server'; +import { expect, test } from '@playwright/test'; +import { waitForError, waitForTransaction } from '../event-proxy-server'; test('Should allow for async context isolation in the edge SDK', async ({ request }) => { // test.skip(process.env.TEST_ENV === 'development', "Doesn't work in dev mode."); diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/client-app-routing-instrumentation.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/client-app-routing-instrumentation.test.ts index 3fa3691e0637..9c6dd31496a8 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/client-app-routing-instrumentation.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/client-app-routing-instrumentation.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { waitForTransaction } from '../event-proxy-server'; test('Creates a pageload transaction for app router routes', async ({ page }) => { diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/devErrorSymbolification.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/devErrorSymbolification.test.ts index 03dd1b978714..be462890067b 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/devErrorSymbolification.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/devErrorSymbolification.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { waitForError } from '../event-proxy-server'; test.describe('dev mode error symbolification', () => { diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/edge-route.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/edge-route.test.ts index 0f02274f9e4c..9c19506392f8 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/edge-route.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/edge-route.test.ts @@ -1,5 +1,5 @@ -import { test, expect } from '@playwright/test'; -import { waitForTransaction, waitForError } from '../event-proxy-server'; +import { expect, test } from '@playwright/test'; +import { waitForError, waitForTransaction } from '../event-proxy-server'; test('Should create a transaction for edge routes', async ({ request }) => { const edgerouteTransactionPromise = waitForTransaction('nextjs-13-app-dir', async transactionEvent => { diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/edge.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/edge.test.ts index 39cdd753e85c..83dc125f2d4d 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/edge.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/edge.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { waitForError, waitForTransaction } from '../event-proxy-server'; test('Should record exceptions for faulty edge server components', async ({ page }) => { diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/exceptions.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/exceptions.test.ts index 5383a43c34a9..6e50d10fb333 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/exceptions.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/exceptions.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from '@playwright/test'; -import { waitForError } from '../event-proxy-server'; +import { expect, test } from '@playwright/test'; import axios, { AxiosError } from 'axios'; +import { waitForError } from '../event-proxy-server'; const authToken = process.env.E2E_TEST_AUTH_TOKEN; const sentryTestOrgSlug = process.env.E2E_TEST_SENTRY_ORG_SLUG; diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/middleware.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/middleware.test.ts index b7bacd9d4ce4..c0832eb2d054 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/middleware.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/middleware.test.ts @@ -1,5 +1,5 @@ -import { test, expect } from '@playwright/test'; -import { waitForTransaction, waitForError } from '../event-proxy-server'; +import { expect, test } from '@playwright/test'; +import { waitForError, waitForTransaction } from '../event-proxy-server'; test('Should create a transaction for middleware', async ({ request }) => { const middlewareTransactionPromise = waitForTransaction('nextjs-13-app-dir', async transactionEvent => { diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/pages-ssr-errors.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/pages-ssr-errors.test.ts index c861ecaafb25..2dbefd1441e2 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/pages-ssr-errors.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/pages-ssr-errors.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { waitForError, waitForTransaction } from '../event-proxy-server'; test('Will capture error for SSR rendering error with a connected trace (Class Component)', async ({ page }) => { diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/route-handlers.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/route-handlers.test.ts index 775cbe462e89..75a07d79b2c4 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/route-handlers.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/route-handlers.test.ts @@ -1,5 +1,5 @@ -import { test, expect } from '@playwright/test'; -import { waitForTransaction, waitForError } from '../event-proxy-server'; +import { expect, test } from '@playwright/test'; +import { waitForError, waitForTransaction } from '../event-proxy-server'; test('Should create a transaction for route handlers', async ({ request }) => { const routehandlerTransactionPromise = waitForTransaction('nextjs-13-app-dir', async transactionEvent => { diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/transactions.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/transactions.test.ts index f47b5e60c85d..ca4f4cb0d1ff 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/transactions.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/transactions.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from '@playwright/test'; -import { waitForTransaction } from '../event-proxy-server'; +import { expect, test } from '@playwright/test'; import axios, { AxiosError } from 'axios'; +import { waitForTransaction } from '../event-proxy-server'; const packageJson = require('../package.json'); diff --git a/packages/e2e-tests/test-applications/node-experimental-fastify-app/event-proxy-server.ts b/packages/e2e-tests/test-applications/node-experimental-fastify-app/event-proxy-server.ts index 67cf80b4dabf..9dee679c71e4 100644 --- a/packages/e2e-tests/test-applications/node-experimental-fastify-app/event-proxy-server.ts +++ b/packages/e2e-tests/test-applications/node-experimental-fastify-app/event-proxy-server.ts @@ -1,5 +1,3 @@ -import type { Envelope, EnvelopeItem, Event } from '@sentry/types'; -import { parseEnvelope } from '@sentry/utils'; import * as fs from 'fs'; import * as http from 'http'; import * as https from 'https'; @@ -8,6 +6,8 @@ import * as os from 'os'; import * as path from 'path'; import * as util from 'util'; import * as zlib from 'zlib'; +import type { Envelope, EnvelopeItem, Event } from '@sentry/types'; +import { parseEnvelope } from '@sentry/utils'; const readFile = util.promisify(fs.readFile); const writeFile = util.promisify(fs.writeFile); diff --git a/packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/errors.test.ts b/packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/errors.test.ts index 70a0a9c660e0..60bef3fb0607 100644 --- a/packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/errors.test.ts +++ b/packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/errors.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import axios, { AxiosError } from 'axios'; const authToken = process.env.E2E_TEST_AUTH_TOKEN; diff --git a/packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/propagation.test.ts b/packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/propagation.test.ts index b05228b21311..84a973219aa8 100644 --- a/packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/propagation.test.ts +++ b/packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/propagation.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Span } from '@sentry/types'; import axios from 'axios'; import { waitForTransaction } from '../event-proxy-server'; diff --git a/packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/transactions.test.ts b/packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/transactions.test.ts index b89297c1689d..a6816d4543c3 100644 --- a/packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/transactions.test.ts +++ b/packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/transactions.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from '@playwright/test'; -import { waitForTransaction } from '../event-proxy-server'; +import { expect, test } from '@playwright/test'; import axios, { AxiosError } from 'axios'; +import { waitForTransaction } from '../event-proxy-server'; const authToken = process.env.E2E_TEST_AUTH_TOKEN; const sentryTestOrgSlug = process.env.E2E_TEST_SENTRY_ORG_SLUG; diff --git a/packages/e2e-tests/test-applications/node-express-app/event-proxy-server.ts b/packages/e2e-tests/test-applications/node-express-app/event-proxy-server.ts index 67cf80b4dabf..9dee679c71e4 100644 --- a/packages/e2e-tests/test-applications/node-express-app/event-proxy-server.ts +++ b/packages/e2e-tests/test-applications/node-express-app/event-proxy-server.ts @@ -1,5 +1,3 @@ -import type { Envelope, EnvelopeItem, Event } from '@sentry/types'; -import { parseEnvelope } from '@sentry/utils'; import * as fs from 'fs'; import * as http from 'http'; import * as https from 'https'; @@ -8,6 +6,8 @@ import * as os from 'os'; import * as path from 'path'; import * as util from 'util'; import * as zlib from 'zlib'; +import type { Envelope, EnvelopeItem, Event } from '@sentry/types'; +import { parseEnvelope } from '@sentry/utils'; const readFile = util.promisify(fs.readFile); const writeFile = util.promisify(fs.writeFile); diff --git a/packages/e2e-tests/test-applications/node-express-app/src/app.ts b/packages/e2e-tests/test-applications/node-express-app/src/app.ts index 9316c9a2a912..b0321e535bfa 100644 --- a/packages/e2e-tests/test-applications/node-express-app/src/app.ts +++ b/packages/e2e-tests/test-applications/node-express-app/src/app.ts @@ -1,6 +1,6 @@ +import * as Integrations from '@sentry/integrations'; import * as Sentry from '@sentry/node'; import '@sentry/tracing'; -import * as Integrations from '@sentry/integrations'; import express from 'express'; declare global { diff --git a/packages/e2e-tests/test-applications/node-express-app/tests/server.test.ts b/packages/e2e-tests/test-applications/node-express-app/tests/server.test.ts index 2443fcf55f66..b139a09dd2a6 100644 --- a/packages/e2e-tests/test-applications/node-express-app/tests/server.test.ts +++ b/packages/e2e-tests/test-applications/node-express-app/tests/server.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import axios, { AxiosError, AxiosResponse } from 'axios'; import { waitForError } from '../event-proxy-server'; diff --git a/packages/e2e-tests/test-applications/react-create-hash-router/src/index.tsx b/packages/e2e-tests/test-applications/react-create-hash-router/src/index.tsx index 643541357342..e23cb81d2c38 100644 --- a/packages/e2e-tests/test-applications/react-create-hash-router/src/index.tsx +++ b/packages/e2e-tests/test-applications/react-create-hash-router/src/index.tsx @@ -1,13 +1,13 @@ +import * as Sentry from '@sentry/react'; import React from 'react'; import ReactDOM from 'react-dom/client'; -import * as Sentry from '@sentry/react'; import { - useLocation, - useNavigationType, - createRoutesFromChildren, - matchRoutes, RouterProvider, createHashRouter, + createRoutesFromChildren, + matchRoutes, + useLocation, + useNavigationType, } from 'react-router-dom'; import Index from './pages/Index'; import User from './pages/User'; diff --git a/packages/e2e-tests/test-applications/react-create-hash-router/src/pages/Index.tsx b/packages/e2e-tests/test-applications/react-create-hash-router/src/pages/Index.tsx index 2f683c63ed84..f339eb867d6c 100644 --- a/packages/e2e-tests/test-applications/react-create-hash-router/src/pages/Index.tsx +++ b/packages/e2e-tests/test-applications/react-create-hash-router/src/pages/Index.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import * as Sentry from '@sentry/react'; +import * as React from 'react'; import { Link } from 'react-router-dom'; const Index = () => { diff --git a/packages/e2e-tests/test-applications/react-create-hash-router/tests/behaviour-test.spec.ts b/packages/e2e-tests/test-applications/react-create-hash-router/tests/behaviour-test.spec.ts index 5397dfa8eb64..f288d14004d5 100644 --- a/packages/e2e-tests/test-applications/react-create-hash-router/tests/behaviour-test.spec.ts +++ b/packages/e2e-tests/test-applications/react-create-hash-router/tests/behaviour-test.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import axios, { AxiosError } from 'axios'; import { ReplayRecordingData } from './fixtures/ReplayRecordingData'; diff --git a/packages/e2e-tests/test-applications/react-router-6-use-routes/src/index.tsx b/packages/e2e-tests/test-applications/react-router-6-use-routes/src/index.tsx index c38730e02ae7..4c4fcc5a7d4f 100644 --- a/packages/e2e-tests/test-applications/react-router-6-use-routes/src/index.tsx +++ b/packages/e2e-tests/test-applications/react-router-6-use-routes/src/index.tsx @@ -1,12 +1,12 @@ +import * as Sentry from '@sentry/react'; import React from 'react'; import ReactDOM from 'react-dom/client'; -import * as Sentry from '@sentry/react'; import { BrowserRouter, - useLocation, - useNavigationType, createRoutesFromChildren, matchRoutes, + useLocation, + useNavigationType, useRoutes, } from 'react-router-dom'; import Index from './pages/Index'; diff --git a/packages/e2e-tests/test-applications/react-router-6-use-routes/src/pages/Index.tsx b/packages/e2e-tests/test-applications/react-router-6-use-routes/src/pages/Index.tsx index 2f683c63ed84..f339eb867d6c 100644 --- a/packages/e2e-tests/test-applications/react-router-6-use-routes/src/pages/Index.tsx +++ b/packages/e2e-tests/test-applications/react-router-6-use-routes/src/pages/Index.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import * as Sentry from '@sentry/react'; +import * as React from 'react'; import { Link } from 'react-router-dom'; const Index = () => { diff --git a/packages/e2e-tests/test-applications/react-router-6-use-routes/tests/behaviour-test.spec.ts b/packages/e2e-tests/test-applications/react-router-6-use-routes/tests/behaviour-test.spec.ts index 4800c9e7cb0e..20f1c75ac222 100644 --- a/packages/e2e-tests/test-applications/react-router-6-use-routes/tests/behaviour-test.spec.ts +++ b/packages/e2e-tests/test-applications/react-router-6-use-routes/tests/behaviour-test.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import axios, { AxiosError } from 'axios'; import { ReplayRecordingData } from './fixtures/ReplayRecordingData'; diff --git a/packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/index.tsx b/packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/index.tsx index a146513fcebb..0a0babe9df84 100644 --- a/packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/index.tsx +++ b/packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/index.tsx @@ -1,15 +1,15 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; import * as Sentry from '@sentry/react'; import { BrowserTracing } from '@sentry/tracing'; +import React from 'react'; +import ReactDOM from 'react-dom/client'; import { - Routes, BrowserRouter, - useLocation, - useNavigationType, + Route, + Routes, createRoutesFromChildren, matchRoutes, - Route, + useLocation, + useNavigationType, } from 'react-router-dom'; import Index from './pages/Index'; import User from './pages/User'; diff --git a/packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/pages/Index.tsx b/packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/pages/Index.tsx index 2f683c63ed84..f339eb867d6c 100644 --- a/packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/pages/Index.tsx +++ b/packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/pages/Index.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import * as Sentry from '@sentry/react'; +import * as React from 'react'; import { Link } from 'react-router-dom'; const Index = () => { diff --git a/packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/tests/behaviour-test.spec.ts b/packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/tests/behaviour-test.spec.ts index 632d2bfe9d55..2e68363ab61a 100644 --- a/packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/tests/behaviour-test.spec.ts +++ b/packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/tests/behaviour-test.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import axios, { AxiosError } from 'axios'; const EVENT_POLLING_TIMEOUT = 90_000; diff --git a/packages/e2e-tests/test-applications/standard-frontend-react/src/index.tsx b/packages/e2e-tests/test-applications/standard-frontend-react/src/index.tsx index 3ade9c308091..dbf5717beee3 100644 --- a/packages/e2e-tests/test-applications/standard-frontend-react/src/index.tsx +++ b/packages/e2e-tests/test-applications/standard-frontend-react/src/index.tsx @@ -1,14 +1,14 @@ +import * as Sentry from '@sentry/react'; import React from 'react'; import ReactDOM from 'react-dom/client'; -import * as Sentry from '@sentry/react'; import { - Routes, BrowserRouter, - useLocation, - useNavigationType, + Route, + Routes, createRoutesFromChildren, matchRoutes, - Route, + useLocation, + useNavigationType, } from 'react-router-dom'; import Index from './pages/Index'; import User from './pages/User'; diff --git a/packages/e2e-tests/test-applications/standard-frontend-react/src/pages/Index.tsx b/packages/e2e-tests/test-applications/standard-frontend-react/src/pages/Index.tsx index 2f683c63ed84..f339eb867d6c 100644 --- a/packages/e2e-tests/test-applications/standard-frontend-react/src/pages/Index.tsx +++ b/packages/e2e-tests/test-applications/standard-frontend-react/src/pages/Index.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import * as Sentry from '@sentry/react'; +import * as React from 'react'; import { Link } from 'react-router-dom'; const Index = () => { diff --git a/packages/e2e-tests/test-applications/standard-frontend-react/tests/behaviour-test.spec.ts b/packages/e2e-tests/test-applications/standard-frontend-react/tests/behaviour-test.spec.ts index 4800c9e7cb0e..20f1c75ac222 100644 --- a/packages/e2e-tests/test-applications/standard-frontend-react/tests/behaviour-test.spec.ts +++ b/packages/e2e-tests/test-applications/standard-frontend-react/tests/behaviour-test.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import axios, { AxiosError } from 'axios'; import { ReplayRecordingData } from './fixtures/ReplayRecordingData'; diff --git a/packages/e2e-tests/test-applications/sveltekit/event-proxy-server.ts b/packages/e2e-tests/test-applications/sveltekit/event-proxy-server.ts index 3037181c36cf..66a9e744846e 100644 --- a/packages/e2e-tests/test-applications/sveltekit/event-proxy-server.ts +++ b/packages/e2e-tests/test-applications/sveltekit/event-proxy-server.ts @@ -1,5 +1,3 @@ -import type { Envelope, EnvelopeItem, Event } from '@sentry/types'; -import { parseEnvelope } from '@sentry/utils'; import * as fs from 'fs'; import * as http from 'http'; import * as https from 'https'; @@ -8,6 +6,8 @@ import * as os from 'os'; import * as path from 'path'; import * as util from 'util'; import * as zlib from 'zlib'; +import type { Envelope, EnvelopeItem, Event } from '@sentry/types'; +import { parseEnvelope } from '@sentry/utils'; const readFile = util.promisify(fs.readFile); const writeFile = util.promisify(fs.writeFile); diff --git a/packages/e2e-tests/test-applications/sveltekit/test/transaction.test.ts b/packages/e2e-tests/test-applications/sveltekit/test/transaction.test.ts index 2a069a79b22f..7d621af34dcf 100644 --- a/packages/e2e-tests/test-applications/sveltekit/test/transaction.test.ts +++ b/packages/e2e-tests/test-applications/sveltekit/test/transaction.test.ts @@ -1,7 +1,7 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; +import axios, { AxiosError } from 'axios'; // @ts-expect-error ok ok import { waitForTransaction } from '../event-proxy-server.ts'; -import axios, { AxiosError } from 'axios'; const authToken = process.env.E2E_TEST_AUTH_TOKEN; const sentryTestOrgSlug = process.env.E2E_TEST_SENTRY_ORG_SLUG; diff --git a/packages/e2e-tests/test-applications/sveltekit/vite.config.js b/packages/e2e-tests/test-applications/sveltekit/vite.config.js index 16db0ed435ce..1a410bee7e11 100644 --- a/packages/e2e-tests/test-applications/sveltekit/vite.config.js +++ b/packages/e2e-tests/test-applications/sveltekit/vite.config.js @@ -1,5 +1,5 @@ -import { sveltekit } from '@sveltejs/kit/vite'; import { sentrySvelteKit } from '@sentry/sveltekit'; +import { sveltekit } from '@sveltejs/kit/vite'; import { defineConfig } from 'vite'; export default defineConfig({ diff --git a/packages/e2e-tests/validate-test-app-setups.ts b/packages/e2e-tests/validate-test-app-setups.ts index 767c47fee8ba..325ab10a1238 100644 --- a/packages/e2e-tests/validate-test-app-setups.ts +++ b/packages/e2e-tests/validate-test-app-setups.ts @@ -1,7 +1,7 @@ /* eslint-disable no-console */ import * as fs from 'fs'; -import * as glob from 'glob'; import * as path from 'path'; +import * as glob from 'glob'; const testRecipePaths = glob.sync('test-applications/*/test-recipe.json', { cwd: __dirname, diff --git a/packages/e2e-tests/validate-verdaccio-configuration.ts b/packages/e2e-tests/validate-verdaccio-configuration.ts index ca0b20f7213e..ca727c0ec3c5 100644 --- a/packages/e2e-tests/validate-verdaccio-configuration.ts +++ b/packages/e2e-tests/validate-verdaccio-configuration.ts @@ -1,7 +1,7 @@ import * as assert from 'assert'; import * as fs from 'fs'; -import * as glob from 'glob'; import * as path from 'path'; +import * as glob from 'glob'; import * as YAML from 'yaml'; /* diff --git a/packages/ember/addon/instance-initializers/sentry-performance.ts b/packages/ember/addon/instance-initializers/sentry-performance.ts index 2e6f88046acc..c6c2eb9e4325 100644 --- a/packages/ember/addon/instance-initializers/sentry-performance.ts +++ b/packages/ember/addon/instance-initializers/sentry-performance.ts @@ -9,7 +9,7 @@ import { getOwnConfig, isTesting, macroCondition } from '@embroider/macros'; import * as Sentry from '@sentry/browser'; import type { ExtendedBackburner } from '@sentry/ember/runloop'; import type { Span, Transaction } from '@sentry/types'; -import { browserPerformanceTimeOrigin, GLOBAL_OBJ, timestampInSeconds } from '@sentry/utils'; +import { GLOBAL_OBJ, browserPerformanceTimeOrigin, timestampInSeconds } from '@sentry/utils'; import type { BrowserClient } from '..'; import { getActiveTransaction } from '..'; diff --git a/packages/feedback/test/unit/util/prepareFeedbackEvent.test.ts b/packages/feedback/test/unit/util/prepareFeedbackEvent.test.ts index c5a2c37390fb..0958b164e34d 100644 --- a/packages/feedback/test/unit/util/prepareFeedbackEvent.test.ts +++ b/packages/feedback/test/unit/util/prepareFeedbackEvent.test.ts @@ -3,7 +3,7 @@ import { getCurrentHub } from '@sentry/core'; import type { Client, FeedbackEvent } from '@sentry/types'; import { prepareFeedbackEvent } from '../../../src/util/prepareFeedbackEvent'; -import { getDefaultClientOptions, TestClient } from '../../utils/TestClient'; +import { TestClient, getDefaultClientOptions } from '../../utils/TestClient'; describe('Unit | util | prepareFeedbackEvent', () => { let hub: Hub; diff --git a/packages/gatsby/src/sdk.ts b/packages/gatsby/src/sdk.ts index 6f4f8a110e3f..26c9ab831da3 100644 --- a/packages/gatsby/src/sdk.ts +++ b/packages/gatsby/src/sdk.ts @@ -1,4 +1,4 @@ -import { init as reactInit, SDK_VERSION } from '@sentry/react'; +import { SDK_VERSION, init as reactInit } from '@sentry/react'; import { getIntegrationsFromOptions } from './utils/integrations'; import type { GatsbyOptions } from './utils/types'; diff --git a/packages/gatsby/test/integration.test.tsx b/packages/gatsby/test/integration.test.tsx index 2253c9d1ba94..88a736ceee75 100644 --- a/packages/gatsby/test/integration.test.tsx +++ b/packages/gatsby/test/integration.test.tsx @@ -1,9 +1,9 @@ +import { TextDecoder, TextEncoder } from 'util'; /* eslint-disable @typescript-eslint/no-explicit-any */ import { render } from '@testing-library/react'; import { useEffect } from 'react'; // eslint-disable-next-line @typescript-eslint/no-unused-vars import * as React from 'react'; -import { TextDecoder, TextEncoder } from 'util'; import { onClientEntry } from '../gatsby-browser'; import * as Sentry from '../src'; diff --git a/packages/gatsby/test/sdk.test.ts b/packages/gatsby/test/sdk.test.ts index 082fd771060b..c3c95cdabc1f 100644 --- a/packages/gatsby/test/sdk.test.ts +++ b/packages/gatsby/test/sdk.test.ts @@ -1,4 +1,4 @@ -import { BrowserTracing, init, SDK_VERSION } from '@sentry/react'; +import { BrowserTracing, SDK_VERSION, init } from '@sentry/react'; import type { Integration } from '@sentry/types'; import { init as gatsbyInit } from '../src/sdk'; diff --git a/packages/hub/src/index.ts b/packages/hub/src/index.ts index deec8a597632..ed804ac191a2 100644 --- a/packages/hub/src/index.ts +++ b/packages/hub/src/index.ts @@ -1,6 +1,9 @@ export type { Carrier, Layer } from '@sentry/core'; import { + Hub as HubCore, + Scope as ScopeCore, + SessionFlusher as SessionFlusherCore, addBreadcrumb as addBreadcrumbCore, addGlobalEventProcessor as addGlobalEventProcessorCore, captureEvent as captureEventCore, @@ -11,11 +14,8 @@ import { getCurrentHub as getCurrentHubCore, getHubFromCarrier as getHubFromCarrierCore, getMainCarrier as getMainCarrierCore, - Hub as HubCore, makeMain as makeMainCore, makeSession as makeSessionCore, - Scope as ScopeCore, - SessionFlusher as SessionFlusherCore, setContext as setContextCore, setExtra as setExtraCore, setExtras as setExtrasCore, diff --git a/packages/hub/test/global.test.ts b/packages/hub/test/global.test.ts index 026cc0028dee..dafe638a5a92 100644 --- a/packages/hub/test/global.test.ts +++ b/packages/hub/test/global.test.ts @@ -2,7 +2,7 @@ import { GLOBAL_OBJ } from '@sentry/utils'; -import { getCurrentHub, getHubFromCarrier, Hub } from '../src'; +import { Hub, getCurrentHub, getHubFromCarrier } from '../src'; describe('global', () => { test('getGlobalHub', () => { diff --git a/packages/hub/test/hub.test.ts b/packages/hub/test/hub.test.ts index 08b876174eb7..fbdc3993b989 100644 --- a/packages/hub/test/hub.test.ts +++ b/packages/hub/test/hub.test.ts @@ -3,7 +3,7 @@ import type { Client, Event, EventType } from '@sentry/types'; -import { getCurrentHub, Hub, Scope } from '../src'; +import { Hub, Scope, getCurrentHub } from '../src'; const clientFn: any = jest.fn(); diff --git a/packages/hub/test/scope.test.ts b/packages/hub/test/scope.test.ts index ed7b35f379c2..c64040f2b6ca 100644 --- a/packages/hub/test/scope.test.ts +++ b/packages/hub/test/scope.test.ts @@ -3,7 +3,7 @@ import type { Event, EventHint, RequestSessionStatus } from '@sentry/types'; import { GLOBAL_OBJ } from '@sentry/utils'; -import { addGlobalEventProcessor, Scope } from '../src'; +import { Scope, addGlobalEventProcessor } from '../src'; describe('Scope', () => { afterEach(() => { diff --git a/packages/integrations/src/captureconsole.ts b/packages/integrations/src/captureconsole.ts index 82dcfcde4886..8d7d2540bc2c 100644 --- a/packages/integrations/src/captureconsole.ts +++ b/packages/integrations/src/captureconsole.ts @@ -1,9 +1,9 @@ import type { EventProcessor, Hub, Integration } from '@sentry/types'; import { - addConsoleInstrumentationHandler, - addExceptionMechanism, CONSOLE_LEVELS, GLOBAL_OBJ, + addConsoleInstrumentationHandler, + addExceptionMechanism, safeJoin, severityLevelFromString, } from '@sentry/utils'; diff --git a/packages/integrations/src/contextlines.ts b/packages/integrations/src/contextlines.ts index d528477718c1..a83df95077e4 100644 --- a/packages/integrations/src/contextlines.ts +++ b/packages/integrations/src/contextlines.ts @@ -1,5 +1,5 @@ import type { Event, Integration, StackFrame } from '@sentry/types'; -import { addContextToFrame, GLOBAL_OBJ, stripUrlQueryAndFragment } from '@sentry/utils'; +import { GLOBAL_OBJ, addContextToFrame, stripUrlQueryAndFragment } from '@sentry/utils'; const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window; diff --git a/packages/integrations/src/httpclient.ts b/packages/integrations/src/httpclient.ts index 02918151817b..1e1ee0318861 100644 --- a/packages/integrations/src/httpclient.ts +++ b/packages/integrations/src/httpclient.ts @@ -7,12 +7,12 @@ import type { SentryWrappedXMLHttpRequest, } from '@sentry/types'; import { + GLOBAL_OBJ, + SENTRY_XHR_DATA_KEY, addExceptionMechanism, addFetchInstrumentationHandler, addXhrInstrumentationHandler, - GLOBAL_OBJ, logger, - SENTRY_XHR_DATA_KEY, supportsNativeFetch, } from '@sentry/utils'; diff --git a/packages/integrations/test/captureconsole.test.ts b/packages/integrations/test/captureconsole.test.ts index 3a75547592aa..49770f0adf09 100644 --- a/packages/integrations/test/captureconsole.test.ts +++ b/packages/integrations/test/captureconsole.test.ts @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/unbound-method */ import type { ConsoleLevel, Event, Hub, Integration } from '@sentry/types'; import { - addConsoleInstrumentationHandler, CONSOLE_LEVELS, GLOBAL_OBJ, + addConsoleInstrumentationHandler, originalConsoleMethods, resetInstrumentationHandlers, } from '@sentry/utils'; diff --git a/packages/integrations/test/dedupe.test.ts b/packages/integrations/test/dedupe.test.ts index f4a703662e0c..545aa1a83c1c 100644 --- a/packages/integrations/test/dedupe.test.ts +++ b/packages/integrations/test/dedupe.test.ts @@ -1,6 +1,6 @@ import type { Event as SentryEvent, Exception, StackFrame, Stacktrace } from '@sentry/types'; -import { _shouldDropEvent, Dedupe } from '../src/dedupe'; +import { Dedupe, _shouldDropEvent } from '../src/dedupe'; type EventWithException = SentryEvent & { exception: { diff --git a/packages/nextjs/playwright.config.ts b/packages/nextjs/playwright.config.ts index d8f73993c815..917c05cb9ed3 100644 --- a/packages/nextjs/playwright.config.ts +++ b/packages/nextjs/playwright.config.ts @@ -1,5 +1,5 @@ -import type { PlaywrightTestConfig } from '@playwright/test'; import * as path from 'path'; +import type { PlaywrightTestConfig } from '@playwright/test'; const config: PlaywrightTestConfig = { retries: 0, // We do not accept flakes. diff --git a/packages/nextjs/src/client/index.ts b/packages/nextjs/src/client/index.ts index b46da56cf98f..9b4e9b724f09 100644 --- a/packages/nextjs/src/client/index.ts +++ b/packages/nextjs/src/client/index.ts @@ -3,10 +3,10 @@ import { RewriteFrames } from '@sentry/integrations'; import type { BrowserOptions } from '@sentry/react'; import { BrowserTracing, + Integrations, configureScope, defaultRequestInstrumentationOptions, init as reactInit, - Integrations, } from '@sentry/react'; import type { EventProcessor } from '@sentry/types'; import { addOrUpdateIntegration } from '@sentry/utils'; diff --git a/packages/nextjs/src/client/routing/pagesRouterRoutingInstrumentation.ts b/packages/nextjs/src/client/routing/pagesRouterRoutingInstrumentation.ts index 2f5995b8354b..91929f885ae0 100644 --- a/packages/nextjs/src/client/routing/pagesRouterRoutingInstrumentation.ts +++ b/packages/nextjs/src/client/routing/pagesRouterRoutingInstrumentation.ts @@ -1,3 +1,4 @@ +import type { ParsedUrlQuery } from 'querystring'; import { getClient, getCurrentHub } from '@sentry/core'; import { WINDOW } from '@sentry/react'; import type { Primitive, Transaction, TransactionContext, TransactionSource } from '@sentry/types'; @@ -9,7 +10,6 @@ import { } from '@sentry/utils'; import type { NEXT_DATA as NextData } from 'next/dist/next-server/lib/utils'; import { default as Router } from 'next/router'; -import type { ParsedUrlQuery } from 'querystring'; import { DEBUG_BUILD } from '../../common/debug-build'; diff --git a/packages/nextjs/src/common/utils/responseEnd.ts b/packages/nextjs/src/common/utils/responseEnd.ts index 35f227261089..4d0fc40082ec 100644 --- a/packages/nextjs/src/common/utils/responseEnd.ts +++ b/packages/nextjs/src/common/utils/responseEnd.ts @@ -1,7 +1,7 @@ +import type { ServerResponse } from 'http'; import { flush } from '@sentry/core'; import type { Transaction } from '@sentry/types'; import { fill, logger } from '@sentry/utils'; -import type { ServerResponse } from 'http'; import { DEBUG_BUILD } from '../debug-build'; import type { ResponseEndMethod, WrappedResponseEndMethod } from '../types'; diff --git a/packages/nextjs/src/common/utils/wrapperUtils.ts b/packages/nextjs/src/common/utils/wrapperUtils.ts index 44487608e251..fedb5ba6f3ff 100644 --- a/packages/nextjs/src/common/utils/wrapperUtils.ts +++ b/packages/nextjs/src/common/utils/wrapperUtils.ts @@ -1,3 +1,4 @@ +import type { IncomingMessage, ServerResponse } from 'http'; import { captureException, getActiveTransaction, @@ -7,7 +8,6 @@ import { } from '@sentry/core'; import type { Span, Transaction } from '@sentry/types'; import { isString, tracingContextFromHeaders } from '@sentry/utils'; -import type { IncomingMessage, ServerResponse } from 'http'; import { platformSupportsStreaming } from './platformSupportsStreaming'; import { autoEndTransactionOnResponseEnd, flushQueue } from './responseEnd'; diff --git a/packages/nextjs/src/config/loaders/prefixLoader.ts b/packages/nextjs/src/config/loaders/prefixLoader.ts index 19e728f3b6b3..3077b3f70db0 100644 --- a/packages/nextjs/src/config/loaders/prefixLoader.ts +++ b/packages/nextjs/src/config/loaders/prefixLoader.ts @@ -1,6 +1,6 @@ -import { escapeStringForRegex } from '@sentry/utils'; import * as fs from 'fs'; import * as path from 'path'; +import { escapeStringForRegex } from '@sentry/utils'; import type { LoaderThis } from './types'; diff --git a/packages/nextjs/src/config/loaders/wrappingLoader.ts b/packages/nextjs/src/config/loaders/wrappingLoader.ts index c43be3565ab0..a6b852af8b28 100644 --- a/packages/nextjs/src/config/loaders/wrappingLoader.ts +++ b/packages/nextjs/src/config/loaders/wrappingLoader.ts @@ -1,8 +1,8 @@ +import * as fs from 'fs'; +import * as path from 'path'; import commonjs from '@rollup/plugin-commonjs'; import { stringMatchesSomePattern } from '@sentry/utils'; import * as chalk from 'chalk'; -import * as fs from 'fs'; -import * as path from 'path'; import type { RollupBuild, RollupError } from 'rollup'; import { rollup } from 'rollup'; diff --git a/packages/nextjs/src/config/templates/apiWrapperTemplate.ts b/packages/nextjs/src/config/templates/apiWrapperTemplate.ts index d8072b470715..d5eae3687403 100644 --- a/packages/nextjs/src/config/templates/apiWrapperTemplate.ts +++ b/packages/nextjs/src/config/templates/apiWrapperTemplate.ts @@ -6,9 +6,9 @@ * this causes both TS and ESLint to complain, hence the pragma comments below. */ +import * as Sentry from '@sentry/nextjs'; // @ts-expect-error See above import * as origModule from '__SENTRY_WRAPPING_TARGET_FILE__'; -import * as Sentry from '@sentry/nextjs'; import type { PageConfig } from 'next'; import type { NextApiHandler, VercelCronsConfig } from '../../common/types'; diff --git a/packages/nextjs/src/config/templates/middlewareWrapperTemplate.ts b/packages/nextjs/src/config/templates/middlewareWrapperTemplate.ts index 42809c104db7..83468b3120d8 100644 --- a/packages/nextjs/src/config/templates/middlewareWrapperTemplate.ts +++ b/packages/nextjs/src/config/templates/middlewareWrapperTemplate.ts @@ -5,9 +5,9 @@ * this causes both TS and ESLint to complain, hence the pragma comments below. */ +import * as Sentry from '@sentry/nextjs'; // @ts-expect-error See above import * as origModule from '__SENTRY_WRAPPING_TARGET_FILE__'; -import * as Sentry from '@sentry/nextjs'; import type { EdgeRouteHandler } from '../../edge/types'; diff --git a/packages/nextjs/src/config/templates/pageWrapperTemplate.ts b/packages/nextjs/src/config/templates/pageWrapperTemplate.ts index d5fba5ca24e9..7ac89ed1931c 100644 --- a/packages/nextjs/src/config/templates/pageWrapperTemplate.ts +++ b/packages/nextjs/src/config/templates/pageWrapperTemplate.ts @@ -6,9 +6,9 @@ * this causes both TS and ESLint to complain, hence the pragma comments below. */ +import * as Sentry from '@sentry/nextjs'; // @ts-expect-error See above import * as wrapee from '__SENTRY_WRAPPING_TARGET_FILE__'; -import * as Sentry from '@sentry/nextjs'; import type { GetServerSideProps, GetStaticProps, NextPage as NextPageComponent } from 'next'; type NextPageModule = { diff --git a/packages/nextjs/src/config/templates/routeHandlerWrapperTemplate.ts b/packages/nextjs/src/config/templates/routeHandlerWrapperTemplate.ts index d40874b19f4b..b09d35c98b4b 100644 --- a/packages/nextjs/src/config/templates/routeHandlerWrapperTemplate.ts +++ b/packages/nextjs/src/config/templates/routeHandlerWrapperTemplate.ts @@ -1,9 +1,9 @@ +import * as Sentry from '@sentry/nextjs'; // @ts-expect-error Because we cannot be sure if the RequestAsyncStorage module exists (it is not part of the Next.js public // API) we use a shim if it doesn't exist. The logic for this is in the wrapping loader. import { requestAsyncStorage } from '__SENTRY_NEXTJS_REQUEST_ASYNC_STORAGE_SHIM__'; // @ts-expect-error See above import * as routeModule from '__SENTRY_WRAPPING_TARGET_FILE__'; -import * as Sentry from '@sentry/nextjs'; import type { RequestAsyncStorage } from './requestAsyncStorageShim'; diff --git a/packages/nextjs/src/config/templates/serverComponentWrapperTemplate.ts b/packages/nextjs/src/config/templates/serverComponentWrapperTemplate.ts index 687e72e02fde..d0cc4adc4466 100644 --- a/packages/nextjs/src/config/templates/serverComponentWrapperTemplate.ts +++ b/packages/nextjs/src/config/templates/serverComponentWrapperTemplate.ts @@ -1,10 +1,10 @@ +import * as Sentry from '@sentry/nextjs'; +import type { WebFetchHeaders } from '@sentry/types'; // @ts-expect-error Because we cannot be sure if the RequestAsyncStorage module exists (it is not part of the Next.js public // API) we use a shim if it doesn't exist. The logic for this is in the wrapping loader. import { requestAsyncStorage } from '__SENTRY_NEXTJS_REQUEST_ASYNC_STORAGE_SHIM__'; // @ts-expect-error We use `__SENTRY_WRAPPING_TARGET_FILE__` as a placeholder for the path to the file being wrapped. import * as serverComponentModule from '__SENTRY_WRAPPING_TARGET_FILE__'; -import * as Sentry from '@sentry/nextjs'; -import type { WebFetchHeaders } from '@sentry/types'; import type { RequestAsyncStorage } from './requestAsyncStorageShim'; diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts index 63a4a8f27d86..6f9b27d56423 100644 --- a/packages/nextjs/src/config/webpack.ts +++ b/packages/nextjs/src/config/webpack.ts @@ -1,11 +1,11 @@ +import * as fs from 'fs'; +import * as path from 'path'; /* eslint-disable complexity */ /* eslint-disable max-lines */ import { getSentryRelease } from '@sentry/node'; import { arrayify, dropUndefinedKeys, escapeStringForRegex, loadModule, logger } from '@sentry/utils'; import type SentryCliPlugin from '@sentry/webpack-plugin'; import * as chalk from 'chalk'; -import * as fs from 'fs'; -import * as path from 'path'; import { sync as resolveSync } from 'resolve'; import type { Compiler } from 'webpack'; diff --git a/packages/nextjs/src/edge/index.ts b/packages/nextjs/src/edge/index.ts index 250aa2c31c24..5c4d39c3bdc7 100644 --- a/packages/nextjs/src/edge/index.ts +++ b/packages/nextjs/src/edge/index.ts @@ -1,7 +1,7 @@ -import { addTracingExtensions, SDK_VERSION } from '@sentry/core'; +import { SDK_VERSION, addTracingExtensions } from '@sentry/core'; import { RewriteFrames } from '@sentry/integrations'; import type { SdkMetadata } from '@sentry/types'; -import { addOrUpdateIntegration, escapeStringForRegex, GLOBAL_OBJ } from '@sentry/utils'; +import { GLOBAL_OBJ, addOrUpdateIntegration, escapeStringForRegex } from '@sentry/utils'; import type { VercelEdgeOptions } from '@sentry/vercel-edge'; import { init as vercelEdgeInit } from '@sentry/vercel-edge'; diff --git a/packages/nextjs/src/server/index.ts b/packages/nextjs/src/server/index.ts index a672d814bc78..b049be2c31b8 100644 --- a/packages/nextjs/src/server/index.ts +++ b/packages/nextjs/src/server/index.ts @@ -1,11 +1,11 @@ +import * as path from 'path'; import { addTracingExtensions } from '@sentry/core'; import { RewriteFrames } from '@sentry/integrations'; import type { NodeOptions } from '@sentry/node'; -import { configureScope, getCurrentHub, init as nodeInit, Integrations } from '@sentry/node'; +import { Integrations, configureScope, getCurrentHub, init as nodeInit } from '@sentry/node'; import type { EventProcessor } from '@sentry/types'; import type { IntegrationWithExclusionOption } from '@sentry/utils'; import { addOrUpdateIntegration, escapeStringForRegex, logger } from '@sentry/utils'; -import * as path from 'path'; import { DEBUG_BUILD } from '../common/debug-build'; import { devErrorSymbolicationEventProcessor } from '../common/devErrorSymbolicationEventProcessor'; diff --git a/packages/nextjs/test/clientSdk.test.ts b/packages/nextjs/test/clientSdk.test.ts index 499b62425442..ebedef2506c0 100644 --- a/packages/nextjs/test/clientSdk.test.ts +++ b/packages/nextjs/test/clientSdk.test.ts @@ -6,7 +6,7 @@ import type { UserIntegrationsFunction } from '@sentry/utils'; import { logger } from '@sentry/utils'; import { JSDOM } from 'jsdom'; -import { init, Integrations, nextRouterInstrumentation } from '../src/client'; +import { Integrations, init, nextRouterInstrumentation } from '../src/client'; const reactInit = jest.spyOn(SentryReact, 'init'); const captureEvent = jest.spyOn(BaseClient.prototype, 'captureEvent'); diff --git a/packages/nextjs/test/config/webpack/sentryWebpackPlugin.test.ts b/packages/nextjs/test/config/webpack/sentryWebpackPlugin.test.ts index 8f5c7a3923ad..db17062041c8 100644 --- a/packages/nextjs/test/config/webpack/sentryWebpackPlugin.test.ts +++ b/packages/nextjs/test/config/webpack/sentryWebpackPlugin.test.ts @@ -1,7 +1,7 @@ -import { default as SentryWebpackPlugin } from '@sentry/webpack-plugin'; import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; +import { default as SentryWebpackPlugin } from '@sentry/webpack-plugin'; import type { BuildContext, ExportedNextConfig } from '../../../src/config/types'; import { getUserConfigFile, getWebpackPluginOptions } from '../../../src/config/webpack'; diff --git a/packages/nextjs/test/config/wrappers.test.ts b/packages/nextjs/test/config/wrappers.test.ts index 5f776bc0ea4d..b6d29d5ecff2 100644 --- a/packages/nextjs/test/config/wrappers.test.ts +++ b/packages/nextjs/test/config/wrappers.test.ts @@ -1,6 +1,6 @@ +import type { IncomingMessage, ServerResponse } from 'http'; import * as SentryCore from '@sentry/core'; import { addTracingExtensions } from '@sentry/core'; -import type { IncomingMessage, ServerResponse } from 'http'; import { wrapGetInitialPropsWithSentry, wrapGetServerSidePropsWithSentry } from '../../src/common'; diff --git a/packages/nextjs/test/integration/components/Layout.tsx b/packages/nextjs/test/integration/components/Layout.tsx index e7c168830ccb..25db194506fa 100644 --- a/packages/nextjs/test/integration/components/Layout.tsx +++ b/packages/nextjs/test/integration/components/Layout.tsx @@ -1,6 +1,6 @@ -import React, { ReactNode } from 'react'; -import Link from 'next/link'; import Head from 'next/head'; +import Link from 'next/link'; +import React, { ReactNode } from 'react'; type Props = { children?: ReactNode; diff --git a/packages/nextjs/test/integration/components/List.tsx b/packages/nextjs/test/integration/components/List.tsx index 0974fd055305..e5c88d3e4b42 100644 --- a/packages/nextjs/test/integration/components/List.tsx +++ b/packages/nextjs/test/integration/components/List.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import ListItem from './ListItem'; import { User } from '../interfaces'; +import ListItem from './ListItem'; type Props = { items: User[]; diff --git a/packages/nextjs/test/integration/components/ListItem.tsx b/packages/nextjs/test/integration/components/ListItem.tsx index 0f1acb6572d2..2f5d131ae3ad 100644 --- a/packages/nextjs/test/integration/components/ListItem.tsx +++ b/packages/nextjs/test/integration/components/ListItem.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import Link from 'next/link'; +import React from 'react'; import { User } from '../interfaces'; diff --git a/packages/nextjs/test/integration/pages/api/requireTest.ts b/packages/nextjs/test/integration/pages/api/requireTest.ts index 38d27c637d2c..353dd632927e 100644 --- a/packages/nextjs/test/integration/pages/api/requireTest.ts +++ b/packages/nextjs/test/integration/pages/api/requireTest.ts @@ -1,4 +1,4 @@ -import { NextApiResponse, NextApiRequest } from 'next'; +import { NextApiRequest, NextApiResponse } from 'next'; if (process.env.NEXT_PUBLIC_SOME_FALSE_ENV_VAR === 'enabled') { require('../../test/server/utils/throw'); // Should not throw unless the hoisting in the wrapping loader is messed up! diff --git a/packages/nextjs/test/integration/pages/users/[id].tsx b/packages/nextjs/test/integration/pages/users/[id].tsx index ad7be7d0b07e..20f79eb0ecd7 100644 --- a/packages/nextjs/test/integration/pages/users/[id].tsx +++ b/packages/nextjs/test/integration/pages/users/[id].tsx @@ -1,9 +1,9 @@ -import { GetStaticProps, GetStaticPaths } from 'next'; +import { GetStaticPaths, GetStaticProps } from 'next'; -import { User } from '../../interfaces'; -import { sampleUserData } from '../../utils/sample-data'; import Layout from '../../components/Layout'; import ListDetail from '../../components/ListDetail'; +import { User } from '../../interfaces'; +import { sampleUserData } from '../../utils/sample-data'; type Props = { item?: User; diff --git a/packages/nextjs/test/integration/pages/users/index.tsx b/packages/nextjs/test/integration/pages/users/index.tsx index 9313d3992dc6..90e959ff440e 100644 --- a/packages/nextjs/test/integration/pages/users/index.tsx +++ b/packages/nextjs/test/integration/pages/users/index.tsx @@ -1,10 +1,10 @@ import { GetStaticProps } from 'next'; import Link from 'next/link'; -import { User } from '../../interfaces'; -import { sampleUserData } from '../../utils/sample-data'; import Layout from '../../components/Layout'; import List from '../../components/List'; +import { User } from '../../interfaces'; +import { sampleUserData } from '../../utils/sample-data'; type Props = { items: User[]; diff --git a/packages/nextjs/test/integration/test/client/appDirTracingPageloadClientcomponent.test.ts b/packages/nextjs/test/integration/test/client/appDirTracingPageloadClientcomponent.test.ts index 25b4be5fedc0..019c84438c72 100644 --- a/packages/nextjs/test/integration/test/client/appDirTracingPageloadClientcomponent.test.ts +++ b/packages/nextjs/test/integration/test/client/appDirTracingPageloadClientcomponent.test.ts @@ -1,5 +1,5 @@ -import { getMultipleSentryEnvelopeRequests, countEnvelopes } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; +import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should create a pageload transaction when the `app` directory is used with a client component.', async ({ page, diff --git a/packages/nextjs/test/integration/test/client/appDirTracingPageloadServercomponent.test.ts b/packages/nextjs/test/integration/test/client/appDirTracingPageloadServercomponent.test.ts index bb3c2a61d675..aa77dc5c9afb 100644 --- a/packages/nextjs/test/integration/test/client/appDirTracingPageloadServercomponent.test.ts +++ b/packages/nextjs/test/integration/test/client/appDirTracingPageloadServercomponent.test.ts @@ -1,5 +1,5 @@ -import { getMultipleSentryEnvelopeRequests, countEnvelopes } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; +import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should create a pageload transaction when the `app` directory is used with a server component.', async ({ page, diff --git a/packages/nextjs/test/integration/test/client/errorClick.test.ts b/packages/nextjs/test/integration/test/client/errorClick.test.ts index aa73e54ec4f7..85369b19e355 100644 --- a/packages/nextjs/test/integration/test/client/errorClick.test.ts +++ b/packages/nextjs/test/integration/test/client/errorClick.test.ts @@ -1,6 +1,6 @@ -import { getMultipleSentryEnvelopeRequests } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Event } from '@sentry/types'; +import { getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should capture error triggered on click', async ({ page }) => { await page.goto('/errorClick'); diff --git a/packages/nextjs/test/integration/test/client/errorGlobal.test.ts b/packages/nextjs/test/integration/test/client/errorGlobal.test.ts index 4e5d1f66fae9..09191094f49f 100644 --- a/packages/nextjs/test/integration/test/client/errorGlobal.test.ts +++ b/packages/nextjs/test/integration/test/client/errorGlobal.test.ts @@ -1,6 +1,6 @@ -import { getMultipleSentryEnvelopeRequests } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Event } from '@sentry/types'; +import { getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should capture a globally triggered event', async ({ page }) => { const event = await getMultipleSentryEnvelopeRequests(page, 1, { url: '/crashed', envelopeType: 'event' }); diff --git a/packages/nextjs/test/integration/test/client/faultyAppGetInitialPropsConfiguration.test.ts b/packages/nextjs/test/integration/test/client/faultyAppGetInitialPropsConfiguration.test.ts index 0c4250e9c658..b03c1f9f705f 100644 --- a/packages/nextjs/test/integration/test/client/faultyAppGetInitialPropsConfiguration.test.ts +++ b/packages/nextjs/test/integration/test/client/faultyAppGetInitialPropsConfiguration.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; // This test verifies that a faulty configuration of `getInitialProps` in `_app` will not cause our // auto - wrapping / instrumentation to throw an error. diff --git a/packages/nextjs/test/integration/test/client/reportDialog.test.ts b/packages/nextjs/test/integration/test/client/reportDialog.test.ts index 2cc59dcfbef7..bfbb54d775ad 100644 --- a/packages/nextjs/test/integration/test/client/reportDialog.test.ts +++ b/packages/nextjs/test/integration/test/client/reportDialog.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; test('should show a dialog', async ({ page }) => { await page.goto('/reportDialog'); diff --git a/packages/nextjs/test/integration/test/client/sessionCrashed.test.ts b/packages/nextjs/test/integration/test/client/sessionCrashed.test.ts index 547346bbebed..a16615cb7afb 100644 --- a/packages/nextjs/test/integration/test/client/sessionCrashed.test.ts +++ b/packages/nextjs/test/integration/test/client/sessionCrashed.test.ts @@ -1,6 +1,6 @@ -import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Session } from '@sentry/types'; +import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should report crashed sessions', async ({ page }) => { const event = await getMultipleSentryEnvelopeRequests(page, 2, { url: '/crashed', envelopeType: 'session' }); diff --git a/packages/nextjs/test/integration/test/client/sessionHealthy.test.ts b/packages/nextjs/test/integration/test/client/sessionHealthy.test.ts index 51cd180619e5..ffbc238fe7ae 100644 --- a/packages/nextjs/test/integration/test/client/sessionHealthy.test.ts +++ b/packages/nextjs/test/integration/test/client/sessionHealthy.test.ts @@ -1,6 +1,6 @@ -import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Session } from '@sentry/types'; +import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should report healthy sessions', async ({ page }) => { const event = await getMultipleSentryEnvelopeRequests(page, 1, { url: '/healthy', envelopeType: 'session' }); diff --git a/packages/nextjs/test/integration/test/client/sessionNavigate.test.ts b/packages/nextjs/test/integration/test/client/sessionNavigate.test.ts index 9316d55e182c..05b201f99609 100644 --- a/packages/nextjs/test/integration/test/client/sessionNavigate.test.ts +++ b/packages/nextjs/test/integration/test/client/sessionNavigate.test.ts @@ -1,6 +1,6 @@ -import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Session } from '@sentry/types'; +import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should report navigation sessions', async ({ page }) => { const event = await getMultipleSentryEnvelopeRequests(page, 1, { url: '/healthy', envelopeType: 'session' }); diff --git a/packages/nextjs/test/integration/test/client/tracingClientGetInitialProps.test.ts b/packages/nextjs/test/integration/test/client/tracingClientGetInitialProps.test.ts index 6b7e05761743..ddacc8bbca91 100644 --- a/packages/nextjs/test/integration/test/client/tracingClientGetInitialProps.test.ts +++ b/packages/nextjs/test/integration/test/client/tracingClientGetInitialProps.test.ts @@ -1,6 +1,6 @@ -import { getMultipleSentryEnvelopeRequests, countEnvelopes } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Transaction } from '@sentry/types'; +import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should instrument `getInitialProps` for performance tracing', async ({ page }) => { const transaction = await getMultipleSentryEnvelopeRequests(page, 1, { diff --git a/packages/nextjs/test/integration/test/client/tracingClientGetServerSideProps.test.ts b/packages/nextjs/test/integration/test/client/tracingClientGetServerSideProps.test.ts index 434a87301332..4da9bc181469 100644 --- a/packages/nextjs/test/integration/test/client/tracingClientGetServerSideProps.test.ts +++ b/packages/nextjs/test/integration/test/client/tracingClientGetServerSideProps.test.ts @@ -1,6 +1,6 @@ -import { getMultipleSentryEnvelopeRequests, countEnvelopes } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Transaction } from '@sentry/types'; +import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should instrument `getServerSideProps` for performance tracing', async ({ page }) => { const transaction = await getMultipleSentryEnvelopeRequests(page, 1, { diff --git a/packages/nextjs/test/integration/test/client/tracingDynamicRoute.test.ts b/packages/nextjs/test/integration/test/client/tracingDynamicRoute.test.ts index 0305d67ee475..015668852f40 100644 --- a/packages/nextjs/test/integration/test/client/tracingDynamicRoute.test.ts +++ b/packages/nextjs/test/integration/test/client/tracingDynamicRoute.test.ts @@ -1,6 +1,6 @@ -import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Transaction } from '@sentry/types'; +import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should correctly instrument dynamic routes for tracing', async ({ page }) => { const transaction = await getMultipleSentryEnvelopeRequests(page, 1, { diff --git a/packages/nextjs/test/integration/test/client/tracingFetch.test.ts b/packages/nextjs/test/integration/test/client/tracingFetch.test.ts index ef3953b39e75..0a6c2af8c5f3 100644 --- a/packages/nextjs/test/integration/test/client/tracingFetch.test.ts +++ b/packages/nextjs/test/integration/test/client/tracingFetch.test.ts @@ -1,6 +1,6 @@ -import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Transaction } from '@sentry/types'; +import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should correctly instrument `fetch` for performance tracing', async ({ page }) => { await page.route('http://example.com/**/*', route => { diff --git a/packages/nextjs/test/integration/test/client/tracingNavigate.test.ts b/packages/nextjs/test/integration/test/client/tracingNavigate.test.ts index ef8e3ad26a98..23c7c6ed0a6d 100644 --- a/packages/nextjs/test/integration/test/client/tracingNavigate.test.ts +++ b/packages/nextjs/test/integration/test/client/tracingNavigate.test.ts @@ -1,6 +1,6 @@ -import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Transaction } from '@sentry/types'; +import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should report navigation transactions', async ({ page }) => { const transaction = await getMultipleSentryEnvelopeRequests(page, 1, { diff --git a/packages/nextjs/test/integration/test/client/tracingPageLoad.test.ts b/packages/nextjs/test/integration/test/client/tracingPageLoad.test.ts index dc0f76d67644..65e1eaf93df6 100644 --- a/packages/nextjs/test/integration/test/client/tracingPageLoad.test.ts +++ b/packages/nextjs/test/integration/test/client/tracingPageLoad.test.ts @@ -1,6 +1,6 @@ -import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Transaction } from '@sentry/types'; +import { countEnvelopes, getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should report a `pageload` transaction', async ({ page }) => { const transaction = await getMultipleSentryEnvelopeRequests(page, 1, { diff --git a/packages/nextjs/test/integration/test/server/tracingHttp.test.ts b/packages/nextjs/test/integration/test/server/tracingHttp.test.ts index 0f8615c4b7f0..c39b8d72f064 100644 --- a/packages/nextjs/test/integration/test/server/tracingHttp.test.ts +++ b/packages/nextjs/test/integration/test/server/tracingHttp.test.ts @@ -1,5 +1,5 @@ -import { NextTestEnv } from './utils/helpers'; import nock from 'nock'; +import { NextTestEnv } from './utils/helpers'; describe('Tracing HTTP', () => { it('should capture a transaction', async () => { diff --git a/packages/nextjs/test/integration/test/server/utils/helpers.ts b/packages/nextjs/test/integration/test/server/utils/helpers.ts index 8e1660e5dfe0..7f463d894513 100644 --- a/packages/nextjs/test/integration/test/server/utils/helpers.ts +++ b/packages/nextjs/test/integration/test/server/utils/helpers.ts @@ -1,10 +1,10 @@ -import { TestEnv } from '../../../../../../node-integration-tests/utils'; import * as http from 'http'; +import { Server, createServer } from 'http'; +import { AddressInfo } from 'net'; import * as path from 'path'; -import { createServer, Server } from 'http'; import { parse } from 'url'; import next from 'next'; -import { AddressInfo } from 'net'; +import { TestEnv } from '../../../../../../node-integration-tests/utils'; // Type not exported from NextJS // @ts-expect-error diff --git a/packages/nextjs/test/serverSdk.test.ts b/packages/nextjs/test/serverSdk.test.ts index 6757b6fe20d1..3467f2baa548 100644 --- a/packages/nextjs/test/serverSdk.test.ts +++ b/packages/nextjs/test/serverSdk.test.ts @@ -1,6 +1,6 @@ import { runWithAsyncContext } from '@sentry/core'; import * as SentryNode from '@sentry/node'; -import { getCurrentHub, NodeClient } from '@sentry/node'; +import { NodeClient, getCurrentHub } from '@sentry/node'; import type { Integration } from '@sentry/types'; import { GLOBAL_OBJ, logger } from '@sentry/utils'; diff --git a/packages/nextjs/test/types/test.ts b/packages/nextjs/test/types/test.ts index 5ff6045952fb..d9b5f059958c 100644 --- a/packages/nextjs/test/types/test.ts +++ b/packages/nextjs/test/types/test.ts @@ -1,6 +1,6 @@ +import { execSync } from 'child_process'; /* eslint-disable no-console */ import { parseSemver } from '@sentry/utils'; -import { execSync } from 'child_process'; const NODE_VERSION = parseSemver(process.versions.node); diff --git a/packages/node-experimental/src/integrations/getAutoPerformanceIntegrations.ts b/packages/node-experimental/src/integrations/getAutoPerformanceIntegrations.ts index 44081d6040f8..1a4200ab6fb0 100644 --- a/packages/node-experimental/src/integrations/getAutoPerformanceIntegrations.ts +++ b/packages/node-experimental/src/integrations/getAutoPerformanceIntegrations.ts @@ -1,5 +1,6 @@ import type { Integration } from '@sentry/types'; +import type { NodePerformanceIntegration } from './NodePerformanceIntegration'; import { Express } from './express'; import { Fastify } from './fastify'; import { GraphQL } from './graphql'; @@ -9,7 +10,6 @@ import { Mongoose } from './mongoose'; import { Mysql } from './mysql'; import { Mysql2 } from './mysql2'; import { Nest } from './nest'; -import type { NodePerformanceIntegration } from './NodePerformanceIntegration'; import { Postgres } from './postgres'; import { Prisma } from './prisma'; diff --git a/packages/node-experimental/src/integrations/http.ts b/packages/node-experimental/src/integrations/http.ts index 4eb0308c6bd0..974828fd46fe 100644 --- a/packages/node-experimental/src/integrations/http.ts +++ b/packages/node-experimental/src/integrations/http.ts @@ -1,3 +1,4 @@ +import type { ClientRequest, IncomingMessage, ServerResponse } from 'http'; import type { Span } from '@opentelemetry/api'; import { SpanKind } from '@opentelemetry/api'; import { registerInstrumentations } from '@opentelemetry/instrumentation'; @@ -6,7 +7,6 @@ import { hasTracingEnabled, isSentryRequestUrl } from '@sentry/core'; import { _INTERNAL, getClient, getCurrentHub, getSpanKind, setSpanMetadata } from '@sentry/opentelemetry'; import type { EventProcessor, Hub, Integration } from '@sentry/types'; import { stringMatchesSomePattern } from '@sentry/utils'; -import type { ClientRequest, IncomingMessage, ServerResponse } from 'http'; import type { NodeExperimentalClient } from '../types'; import { addOriginToSpan } from '../utils/addOriginToSpan'; diff --git a/packages/node-experimental/src/sdk/initOtel.ts b/packages/node-experimental/src/sdk/initOtel.ts index 285938b92c90..53f319d313b6 100644 --- a/packages/node-experimental/src/sdk/initOtel.ts +++ b/packages/node-experimental/src/sdk/initOtel.ts @@ -1,13 +1,13 @@ -import { diag, DiagLogLevel } from '@opentelemetry/api'; +import { DiagLogLevel, diag } from '@opentelemetry/api'; import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks'; import { Resource } from '@opentelemetry/resources'; import { BasicTracerProvider } from '@opentelemetry/sdk-trace-base'; import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'; import { SDK_VERSION } from '@sentry/core'; import { - getClient, SentryPropagator, SentrySampler, + getClient, setupEventContextTrace, wrapContextManagerClass, } from '@sentry/opentelemetry'; diff --git a/packages/node-experimental/src/sdk/spanProcessor.ts b/packages/node-experimental/src/sdk/spanProcessor.ts index 5b6870cbc9fd..067e1568e90f 100644 --- a/packages/node-experimental/src/sdk/spanProcessor.ts +++ b/packages/node-experimental/src/sdk/spanProcessor.ts @@ -1,7 +1,7 @@ import { SpanKind } from '@opentelemetry/api'; import type { Span } from '@opentelemetry/sdk-trace-base'; import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; -import { getClient, SentrySpanProcessor } from '@sentry/opentelemetry'; +import { SentrySpanProcessor, getClient } from '@sentry/opentelemetry'; import { Http } from '../integrations/http'; import { NodeFetch } from '../integrations/node-fetch'; diff --git a/packages/node-experimental/test/helpers/mockSdkInit.ts b/packages/node-experimental/test/helpers/mockSdkInit.ts index 3443f0608806..82752ab203d0 100644 --- a/packages/node-experimental/test/helpers/mockSdkInit.ts +++ b/packages/node-experimental/test/helpers/mockSdkInit.ts @@ -1,4 +1,4 @@ -import { context, propagation, ProxyTracerProvider, trace } from '@opentelemetry/api'; +import { ProxyTracerProvider, context, propagation, trace } from '@opentelemetry/api'; import { BasicTracerProvider } from '@opentelemetry/sdk-trace-base'; import { GLOBAL_OBJ } from '@sentry/utils'; diff --git a/packages/node-experimental/test/integration/transactions.test.ts b/packages/node-experimental/test/integration/transactions.test.ts index 45dafa88916c..107377c9a633 100644 --- a/packages/node-experimental/test/integration/transactions.test.ts +++ b/packages/node-experimental/test/integration/transactions.test.ts @@ -1,7 +1,7 @@ -import { context, SpanKind, trace, TraceFlags } from '@opentelemetry/api'; +import { SpanKind, TraceFlags, context, trace } from '@opentelemetry/api'; import type { SpanProcessor } from '@opentelemetry/sdk-trace-base'; import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; -import { getCurrentHub, SentrySpanProcessor, setPropagationContextOnContext } from '@sentry/opentelemetry'; +import { SentrySpanProcessor, getCurrentHub, setPropagationContextOnContext } from '@sentry/opentelemetry'; import type { Integration, PropagationContext, TransactionEvent } from '@sentry/types'; import { logger } from '@sentry/utils'; diff --git a/packages/node-integration-tests/suites/anr/test.ts b/packages/node-integration-tests/suites/anr/test.ts index e7214ae194ec..0c815c280f00 100644 --- a/packages/node-integration-tests/suites/anr/test.ts +++ b/packages/node-integration-tests/suites/anr/test.ts @@ -1,8 +1,8 @@ +import * as childProcess from 'child_process'; +import * as path from 'path'; import type { Event } from '@sentry/node'; import type { SerializedSession } from '@sentry/types'; import { parseSemver } from '@sentry/utils'; -import * as childProcess from 'child_process'; -import * as path from 'path'; const NODE_VERSION = parseSemver(process.versions.node).major || 0; diff --git a/packages/node-integration-tests/suites/express/handle-error/test.ts b/packages/node-integration-tests/suites/express/handle-error/test.ts index d9eb59a72785..5d2f22ddb195 100644 --- a/packages/node-integration-tests/suites/express/handle-error/test.ts +++ b/packages/node-integration-tests/suites/express/handle-error/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../utils/index'; +import { TestEnv, assertSentryEvent } from '../../../utils/index'; test('should capture and send Express controller error.', async () => { const env = await TestEnv.init(__dirname, `${__dirname}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/multiple-routers/common-infix-parameterized/test.ts b/packages/node-integration-tests/suites/express/multiple-routers/common-infix-parameterized/test.ts index 2bf79275a7a9..722351a372f6 100644 --- a/packages/node-integration-tests/suites/express/multiple-routers/common-infix-parameterized/test.ts +++ b/packages/node-integration-tests/suites/express/multiple-routers/common-infix-parameterized/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils/index'; +import { TestEnv, assertSentryEvent } from '../../../../utils/index'; test('should construct correct url with common infixes with multiple parameterized routers.', async () => { const env = await TestEnv.init(__dirname, `${__dirname}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/multiple-routers/common-infix/test.ts b/packages/node-integration-tests/suites/express/multiple-routers/common-infix/test.ts index fc921c23b350..81244b1d637b 100644 --- a/packages/node-integration-tests/suites/express/multiple-routers/common-infix/test.ts +++ b/packages/node-integration-tests/suites/express/multiple-routers/common-infix/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils/index'; +import { TestEnv, assertSentryEvent } from '../../../../utils/index'; test('should construct correct url with common infixes with multiple routers.', async () => { const env = await TestEnv.init(__dirname, `${__dirname}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-parameterized-reverse/test.ts b/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-parameterized-reverse/test.ts index 55bc51f60ddf..85f613cf6417 100644 --- a/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-parameterized-reverse/test.ts +++ b/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-parameterized-reverse/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils/index'; +import { TestEnv, assertSentryEvent } from '../../../../utils/index'; test('should construct correct urls with multiple parameterized routers (use order reversed).', async () => { const env = await TestEnv.init(__dirname, `${__dirname}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-parameterized/test.ts b/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-parameterized/test.ts index 81b624e8bdb8..ff4ad719109c 100644 --- a/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-parameterized/test.ts +++ b/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-parameterized/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils/index'; +import { TestEnv, assertSentryEvent } from '../../../../utils/index'; test('should construct correct urls with multiple parameterized routers.', async () => { const env = await TestEnv.init(__dirname, `${__dirname}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-same-length-parameterized copy/test.ts b/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-same-length-parameterized copy/test.ts index 2ccbd477a557..604a714532d0 100644 --- a/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-same-length-parameterized copy/test.ts +++ b/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-same-length-parameterized copy/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils/index'; +import { TestEnv, assertSentryEvent } from '../../../../utils/index'; test('should construct correct url with multiple parameterized routers of the same length (use order reversed).', async () => { const env = await TestEnv.init(__dirname, `${__dirname}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-same-length-parameterized/test.ts b/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-same-length-parameterized/test.ts index 05449a0b18bf..1c94d1711214 100644 --- a/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-same-length-parameterized/test.ts +++ b/packages/node-integration-tests/suites/express/multiple-routers/common-prefix-same-length-parameterized/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils/index'; +import { TestEnv, assertSentryEvent } from '../../../../utils/index'; test('should construct correct url with multiple parameterized routers of the same length.', async () => { const env = await TestEnv.init(__dirname, `${__dirname}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/multiple-routers/common-prefix/test.ts b/packages/node-integration-tests/suites/express/multiple-routers/common-prefix/test.ts index cd5b81be2992..2156837aa7c9 100644 --- a/packages/node-integration-tests/suites/express/multiple-routers/common-prefix/test.ts +++ b/packages/node-integration-tests/suites/express/multiple-routers/common-prefix/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils/index'; +import { TestEnv, assertSentryEvent } from '../../../../utils/index'; test('should construct correct urls with multiple routers.', async () => { const env = await TestEnv.init(__dirname, `${__dirname}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/multiple-routers/complex-router/test.ts b/packages/node-integration-tests/suites/express/multiple-routers/complex-router/test.ts index 05de34cc8159..50372674108f 100644 --- a/packages/node-integration-tests/suites/express/multiple-routers/complex-router/test.ts +++ b/packages/node-integration-tests/suites/express/multiple-routers/complex-router/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils/index'; +import { TestEnv, assertSentryEvent } from '../../../../utils/index'; test('should construct correct url with multiple parameterized routers, when param is also contain in middle layer route and express used multiple middlewares with route', async () => { const env = await TestEnv.init(__dirname, `${__dirname}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/multiple-routers/middle-layer-parameterized/test.ts b/packages/node-integration-tests/suites/express/multiple-routers/middle-layer-parameterized/test.ts index 3527cce5c3a6..133d24dfab3d 100644 --- a/packages/node-integration-tests/suites/express/multiple-routers/middle-layer-parameterized/test.ts +++ b/packages/node-integration-tests/suites/express/multiple-routers/middle-layer-parameterized/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils/index'; +import { TestEnv, assertSentryEvent } from '../../../../utils/index'; test('should construct correct url with multiple parameterized routers, when param is also contain in middle layer route', async () => { const env = await TestEnv.init(__dirname, `${__dirname}/server.ts`); diff --git a/packages/node-integration-tests/suites/express/sentry-trace/baggage-header-out/server.ts b/packages/node-integration-tests/suites/express/sentry-trace/baggage-header-out/server.ts index 750f49b40210..31e5580fe56a 100644 --- a/packages/node-integration-tests/suites/express/sentry-trace/baggage-header-out/server.ts +++ b/packages/node-integration-tests/suites/express/sentry-trace/baggage-header-out/server.ts @@ -1,8 +1,8 @@ +import http from 'http'; import * as Sentry from '@sentry/node'; import * as Tracing from '@sentry/tracing'; import cors from 'cors'; import express from 'express'; -import http from 'http'; const app = express(); diff --git a/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors-with-sentry-entries/server.ts b/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors-with-sentry-entries/server.ts index 93738d4c0a12..2d872e14574c 100644 --- a/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors-with-sentry-entries/server.ts +++ b/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors-with-sentry-entries/server.ts @@ -1,8 +1,8 @@ +import http from 'http'; import * as Sentry from '@sentry/node'; import * as Tracing from '@sentry/tracing'; import cors from 'cors'; import express from 'express'; -import http from 'http'; const app = express(); diff --git a/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors/server.ts b/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors/server.ts index 867bb0e6131e..81c6f986cd79 100644 --- a/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors/server.ts +++ b/packages/node-integration-tests/suites/express/sentry-trace/baggage-other-vendors/server.ts @@ -1,8 +1,8 @@ +import http from 'http'; import * as Sentry from '@sentry/node'; import * as Tracing from '@sentry/tracing'; import cors from 'cors'; import express from 'express'; -import http from 'http'; const app = express(); diff --git a/packages/node-integration-tests/suites/express/sentry-trace/baggage-transaction-name/server.ts b/packages/node-integration-tests/suites/express/sentry-trace/baggage-transaction-name/server.ts index 21738f3b3fb8..061a7815ca75 100644 --- a/packages/node-integration-tests/suites/express/sentry-trace/baggage-transaction-name/server.ts +++ b/packages/node-integration-tests/suites/express/sentry-trace/baggage-transaction-name/server.ts @@ -1,8 +1,8 @@ +import http from 'http'; import * as Sentry from '@sentry/node'; import * as Tracing from '@sentry/tracing'; import cors from 'cors'; import express from 'express'; -import http from 'http'; const app = express(); diff --git a/packages/node-integration-tests/suites/express/sentry-trace/server.ts b/packages/node-integration-tests/suites/express/sentry-trace/server.ts index 1cfc02648f02..b9cace447b4a 100644 --- a/packages/node-integration-tests/suites/express/sentry-trace/server.ts +++ b/packages/node-integration-tests/suites/express/sentry-trace/server.ts @@ -1,8 +1,8 @@ +import http from 'http'; import * as Sentry from '@sentry/node'; import * as Tracing from '@sentry/tracing'; import cors from 'cors'; import express from 'express'; -import http from 'http'; const app = express(); diff --git a/packages/node-integration-tests/suites/express/sentry-trace/trace-header-assign/test.ts b/packages/node-integration-tests/suites/express/sentry-trace/trace-header-assign/test.ts index cb90133b043f..83765cee248d 100644 --- a/packages/node-integration-tests/suites/express/sentry-trace/trace-header-assign/test.ts +++ b/packages/node-integration-tests/suites/express/sentry-trace/trace-header-assign/test.ts @@ -1,5 +1,5 @@ -import { TRACEPARENT_REGEXP } from '@sentry/utils'; import * as path from 'path'; +import { TRACEPARENT_REGEXP } from '@sentry/utils'; import { TestEnv } from '../../../../utils/index'; import type { TestAPIResponse } from '../server'; diff --git a/packages/node-integration-tests/suites/express/sentry-trace/trace-header-out/test.ts b/packages/node-integration-tests/suites/express/sentry-trace/trace-header-out/test.ts index aeccfd23a2e5..f9f841caf3d8 100644 --- a/packages/node-integration-tests/suites/express/sentry-trace/trace-header-out/test.ts +++ b/packages/node-integration-tests/suites/express/sentry-trace/trace-header-out/test.ts @@ -1,5 +1,5 @@ -import { TRACEPARENT_REGEXP } from '@sentry/utils'; import * as path from 'path'; +import { TRACEPARENT_REGEXP } from '@sentry/utils'; import { TestEnv } from '../../../../utils/index'; import type { TestAPIResponse } from '../server'; diff --git a/packages/node-integration-tests/suites/express/tracing/test.ts b/packages/node-integration-tests/suites/express/tracing/test.ts index 835c2938ae5b..e391ca881b30 100644 --- a/packages/node-integration-tests/suites/express/tracing/test.ts +++ b/packages/node-integration-tests/suites/express/tracing/test.ts @@ -1,4 +1,4 @@ -import { assertSentryTransaction, TestEnv } from '../../../utils/index'; +import { TestEnv, assertSentryTransaction } from '../../../utils/index'; test('should create and send transactions for Express routes and spans for middlewares.', async () => { const env = await TestEnv.init(__dirname, `${__dirname}/server.ts`); diff --git a/packages/node-integration-tests/suites/public-api/LocalVariables/test.ts b/packages/node-integration-tests/suites/public-api/LocalVariables/test.ts index d07959e9d10d..0b542c19c629 100644 --- a/packages/node-integration-tests/suites/public-api/LocalVariables/test.ts +++ b/packages/node-integration-tests/suites/public-api/LocalVariables/test.ts @@ -1,6 +1,6 @@ -import type { Event } from '@sentry/node'; import * as childProcess from 'child_process'; import * as path from 'path'; +import type { Event } from '@sentry/node'; import { conditionalTest } from '../../../utils'; diff --git a/packages/node-integration-tests/suites/public-api/addBreadcrumb/empty-obj/test.ts b/packages/node-integration-tests/suites/public-api/addBreadcrumb/empty-obj/test.ts index f384ccf292dc..99392c290924 100644 --- a/packages/node-integration-tests/suites/public-api/addBreadcrumb/empty-obj/test.ts +++ b/packages/node-integration-tests/suites/public-api/addBreadcrumb/empty-obj/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should add an empty breadcrumb, when an empty object is given', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/test.ts b/packages/node-integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/test.ts index 30dbfa54108f..79feca7d7b9e 100644 --- a/packages/node-integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/test.ts +++ b/packages/node-integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should add multiple breadcrumbs', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/test.ts b/packages/node-integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/test.ts index 9fb42f2f4685..b405549ffdaf 100644 --- a/packages/node-integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/test.ts +++ b/packages/node-integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should add a simple breadcrumb', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/captureException/catched-error/test.ts b/packages/node-integration-tests/suites/public-api/captureException/catched-error/test.ts index 7225c0f4b1f9..d47b03efd21b 100644 --- a/packages/node-integration-tests/suites/public-api/captureException/catched-error/test.ts +++ b/packages/node-integration-tests/suites/public-api/captureException/catched-error/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should work inside catch block', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/captureException/empty-obj/test.ts b/packages/node-integration-tests/suites/public-api/captureException/empty-obj/test.ts index 37d5ed8b9855..8d27b5db2548 100644 --- a/packages/node-integration-tests/suites/public-api/captureException/empty-obj/test.ts +++ b/packages/node-integration-tests/suites/public-api/captureException/empty-obj/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should capture an empty object', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/captureException/simple-error/test.ts b/packages/node-integration-tests/suites/public-api/captureException/simple-error/test.ts index ab09786380b4..e12a2d4dec16 100644 --- a/packages/node-integration-tests/suites/public-api/captureException/simple-error/test.ts +++ b/packages/node-integration-tests/suites/public-api/captureException/simple-error/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should capture a simple error with message', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/captureMessage/simple_message/test.ts b/packages/node-integration-tests/suites/public-api/captureMessage/simple_message/test.ts index 421360d460b7..876fd978b6b3 100644 --- a/packages/node-integration-tests/suites/public-api/captureMessage/simple_message/test.ts +++ b/packages/node-integration-tests/suites/public-api/captureMessage/simple_message/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should capture a simple message string', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/captureMessage/with_level/test.ts b/packages/node-integration-tests/suites/public-api/captureMessage/with_level/test.ts index e7f20f96fe9e..c4ab3d189cf7 100644 --- a/packages/node-integration-tests/suites/public-api/captureMessage/with_level/test.ts +++ b/packages/node-integration-tests/suites/public-api/captureMessage/with_level/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should capture with different severity levels', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/configureScope/clear_scope/test.ts b/packages/node-integration-tests/suites/public-api/configureScope/clear_scope/test.ts index 4891187a10d4..e575ab06faae 100644 --- a/packages/node-integration-tests/suites/public-api/configureScope/clear_scope/test.ts +++ b/packages/node-integration-tests/suites/public-api/configureScope/clear_scope/test.ts @@ -1,6 +1,6 @@ import type { Event } from '@sentry/node'; -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should clear previously set properties of a scope', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/configureScope/set_properties/test.ts b/packages/node-integration-tests/suites/public-api/configureScope/set_properties/test.ts index 43f82ac64383..0f89eb334800 100644 --- a/packages/node-integration-tests/suites/public-api/configureScope/set_properties/test.ts +++ b/packages/node-integration-tests/suites/public-api/configureScope/set_properties/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should set different properties of a scope', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/setContext/multiple-contexts/test.ts b/packages/node-integration-tests/suites/public-api/setContext/multiple-contexts/test.ts index 51ad8a30af17..db449f8e3cf3 100644 --- a/packages/node-integration-tests/suites/public-api/setContext/multiple-contexts/test.ts +++ b/packages/node-integration-tests/suites/public-api/setContext/multiple-contexts/test.ts @@ -1,6 +1,6 @@ import type { Event } from '@sentry/node'; -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should record multiple contexts', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/setContext/non-serializable-context/test.ts b/packages/node-integration-tests/suites/public-api/setContext/non-serializable-context/test.ts index 85f29fdab4dc..289715e2bc06 100644 --- a/packages/node-integration-tests/suites/public-api/setContext/non-serializable-context/test.ts +++ b/packages/node-integration-tests/suites/public-api/setContext/non-serializable-context/test.ts @@ -1,6 +1,6 @@ import type { Event } from '@sentry/node'; -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should normalize non-serializable context', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/setContext/simple-context/test.ts b/packages/node-integration-tests/suites/public-api/setContext/simple-context/test.ts index 89c1128fefb0..a8d3588a2c9c 100644 --- a/packages/node-integration-tests/suites/public-api/setContext/simple-context/test.ts +++ b/packages/node-integration-tests/suites/public-api/setContext/simple-context/test.ts @@ -1,6 +1,6 @@ import type { Event } from '@sentry/node'; -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should set a simple context', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/setExtra/multiple-extras/test.ts b/packages/node-integration-tests/suites/public-api/setExtra/multiple-extras/test.ts index 6caf42fc4b2b..10b398b36fd3 100644 --- a/packages/node-integration-tests/suites/public-api/setExtra/multiple-extras/test.ts +++ b/packages/node-integration-tests/suites/public-api/setExtra/multiple-extras/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should record multiple extras of different types', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/setExtra/non-serializable-extra/test.ts b/packages/node-integration-tests/suites/public-api/setExtra/non-serializable-extra/test.ts index 167a636d3ed8..439a91db98d1 100644 --- a/packages/node-integration-tests/suites/public-api/setExtra/non-serializable-extra/test.ts +++ b/packages/node-integration-tests/suites/public-api/setExtra/non-serializable-extra/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should normalize non-serializable extra', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/setExtra/simple-extra/test.ts b/packages/node-integration-tests/suites/public-api/setExtra/simple-extra/test.ts index 952db2f17dee..dbac8bdd0607 100644 --- a/packages/node-integration-tests/suites/public-api/setExtra/simple-extra/test.ts +++ b/packages/node-integration-tests/suites/public-api/setExtra/simple-extra/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should set a simple extra', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/setExtras/consecutive-calls/test.ts b/packages/node-integration-tests/suites/public-api/setExtras/consecutive-calls/test.ts index bec43b67e6cd..fd3d00a0b5da 100644 --- a/packages/node-integration-tests/suites/public-api/setExtras/consecutive-calls/test.ts +++ b/packages/node-integration-tests/suites/public-api/setExtras/consecutive-calls/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should set extras from multiple consecutive calls', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/setExtras/multiple-extras/test.ts b/packages/node-integration-tests/suites/public-api/setExtras/multiple-extras/test.ts index a860d5654177..940330a68a63 100644 --- a/packages/node-integration-tests/suites/public-api/setExtras/multiple-extras/test.ts +++ b/packages/node-integration-tests/suites/public-api/setExtras/multiple-extras/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should record an extras object', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/setTag/with-primitives/test.ts b/packages/node-integration-tests/suites/public-api/setTag/with-primitives/test.ts index 11a4eee61f30..623502d751b6 100644 --- a/packages/node-integration-tests/suites/public-api/setTag/with-primitives/test.ts +++ b/packages/node-integration-tests/suites/public-api/setTag/with-primitives/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should set primitive tags', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/setTags/with-primitives/test.ts b/packages/node-integration-tests/suites/public-api/setTags/with-primitives/test.ts index 11a4eee61f30..623502d751b6 100644 --- a/packages/node-integration-tests/suites/public-api/setTags/with-primitives/test.ts +++ b/packages/node-integration-tests/suites/public-api/setTags/with-primitives/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should set primitive tags', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/setUser/unset_user/test.ts b/packages/node-integration-tests/suites/public-api/setUser/unset_user/test.ts index 46d4c5180526..9b95e30f68cc 100644 --- a/packages/node-integration-tests/suites/public-api/setUser/unset_user/test.ts +++ b/packages/node-integration-tests/suites/public-api/setUser/unset_user/test.ts @@ -1,6 +1,6 @@ import type { Event } from '@sentry/node'; -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should unset user', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/setUser/update_user/test.ts b/packages/node-integration-tests/suites/public-api/setUser/update_user/test.ts index 40c3c663a502..3f630bdf4586 100644 --- a/packages/node-integration-tests/suites/public-api/setUser/update_user/test.ts +++ b/packages/node-integration-tests/suites/public-api/setUser/update_user/test.ts @@ -1,4 +1,4 @@ -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should update user', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/startTransaction/basic-usage/test.ts b/packages/node-integration-tests/suites/public-api/startTransaction/basic-usage/test.ts index 6a5377e2717b..4628782f025c 100644 --- a/packages/node-integration-tests/suites/public-api/startTransaction/basic-usage/test.ts +++ b/packages/node-integration-tests/suites/public-api/startTransaction/basic-usage/test.ts @@ -1,4 +1,4 @@ -import { assertSentryTransaction, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryTransaction } from '../../../../utils'; test('should send a manually started transaction when @sentry/tracing is imported using unnamed import.', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/startTransaction/with-nested-spans/test.ts b/packages/node-integration-tests/suites/public-api/startTransaction/with-nested-spans/test.ts index 0f23709ae9cf..5c4e5564c09d 100644 --- a/packages/node-integration-tests/suites/public-api/startTransaction/with-nested-spans/test.ts +++ b/packages/node-integration-tests/suites/public-api/startTransaction/with-nested-spans/test.ts @@ -1,4 +1,4 @@ -import { assertSentryTransaction, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryTransaction } from '../../../../utils'; test('should report finished spans as children of the root transaction.', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/public-api/withScope/nested-scopes/test.ts b/packages/node-integration-tests/suites/public-api/withScope/nested-scopes/test.ts index 21c842e6a6f7..63752853046b 100644 --- a/packages/node-integration-tests/suites/public-api/withScope/nested-scopes/test.ts +++ b/packages/node-integration-tests/suites/public-api/withScope/nested-scopes/test.ts @@ -1,6 +1,6 @@ import type { Event } from '@sentry/node'; -import { assertSentryEvent, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryEvent } from '../../../../utils'; test('should allow nested scoping', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/sessions/crashed-session-aggregate/test.ts b/packages/node-integration-tests/suites/sessions/crashed-session-aggregate/test.ts index e47bafb4797a..6e8766e8ff3e 100644 --- a/packages/node-integration-tests/suites/sessions/crashed-session-aggregate/test.ts +++ b/packages/node-integration-tests/suites/sessions/crashed-session-aggregate/test.ts @@ -1,5 +1,5 @@ -import nock from 'nock'; import path from 'path'; +import nock from 'nock'; import { TestEnv } from '../../../utils'; diff --git a/packages/node-integration-tests/suites/sessions/exited-session-aggregate/test.ts b/packages/node-integration-tests/suites/sessions/exited-session-aggregate/test.ts index c610533aa605..ae0182fde295 100644 --- a/packages/node-integration-tests/suites/sessions/exited-session-aggregate/test.ts +++ b/packages/node-integration-tests/suites/sessions/exited-session-aggregate/test.ts @@ -1,5 +1,5 @@ -import nock from 'nock'; import path from 'path'; +import nock from 'nock'; import { TestEnv } from '../../../utils'; diff --git a/packages/node-integration-tests/suites/tracing-new/apollo-graphql/test.ts b/packages/node-integration-tests/suites/tracing-new/apollo-graphql/test.ts index 128f8a2f164b..bcddfd588447 100644 --- a/packages/node-integration-tests/suites/tracing-new/apollo-graphql/test.ts +++ b/packages/node-integration-tests/suites/tracing-new/apollo-graphql/test.ts @@ -1,4 +1,4 @@ -import { assertSentryTransaction, conditionalTest, TestEnv } from '../../../utils'; +import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../utils'; // Node 10 is not supported by `graphql-js` // Ref: https://github.com/graphql/graphql-js/blob/main/package.json diff --git a/packages/node-integration-tests/suites/tracing-new/auto-instrument/mongodb/test.ts b/packages/node-integration-tests/suites/tracing-new/auto-instrument/mongodb/test.ts index 2d2ec05553e3..7c65cc25df25 100644 --- a/packages/node-integration-tests/suites/tracing-new/auto-instrument/mongodb/test.ts +++ b/packages/node-integration-tests/suites/tracing-new/auto-instrument/mongodb/test.ts @@ -1,6 +1,6 @@ import { MongoMemoryServer } from 'mongodb-memory-server-global'; -import { assertSentryTransaction, conditionalTest, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../../utils'; // This test can take longer. jest.setTimeout(15000); diff --git a/packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withConnect/test.ts b/packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withConnect/test.ts index 972c9496216a..14d4acbaec50 100644 --- a/packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withConnect/test.ts +++ b/packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withConnect/test.ts @@ -1,4 +1,4 @@ -import { assertSentryTransaction, TestEnv } from '../../../../../utils'; +import { TestEnv, assertSentryTransaction } from '../../../../../utils'; test('should auto-instrument `mysql` package when using connection.connect()', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withoutCallback/test.ts b/packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withoutCallback/test.ts index ccc5df1c4739..0f6dee99d59b 100644 --- a/packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withoutCallback/test.ts +++ b/packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withoutCallback/test.ts @@ -1,4 +1,4 @@ -import { assertSentryTransaction, TestEnv } from '../../../../../utils'; +import { TestEnv, assertSentryTransaction } from '../../../../../utils'; test('should auto-instrument `mysql` package when using query without callback', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withoutConnect/test.ts b/packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withoutConnect/test.ts index 85340c2c6fc7..e05dc7d9e85c 100644 --- a/packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withoutConnect/test.ts +++ b/packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withoutConnect/test.ts @@ -1,4 +1,4 @@ -import { assertSentryTransaction, TestEnv } from '../../../../../utils'; +import { TestEnv, assertSentryTransaction } from '../../../../../utils'; test('should auto-instrument `mysql` package without connection.connect()', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/tracing-new/auto-instrument/pg/test.ts b/packages/node-integration-tests/suites/tracing-new/auto-instrument/pg/test.ts index 359e04d7d5f0..6efeb6281c05 100644 --- a/packages/node-integration-tests/suites/tracing-new/auto-instrument/pg/test.ts +++ b/packages/node-integration-tests/suites/tracing-new/auto-instrument/pg/test.ts @@ -1,4 +1,4 @@ -import { assertSentryTransaction, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryTransaction } from '../../../../utils'; class PgClient { // https://node-postgres.com/api/client#clientquery diff --git a/packages/node-integration-tests/suites/tracing-new/prisma-orm/scenario.ts b/packages/node-integration-tests/suites/tracing-new/prisma-orm/scenario.ts index 0eb40d9c83ee..27d82a4c4dd1 100644 --- a/packages/node-integration-tests/suites/tracing-new/prisma-orm/scenario.ts +++ b/packages/node-integration-tests/suites/tracing-new/prisma-orm/scenario.ts @@ -1,7 +1,7 @@ +import { randomBytes } from 'crypto'; /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { PrismaClient } from '@prisma/client'; import * as Sentry from '@sentry/node'; -import { randomBytes } from 'crypto'; const client = new PrismaClient(); diff --git a/packages/node-integration-tests/suites/tracing-new/prisma-orm/setup.ts b/packages/node-integration-tests/suites/tracing-new/prisma-orm/setup.ts index 3c40d12f7337..d5c4e552b397 100755 --- a/packages/node-integration-tests/suites/tracing-new/prisma-orm/setup.ts +++ b/packages/node-integration-tests/suites/tracing-new/prisma-orm/setup.ts @@ -1,5 +1,5 @@ -import { parseSemver } from '@sentry/utils'; import { execSync } from 'child_process'; +import { parseSemver } from '@sentry/utils'; const NODE_VERSION = parseSemver(process.versions.node); diff --git a/packages/node-integration-tests/suites/tracing-new/prisma-orm/test.ts b/packages/node-integration-tests/suites/tracing-new/prisma-orm/test.ts index cae5bbc2c46a..4a76f328dd34 100644 --- a/packages/node-integration-tests/suites/tracing-new/prisma-orm/test.ts +++ b/packages/node-integration-tests/suites/tracing-new/prisma-orm/test.ts @@ -1,4 +1,4 @@ -import { assertSentryTransaction, conditionalTest, TestEnv } from '../../../utils'; +import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../utils'; conditionalTest({ min: 12 })('Prisma ORM Integration', () => { test('should instrument Prisma client for tracing.', async () => { diff --git a/packages/node-integration-tests/suites/tracing-new/tracePropagationTargets/scenario.ts b/packages/node-integration-tests/suites/tracing-new/tracePropagationTargets/scenario.ts index aac4bb97035f..9084c06441fb 100644 --- a/packages/node-integration-tests/suites/tracing-new/tracePropagationTargets/scenario.ts +++ b/packages/node-integration-tests/suites/tracing-new/tracePropagationTargets/scenario.ts @@ -1,6 +1,6 @@ +import * as http from 'http'; // eslint-disable-next-line @typescript-eslint/no-unused-vars import * as Sentry from '@sentry/node'; -import * as http from 'http'; Sentry.init({ dsn: 'https://public@dsn.ingest.sentry.io/1337', diff --git a/packages/node-integration-tests/suites/tracing-new/tracePropagationTargets/test.ts b/packages/node-integration-tests/suites/tracing-new/tracePropagationTargets/test.ts index 1209c59da46a..01b75ab10330 100644 --- a/packages/node-integration-tests/suites/tracing-new/tracePropagationTargets/test.ts +++ b/packages/node-integration-tests/suites/tracing-new/tracePropagationTargets/test.ts @@ -1,6 +1,6 @@ import nock from 'nock'; -import { runScenario, TestEnv } from '../../../utils'; +import { TestEnv, runScenario } from '../../../utils'; test('HttpIntegration should instrument correct requests when tracePropagationTargets option is provided', async () => { const match1 = nock('http://match-this-url.com') diff --git a/packages/node-integration-tests/suites/tracing/apollo-graphql/test.ts b/packages/node-integration-tests/suites/tracing/apollo-graphql/test.ts index 128f8a2f164b..bcddfd588447 100644 --- a/packages/node-integration-tests/suites/tracing/apollo-graphql/test.ts +++ b/packages/node-integration-tests/suites/tracing/apollo-graphql/test.ts @@ -1,4 +1,4 @@ -import { assertSentryTransaction, conditionalTest, TestEnv } from '../../../utils'; +import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../utils'; // Node 10 is not supported by `graphql-js` // Ref: https://github.com/graphql/graphql-js/blob/main/package.json diff --git a/packages/node-integration-tests/suites/tracing/auto-instrument/mongodb/test.ts b/packages/node-integration-tests/suites/tracing/auto-instrument/mongodb/test.ts index 2d2ec05553e3..7c65cc25df25 100644 --- a/packages/node-integration-tests/suites/tracing/auto-instrument/mongodb/test.ts +++ b/packages/node-integration-tests/suites/tracing/auto-instrument/mongodb/test.ts @@ -1,6 +1,6 @@ import { MongoMemoryServer } from 'mongodb-memory-server-global'; -import { assertSentryTransaction, conditionalTest, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../../utils'; // This test can take longer. jest.setTimeout(15000); diff --git a/packages/node-integration-tests/suites/tracing/auto-instrument/mysql/test.ts b/packages/node-integration-tests/suites/tracing/auto-instrument/mysql/test.ts index b28c6b613e48..3fcf25d731a5 100644 --- a/packages/node-integration-tests/suites/tracing/auto-instrument/mysql/test.ts +++ b/packages/node-integration-tests/suites/tracing/auto-instrument/mysql/test.ts @@ -1,4 +1,4 @@ -import { assertSentryTransaction, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryTransaction } from '../../../../utils'; test('should auto-instrument `mysql` package.', async () => { const env = await TestEnv.init(__dirname); diff --git a/packages/node-integration-tests/suites/tracing/auto-instrument/pg/test.ts b/packages/node-integration-tests/suites/tracing/auto-instrument/pg/test.ts index a9d4b56b0b3c..559f41fcb26a 100644 --- a/packages/node-integration-tests/suites/tracing/auto-instrument/pg/test.ts +++ b/packages/node-integration-tests/suites/tracing/auto-instrument/pg/test.ts @@ -1,4 +1,4 @@ -import { assertSentryTransaction, TestEnv } from '../../../../utils'; +import { TestEnv, assertSentryTransaction } from '../../../../utils'; class PgClient { database?: string = 'test'; diff --git a/packages/node-integration-tests/suites/tracing/prisma-orm/scenario.ts b/packages/node-integration-tests/suites/tracing/prisma-orm/scenario.ts index 9c6e25e8b342..7d953353dfe3 100644 --- a/packages/node-integration-tests/suites/tracing/prisma-orm/scenario.ts +++ b/packages/node-integration-tests/suites/tracing/prisma-orm/scenario.ts @@ -1,8 +1,8 @@ +import { randomBytes } from 'crypto'; /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { PrismaClient } from '@prisma/client'; import * as Sentry from '@sentry/node'; import * as Tracing from '@sentry/tracing'; -import { randomBytes } from 'crypto'; const client = new PrismaClient(); diff --git a/packages/node-integration-tests/suites/tracing/prisma-orm/setup.ts b/packages/node-integration-tests/suites/tracing/prisma-orm/setup.ts index 3c40d12f7337..d5c4e552b397 100755 --- a/packages/node-integration-tests/suites/tracing/prisma-orm/setup.ts +++ b/packages/node-integration-tests/suites/tracing/prisma-orm/setup.ts @@ -1,5 +1,5 @@ -import { parseSemver } from '@sentry/utils'; import { execSync } from 'child_process'; +import { parseSemver } from '@sentry/utils'; const NODE_VERSION = parseSemver(process.versions.node); diff --git a/packages/node-integration-tests/suites/tracing/prisma-orm/test.ts b/packages/node-integration-tests/suites/tracing/prisma-orm/test.ts index cae5bbc2c46a..4a76f328dd34 100644 --- a/packages/node-integration-tests/suites/tracing/prisma-orm/test.ts +++ b/packages/node-integration-tests/suites/tracing/prisma-orm/test.ts @@ -1,4 +1,4 @@ -import { assertSentryTransaction, conditionalTest, TestEnv } from '../../../utils'; +import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../utils'; conditionalTest({ min: 12 })('Prisma ORM Integration', () => { test('should instrument Prisma client for tracing.', async () => { diff --git a/packages/node-integration-tests/suites/tracing/tracePropagationTargets/scenario.ts b/packages/node-integration-tests/suites/tracing/tracePropagationTargets/scenario.ts index a4d5e84484a5..23ca6e7122cc 100644 --- a/packages/node-integration-tests/suites/tracing/tracePropagationTargets/scenario.ts +++ b/packages/node-integration-tests/suites/tracing/tracePropagationTargets/scenario.ts @@ -1,8 +1,8 @@ // eslint-disable-next-line @typescript-eslint/no-unused-vars import '@sentry/tracing'; -import * as Sentry from '@sentry/node'; import * as http from 'http'; +import * as Sentry from '@sentry/node'; Sentry.init({ dsn: 'https://public@dsn.ingest.sentry.io/1337', diff --git a/packages/node-integration-tests/suites/tracing/tracePropagationTargets/test.ts b/packages/node-integration-tests/suites/tracing/tracePropagationTargets/test.ts index 1209c59da46a..01b75ab10330 100644 --- a/packages/node-integration-tests/suites/tracing/tracePropagationTargets/test.ts +++ b/packages/node-integration-tests/suites/tracing/tracePropagationTargets/test.ts @@ -1,6 +1,6 @@ import nock from 'nock'; -import { runScenario, TestEnv } from '../../../utils'; +import { TestEnv, runScenario } from '../../../utils'; test('HttpIntegration should instrument correct requests when tracePropagationTargets option is provided', async () => { const match1 = nock('http://match-this-url.com') diff --git a/packages/node-integration-tests/utils/index.ts b/packages/node-integration-tests/utils/index.ts index a30689a45d11..ced5b2475aee 100644 --- a/packages/node-integration-tests/utils/index.ts +++ b/packages/node-integration-tests/utils/index.ts @@ -1,3 +1,6 @@ +import type * as http from 'http'; +import type { AddressInfo } from 'net'; +import * as path from 'path'; /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import * as Sentry from '@sentry/node'; import type { EnvelopeItemType } from '@sentry/types'; @@ -5,12 +8,9 @@ import { logger, parseSemver } from '@sentry/utils'; import type { AxiosRequestConfig } from 'axios'; import axios from 'axios'; import type { Express } from 'express'; -import type * as http from 'http'; import type { HttpTerminator } from 'http-terminator'; import { createHttpTerminator } from 'http-terminator'; -import type { AddressInfo } from 'net'; import nock from 'nock'; -import * as path from 'path'; const NODE_VERSION = parseSemver(process.versions.node).major; diff --git a/packages/node/src/anr/index.ts b/packages/node/src/anr/index.ts index e2b5b62b1c3c..b7a85273f4db 100644 --- a/packages/node/src/anr/index.ts +++ b/packages/node/src/anr/index.ts @@ -1,7 +1,7 @@ +import { spawn } from 'child_process'; import { getClient, makeSession, updateSession } from '@sentry/core'; import type { Event, Session, StackFrame } from '@sentry/types'; import { logger, watchdogTimer } from '@sentry/utils'; -import { spawn } from 'child_process'; import { addGlobalEventProcessor, captureEvent, flush, getCurrentHub } from '..'; import { captureStackTrace } from './debugger'; diff --git a/packages/node/src/async/domain.ts b/packages/node/src/async/domain.ts index 628d2428e8ed..345cfc06baea 100644 --- a/packages/node/src/async/domain.ts +++ b/packages/node/src/async/domain.ts @@ -1,6 +1,6 @@ +import * as domain from 'domain'; import type { Carrier, Hub, RunWithAsyncContextOptions } from '@sentry/core'; import { ensureHubOnCarrier, getHubFromCarrier, setAsyncContextStrategy, setHubOnCarrier } from '@sentry/core'; -import * as domain from 'domain'; function getActiveDomain(): T | undefined { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any diff --git a/packages/node/src/client.ts b/packages/node/src/client.ts index 8a174754d1f1..70fcd043d537 100644 --- a/packages/node/src/client.ts +++ b/packages/node/src/client.ts @@ -1,7 +1,7 @@ -import type { ServerRuntimeClientOptions } from '@sentry/core'; -import { SDK_VERSION, ServerRuntimeClient } from '@sentry/core'; import * as os from 'os'; import { TextEncoder } from 'util'; +import type { ServerRuntimeClientOptions } from '@sentry/core'; +import { SDK_VERSION, ServerRuntimeClient } from '@sentry/core'; import type { NodeClientOptions } from './types'; diff --git a/packages/node/src/handlers.ts b/packages/node/src/handlers.ts index b266a22e7f1d..83f23ccaec7c 100644 --- a/packages/node/src/handlers.ts +++ b/packages/node/src/handlers.ts @@ -1,3 +1,4 @@ +import type * as http from 'http'; /* eslint-disable @typescript-eslint/no-explicit-any */ import { captureException, @@ -22,7 +23,6 @@ import { logger, normalize, } from '@sentry/utils'; -import type * as http from 'http'; import type { NodeClient } from './client'; import { DEBUG_BUILD } from './debug-build'; diff --git a/packages/node/src/integrations/console.ts b/packages/node/src/integrations/console.ts index 9f39b41fe0b1..f99ab88b43b5 100644 --- a/packages/node/src/integrations/console.ts +++ b/packages/node/src/integrations/console.ts @@ -1,7 +1,7 @@ +import * as util from 'util'; import { getCurrentHub } from '@sentry/core'; import type { Integration } from '@sentry/types'; import { addConsoleInstrumentationHandler, severityLevelFromString } from '@sentry/utils'; -import * as util from 'util'; /** Console module integration */ export class Console implements Integration { diff --git a/packages/node/src/integrations/context.ts b/packages/node/src/integrations/context.ts index 5b683d5c688d..f7044c509265 100644 --- a/packages/node/src/integrations/context.ts +++ b/packages/node/src/integrations/context.ts @@ -1,3 +1,8 @@ +import { execFile } from 'child_process'; +import { readFile, readdir } from 'fs'; +import * as os from 'os'; +import { join } from 'path'; +import { promisify } from 'util'; /* eslint-disable max-lines */ import type { AppContext, @@ -10,11 +15,6 @@ import type { Integration, OsContext, } from '@sentry/types'; -import { execFile } from 'child_process'; -import { readdir, readFile } from 'fs'; -import * as os from 'os'; -import { join } from 'path'; -import { promisify } from 'util'; // TODO: Required until we drop support for Node v8 export const readFileAsync = promisify(readFile); diff --git a/packages/node/src/integrations/contextlines.ts b/packages/node/src/integrations/contextlines.ts index f47e31eb268a..c48f35adfd8b 100644 --- a/packages/node/src/integrations/contextlines.ts +++ b/packages/node/src/integrations/contextlines.ts @@ -1,6 +1,6 @@ -import type { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types'; -import { addContextToFrame, LRUMap } from '@sentry/utils'; import { readFile } from 'fs'; +import type { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types'; +import { LRUMap, addContextToFrame } from '@sentry/utils'; const FILE_CONTENT_CACHE = new LRUMap(100); const DEFAULT_LINES_OF_CONTEXT = 7; diff --git a/packages/node/src/integrations/http.ts b/packages/node/src/integrations/http.ts index be5f061e62e5..407343a96770 100644 --- a/packages/node/src/integrations/http.ts +++ b/packages/node/src/integrations/http.ts @@ -1,3 +1,5 @@ +import type * as http from 'http'; +import type * as https from 'https'; import type { Hub } from '@sentry/core'; import { getCurrentHub, getDynamicSamplingContextFromClient, isSentryRequestUrl } from '@sentry/core'; import type { @@ -8,15 +10,13 @@ import type { TracePropagationTargets, } from '@sentry/types'; import { + LRUMap, dynamicSamplingContextToSentryBaggageHeader, fill, generateSentryTraceHeader, logger, - LRUMap, stringMatchesSomePattern, } from '@sentry/utils'; -import type * as http from 'http'; -import type * as https from 'https'; import type { NodeClient } from '../client'; import { DEBUG_BUILD } from '../debug-build'; diff --git a/packages/node/src/integrations/localvariables.ts b/packages/node/src/integrations/localvariables.ts index 5ac70db4a839..a41822331ea5 100644 --- a/packages/node/src/integrations/localvariables.ts +++ b/packages/node/src/integrations/localvariables.ts @@ -1,6 +1,6 @@ /* eslint-disable max-lines */ import type { Event, EventProcessor, Exception, Hub, Integration, StackFrame, StackParser } from '@sentry/types'; -import { logger, LRUMap } from '@sentry/utils'; +import { LRUMap, logger } from '@sentry/utils'; import type { Debugger, InspectorNotification, Runtime, Session } from 'inspector'; import { NODE_VERSION } from '../nodeVersion'; diff --git a/packages/node/src/integrations/modules.ts b/packages/node/src/integrations/modules.ts index 376c0b0144f6..9a81d5808425 100644 --- a/packages/node/src/integrations/modules.ts +++ b/packages/node/src/integrations/modules.ts @@ -1,6 +1,6 @@ -import type { EventProcessor, Hub, Integration } from '@sentry/types'; import { existsSync, readFileSync } from 'fs'; import { dirname, join } from 'path'; +import type { EventProcessor, Hub, Integration } from '@sentry/types'; let moduleCache: { [key: string]: string }; diff --git a/packages/node/src/integrations/spotlight.ts b/packages/node/src/integrations/spotlight.ts index 5489933fa6d9..cef0c27e2a4a 100644 --- a/packages/node/src/integrations/spotlight.ts +++ b/packages/node/src/integrations/spotlight.ts @@ -1,7 +1,7 @@ -import type { Client, Envelope, Integration } from '@sentry/types'; -import { logger, serializeEnvelope } from '@sentry/utils'; import * as http from 'http'; import { URL } from 'url'; +import type { Client, Envelope, Integration } from '@sentry/types'; +import { logger, serializeEnvelope } from '@sentry/utils'; type SpotlightConnectionOptions = { /** diff --git a/packages/node/src/integrations/undici/index.ts b/packages/node/src/integrations/undici/index.ts index 6ffec69d7d24..50e8dd0b30fb 100644 --- a/packages/node/src/integrations/undici/index.ts +++ b/packages/node/src/integrations/undici/index.ts @@ -1,11 +1,11 @@ import { getCurrentHub, getDynamicSamplingContextFromClient, isSentryRequestUrl } from '@sentry/core'; import type { EventProcessor, Integration, Span } from '@sentry/types'; import { + LRUMap, dynamicRequire, dynamicSamplingContextToSentryBaggageHeader, generateSentryTraceHeader, getSanitizedUrlString, - LRUMap, parseUrl, stringMatchesSomePattern, } from '@sentry/utils'; diff --git a/packages/node/src/integrations/undici/types.ts b/packages/node/src/integrations/undici/types.ts index 231c49aebf1f..225760d7bd7c 100644 --- a/packages/node/src/integrations/undici/types.ts +++ b/packages/node/src/integrations/undici/types.ts @@ -1,7 +1,7 @@ // Vendored from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/5a94716c6788f654aea7999a5fc28f4f1e7c48ad/types/node/diagnostics_channel.d.ts -import type { Span } from '@sentry/core'; import type { URL } from 'url'; +import type { Span } from '@sentry/core'; // License: // This project is licensed under the MIT license. diff --git a/packages/node/src/sdk.ts b/packages/node/src/sdk.ts index af4ce7905fda..6e25375c6eff 100644 --- a/packages/node/src/sdk.ts +++ b/packages/node/src/sdk.ts @@ -1,15 +1,15 @@ /* eslint-disable max-lines */ import { + Integrations as CoreIntegrations, getCurrentHub, getIntegrationsToSetup, getMainCarrier, initAndBind, - Integrations as CoreIntegrations, } from '@sentry/core'; import type { SessionStatus, StackParser } from '@sentry/types'; import { - createStackParser, GLOBAL_OBJ, + createStackParser, nodeStackLineParser, stackParserFromStackParserOptions, tracingContextFromHeaders, diff --git a/packages/node/src/transports/http.ts b/packages/node/src/transports/http.ts index 7a2cd50df319..56e71156386a 100644 --- a/packages/node/src/transports/http.ts +++ b/packages/node/src/transports/http.ts @@ -1,3 +1,8 @@ +import * as http from 'http'; +import * as https from 'https'; +import { Readable } from 'stream'; +import { URL } from 'url'; +import { createGzip } from 'zlib'; import { createTransport } from '@sentry/core'; import type { BaseTransportOptions, @@ -7,12 +12,7 @@ import type { TransportRequestExecutor, } from '@sentry/types'; import { consoleSandbox } from '@sentry/utils'; -import * as http from 'http'; -import * as https from 'https'; import { HttpsProxyAgent } from 'https-proxy-agent'; -import { Readable } from 'stream'; -import { URL } from 'url'; -import { createGzip } from 'zlib'; import type { HTTPModule } from './http-module'; diff --git a/packages/node/test/client.test.ts b/packages/node/test/client.test.ts index ab2e69c7b33b..ab302c8e1f08 100644 --- a/packages/node/test/client.test.ts +++ b/packages/node/test/client.test.ts @@ -1,6 +1,6 @@ +import * as os from 'os'; import { Scope, SessionFlusher } from '@sentry/core'; import type { Event, EventHint } from '@sentry/types'; -import * as os from 'os'; import { NodeClient } from '../src'; import { getDefaultNodeClientOptions } from './helper/node-client-options'; diff --git a/packages/node/test/context-lines.test.ts b/packages/node/test/context-lines.test.ts index 25b17e29ba77..c65b8db295d5 100644 --- a/packages/node/test/context-lines.test.ts +++ b/packages/node/test/context-lines.test.ts @@ -1,6 +1,6 @@ +import * as fs from 'fs'; import type { StackFrame } from '@sentry/types'; import { parseStackFrames } from '@sentry/utils'; -import * as fs from 'fs'; import { ContextLines, resetFileContentCache } from '../src/integrations/contextlines'; import { defaultStackParser } from '../src/sdk'; diff --git a/packages/node/test/eventbuilders.test.ts b/packages/node/test/eventbuilders.test.ts index cf612afef508..53598505d474 100644 --- a/packages/node/test/eventbuilders.test.ts +++ b/packages/node/test/eventbuilders.test.ts @@ -1,7 +1,7 @@ import type { Client } from '@sentry/types'; import { eventFromUnknownInput } from '@sentry/utils'; -import { defaultStackParser, getCurrentHub, Scope } from '../src'; +import { Scope, defaultStackParser, getCurrentHub } from '../src'; const testScope = new Scope(); diff --git a/packages/node/test/handlers.test.ts b/packages/node/test/handlers.test.ts index e31383118c82..37faef621907 100644 --- a/packages/node/test/handlers.test.ts +++ b/packages/node/test/handlers.test.ts @@ -1,9 +1,9 @@ +import * as http from 'http'; import type { Hub } from '@sentry/core'; import * as sentryCore from '@sentry/core'; -import { setAsyncContextStrategy, Transaction } from '@sentry/core'; +import { Transaction, setAsyncContextStrategy } from '@sentry/core'; import type { Event, PropagationContext } from '@sentry/types'; import { SentryError } from '@sentry/utils'; -import * as http from 'http'; import { NodeClient } from '../src/client'; import { errorHandler, requestHandler, tracingHandler } from '../src/handlers'; diff --git a/packages/node/test/index.test.ts b/packages/node/test/index.test.ts index 0d55b4be6da3..2b91dc414ee1 100644 --- a/packages/node/test/index.test.ts +++ b/packages/node/test/index.test.ts @@ -1,8 +1,9 @@ -import { getMainCarrier, initAndBind, LinkedErrors, runWithAsyncContext, SDK_VERSION } from '@sentry/core'; +import { LinkedErrors, SDK_VERSION, getMainCarrier, initAndBind, runWithAsyncContext } from '@sentry/core'; import type { EventHint, Integration } from '@sentry/types'; import type { Event, Scope } from '../src'; import { + NodeClient, addBreadcrumb, captureEvent, captureException, @@ -11,7 +12,6 @@ import { getClient, getCurrentHub, init, - NodeClient, } from '../src'; import { setNodeAsyncContextStrategy } from '../src/async'; import { ContextLines } from '../src/integrations'; diff --git a/packages/node/test/integrations/http.test.ts b/packages/node/test/integrations/http.test.ts index 02c13b544b01..ba5bbe91151c 100644 --- a/packages/node/test/integrations/http.test.ts +++ b/packages/node/test/integrations/http.test.ts @@ -1,10 +1,10 @@ +import * as http from 'http'; +import * as https from 'https'; import type { Span, Transaction } from '@sentry/core'; import * as sentryCore from '@sentry/core'; -import { addTracingExtensions, Hub } from '@sentry/core'; +import { Hub, addTracingExtensions } from '@sentry/core'; import type { TransactionContext } from '@sentry/types'; -import { logger, TRACEPARENT_REGEXP } from '@sentry/utils'; -import * as http from 'http'; -import * as https from 'https'; +import { TRACEPARENT_REGEXP, logger } from '@sentry/utils'; import * as HttpsProxyAgent from 'https-proxy-agent'; import * as nock from 'nock'; diff --git a/packages/node/test/integrations/localvariables.test.ts b/packages/node/test/integrations/localvariables.test.ts index f48666658e79..640a59e03ae4 100644 --- a/packages/node/test/integrations/localvariables.test.ts +++ b/packages/node/test/integrations/localvariables.test.ts @@ -4,7 +4,7 @@ import type { Debugger, InspectorNotification } from 'inspector'; import { defaultStackParser } from '../../src'; import type { DebugSession, FrameVariables } from '../../src/integrations/localvariables'; -import { createCallbackList, createRateLimiter, LocalVariables } from '../../src/integrations/localvariables'; +import { LocalVariables, createCallbackList, createRateLimiter } from '../../src/integrations/localvariables'; import { NODE_VERSION } from '../../src/nodeVersion'; import { getDefaultNodeClientOptions } from '../../test/helper/node-client-options'; diff --git a/packages/node/test/integrations/requestdata.test.ts b/packages/node/test/integrations/requestdata.test.ts index 4a9adc729488..4895ef43c678 100644 --- a/packages/node/test/integrations/requestdata.test.ts +++ b/packages/node/test/integrations/requestdata.test.ts @@ -1,8 +1,8 @@ +import * as http from 'http'; import type { RequestDataIntegrationOptions } from '@sentry/core'; -import { getCurrentHub, Hub, makeMain, RequestData } from '@sentry/core'; +import { Hub, RequestData, getCurrentHub, makeMain } from '@sentry/core'; import type { Event, EventProcessor, PolymorphicRequest } from '@sentry/types'; import * as sentryUtils from '@sentry/utils'; -import * as http from 'http'; import { NodeClient } from '../../src/client'; import { requestHandler } from '../../src/handlers'; diff --git a/packages/node/test/integrations/spotlight.test.ts b/packages/node/test/integrations/spotlight.test.ts index 3644b3f29def..71af071cbf3c 100644 --- a/packages/node/test/integrations/spotlight.test.ts +++ b/packages/node/test/integrations/spotlight.test.ts @@ -1,6 +1,6 @@ +import * as http from 'http'; import type { Envelope, EventEnvelope } from '@sentry/types'; import { createEnvelope, logger } from '@sentry/utils'; -import * as http from 'http'; import { NodeClient } from '../../src'; import { Spotlight } from '../../src/integrations'; diff --git a/packages/node/test/integrations/undici.test.ts b/packages/node/test/integrations/undici.test.ts index 103304080b9c..27cde77fdcc3 100644 --- a/packages/node/test/integrations/undici.test.ts +++ b/packages/node/test/integrations/undici.test.ts @@ -1,6 +1,6 @@ +import * as http from 'http'; import type { Transaction } from '@sentry/core'; import { Hub, makeMain, runWithAsyncContext } from '@sentry/core'; -import * as http from 'http'; import type { fetch as FetchType } from 'undici'; import { NodeClient } from '../../src/client'; diff --git a/packages/node/test/requestdata.test.ts b/packages/node/test/requestdata.test.ts index 989aa680e2d9..6b4e5e13101a 100644 --- a/packages/node/test/requestdata.test.ts +++ b/packages/node/test/requestdata.test.ts @@ -2,6 +2,7 @@ // TODO (v8 / #5257): Remove everything related to the deprecated functions and move tests into `@sentry/utils` +import type * as net from 'net'; import type { Event, PolymorphicRequest, TransactionSource, User } from '@sentry/types'; import type { AddRequestDataToEventOptions } from '@sentry/utils'; import { @@ -9,7 +10,6 @@ import { extractPathForTransaction, extractRequestData as newExtractRequestData, } from '@sentry/utils'; -import type * as net from 'net'; import type { ExpressRequest } from '../src/requestDataDeprecated'; import { extractRequestData as oldExtractRequestData, parseRequest } from '../src/requestDataDeprecated'; diff --git a/packages/node/test/transports/http.test.ts b/packages/node/test/transports/http.test.ts index 219d0c3bde77..747c6462b1bb 100644 --- a/packages/node/test/transports/http.test.ts +++ b/packages/node/test/transports/http.test.ts @@ -1,9 +1,9 @@ -import { createTransport } from '@sentry/core'; -import type { EventEnvelope, EventItem } from '@sentry/types'; -import { addItemToEnvelope, createAttachmentEnvelopeItem, createEnvelope, serializeEnvelope } from '@sentry/utils'; import * as http from 'http'; import { TextEncoder } from 'util'; import { createGunzip } from 'zlib'; +import { createTransport } from '@sentry/core'; +import type { EventEnvelope, EventItem } from '@sentry/types'; +import { addItemToEnvelope, createAttachmentEnvelopeItem, createEnvelope, serializeEnvelope } from '@sentry/utils'; import { makeNodeTransport } from '../../src/transports'; diff --git a/packages/node/test/transports/https.test.ts b/packages/node/test/transports/https.test.ts index 485b582d8e92..2236cf99cb5c 100644 --- a/packages/node/test/transports/https.test.ts +++ b/packages/node/test/transports/https.test.ts @@ -1,9 +1,9 @@ -import { createTransport } from '@sentry/core'; -import type { EventEnvelope, EventItem } from '@sentry/types'; -import { createEnvelope, serializeEnvelope } from '@sentry/utils'; import * as http from 'http'; import * as https from 'https'; import { TextEncoder } from 'util'; +import { createTransport } from '@sentry/core'; +import type { EventEnvelope, EventItem } from '@sentry/types'; +import { createEnvelope, serializeEnvelope } from '@sentry/utils'; import { makeNodeTransport } from '../../src/transports'; import type { HTTPModule, HTTPModuleRequestIncomingMessage } from '../../src/transports/http-module'; diff --git a/packages/opentelemetry-node/src/propagator.ts b/packages/opentelemetry-node/src/propagator.ts index 63ca69c98fb7..a8154c21e088 100644 --- a/packages/opentelemetry-node/src/propagator.ts +++ b/packages/opentelemetry-node/src/propagator.ts @@ -1,10 +1,10 @@ import type { Baggage, Context, TextMapGetter, TextMapSetter } from '@opentelemetry/api'; -import { isSpanContextValid, propagation, trace, TraceFlags } from '@opentelemetry/api'; -import { isTracingSuppressed, W3CBaggagePropagator } from '@opentelemetry/core'; +import { TraceFlags, isSpanContextValid, propagation, trace } from '@opentelemetry/api'; +import { W3CBaggagePropagator, isTracingSuppressed } from '@opentelemetry/core'; import { + SENTRY_BAGGAGE_KEY_PREFIX, baggageHeaderToDynamicSamplingContext, extractTraceparentData, - SENTRY_BAGGAGE_KEY_PREFIX, } from '@sentry/utils'; import { diff --git a/packages/opentelemetry-node/src/spanprocessor.ts b/packages/opentelemetry-node/src/spanprocessor.ts index 571871e1e3f0..ed8a2e84d5f4 100644 --- a/packages/opentelemetry-node/src/spanprocessor.ts +++ b/packages/opentelemetry-node/src/spanprocessor.ts @@ -1,8 +1,8 @@ import type { Context } from '@opentelemetry/api'; -import { context, SpanKind, trace } from '@opentelemetry/api'; +import { SpanKind, context, trace } from '@opentelemetry/api'; import { suppressTracing } from '@opentelemetry/core'; import type { Span as OtelSpan, SpanProcessor as OtelSpanProcessor } from '@opentelemetry/sdk-trace-base'; -import { addGlobalEventProcessor, addTracingExtensions, getClient, getCurrentHub, Transaction } from '@sentry/core'; +import { Transaction, addGlobalEventProcessor, addTracingExtensions, getClient, getCurrentHub } from '@sentry/core'; import type { DynamicSamplingContext, Span as SentrySpan, TraceparentData, TransactionContext } from '@sentry/types'; import { logger } from '@sentry/utils'; diff --git a/packages/opentelemetry-node/src/utils/parseOtelSpanDescription.ts b/packages/opentelemetry-node/src/utils/parseOtelSpanDescription.ts index b0f13eb6215f..d53d31aa2069 100644 --- a/packages/opentelemetry-node/src/utils/parseOtelSpanDescription.ts +++ b/packages/opentelemetry-node/src/utils/parseOtelSpanDescription.ts @@ -1,4 +1,4 @@ -import type { Attributes, AttributeValue } from '@opentelemetry/api'; +import type { AttributeValue, Attributes } from '@opentelemetry/api'; import { SpanKind } from '@opentelemetry/api'; import type { Span as OtelSpan } from '@opentelemetry/sdk-trace-base'; import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; diff --git a/packages/opentelemetry-node/test/propagator.test.ts b/packages/opentelemetry-node/test/propagator.test.ts index cee113e38e8b..345cd9c6eceb 100644 --- a/packages/opentelemetry-node/test/propagator.test.ts +++ b/packages/opentelemetry-node/test/propagator.test.ts @@ -1,13 +1,13 @@ import { + ROOT_CONTEXT, + TraceFlags, defaultTextMapGetter, defaultTextMapSetter, propagation, - ROOT_CONTEXT, trace, - TraceFlags, } from '@opentelemetry/api'; import { suppressTracing } from '@opentelemetry/core'; -import { addTracingExtensions, Hub, makeMain, Transaction } from '@sentry/core'; +import { Hub, Transaction, addTracingExtensions, makeMain } from '@sentry/core'; import type { TransactionContext } from '@sentry/types'; import { @@ -17,7 +17,7 @@ import { SENTRY_TRACE_PARENT_CONTEXT_KEY, } from '../src/constants'; import { SentryPropagator } from '../src/propagator'; -import { setSentrySpan, SPAN_MAP } from '../src/utils/spanMap'; +import { SPAN_MAP, setSentrySpan } from '../src/utils/spanMap'; beforeAll(() => { addTracingExtensions(); diff --git a/packages/opentelemetry-node/test/spanprocessor.test.ts b/packages/opentelemetry-node/test/spanprocessor.test.ts index fff3d0f4bc98..992a05dda0c6 100644 --- a/packages/opentelemetry-node/test/spanprocessor.test.ts +++ b/packages/opentelemetry-node/test/spanprocessor.test.ts @@ -6,19 +6,19 @@ import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; import { SemanticAttributes, SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'; import type { SpanStatusType } from '@sentry/core'; import { - addTracingExtensions, - createTransport, Hub, - makeMain, Scope, Span as SentrySpan, Transaction, + addTracingExtensions, + createTransport, + makeMain, } from '@sentry/core'; import { NodeClient } from '@sentry/node'; import { resolvedSyncPromise } from '@sentry/utils'; import { SentrySpanProcessor } from '../src/spanprocessor'; -import { clearSpan, getSentrySpan, SPAN_MAP } from '../src/utils/spanMap'; +import { SPAN_MAP, clearSpan, getSentrySpan } from '../src/utils/spanMap'; const SENTRY_DSN = 'https://0@0.ingest.sentry.io/0'; diff --git a/packages/opentelemetry/src/custom/hub.ts b/packages/opentelemetry/src/custom/hub.ts index 339cba87ce4d..3ecea85b0a6f 100644 --- a/packages/opentelemetry/src/custom/hub.ts +++ b/packages/opentelemetry/src/custom/hub.ts @@ -1,7 +1,7 @@ import type { Carrier, Scope } from '@sentry/core'; import { Hub } from '@sentry/core'; import type { Client } from '@sentry/types'; -import { getGlobalSingleton, GLOBAL_OBJ } from '@sentry/utils'; +import { GLOBAL_OBJ, getGlobalSingleton } from '@sentry/utils'; import { OpenTelemetryScope } from './scope'; diff --git a/packages/opentelemetry/src/propagator.ts b/packages/opentelemetry/src/propagator.ts index d2cf6dbe5556..0768541fbfb9 100644 --- a/packages/opentelemetry/src/propagator.ts +++ b/packages/opentelemetry/src/propagator.ts @@ -1,9 +1,9 @@ import type { Baggage, Context, SpanContext, TextMapGetter, TextMapSetter } from '@opentelemetry/api'; -import { propagation, trace, TraceFlags } from '@opentelemetry/api'; -import { isTracingSuppressed, W3CBaggagePropagator } from '@opentelemetry/core'; +import { TraceFlags, propagation, trace } from '@opentelemetry/api'; +import { W3CBaggagePropagator, isTracingSuppressed } from '@opentelemetry/core'; import { getDynamicSamplingContextFromClient } from '@sentry/core'; import type { DynamicSamplingContext, PropagationContext } from '@sentry/types'; -import { generateSentryTraceHeader, SENTRY_BAGGAGE_KEY_PREFIX, tracingContextFromHeaders } from '@sentry/utils'; +import { SENTRY_BAGGAGE_KEY_PREFIX, generateSentryTraceHeader, tracingContextFromHeaders } from '@sentry/utils'; import { SENTRY_BAGGAGE_HEADER, SENTRY_TRACE_HEADER } from './constants'; import { getClient } from './custom/hub'; diff --git a/packages/opentelemetry/src/sampler.ts b/packages/opentelemetry/src/sampler.ts index f07dc4f8f1e4..a3f2d07eddd4 100644 --- a/packages/opentelemetry/src/sampler.ts +++ b/packages/opentelemetry/src/sampler.ts @@ -1,6 +1,6 @@ /* eslint-disable no-bitwise */ import type { Attributes, Context, SpanContext } from '@opentelemetry/api'; -import { isSpanContextValid, trace, TraceFlags } from '@opentelemetry/api'; +import { TraceFlags, isSpanContextValid, trace } from '@opentelemetry/api'; import type { Sampler, SamplingResult } from '@opentelemetry/sdk-trace-base'; import { SamplingDecision } from '@opentelemetry/sdk-trace-base'; import { hasTracingEnabled } from '@sentry/core'; diff --git a/packages/opentelemetry/src/utils/parseSpanDescription.ts b/packages/opentelemetry/src/utils/parseSpanDescription.ts index 784b268cc4f1..9f0d15f628e4 100644 --- a/packages/opentelemetry/src/utils/parseSpanDescription.ts +++ b/packages/opentelemetry/src/utils/parseSpanDescription.ts @@ -1,4 +1,4 @@ -import type { Attributes, AttributeValue } from '@opentelemetry/api'; +import type { AttributeValue, Attributes } from '@opentelemetry/api'; import { SpanKind } from '@opentelemetry/api'; import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; import type { TransactionSource } from '@sentry/types'; diff --git a/packages/opentelemetry/test/asyncContextStrategy.test.ts b/packages/opentelemetry/test/asyncContextStrategy.test.ts index 7f6039a03c0e..81c3adafa536 100644 --- a/packages/opentelemetry/test/asyncContextStrategy.test.ts +++ b/packages/opentelemetry/test/asyncContextStrategy.test.ts @@ -4,9 +4,9 @@ import { runWithAsyncContext, setAsyncContextStrategy } from '@sentry/core'; import { setOpenTelemetryContextAsyncContextStrategy } from '../src/asyncContextStrategy'; import { getCurrentHub } from '../src/custom/hub'; +import { TestClient, getDefaultTestClientOptions } from './helpers/TestClient'; import { setupOtel } from './helpers/initOtel'; import { cleanupOtel } from './helpers/mockSdkInit'; -import { getDefaultTestClientOptions, TestClient } from './helpers/TestClient'; describe('asyncContextStrategy', () => { let provider: BasicTracerProvider | undefined; diff --git a/packages/opentelemetry/test/custom/client.test.ts b/packages/opentelemetry/test/custom/client.test.ts index d377522c9c21..8b4005c199d0 100644 --- a/packages/opentelemetry/test/custom/client.test.ts +++ b/packages/opentelemetry/test/custom/client.test.ts @@ -1,6 +1,6 @@ import { ProxyTracer } from '@opentelemetry/api'; -import { getDefaultTestClientOptions, TestClient } from '../helpers/TestClient'; +import { TestClient, getDefaultTestClientOptions } from '../helpers/TestClient'; describe('OpenTelemetryClient', () => { it('exposes a tracer', () => { diff --git a/packages/opentelemetry/test/custom/hub.test.ts b/packages/opentelemetry/test/custom/hub.test.ts index 08e9b5e1bf90..3fb707dca18a 100644 --- a/packages/opentelemetry/test/custom/hub.test.ts +++ b/packages/opentelemetry/test/custom/hub.test.ts @@ -1,4 +1,4 @@ -import { getCurrentHub, OpenTelemetryHub } from '../../src/custom/hub'; +import { OpenTelemetryHub, getCurrentHub } from '../../src/custom/hub'; import { OpenTelemetryScope } from '../../src/custom/scope'; describe('OpenTelemetryHub', () => { diff --git a/packages/opentelemetry/test/custom/hubextensions.test.ts b/packages/opentelemetry/test/custom/hubextensions.test.ts index 47f6452062cc..44b7b941161d 100644 --- a/packages/opentelemetry/test/custom/hubextensions.test.ts +++ b/packages/opentelemetry/test/custom/hubextensions.test.ts @@ -1,6 +1,6 @@ import { getCurrentHub } from '../../src/custom/hub'; import { addTracingExtensions } from '../../src/custom/hubextensions'; -import { getDefaultTestClientOptions, TestClient } from '../helpers/TestClient'; +import { TestClient, getDefaultTestClientOptions } from '../helpers/TestClient'; describe('hubextensions', () => { afterEach(() => { diff --git a/packages/opentelemetry/test/custom/transaction.test.ts b/packages/opentelemetry/test/custom/transaction.test.ts index 1c4f9f3eea81..043d76235140 100644 --- a/packages/opentelemetry/test/custom/transaction.test.ts +++ b/packages/opentelemetry/test/custom/transaction.test.ts @@ -1,7 +1,7 @@ import { getCurrentHub } from '../../src/custom/hub'; import { OpenTelemetryScope } from '../../src/custom/scope'; import { OpenTelemetryTransaction, startTransaction } from '../../src/custom/transaction'; -import { getDefaultTestClientOptions, TestClient } from '../helpers/TestClient'; +import { TestClient, getDefaultTestClientOptions } from '../helpers/TestClient'; describe('NodeExperimentalTransaction', () => { afterEach(() => { diff --git a/packages/opentelemetry/test/helpers/initOtel.ts b/packages/opentelemetry/test/helpers/initOtel.ts index e69420242a09..052812c12d33 100644 --- a/packages/opentelemetry/test/helpers/initOtel.ts +++ b/packages/opentelemetry/test/helpers/initOtel.ts @@ -1,4 +1,4 @@ -import { diag, DiagLogLevel } from '@opentelemetry/api'; +import { DiagLogLevel, diag } from '@opentelemetry/api'; import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks'; import { Resource } from '@opentelemetry/resources'; import { BasicTracerProvider } from '@opentelemetry/sdk-trace-base'; diff --git a/packages/opentelemetry/test/helpers/mockSdkInit.ts b/packages/opentelemetry/test/helpers/mockSdkInit.ts index 50dea300a4a9..cc5a4e11c5e6 100644 --- a/packages/opentelemetry/test/helpers/mockSdkInit.ts +++ b/packages/opentelemetry/test/helpers/mockSdkInit.ts @@ -1,12 +1,12 @@ -import { context, propagation, ProxyTracerProvider, trace } from '@opentelemetry/api'; +import { ProxyTracerProvider, context, propagation, trace } from '@opentelemetry/api'; import { BasicTracerProvider } from '@opentelemetry/sdk-trace-base'; import type { ClientOptions, Options } from '@sentry/types'; import { GLOBAL_OBJ } from '@sentry/utils'; import { setOpenTelemetryContextAsyncContextStrategy } from '../../src/asyncContextStrategy'; import { setupGlobalHub } from '../../src/custom/hub'; -import { initOtel } from './initOtel'; import { init as initTestClient } from './TestClient'; +import { initOtel } from './initOtel'; const PUBLIC_DSN = 'https://username@domain/123'; diff --git a/packages/opentelemetry/test/integration/breadcrumbs.test.ts b/packages/opentelemetry/test/integration/breadcrumbs.test.ts index f56821a83e2a..af095be83f76 100644 --- a/packages/opentelemetry/test/integration/breadcrumbs.test.ts +++ b/packages/opentelemetry/test/integration/breadcrumbs.test.ts @@ -1,9 +1,9 @@ import { withScope } from '@sentry/core'; -import { getCurrentHub, OpenTelemetryHub } from '../../src/custom/hub'; +import { OpenTelemetryHub, getCurrentHub } from '../../src/custom/hub'; import { startSpan } from '../../src/trace'; -import { cleanupOtel, mockSdkInit } from '../helpers/mockSdkInit'; import type { TestClientInterface } from '../helpers/TestClient'; +import { cleanupOtel, mockSdkInit } from '../helpers/mockSdkInit'; describe('Integration | breadcrumbs', () => { const beforeSendTransaction = jest.fn(() => null); diff --git a/packages/opentelemetry/test/integration/otelTimedEvents.test.ts b/packages/opentelemetry/test/integration/otelTimedEvents.test.ts index 0fb1f1ff9d26..ec25108821f5 100644 --- a/packages/opentelemetry/test/integration/otelTimedEvents.test.ts +++ b/packages/opentelemetry/test/integration/otelTimedEvents.test.ts @@ -2,8 +2,8 @@ import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; import { getCurrentHub } from '../../src/custom/hub'; import { startSpan } from '../../src/trace'; -import { cleanupOtel, mockSdkInit } from '../helpers/mockSdkInit'; import type { TestClientInterface } from '../helpers/TestClient'; +import { cleanupOtel, mockSdkInit } from '../helpers/mockSdkInit'; describe('Integration | OTEL TimedEvents', () => { afterEach(() => { diff --git a/packages/opentelemetry/test/integration/scope.test.ts b/packages/opentelemetry/test/integration/scope.test.ts index 16ff5e85ae37..094f926bd30e 100644 --- a/packages/opentelemetry/test/integration/scope.test.ts +++ b/packages/opentelemetry/test/integration/scope.test.ts @@ -1,11 +1,11 @@ import { captureException, setTag, withScope } from '@sentry/core'; -import { getCurrentHub, OpenTelemetryHub } from '../../src/custom/hub'; +import { OpenTelemetryHub, getCurrentHub } from '../../src/custom/hub'; import { OpenTelemetryScope } from '../../src/custom/scope'; import { startSpan } from '../../src/trace'; import { getSpanScope } from '../../src/utils/spanData'; -import { cleanupOtel, mockSdkInit } from '../helpers/mockSdkInit'; import type { TestClientInterface } from '../helpers/TestClient'; +import { cleanupOtel, mockSdkInit } from '../helpers/mockSdkInit'; describe('Integration | Scope', () => { afterEach(() => { diff --git a/packages/opentelemetry/test/integration/transactions.test.ts b/packages/opentelemetry/test/integration/transactions.test.ts index 5174b577611a..787d251b0558 100644 --- a/packages/opentelemetry/test/integration/transactions.test.ts +++ b/packages/opentelemetry/test/integration/transactions.test.ts @@ -1,4 +1,4 @@ -import { context, trace, TraceFlags } from '@opentelemetry/api'; +import { TraceFlags, context, trace } from '@opentelemetry/api'; import type { SpanProcessor } from '@opentelemetry/sdk-trace-base'; import { addBreadcrumb, setTag } from '@sentry/core'; import type { PropagationContext, TransactionEvent } from '@sentry/types'; @@ -8,8 +8,8 @@ import { getCurrentHub } from '../../src/custom/hub'; import { SentrySpanProcessor } from '../../src/spanProcessor'; import { startInactiveSpan, startSpan } from '../../src/trace'; import { setPropagationContextOnContext } from '../../src/utils/contextData'; -import { cleanupOtel, getProvider, mockSdkInit } from '../helpers/mockSdkInit'; import type { TestClientInterface } from '../helpers/TestClient'; +import { cleanupOtel, getProvider, mockSdkInit } from '../helpers/mockSdkInit'; describe('Integration | Transactions', () => { afterEach(() => { diff --git a/packages/opentelemetry/test/propagator.test.ts b/packages/opentelemetry/test/propagator.test.ts index c90a2636a58a..9b4cdb21d5aa 100644 --- a/packages/opentelemetry/test/propagator.test.ts +++ b/packages/opentelemetry/test/propagator.test.ts @@ -1,13 +1,13 @@ import { + ROOT_CONTEXT, + TraceFlags, defaultTextMapGetter, defaultTextMapSetter, propagation, - ROOT_CONTEXT, trace, - TraceFlags, } from '@opentelemetry/api'; import { suppressTracing } from '@opentelemetry/core'; -import { addTracingExtensions, Hub, makeMain } from '@sentry/core'; +import { Hub, addTracingExtensions, makeMain } from '@sentry/core'; import type { PropagationContext } from '@sentry/types'; import { SENTRY_BAGGAGE_HEADER, SENTRY_TRACE_HEADER } from '../src/constants'; diff --git a/packages/opentelemetry/test/trace.test.ts b/packages/opentelemetry/test/trace.test.ts index 18037c7412af..4075eef1e4de 100644 --- a/packages/opentelemetry/test/trace.test.ts +++ b/packages/opentelemetry/test/trace.test.ts @@ -1,5 +1,5 @@ import type { Span } from '@opentelemetry/api'; -import { context, trace, TraceFlags } from '@opentelemetry/api'; +import { TraceFlags, context, trace } from '@opentelemetry/api'; import type { ReadableSpan } from '@opentelemetry/sdk-trace-base'; import type { PropagationContext } from '@sentry/types'; diff --git a/packages/opentelemetry/test/utils/getActiveSpan.test.ts b/packages/opentelemetry/test/utils/getActiveSpan.test.ts index b3a2f359bfbd..4859d970623e 100644 --- a/packages/opentelemetry/test/utils/getActiveSpan.test.ts +++ b/packages/opentelemetry/test/utils/getActiveSpan.test.ts @@ -2,9 +2,9 @@ import { trace } from '@opentelemetry/api'; import type { BasicTracerProvider } from '@opentelemetry/sdk-trace-base'; import { getActiveSpan, getRootSpan } from '../../src/utils/getActiveSpan'; +import { TestClient, getDefaultTestClientOptions } from '../helpers/TestClient'; import { setupOtel } from '../helpers/initOtel'; import { cleanupOtel } from '../helpers/mockSdkInit'; -import { getDefaultTestClientOptions, TestClient } from '../helpers/TestClient'; describe('getActiveSpan', () => { let provider: BasicTracerProvider | undefined; diff --git a/packages/opentelemetry/test/utils/setupEventContextTrace.test.ts b/packages/opentelemetry/test/utils/setupEventContextTrace.test.ts index 704225e4eb20..887a7f6bc803 100644 --- a/packages/opentelemetry/test/utils/setupEventContextTrace.test.ts +++ b/packages/opentelemetry/test/utils/setupEventContextTrace.test.ts @@ -3,10 +3,10 @@ import { makeMain } from '@sentry/core'; import { OpenTelemetryHub } from '../../src/custom/hub'; import { setupEventContextTrace } from '../../src/setupEventContextTrace'; +import type { TestClientInterface } from '../helpers/TestClient'; +import { TestClient, getDefaultTestClientOptions } from '../helpers/TestClient'; import { setupOtel } from '../helpers/initOtel'; import { cleanupOtel } from '../helpers/mockSdkInit'; -import type { TestClientInterface } from '../helpers/TestClient'; -import { getDefaultTestClientOptions, TestClient } from '../helpers/TestClient'; const PUBLIC_DSN = 'https://username@domain/123'; diff --git a/packages/overhead-metrics/configs/ci/process.ts b/packages/overhead-metrics/configs/ci/process.ts index 0af2f12d8f39..31e7842844ef 100644 --- a/packages/overhead-metrics/configs/ci/process.ts +++ b/packages/overhead-metrics/configs/ci/process.ts @@ -1,5 +1,5 @@ -import fs from 'fs-extra'; import path from 'path'; +import fs from 'fs-extra'; import { ResultsAnalyzer } from '../../src/results/analyzer.js'; import { PrCommentBuilder } from '../../src/results/pr-comment.js'; diff --git a/packages/overhead-metrics/src/util/github.ts b/packages/overhead-metrics/src/util/github.ts index 7aa1ba6be71e..e48cbb55eeea 100644 --- a/packages/overhead-metrics/src/util/github.ts +++ b/packages/overhead-metrics/src/util/github.ts @@ -1,8 +1,8 @@ +import * as fs from 'fs'; +import path from 'path'; import { Octokit } from '@octokit/rest'; import axios from 'axios'; import extract from 'extract-zip'; -import * as fs from 'fs'; -import path from 'path'; import type { PrCommentBuilder } from '../results/pr-comment.js'; import { consoleGroup } from './console.js'; diff --git a/packages/react/src/sdk.ts b/packages/react/src/sdk.ts index aeede1fc7cd5..eeba4c58907d 100644 --- a/packages/react/src/sdk.ts +++ b/packages/react/src/sdk.ts @@ -1,5 +1,5 @@ import type { BrowserOptions } from '@sentry/browser'; -import { init as browserInit, SDK_VERSION } from '@sentry/browser'; +import { SDK_VERSION, init as browserInit } from '@sentry/browser'; import type { SdkMetadata } from '@sentry/types'; /** diff --git a/packages/react/test/errorboundary.test.tsx b/packages/react/test/errorboundary.test.tsx index 6d77802948eb..b7acfa12b2af 100644 --- a/packages/react/test/errorboundary.test.tsx +++ b/packages/react/test/errorboundary.test.tsx @@ -1,10 +1,10 @@ -import { getClient, getCurrentHub, Scope } from '@sentry/browser'; +import { Scope, getClient, getCurrentHub } from '@sentry/browser'; import { fireEvent, render, screen } from '@testing-library/react'; import * as React from 'react'; import { useState } from 'react'; import type { ErrorBoundaryProps } from '../src/errorboundary'; -import { ErrorBoundary, isAtLeastReact17, UNKNOWN_COMPONENT, withErrorBoundary } from '../src/errorboundary'; +import { ErrorBoundary, UNKNOWN_COMPONENT, isAtLeastReact17, withErrorBoundary } from '../src/errorboundary'; const mockCaptureException = jest.fn(); const mockShowReportDialog = jest.fn(); diff --git a/packages/react/test/reactrouterv3.test.tsx b/packages/react/test/reactrouterv3.test.tsx index 42d1b6992440..dad1b4793d26 100644 --- a/packages/react/test/reactrouterv3.test.tsx +++ b/packages/react/test/reactrouterv3.test.tsx @@ -1,6 +1,6 @@ import { act, render } from '@testing-library/react'; import * as React from 'react'; -import { createMemoryHistory, createRoutes, IndexRoute, match, Route, Router } from 'react-router-3'; +import { IndexRoute, Route, Router, createMemoryHistory, createRoutes, match } from 'react-router-3'; import type { Match, Route as RouteType } from '../src/reactrouterv3'; import { reactRouterV3Instrumentation } from '../src/reactrouterv3'; diff --git a/packages/react/test/reactrouterv4.test.tsx b/packages/react/test/reactrouterv4.test.tsx index fb608a37726e..e1c8a71e66b0 100644 --- a/packages/react/test/reactrouterv4.test.tsx +++ b/packages/react/test/reactrouterv4.test.tsx @@ -1,7 +1,7 @@ import { act, render } from '@testing-library/react'; import { createMemoryHistory } from 'history-4'; import * as React from 'react'; -import { matchPath, Route, Router, Switch } from 'react-router-4'; +import { Route, Router, Switch, matchPath } from 'react-router-4'; import { reactRouterV4Instrumentation, withSentryRouting } from '../src'; import type { RouteConfig } from '../src/reactrouter'; diff --git a/packages/react/test/reactrouterv5.test.tsx b/packages/react/test/reactrouterv5.test.tsx index c4a6ae2f7d98..3ab94aea0401 100644 --- a/packages/react/test/reactrouterv5.test.tsx +++ b/packages/react/test/reactrouterv5.test.tsx @@ -1,7 +1,7 @@ import { act, render } from '@testing-library/react'; import { createMemoryHistory } from 'history-4'; import * as React from 'react'; -import { matchPath, Route, Router, Switch } from 'react-router-5'; +import { Route, Router, Switch, matchPath } from 'react-router-5'; import { reactRouterV5Instrumentation, withSentryRouting } from '../src'; import type { RouteConfig } from '../src/reactrouter'; diff --git a/packages/react/test/reactrouterv6.4.test.tsx b/packages/react/test/reactrouterv6.4.test.tsx index a5c35169c283..f97b9a82253a 100644 --- a/packages/react/test/reactrouterv6.4.test.tsx +++ b/packages/react/test/reactrouterv6.4.test.tsx @@ -2,12 +2,12 @@ import { render } from '@testing-library/react'; import { Request } from 'node-fetch'; import * as React from 'react'; import { + Navigate, + RouterProvider, createMemoryRouter, createRoutesFromChildren, matchPath, matchRoutes, - Navigate, - RouterProvider, useLocation, useNavigationType, } from 'react-router-6.4'; diff --git a/packages/react/test/reactrouterv6.test.tsx b/packages/react/test/reactrouterv6.test.tsx index 281999b95696..86f6ae9b66e0 100644 --- a/packages/react/test/reactrouterv6.test.tsx +++ b/packages/react/test/reactrouterv6.test.tsx @@ -1,14 +1,14 @@ import { render } from '@testing-library/react'; import * as React from 'react'; import { - createRoutesFromChildren, - matchPath, - matchRoutes, MemoryRouter, Navigate, Outlet, Route, Routes, + createRoutesFromChildren, + matchPath, + matchRoutes, useLocation, useNavigationType, useRoutes, diff --git a/packages/remix/src/utils/vendor/types.ts b/packages/remix/src/utils/vendor/types.ts index faaa7e5f6f60..e92dbc0f99af 100644 --- a/packages/remix/src/utils/vendor/types.ts +++ b/packages/remix/src/utils/vendor/types.ts @@ -1,3 +1,4 @@ +import type { Agent } from 'https'; /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable max-lines */ /* eslint-disable @typescript-eslint/ban-types */ @@ -11,7 +12,6 @@ // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import type * as Express from 'express'; -import type { Agent } from 'https'; import type { ComponentType } from 'react'; type Dev = { diff --git a/packages/remix/test/index.server.test.ts b/packages/remix/test/index.server.test.ts index fc977117897c..8568dc3c0cdb 100644 --- a/packages/remix/test/index.server.test.ts +++ b/packages/remix/test/index.server.test.ts @@ -2,7 +2,7 @@ import * as SentryNode from '@sentry/node'; import { getCurrentHub } from '@sentry/node'; import { GLOBAL_OBJ } from '@sentry/utils'; -import { init, Integrations } from '../src/index.server'; +import { Integrations, init } from '../src/index.server'; const nodeInit = jest.spyOn(SentryNode, 'init'); diff --git a/packages/remix/test/integration/app_v1/entry.client.tsx b/packages/remix/test/integration/app_v1/entry.client.tsx index f9cfc14f2507..17da03ff6a70 100644 --- a/packages/remix/test/integration/app_v1/entry.client.tsx +++ b/packages/remix/test/integration/app_v1/entry.client.tsx @@ -1,7 +1,7 @@ import { RemixBrowser, useLocation, useMatches } from '@remix-run/react'; -import { hydrate } from 'react-dom'; import * as Sentry from '@sentry/remix'; import { useEffect } from 'react'; +import { hydrate } from 'react-dom'; Sentry.init({ dsn: 'https://public@dsn.ingest.sentry.io/1337', diff --git a/packages/remix/test/integration/app_v1/entry.server.tsx b/packages/remix/test/integration/app_v1/entry.server.tsx index d48f2644fac4..d7fcd6b1ea6b 100644 --- a/packages/remix/test/integration/app_v1/entry.server.tsx +++ b/packages/remix/test/integration/app_v1/entry.server.tsx @@ -1,7 +1,7 @@ import type { EntryContext } from '@remix-run/node'; import { RemixServer } from '@remix-run/react'; -import { renderToString } from 'react-dom/server'; import * as Sentry from '@sentry/remix'; +import { renderToString } from 'react-dom/server'; Sentry.init({ dsn: 'https://public@dsn.ingest.sentry.io/1337', diff --git a/packages/remix/test/integration/app_v1/root.tsx b/packages/remix/test/integration/app_v1/root.tsx index ee9b6ceddb78..51dcb00c4e8f 100644 --- a/packages/remix/test/integration/app_v1/root.tsx +++ b/packages/remix/test/integration/app_v1/root.tsx @@ -1,4 +1,4 @@ -import { MetaFunction, LoaderFunction, json, defer, redirect } from '@remix-run/node'; +import { LoaderFunction, MetaFunction, defer, json, redirect } from '@remix-run/node'; import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration } from '@remix-run/react'; import { withSentry } from '@sentry/remix'; diff --git a/packages/remix/test/integration/app_v2/entry.client.tsx b/packages/remix/test/integration/app_v2/entry.client.tsx index f9cfc14f2507..17da03ff6a70 100644 --- a/packages/remix/test/integration/app_v2/entry.client.tsx +++ b/packages/remix/test/integration/app_v2/entry.client.tsx @@ -1,7 +1,7 @@ import { RemixBrowser, useLocation, useMatches } from '@remix-run/react'; -import { hydrate } from 'react-dom'; import * as Sentry from '@sentry/remix'; import { useEffect } from 'react'; +import { hydrate } from 'react-dom'; Sentry.init({ dsn: 'https://public@dsn.ingest.sentry.io/1337', diff --git a/packages/remix/test/integration/app_v2/entry.server.tsx b/packages/remix/test/integration/app_v2/entry.server.tsx index 71f9ec7c3d67..3b18492eb62b 100644 --- a/packages/remix/test/integration/app_v2/entry.server.tsx +++ b/packages/remix/test/integration/app_v2/entry.server.tsx @@ -1,7 +1,7 @@ -import type { EntryContext, DataFunctionArgs } from '@remix-run/node'; +import type { DataFunctionArgs, EntryContext } from '@remix-run/node'; import { RemixServer } from '@remix-run/react'; -import { renderToString } from 'react-dom/server'; import * as Sentry from '@sentry/remix'; +import { renderToString } from 'react-dom/server'; Sentry.init({ dsn: 'https://public@dsn.ingest.sentry.io/1337', diff --git a/packages/remix/test/integration/app_v2/root.tsx b/packages/remix/test/integration/app_v2/root.tsx index 2320451cee74..15b78b8a6325 100644 --- a/packages/remix/test/integration/app_v2/root.tsx +++ b/packages/remix/test/integration/app_v2/root.tsx @@ -1,4 +1,4 @@ -import { V2_MetaFunction, LoaderFunction, json, defer, redirect } from '@remix-run/node'; +import { LoaderFunction, V2_MetaFunction, defer, json, redirect } from '@remix-run/node'; import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration, useRouteError } from '@remix-run/react'; import { V2_ErrorBoundaryComponent } from '@remix-run/react/dist/routeModules'; import { captureRemixErrorBoundaryError, withSentry } from '@sentry/remix'; diff --git a/packages/remix/test/integration/common/routes/action-json-response.$id.tsx b/packages/remix/test/integration/common/routes/action-json-response.$id.tsx index ff0f6940fe44..2bcc44588a0c 100644 --- a/packages/remix/test/integration/common/routes/action-json-response.$id.tsx +++ b/packages/remix/test/integration/common/routes/action-json-response.$id.tsx @@ -1,4 +1,4 @@ -import { ActionFunction, json, redirect, LoaderFunction } from '@remix-run/node'; +import { ActionFunction, LoaderFunction, json, redirect } from '@remix-run/node'; import { useActionData } from '@remix-run/react'; export const loader: LoaderFunction = async ({ params: { id } }) => { diff --git a/packages/remix/test/integration/common/routes/loader-defer-response.$id.tsx b/packages/remix/test/integration/common/routes/loader-defer-response.$id.tsx index ad7060888c19..1888a6d5ee30 100644 --- a/packages/remix/test/integration/common/routes/loader-defer-response.$id.tsx +++ b/packages/remix/test/integration/common/routes/loader-defer-response.$id.tsx @@ -1,4 +1,4 @@ -import { defer, LoaderFunction } from '@remix-run/node'; +import { LoaderFunction, defer } from '@remix-run/node'; import { useLoaderData } from '@remix-run/react'; type LoaderData = { id: string }; diff --git a/packages/remix/test/integration/common/routes/loader-json-response.$id.tsx b/packages/remix/test/integration/common/routes/loader-json-response.$id.tsx index a4ad3dc48339..dd8a1812ecc4 100644 --- a/packages/remix/test/integration/common/routes/loader-json-response.$id.tsx +++ b/packages/remix/test/integration/common/routes/loader-json-response.$id.tsx @@ -1,4 +1,4 @@ -import { json, LoaderFunction, redirect } from '@remix-run/node'; +import { LoaderFunction, json, redirect } from '@remix-run/node'; import { useLoaderData } from '@remix-run/react'; type LoaderData = { id: string }; diff --git a/packages/remix/test/integration/common/routes/scope-bleed.$id.tsx b/packages/remix/test/integration/common/routes/scope-bleed.$id.tsx index 5b6aba13b0c9..1b684b1a6759 100644 --- a/packages/remix/test/integration/common/routes/scope-bleed.$id.tsx +++ b/packages/remix/test/integration/common/routes/scope-bleed.$id.tsx @@ -1,4 +1,4 @@ -import { json, LoaderFunction } from '@remix-run/node'; +import { LoaderFunction, json } from '@remix-run/node'; import * as Sentry from '@sentry/remix'; diff --git a/packages/remix/test/integration/test/client/capture-exception.test.ts b/packages/remix/test/integration/test/client/capture-exception.test.ts index 8f2db9d8704b..979e192b8850 100644 --- a/packages/remix/test/integration/test/client/capture-exception.test.ts +++ b/packages/remix/test/integration/test/client/capture-exception.test.ts @@ -1,6 +1,6 @@ -import { getMultipleSentryEnvelopeRequests } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Event } from '@sentry/types'; +import { getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should report a manually captured error.', async ({ page }) => { const envelopes = await getMultipleSentryEnvelopeRequests(page, 2, { url: '/capture-exception' }); diff --git a/packages/remix/test/integration/test/client/capture-message.test.ts b/packages/remix/test/integration/test/client/capture-message.test.ts index 8ae743f8419a..577ecaf105eb 100644 --- a/packages/remix/test/integration/test/client/capture-message.test.ts +++ b/packages/remix/test/integration/test/client/capture-message.test.ts @@ -1,6 +1,6 @@ -import { getMultipleSentryEnvelopeRequests } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Event } from '@sentry/types'; +import { getMultipleSentryEnvelopeRequests } from './utils/helpers'; test('should report a manually captured message.', async ({ page }) => { const envelopes = await getMultipleSentryEnvelopeRequests(page, 2, { url: '/capture-message' }); diff --git a/packages/remix/test/integration/test/client/deferred-response.test.ts b/packages/remix/test/integration/test/client/deferred-response.test.ts index c239565428da..bb647870c818 100644 --- a/packages/remix/test/integration/test/client/deferred-response.test.ts +++ b/packages/remix/test/integration/test/client/deferred-response.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; test('should receive correct data from instrumented defer response', async ({ page }) => { await page.goto('/loader-defer-response/98765'); diff --git a/packages/remix/test/integration/test/client/errorboundary.test.ts b/packages/remix/test/integration/test/client/errorboundary.test.ts index 56b18aa72d12..a2ebb2e36b2c 100644 --- a/packages/remix/test/integration/test/client/errorboundary.test.ts +++ b/packages/remix/test/integration/test/client/errorboundary.test.ts @@ -1,6 +1,6 @@ -import { getMultipleSentryEnvelopeRequests } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Event } from '@sentry/types'; +import { getMultipleSentryEnvelopeRequests } from './utils/helpers'; const useV2 = process.env.REMIX_VERSION === '2'; diff --git a/packages/remix/test/integration/test/client/manualtracing.test.ts b/packages/remix/test/integration/test/client/manualtracing.test.ts index 424408e7be9d..4fd16035a55d 100644 --- a/packages/remix/test/integration/test/client/manualtracing.test.ts +++ b/packages/remix/test/integration/test/client/manualtracing.test.ts @@ -1,6 +1,6 @@ -import { getMultipleSentryEnvelopeRequests } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Event } from '@sentry/types'; +import { getMultipleSentryEnvelopeRequests } from './utils/helpers'; const useV2 = process.env.REMIX_VERSION === '2'; diff --git a/packages/remix/test/integration/test/client/meta-tags.test.ts b/packages/remix/test/integration/test/client/meta-tags.test.ts index 2ca07ba23fd5..34bf6fec1e01 100644 --- a/packages/remix/test/integration/test/client/meta-tags.test.ts +++ b/packages/remix/test/integration/test/client/meta-tags.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from '@playwright/test'; -import { getFirstSentryEnvelopeRequest } from './utils/helpers'; +import { expect, test } from '@playwright/test'; import { Event } from '@sentry/types'; +import { getFirstSentryEnvelopeRequest } from './utils/helpers'; test('should inject `sentry-trace` and `baggage` meta tags inside the root page.', async ({ page }) => { await page.goto('/'); diff --git a/packages/remix/test/integration/test/client/pageload.test.ts b/packages/remix/test/integration/test/client/pageload.test.ts index 7c49e4ac9c8c..16b41fddd568 100644 --- a/packages/remix/test/integration/test/client/pageload.test.ts +++ b/packages/remix/test/integration/test/client/pageload.test.ts @@ -1,8 +1,8 @@ const useV2 = process.env.REMIX_VERSION === '2'; -import { getFirstSentryEnvelopeRequest } from './utils/helpers'; -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { Event } from '@sentry/types'; +import { getFirstSentryEnvelopeRequest } from './utils/helpers'; test('should add `pageload` transaction on load.', async ({ page }) => { const envelope = await getFirstSentryEnvelopeRequest(page, '/'); diff --git a/packages/remix/test/integration/test/client/root-loader.test.ts b/packages/remix/test/integration/test/client/root-loader.test.ts index c78ceb2aa411..53b7648756e5 100644 --- a/packages/remix/test/integration/test/client/root-loader.test.ts +++ b/packages/remix/test/integration/test/client/root-loader.test.ts @@ -1,4 +1,4 @@ -import { test, expect, Page } from '@playwright/test'; +import { Page, expect, test } from '@playwright/test'; async function getRouteData(page: Page): Promise { return page.evaluate('window.__remixContext.state.loaderData').catch(err => { diff --git a/packages/remix/test/integration/test/server/action.test.ts b/packages/remix/test/integration/test/server/action.test.ts index fdeb70962a3e..7cc99ded78d3 100644 --- a/packages/remix/test/integration/test/server/action.test.ts +++ b/packages/remix/test/integration/test/server/action.test.ts @@ -1,4 +1,4 @@ -import { assertSentryTransaction, assertSentryEvent, RemixTestEnv } from './utils/helpers'; +import { RemixTestEnv, assertSentryEvent, assertSentryTransaction } from './utils/helpers'; const useV2 = process.env.REMIX_VERSION === '2'; diff --git a/packages/remix/test/integration/test/server/loader.test.ts b/packages/remix/test/integration/test/server/loader.test.ts index e45c5be33e8c..c3f60dcb66ee 100644 --- a/packages/remix/test/integration/test/server/loader.test.ts +++ b/packages/remix/test/integration/test/server/loader.test.ts @@ -1,5 +1,5 @@ -import { assertSentryTransaction, RemixTestEnv, assertSentryEvent } from './utils/helpers'; import { Event } from '@sentry/types'; +import { RemixTestEnv, assertSentryEvent, assertSentryTransaction } from './utils/helpers'; const useV2 = process.env.REMIX_VERSION === '2'; diff --git a/packages/remix/test/integration/test/server/utils/helpers.ts b/packages/remix/test/integration/test/server/utils/helpers.ts index 7042940d6c14..3842ef778ca2 100644 --- a/packages/remix/test/integration/test/server/utils/helpers.ts +++ b/packages/remix/test/integration/test/server/utils/helpers.ts @@ -1,9 +1,9 @@ -import express from 'express'; +import * as http from 'http'; +import { AddressInfo } from 'net'; import { createRequestHandler } from '@remix-run/express'; import { wrapExpressCreateRequestHandler } from '@sentry/remix'; +import express from 'express'; import { TestEnv } from '../../../../../../node-integration-tests/utils'; -import * as http from 'http'; -import { AddressInfo } from 'net'; export * from '../../../../../../node-integration-tests/utils'; diff --git a/packages/replay-worker/rollup.examples.config.js b/packages/replay-worker/rollup.examples.config.js index f3439b8650d2..b7e4f6e31ae2 100644 --- a/packages/replay-worker/rollup.examples.config.js +++ b/packages/replay-worker/rollup.examples.config.js @@ -1,5 +1,5 @@ -import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; +import resolve from '@rollup/plugin-node-resolve'; import typescript from '@rollup/plugin-typescript'; import { defineConfig } from 'rollup'; import { terser } from 'rollup-plugin-terser'; diff --git a/packages/replay-worker/rollup.worker.config.js b/packages/replay-worker/rollup.worker.config.js index 452eb31dd37d..94df8f3a3be3 100644 --- a/packages/replay-worker/rollup.worker.config.js +++ b/packages/replay-worker/rollup.worker.config.js @@ -1,7 +1,7 @@ // inspired by https://justinribeiro.com/chronicle/2020/07/17/building-module-web-workers-for-cross-browser-compatibility-with-rollup/ -import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; +import resolve from '@rollup/plugin-node-resolve'; import typescript from '@rollup/plugin-typescript'; import { defineConfig } from 'rollup'; import { terser } from 'rollup-plugin-terser'; diff --git a/packages/replay-worker/src/Compressor.ts b/packages/replay-worker/src/Compressor.ts index e25d974a073b..80a5fa1822ac 100644 --- a/packages/replay-worker/src/Compressor.ts +++ b/packages/replay-worker/src/Compressor.ts @@ -1,4 +1,4 @@ -import { compressSync, EncodeUTF8, strToU8, Zlib } from 'fflate'; +import { EncodeUTF8, Zlib, compressSync, strToU8 } from 'fflate'; /** * A stateful compressor that can be used to batch compress events. diff --git a/packages/replay-worker/src/handleMessage.ts b/packages/replay-worker/src/handleMessage.ts index 2edeb71c1c22..79eed0345ccd 100644 --- a/packages/replay-worker/src/handleMessage.ts +++ b/packages/replay-worker/src/handleMessage.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import { compress, Compressor } from './Compressor'; +import { Compressor, compress } from './Compressor'; const compressor = new Compressor(); diff --git a/packages/replay/jest.setup.ts b/packages/replay/jest.setup.ts index 2c0ec715b7f6..09e6c68a4483 100644 --- a/packages/replay/jest.setup.ts +++ b/packages/replay/jest.setup.ts @@ -1,8 +1,8 @@ +import { TextEncoder } from 'util'; /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { getCurrentHub } from '@sentry/core'; import type { ReplayRecordingData, Transport } from '@sentry/types'; import * as SentryUtils from '@sentry/utils'; -import { TextEncoder } from 'util'; import type { ReplayContainer, Session } from './src/types'; diff --git a/packages/replay/src/coreHandlers/util/xhrUtils.ts b/packages/replay/src/coreHandlers/util/xhrUtils.ts index db3e8eab7d93..fa2345dc04bd 100644 --- a/packages/replay/src/coreHandlers/util/xhrUtils.ts +++ b/packages/replay/src/coreHandlers/util/xhrUtils.ts @@ -1,5 +1,5 @@ import type { Breadcrumb, TextEncoderInternal, XhrBreadcrumbData } from '@sentry/types'; -import { logger, SENTRY_XHR_DATA_KEY } from '@sentry/utils'; +import { SENTRY_XHR_DATA_KEY, logger } from '@sentry/utils'; import { DEBUG_BUILD } from '../../debug-build'; import type { diff --git a/packages/replay/src/eventBuffer/EventBufferCompressionWorker.ts b/packages/replay/src/eventBuffer/EventBufferCompressionWorker.ts index 90e1eeba8f11..6e707638386f 100644 --- a/packages/replay/src/eventBuffer/EventBufferCompressionWorker.ts +++ b/packages/replay/src/eventBuffer/EventBufferCompressionWorker.ts @@ -3,8 +3,8 @@ import type { ReplayRecordingData } from '@sentry/types'; import { REPLAY_MAX_EVENT_BUFFER_SIZE } from '../constants'; import type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types'; import { timestampToMs } from '../util/timestamp'; -import { EventBufferSizeExceededError } from './error'; import { WorkerHandler } from './WorkerHandler'; +import { EventBufferSizeExceededError } from './error'; /** * Event buffer that uses a web worker to compress events. diff --git a/packages/replay/src/replay.ts b/packages/replay/src/replay.ts index 9501db156c82..5b46ac64e110 100644 --- a/packages/replay/src/replay.ts +++ b/packages/replay/src/replay.ts @@ -54,7 +54,7 @@ import { isSessionExpired } from './util/isSessionExpired'; import { logInfo, logInfoNextTick } from './util/log'; import { sendReplay } from './util/sendReplay'; import type { SKIPPED } from './util/throttle'; -import { throttle, THROTTLED } from './util/throttle'; +import { THROTTLED, throttle } from './util/throttle'; /** * The main replay container class, which holds all the state and methods for recording and sending replays. diff --git a/packages/replay/src/session/createSession.ts b/packages/replay/src/session/createSession.ts index 2cb9c0853b09..1104ac33ba80 100644 --- a/packages/replay/src/session/createSession.ts +++ b/packages/replay/src/session/createSession.ts @@ -1,7 +1,7 @@ import type { Sampled, Session, SessionOptions } from '../types'; import { isSampled } from '../util/isSampled'; -import { saveSession } from './saveSession'; import { makeSession } from './Session'; +import { saveSession } from './saveSession'; /** * Get the sampled status for a session based on sample rates & current sampled status. diff --git a/packages/replay/src/util/sendReplay.ts b/packages/replay/src/util/sendReplay.ts index 9aea14be4a16..18c256987453 100644 --- a/packages/replay/src/util/sendReplay.ts +++ b/packages/replay/src/util/sendReplay.ts @@ -3,7 +3,7 @@ import { captureException, setContext } from '@sentry/core'; import { RETRY_BASE_INTERVAL, RETRY_MAX_COUNT, UNABLE_TO_SEND_REPLAY } from '../constants'; import { DEBUG_BUILD } from '../debug-build'; import type { SendReplayData } from '../types'; -import { RateLimitError, sendReplayRequest, TransportStatusCodeError } from './sendReplayRequest'; +import { RateLimitError, TransportStatusCodeError, sendReplayRequest } from './sendReplayRequest'; /** * Finalize and send the current replay event to Sentry diff --git a/packages/replay/test/unit/coreHandlers/handleNetworkBreadcrumbs.test.ts b/packages/replay/test/unit/coreHandlers/handleNetworkBreadcrumbs.test.ts index 2d012bd936de..00a8ffdf8829 100644 --- a/packages/replay/test/unit/coreHandlers/handleNetworkBreadcrumbs.test.ts +++ b/packages/replay/test/unit/coreHandlers/handleNetworkBreadcrumbs.test.ts @@ -1,3 +1,4 @@ +import { TextEncoder } from 'util'; import type { Breadcrumb, BreadcrumbHint, @@ -7,7 +8,6 @@ import type { XhrBreadcrumbHint, } from '@sentry/types'; import { SENTRY_XHR_DATA_KEY } from '@sentry/utils'; -import { TextEncoder } from 'util'; import { BASE_TIMESTAMP } from '../..'; import { NETWORK_BODY_MAX_SIZE } from '../../../src/constants'; diff --git a/packages/replay/test/unit/eventBuffer/EventBufferCompressionWorker.test.ts b/packages/replay/test/unit/eventBuffer/EventBufferCompressionWorker.test.ts index 92aef73868e2..6b314a0d1b24 100644 --- a/packages/replay/test/unit/eventBuffer/EventBufferCompressionWorker.test.ts +++ b/packages/replay/test/unit/eventBuffer/EventBufferCompressionWorker.test.ts @@ -3,8 +3,8 @@ import 'jsdom-worker'; import { BASE_TIMESTAMP } from '../..'; import { REPLAY_MAX_EVENT_BUFFER_SIZE } from '../../../src/constants'; import { createEventBuffer } from '../../../src/eventBuffer'; -import { EventBufferSizeExceededError } from '../../../src/eventBuffer/error'; import { EventBufferProxy } from '../../../src/eventBuffer/EventBufferProxy'; +import { EventBufferSizeExceededError } from '../../../src/eventBuffer/error'; import { decompress } from '../../utils/compression'; import { getTestEventIncremental } from '../../utils/getTestEvent'; diff --git a/packages/replay/test/unit/session/loadOrCreateSession.test.ts b/packages/replay/test/unit/session/loadOrCreateSession.test.ts index 417b9703d479..bac9ee397984 100644 --- a/packages/replay/test/unit/session/loadOrCreateSession.test.ts +++ b/packages/replay/test/unit/session/loadOrCreateSession.test.ts @@ -1,9 +1,9 @@ import { MAX_REPLAY_DURATION, SESSION_IDLE_EXPIRE_DURATION, WINDOW } from '../../../src/constants'; +import { makeSession } from '../../../src/session/Session'; import * as CreateSession from '../../../src/session/createSession'; import * as FetchSession from '../../../src/session/fetchSession'; import { loadOrCreateSession } from '../../../src/session/loadOrCreateSession'; import { saveSession } from '../../../src/session/saveSession'; -import { makeSession } from '../../../src/session/Session'; import type { SessionOptions } from '../../../src/types'; jest.mock('@sentry/utils', () => { diff --git a/packages/replay/test/unit/session/saveSession.test.ts b/packages/replay/test/unit/session/saveSession.test.ts index ff8b8e15f204..f3861142b113 100644 --- a/packages/replay/test/unit/session/saveSession.test.ts +++ b/packages/replay/test/unit/session/saveSession.test.ts @@ -1,6 +1,6 @@ import { REPLAY_SESSION_KEY, WINDOW } from '../../../src/constants'; -import { saveSession } from '../../../src/session/saveSession'; import { makeSession } from '../../../src/session/Session'; +import { saveSession } from '../../../src/session/saveSession'; describe('Unit | session | saveSession', () => { beforeAll(() => { diff --git a/packages/replay/test/unit/session/sessionSampling.test.ts b/packages/replay/test/unit/session/sessionSampling.test.ts index 7e5b27175011..2121c91e9491 100644 --- a/packages/replay/test/unit/session/sessionSampling.test.ts +++ b/packages/replay/test/unit/session/sessionSampling.test.ts @@ -1,5 +1,5 @@ -import { getSessionSampleType } from '../../../src/session/createSession'; import { makeSession } from '../../../src/session/Session'; +import { getSessionSampleType } from '../../../src/session/createSession'; describe('Unit | session | sessionSampling', () => { it('does not sample', function () { diff --git a/packages/replay/test/unit/util/prepareReplayEvent.test.ts b/packages/replay/test/unit/util/prepareReplayEvent.test.ts index dd132f4e3633..33019507046a 100644 --- a/packages/replay/test/unit/util/prepareReplayEvent.test.ts +++ b/packages/replay/test/unit/util/prepareReplayEvent.test.ts @@ -4,7 +4,7 @@ import type { Client, ReplayEvent } from '@sentry/types'; import { REPLAY_EVENT_NAME } from '../../../src/constants'; import { prepareReplayEvent } from '../../../src/util/prepareReplayEvent'; -import { getDefaultClientOptions, TestClient } from '../../utils/TestClient'; +import { TestClient, getDefaultClientOptions } from '../../utils/TestClient'; describe('Unit | util | prepareReplayEvent', () => { let hub: Hub; diff --git a/packages/replay/test/unit/util/throttle.test.ts b/packages/replay/test/unit/util/throttle.test.ts index 4f1c0bc9f6a2..a242bde73398 100644 --- a/packages/replay/test/unit/util/throttle.test.ts +++ b/packages/replay/test/unit/util/throttle.test.ts @@ -1,5 +1,5 @@ import { BASE_TIMESTAMP } from '../..'; -import { SKIPPED, throttle, THROTTLED } from '../../../src/util/throttle'; +import { SKIPPED, THROTTLED, throttle } from '../../../src/util/throttle'; jest.useFakeTimers(); diff --git a/packages/serverless/rollup.aws.config.js b/packages/serverless/rollup.aws.config.js index 23c10b757f33..5a32f2632f3e 100644 --- a/packages/serverless/rollup.aws.config.js +++ b/packages/serverless/rollup.aws.config.js @@ -1,4 +1,4 @@ -import { makeBaseBundleConfig, makeBundleConfigVariants, makeBaseNPMConfig } from '../../rollup/index.js'; +import { makeBaseBundleConfig, makeBaseNPMConfig, makeBundleConfigVariants } from '../../rollup/index.js'; export default [ // The SDK diff --git a/packages/serverless/src/awslambda.ts b/packages/serverless/src/awslambda.ts index 6d8d8628e32f..1da44ed1b47c 100644 --- a/packages/serverless/src/awslambda.ts +++ b/packages/serverless/src/awslambda.ts @@ -1,3 +1,7 @@ +import { existsSync } from 'fs'; +import { hostname } from 'os'; +import { basename, resolve } from 'path'; +import { types } from 'util'; /* eslint-disable max-lines */ import type { Scope } from '@sentry/node'; import * as Sentry from '@sentry/node'; @@ -6,11 +10,7 @@ import type { Integration, SdkMetadata } from '@sentry/types'; import { isString, logger, tracingContextFromHeaders } from '@sentry/utils'; // NOTE: I have no idea how to fix this right now, and don't want to waste more time, as it builds just fine — Kamil import type { Context, Handler } from 'aws-lambda'; -import { existsSync } from 'fs'; -import { hostname } from 'os'; -import { basename, resolve } from 'path'; import { performance } from 'perf_hooks'; -import { types } from 'util'; import { AWSServices } from './awsservices'; import { DEBUG_BUILD } from './debug-build'; diff --git a/packages/serverless/src/google-cloud-grpc.ts b/packages/serverless/src/google-cloud-grpc.ts index 276fc4e44b55..8dfbcc092cb4 100644 --- a/packages/serverless/src/google-cloud-grpc.ts +++ b/packages/serverless/src/google-cloud-grpc.ts @@ -1,7 +1,7 @@ +import type { EventEmitter } from 'events'; import { getCurrentHub } from '@sentry/node'; import type { Integration, Span } from '@sentry/types'; import { fill } from '@sentry/utils'; -import type { EventEmitter } from 'events'; interface GrpcFunction extends CallableFunction { (...args: unknown[]): EventEmitter; diff --git a/packages/serverless/test/gcpfunction.test.ts b/packages/serverless/test/gcpfunction.test.ts index 6aef838b1eb3..90ff6e082c29 100644 --- a/packages/serverless/test/gcpfunction.test.ts +++ b/packages/serverless/test/gcpfunction.test.ts @@ -1,6 +1,6 @@ +import * as domain from 'domain'; import * as SentryNode from '@sentry/node'; import type { Event } from '@sentry/types'; -import * as domain from 'domain'; import * as Sentry from '../src'; import { wrapCloudEventFunction, wrapEventFunction, wrapHttpFunction } from '../src/gcpfunction'; diff --git a/packages/serverless/test/google-cloud-grpc.test.ts b/packages/serverless/test/google-cloud-grpc.test.ts index d810dba7b011..a9fd8f726e08 100644 --- a/packages/serverless/test/google-cloud-grpc.test.ts +++ b/packages/serverless/test/google-cloud-grpc.test.ts @@ -1,13 +1,13 @@ jest.mock('dns'); -import { PubSub } from '@google-cloud/pubsub'; -import * as SentryNode from '@sentry/node'; import * as dns from 'dns'; import { EventEmitter } from 'events'; import * as fs from 'fs'; +import * as path from 'path'; +import { PubSub } from '@google-cloud/pubsub'; +import * as SentryNode from '@sentry/node'; import * as http2 from 'http2'; import * as nock from 'nock'; -import * as path from 'path'; import { GoogleCloudGrpc } from '../src/google-cloud-grpc'; diff --git a/packages/serverless/test/google-cloud-http.test.ts b/packages/serverless/test/google-cloud-http.test.ts index 7327ba01b97e..8296ab4e1d88 100644 --- a/packages/serverless/test/google-cloud-http.test.ts +++ b/packages/serverless/test/google-cloud-http.test.ts @@ -1,8 +1,8 @@ +import * as fs from 'fs'; +import * as path from 'path'; import { BigQuery } from '@google-cloud/bigquery'; import * as SentryNode from '@sentry/node'; -import * as fs from 'fs'; import * as nock from 'nock'; -import * as path from 'path'; import { GoogleCloudHttp } from '../src/google-cloud-http'; diff --git a/packages/svelte/src/sdk.ts b/packages/svelte/src/sdk.ts index c09e101a72c4..6caef4817af9 100644 --- a/packages/svelte/src/sdk.ts +++ b/packages/svelte/src/sdk.ts @@ -1,5 +1,5 @@ import type { BrowserOptions } from '@sentry/browser'; -import { addGlobalEventProcessor, init as browserInit, SDK_VERSION } from '@sentry/browser'; +import { SDK_VERSION, addGlobalEventProcessor, init as browserInit } from '@sentry/browser'; import type { EventProcessor, SdkMetadata } from '@sentry/types'; import { getDomElement } from '@sentry/utils'; /** diff --git a/packages/svelte/test/config.test.ts b/packages/svelte/test/config.test.ts index 5e33355a4994..1835e7a4bd4d 100644 --- a/packages/svelte/test/config.test.ts +++ b/packages/svelte/test/config.test.ts @@ -1,5 +1,5 @@ import { withSentryConfig } from '../src/config'; -import { componentTrackingPreprocessor, FIRST_PASS_COMPONENT_TRACKING_PREPROC_ID } from '../src/preprocessors'; +import { FIRST_PASS_COMPONENT_TRACKING_PREPROC_ID, componentTrackingPreprocessor } from '../src/preprocessors'; import type { SentryPreprocessorGroup, SentrySvelteConfigOptions, SvelteConfig } from '../src/types'; describe('withSentryConfig', () => { diff --git a/packages/svelte/test/preprocessors.test.ts b/packages/svelte/test/preprocessors.test.ts index 57a235ce4cfd..16aa9d125636 100644 --- a/packages/svelte/test/preprocessors.test.ts +++ b/packages/svelte/test/preprocessors.test.ts @@ -2,9 +2,9 @@ import * as svelteCompiler from 'svelte/compiler'; /* eslint-disable deprecation/deprecation */ import { + FIRST_PASS_COMPONENT_TRACKING_PREPROC_ID, componentTrackingPreprocessor, defaultComponentTrackingOptions, - FIRST_PASS_COMPONENT_TRACKING_PREPROC_ID, } from '../src/preprocessors'; import type { SentryPreprocessorGroup } from '../src/types'; diff --git a/packages/sveltekit/src/client/sdk.ts b/packages/sveltekit/src/client/sdk.ts index c399a4a2ad02..900813ce7f9b 100644 --- a/packages/sveltekit/src/client/sdk.ts +++ b/packages/sveltekit/src/client/sdk.ts @@ -1,6 +1,6 @@ import { hasTracingEnabled } from '@sentry/core'; import type { BrowserOptions } from '@sentry/svelte'; -import { BrowserTracing, configureScope, init as initSvelteSdk, WINDOW } from '@sentry/svelte'; +import { BrowserTracing, WINDOW, configureScope, init as initSvelteSdk } from '@sentry/svelte'; import { addOrUpdateIntegration } from '@sentry/utils'; import { applySdkMetadata } from '../common/metadata'; diff --git a/packages/sveltekit/src/server/utils.ts b/packages/sveltekit/src/server/utils.ts index 719771d50c57..96aa53e1f9f4 100644 --- a/packages/sveltekit/src/server/utils.ts +++ b/packages/sveltekit/src/server/utils.ts @@ -1,6 +1,6 @@ import { flush } from '@sentry/node'; import type { StackFrame } from '@sentry/types'; -import { basename, escapeStringForRegex, GLOBAL_OBJ, join, logger, tracingContextFromHeaders } from '@sentry/utils'; +import { GLOBAL_OBJ, basename, escapeStringForRegex, join, logger, tracingContextFromHeaders } from '@sentry/utils'; import type { RequestEvent } from '@sveltejs/kit'; import { DEBUG_BUILD } from '../common/debug-build'; diff --git a/packages/sveltekit/src/vite/autoInstrument.ts b/packages/sveltekit/src/vite/autoInstrument.ts index 07e8b7646124..708f3c5fc7dc 100644 --- a/packages/sveltekit/src/vite/autoInstrument.ts +++ b/packages/sveltekit/src/vite/autoInstrument.ts @@ -1,8 +1,8 @@ +import * as fs from 'fs'; +import * as path from 'path'; /* eslint-disable @sentry-internal/sdk/no-optional-chaining */ import type { ExportNamedDeclaration } from '@babel/types'; -import * as fs from 'fs'; import { parseModule } from 'magicast'; -import * as path from 'path'; import type { Plugin } from 'vite'; export const WRAPPED_MODULE_SUFFIX = '?sentry-auto-wrap'; diff --git a/packages/sveltekit/src/vite/detectAdapter.ts b/packages/sveltekit/src/vite/detectAdapter.ts index 95e26dfc9f6d..ac9dce2bf8a9 100644 --- a/packages/sveltekit/src/vite/detectAdapter.ts +++ b/packages/sveltekit/src/vite/detectAdapter.ts @@ -1,6 +1,6 @@ -import type { Package } from '@sentry/types'; import * as fs from 'fs'; import * as path from 'path'; +import type { Package } from '@sentry/types'; /** * Supported @sveltejs/adapters-[adapter] SvelteKit adapters diff --git a/packages/sveltekit/src/vite/sourceMaps.ts b/packages/sveltekit/src/vite/sourceMaps.ts index 42a46d38d649..a418dd0dcaa0 100644 --- a/packages/sveltekit/src/vite/sourceMaps.ts +++ b/packages/sveltekit/src/vite/sourceMaps.ts @@ -1,10 +1,10 @@ +import * as child_process from 'child_process'; +import * as fs from 'fs'; +import * as path from 'path'; import { getSentryRelease } from '@sentry/node'; import { escapeStringForRegex, uuid4 } from '@sentry/utils'; import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; import { sentryVitePlugin } from '@sentry/vite-plugin'; -import * as child_process from 'child_process'; -import * as fs from 'fs'; -import * as path from 'path'; // @ts-expect-error -sorcery has no types :( import * as sorcery from 'sorcery'; import type { Plugin } from 'vite'; @@ -12,7 +12,7 @@ import type { Plugin } from 'vite'; import { WRAPPED_MODULE_SUFFIX } from './autoInstrument'; import type { SupportedSvelteKitAdapters } from './detectAdapter'; import type { GlobalSentryValues } from './injectGlobalValues'; -import { getGlobalValueInjectionCode, VIRTUAL_GLOBAL_VALUES_FILE } from './injectGlobalValues'; +import { VIRTUAL_GLOBAL_VALUES_FILE, getGlobalValueInjectionCode } from './injectGlobalValues'; import { getAdapterOutputDir, getHooksFileName, loadSvelteConfig } from './svelteConfig'; // sorcery has no types, so these are some basic type definitions: diff --git a/packages/sveltekit/src/vite/svelteConfig.ts b/packages/sveltekit/src/vite/svelteConfig.ts index 1384769be52f..e50f8b10a2c3 100644 --- a/packages/sveltekit/src/vite/svelteConfig.ts +++ b/packages/sveltekit/src/vite/svelteConfig.ts @@ -1,9 +1,9 @@ /* eslint-disable @sentry-internal/sdk/no-optional-chaining */ -import type { Builder, Config } from '@sveltejs/kit'; import * as fs from 'fs'; import * as path from 'path'; import * as url from 'url'; +import type { Builder, Config } from '@sveltejs/kit'; import type { SupportedSvelteKitAdapters } from './detectAdapter'; diff --git a/packages/sveltekit/test/server/handle.test.ts b/packages/sveltekit/test/server/handle.test.ts index 2c726127a43b..1444b75d9ea5 100644 --- a/packages/sveltekit/test/server/handle.test.ts +++ b/packages/sveltekit/test/server/handle.test.ts @@ -1,4 +1,4 @@ -import { addTracingExtensions, Hub, makeMain } from '@sentry/core'; +import { Hub, addTracingExtensions, makeMain } from '@sentry/core'; import { NodeClient } from '@sentry/node'; import * as SentryNode from '@sentry/node'; import type { Transaction } from '@sentry/types'; diff --git a/packages/tracing-internal/src/browser/browsertracing.ts b/packages/tracing-internal/src/browser/browsertracing.ts index f1ee79c39679..93dc8716d71f 100644 --- a/packages/tracing-internal/src/browser/browsertracing.ts +++ b/packages/tracing-internal/src/browser/browsertracing.ts @@ -1,6 +1,6 @@ /* eslint-disable max-lines */ import type { Hub, IdleTransaction } from '@sentry/core'; -import { addTracingExtensions, getActiveTransaction, startIdleTransaction, TRACING_DEFAULTS } from '@sentry/core'; +import { TRACING_DEFAULTS, addTracingExtensions, getActiveTransaction, startIdleTransaction } from '@sentry/core'; import type { EventProcessor, Integration, Transaction, TransactionContext, TransactionSource } from '@sentry/types'; import { getDomElement, logger, tracingContextFromHeaders } from '@sentry/utils'; diff --git a/packages/tracing-internal/src/browser/request.ts b/packages/tracing-internal/src/browser/request.ts index 78e334e98549..b45e15679805 100644 --- a/packages/tracing-internal/src/browser/request.ts +++ b/packages/tracing-internal/src/browser/request.ts @@ -2,13 +2,13 @@ import { getCurrentHub, getDynamicSamplingContextFromClient, hasTracingEnabled } from '@sentry/core'; import type { HandlerDataXhr, SentryWrappedXMLHttpRequest, Span } from '@sentry/types'; import { + BAGGAGE_HEADER_NAME, + SENTRY_XHR_DATA_KEY, addFetchInstrumentationHandler, addXhrInstrumentationHandler, - BAGGAGE_HEADER_NAME, browserPerformanceTimeOrigin, dynamicSamplingContextToSentryBaggageHeader, generateSentryTraceHeader, - SENTRY_XHR_DATA_KEY, stringMatchesSomePattern, } from '@sentry/utils'; diff --git a/packages/tracing-internal/src/node/integrations/express.ts b/packages/tracing-internal/src/node/integrations/express.ts index 3efafcfb3312..0cbbf5d6af07 100644 --- a/packages/tracing-internal/src/node/integrations/express.ts +++ b/packages/tracing-internal/src/node/integrations/express.ts @@ -1,9 +1,9 @@ /* eslint-disable max-lines */ import type { Hub, Integration, PolymorphicRequest, Transaction } from '@sentry/types'; import { + GLOBAL_OBJ, extractPathForTransaction, getNumberOfUrlSegments, - GLOBAL_OBJ, isRegExp, logger, stripUrlQueryAndFragment, diff --git a/packages/tracing-internal/test/browser/browsertracing.test.ts b/packages/tracing-internal/test/browser/browsertracing.test.ts index d1ce55644e6c..65de2adbd85d 100644 --- a/packages/tracing-internal/test/browser/browsertracing.test.ts +++ b/packages/tracing-internal/test/browser/browsertracing.test.ts @@ -1,5 +1,5 @@ /* eslint-disable deprecation/deprecation */ -import { Hub, makeMain, TRACING_DEFAULTS } from '@sentry/core'; +import { Hub, TRACING_DEFAULTS, makeMain } from '@sentry/core'; import * as hubExtensions from '@sentry/core'; import type { BaseTransportOptions, ClientOptions, DsnComponents, HandlerDataHistory } from '@sentry/types'; import { JSDOM } from 'jsdom'; diff --git a/packages/tracing-internal/test/browser/request.test.ts b/packages/tracing-internal/test/browser/request.test.ts index 54a33396df39..29cf7e287f0c 100644 --- a/packages/tracing-internal/test/browser/request.test.ts +++ b/packages/tracing-internal/test/browser/request.test.ts @@ -5,7 +5,7 @@ import * as utils from '@sentry/utils'; import { SENTRY_XHR_DATA_KEY } from '@sentry/utils'; import type { Transaction } from '../../../tracing/src'; -import { addExtensionMethods, Span, spanStatusfromHttpCode } from '../../../tracing/src'; +import { Span, addExtensionMethods, spanStatusfromHttpCode } from '../../../tracing/src'; import { getDefaultBrowserClientOptions } from '../../../tracing/test/testutils'; import { extractNetworkProtocol, diff --git a/packages/tracing/src/index.ts b/packages/tracing/src/index.ts index 680a36f7a68f..a515db240117 100644 --- a/packages/tracing/src/index.ts +++ b/packages/tracing/src/index.ts @@ -3,29 +3,29 @@ import type { SpanStatusType as SpanStatusTypeT, } from '@sentry-internal/tracing'; import { - addExtensionMethods as addExtensionMethodsT, Apollo, BROWSER_TRACING_INTEGRATION_ID as BROWSER_TRACING_INTEGRATION_ID_T, BrowserTracing as BrowserTracingT, - defaultRequestInstrumentationOptions as defaultRequestInstrumentationOptionsT, Express, - extractTraceparentData as extractTraceparentDataT, - getActiveTransaction as getActiveTransactionT, GraphQL, - hasTracingEnabled as hasTracingEnabledT, IdleTransaction as IdleTransactionT, - instrumentOutgoingRequests as instrumentOutgoingRequestsT, Mongo, Mysql, Postgres, Prisma, Span as SpanT, SpanStatus as SpanStatusT, + TRACEPARENT_REGEXP as TRACEPARENT_REGEXP_T, + Transaction as TransactionT, + addExtensionMethods as addExtensionMethodsT, + defaultRequestInstrumentationOptions as defaultRequestInstrumentationOptionsT, + extractTraceparentData as extractTraceparentDataT, + getActiveTransaction as getActiveTransactionT, + hasTracingEnabled as hasTracingEnabledT, + instrumentOutgoingRequests as instrumentOutgoingRequestsT, spanStatusfromHttpCode as spanStatusfromHttpCodeT, startIdleTransaction as startIdleTransactionT, stripUrlQueryAndFragment as stripUrlQueryAndFragmentT, - TRACEPARENT_REGEXP as TRACEPARENT_REGEXP_T, - Transaction as TransactionT, } from '@sentry-internal/tracing'; // BrowserTracing is already exported as part of `Integrations` below (and for the moment will remain so for diff --git a/packages/tracing/test/hub.test.ts b/packages/tracing/test/hub.test.ts index 37a7693ad389..86fcf5d6807e 100644 --- a/packages/tracing/test/hub.test.ts +++ b/packages/tracing/test/hub.test.ts @@ -5,7 +5,7 @@ import { Hub, makeMain } from '@sentry/core'; import * as utilsModule from '@sentry/utils'; // for mocking import { logger } from '@sentry/utils'; -import { addExtensionMethods, BrowserTracing, extractTraceparentData, TRACEPARENT_REGEXP, Transaction } from '../src'; +import { BrowserTracing, TRACEPARENT_REGEXP, Transaction, addExtensionMethods, extractTraceparentData } from '../src'; import { addDOMPropertiesToGlobal, getDefaultBrowserClientOptions, diff --git a/packages/tracing/test/span.test.ts b/packages/tracing/test/span.test.ts index ffa57d615d7b..1a7981ad95f6 100644 --- a/packages/tracing/test/span.test.ts +++ b/packages/tracing/test/span.test.ts @@ -1,6 +1,6 @@ /* eslint-disable deprecation/deprecation */ import { BrowserClient } from '@sentry/browser'; -import { Hub, makeMain, Scope } from '@sentry/core'; +import { Hub, Scope, makeMain } from '@sentry/core'; import type { BaseTransportOptions, ClientOptions, TransactionSource } from '@sentry/types'; import { Span, TRACEPARENT_REGEXP, Transaction } from '../src'; diff --git a/packages/tracing/test/transaction.test.ts b/packages/tracing/test/transaction.test.ts index a8a8557150a1..979dc119531e 100644 --- a/packages/tracing/test/transaction.test.ts +++ b/packages/tracing/test/transaction.test.ts @@ -1,7 +1,7 @@ /* eslint-disable deprecation/deprecation */ import { BrowserClient, Hub } from '@sentry/browser'; -import { addExtensionMethods, Transaction } from '../src'; +import { Transaction, addExtensionMethods } from '../src'; import { getDefaultBrowserClientOptions } from './testutils'; describe('`Transaction` class', () => { diff --git a/packages/utils/src/instrument/index.ts b/packages/utils/src/instrument/index.ts index bc200e6230ff..d28f17d277dc 100644 --- a/packages/utils/src/instrument/index.ts +++ b/packages/utils/src/instrument/index.ts @@ -1,19 +1,19 @@ // TODO(v8): Consider moving this file (or at least parts of it) into the browser package. The registered handlers are mostly non-generic and we risk leaking runtime specific code into generic packages. import { DEBUG_BUILD } from '../debug-build'; +import { logger } from './../logger'; import type { InstrumentHandlerCallback as _InstrumentHandlerCallback, InstrumentHandlerType as _InstrumentHandlerType, } from './_handlers'; import { resetInstrumentationHandlers } from './_handlers'; -import { logger } from './../logger'; import { addConsoleInstrumentationHandler } from './console'; import { addClickKeypressInstrumentationHandler } from './dom'; import { addFetchInstrumentationHandler } from './fetch'; import { addGlobalErrorInstrumentationHandler } from './globalError'; import { addGlobalUnhandledRejectionInstrumentationHandler } from './globalUnhandledRejection'; import { addHistoryInstrumentationHandler } from './history'; -import { addXhrInstrumentationHandler, SENTRY_XHR_DATA_KEY } from './xhr'; +import { SENTRY_XHR_DATA_KEY, addXhrInstrumentationHandler } from './xhr'; /** * Add handler that will be called when given type of instrumentation triggers. diff --git a/packages/utils/src/promisebuffer.ts b/packages/utils/src/promisebuffer.ts index 429d3dc62d4b..0ad4991cfb48 100644 --- a/packages/utils/src/promisebuffer.ts +++ b/packages/utils/src/promisebuffer.ts @@ -1,5 +1,5 @@ import { SentryError } from './error'; -import { rejectedSyncPromise, resolvedSyncPromise, SyncPromise } from './syncpromise'; +import { SyncPromise, rejectedSyncPromise, resolvedSyncPromise } from './syncpromise'; export interface PromiseBuffer { // exposes the internal array so tests can assert on the state of it. diff --git a/packages/utils/test/clientreport.test.ts b/packages/utils/test/clientreport.test.ts index b783886771dc..05c30a9cf3ea 100644 --- a/packages/utils/test/clientreport.test.ts +++ b/packages/utils/test/clientreport.test.ts @@ -1,5 +1,5 @@ -import type { ClientReport } from '@sentry/types'; import { TextDecoder, TextEncoder } from 'util'; +import type { ClientReport } from '@sentry/types'; import { createClientReportEnvelope } from '../src/clientreport'; import { parseEnvelope, serializeEnvelope } from '../src/envelope'; diff --git a/packages/utils/test/envelope.test.ts b/packages/utils/test/envelope.test.ts index 10cdcc2cab73..12cc501a96be 100644 --- a/packages/utils/test/envelope.test.ts +++ b/packages/utils/test/envelope.test.ts @@ -1,5 +1,5 @@ -import type { Event, EventEnvelope } from '@sentry/types'; import { TextDecoder, TextEncoder } from 'util'; +import type { Event, EventEnvelope } from '@sentry/types'; const encoder = new TextEncoder(); const decoder = new TextDecoder(); diff --git a/packages/utils/test/syncpromise.test.ts b/packages/utils/test/syncpromise.test.ts index 7c896cbce360..69e57b3ac533 100644 --- a/packages/utils/test/syncpromise.test.ts +++ b/packages/utils/test/syncpromise.test.ts @@ -1,4 +1,4 @@ -import { rejectedSyncPromise, resolvedSyncPromise, SyncPromise } from '../src/syncpromise'; +import { SyncPromise, rejectedSyncPromise, resolvedSyncPromise } from '../src/syncpromise'; describe('SyncPromise', () => { test('simple', async () => { diff --git a/packages/vercel-edge/src/integrations/wintercg-fetch.ts b/packages/vercel-edge/src/integrations/wintercg-fetch.ts index 4107e617af28..ded26ed21a9d 100644 --- a/packages/vercel-edge/src/integrations/wintercg-fetch.ts +++ b/packages/vercel-edge/src/integrations/wintercg-fetch.ts @@ -1,7 +1,7 @@ import { instrumentFetchRequest } from '@sentry-internal/tracing'; import { getCurrentHub, isSentryRequestUrl } from '@sentry/core'; import type { FetchBreadcrumbData, FetchBreadcrumbHint, HandlerDataFetch, Integration, Span } from '@sentry/types'; -import { addFetchInstrumentationHandler, LRUMap, stringMatchesSomePattern } from '@sentry/utils'; +import { LRUMap, addFetchInstrumentationHandler, stringMatchesSomePattern } from '@sentry/utils'; export interface Options { /** diff --git a/packages/vercel-edge/src/sdk.ts b/packages/vercel-edge/src/sdk.ts index 5f1640bdf3c8..9e85593e4b78 100644 --- a/packages/vercel-edge/src/sdk.ts +++ b/packages/vercel-edge/src/sdk.ts @@ -1,6 +1,6 @@ -import { getIntegrationsToSetup, initAndBind, Integrations as CoreIntegrations, RequestData } from '@sentry/core'; +import { Integrations as CoreIntegrations, RequestData, getIntegrationsToSetup, initAndBind } from '@sentry/core'; import type { Integration } from '@sentry/types'; -import { createStackParser, GLOBAL_OBJ, nodeStackLineParser, stackParserFromStackParserOptions } from '@sentry/utils'; +import { GLOBAL_OBJ, createStackParser, nodeStackLineParser, stackParserFromStackParserOptions } from '@sentry/utils'; import { setAsyncLocalStorageAsyncContextStrategy } from './async'; import { VercelEdgeClient } from './client'; diff --git a/packages/vercel-edge/test/transports/index.test.ts b/packages/vercel-edge/test/transports/index.test.ts index da0ab1389325..f2304f5b1fc2 100644 --- a/packages/vercel-edge/test/transports/index.test.ts +++ b/packages/vercel-edge/test/transports/index.test.ts @@ -1,6 +1,6 @@ +import { TextEncoder } from 'util'; import type { EventEnvelope, EventItem } from '@sentry/types'; import { createEnvelope, serializeEnvelope } from '@sentry/utils'; -import { TextEncoder } from 'util'; import type { VercelEdgeTransportOptions } from '../../src/transports'; import { IsolatedPromiseBuffer, makeEdgeTransport } from '../../src/transports'; diff --git a/packages/vue/src/integration.ts b/packages/vue/src/integration.ts index 3f35c66fe554..90e02014aaac 100644 --- a/packages/vue/src/integration.ts +++ b/packages/vue/src/integration.ts @@ -1,6 +1,6 @@ import { hasTracingEnabled } from '@sentry/core'; import type { Hub, Integration } from '@sentry/types'; -import { arrayify, consoleSandbox, GLOBAL_OBJ } from '@sentry/utils'; +import { GLOBAL_OBJ, arrayify, consoleSandbox } from '@sentry/utils'; import { DEFAULT_HOOKS } from './constants'; import { attachErrorHandler } from './errorhandler'; diff --git a/packages/vue/src/router.ts b/packages/vue/src/router.ts index 75f2c573cdda..2f8ab7b30c1a 100644 --- a/packages/vue/src/router.ts +++ b/packages/vue/src/router.ts @@ -1,4 +1,4 @@ -import { captureException, WINDOW } from '@sentry/browser'; +import { WINDOW, captureException } from '@sentry/browser'; import type { Transaction, TransactionContext, TransactionSource } from '@sentry/types'; import { getActiveTransaction } from './tracing'; diff --git a/packages/vue/src/sdk.ts b/packages/vue/src/sdk.ts index 21d7246f503c..cc0db40c5c96 100644 --- a/packages/vue/src/sdk.ts +++ b/packages/vue/src/sdk.ts @@ -1,4 +1,4 @@ -import { defaultIntegrations, init as browserInit, SDK_VERSION } from '@sentry/browser'; +import { SDK_VERSION, defaultIntegrations, init as browserInit } from '@sentry/browser'; import { VueIntegration } from './integration'; import type { Options, TracingOptions } from './types'; diff --git a/rollup/bundleHelpers.js b/rollup/bundleHelpers.js index d001a3b30ecc..cd329dfb31d2 100644 --- a/rollup/bundleHelpers.js +++ b/rollup/bundleHelpers.js @@ -7,18 +7,18 @@ import { builtinModules } from 'module'; import deepMerge from 'deepmerge'; import { + getEs5Polyfills, makeBrowserBuildPlugin, + makeCleanupPlugin, makeCommonJSPlugin, makeIsDebugBuildPlugin, - makeRrwebBuildPlugin, makeLicensePlugin, makeNodeResolvePlugin, - makeCleanupPlugin, + makeRrwebBuildPlugin, + makeSetSDKSourcePlugin, makeSucrasePlugin, - makeTerserPlugin, makeTSPlugin, - makeSetSDKSourcePlugin, - getEs5Polyfills, + makeTerserPlugin, } from './plugins/index.js'; import { mergePlugins } from './utils'; diff --git a/rollup/npmHelpers.js b/rollup/npmHelpers.js index b0056cd80bb3..3d374a4e05f0 100644 --- a/rollup/npmHelpers.js +++ b/rollup/npmHelpers.js @@ -8,13 +8,13 @@ import * as path from 'path'; import deepMerge from 'deepmerge'; import { + makeCleanupPlugin, + makeDebugBuildStatementReplacePlugin, makeExtractPolyfillsPlugin, makeNodeResolvePlugin, - makeCleanupPlugin, - makeSucrasePlugin, makeRrwebBuildPlugin, - makeDebugBuildStatementReplacePlugin, makeSetSDKSourcePlugin, + makeSucrasePlugin, } from './plugins/index.js'; import { mergePlugins } from './utils'; diff --git a/rollup/plugins/bundlePlugins.js b/rollup/plugins/bundlePlugins.js index d012b32d1f0e..87dfffc1f0f0 100644 --- a/rollup/plugins/bundlePlugins.js +++ b/rollup/plugins/bundlePlugins.js @@ -12,12 +12,12 @@ import * as fs from 'fs'; import * as path from 'path'; import commonjs from '@rollup/plugin-commonjs'; -import deepMerge from 'deepmerge'; -import license from 'rollup-plugin-license'; import { nodeResolve } from '@rollup/plugin-node-resolve'; import replace from '@rollup/plugin-replace'; -import { terser } from 'rollup-plugin-terser'; import typescript from '@rollup/plugin-typescript'; +import deepMerge from 'deepmerge'; +import license from 'rollup-plugin-license'; +import { terser } from 'rollup-plugin-terser'; /** * Create a plugin to add an identification banner to the top of stand-alone bundles. diff --git a/rollup/plugins/npmPlugins.js b/rollup/plugins/npmPlugins.js index 76564cfe7e6d..b7683a1306e4 100644 --- a/rollup/plugins/npmPlugins.js +++ b/rollup/plugins/npmPlugins.js @@ -7,9 +7,9 @@ * Sucrase plugin docs: https://github.com/rollup/plugins/tree/master/packages/sucrase */ -import cleanup from 'rollup-plugin-cleanup'; import replace from '@rollup/plugin-replace'; import sucrase from '@rollup/plugin-sucrase'; +import cleanup from 'rollup-plugin-cleanup'; /** * Create a plugin to transpile TS syntax using `sucrase`. From 59db749cf4d1ad2165819e571fbc42945aea0f4c Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Wed, 29 Nov 2023 11:58:47 -0500 Subject: [PATCH 19/20] feat(metrics): Add interfaces for metrics (#9698) Not adding any tests for `createMetricEnvelope` yet because the type for `metricAggregate` is going to change, just added it as boilerplate. In the next PR I'll be implementing a metrics aggregator class which lives on the client. This is responsible for bucketing metrics and incrementally flushing them out. https://develop.sentry.dev/delightful-developer-metrics/ https://develop.sentry.dev/delightful-developer-metrics/sending-metrics-sdk/ --- packages/core/src/metrics/index.ts | 43 ++++++++++++++++++++++++++++++ packages/types/src/envelope.ts | 8 +++++- packages/types/src/index.ts | 3 +++ packages/types/src/metrics.ts | 32 ++++++++++++++++++++++ 4 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 packages/core/src/metrics/index.ts create mode 100644 packages/types/src/metrics.ts diff --git a/packages/core/src/metrics/index.ts b/packages/core/src/metrics/index.ts new file mode 100644 index 000000000000..3cfeae37e03f --- /dev/null +++ b/packages/core/src/metrics/index.ts @@ -0,0 +1,43 @@ +import type { DsnComponents, DynamicSamplingContext, SdkMetadata, StatsdEnvelope, StatsdItem } from '@sentry/types'; +import { createEnvelope, dropUndefinedKeys, dsnToString } from '@sentry/utils'; + +/** + * Create envelope from a metric aggregate. + */ +export function createMetricEnvelope( + // TODO(abhi): Add type for this + metricAggregate: string, + dynamicSamplingContext?: Partial, + metadata?: SdkMetadata, + tunnel?: string, + dsn?: DsnComponents, +): StatsdEnvelope { + const headers: StatsdEnvelope[0] = { + sent_at: new Date().toISOString(), + }; + + if (metadata && metadata.sdk) { + headers.sdk = { + name: metadata.sdk.name, + version: metadata.sdk.version, + }; + } + + if (!!tunnel && !!dsn) { + headers.dsn = dsnToString(dsn); + } + + if (dynamicSamplingContext) { + headers.trace = dropUndefinedKeys(dynamicSamplingContext) as DynamicSamplingContext; + } + + const item = createMetricEnvelopeItem(metricAggregate); + return createEnvelope(headers, [item]); +} + +function createMetricEnvelopeItem(metricAggregate: string): StatsdItem { + const metricHeaders: StatsdItem[0] = { + type: 'statsd', + }; + return [metricHeaders, metricAggregate]; +} diff --git a/packages/types/src/envelope.ts b/packages/types/src/envelope.ts index d479b9f8a4e9..fbe593dd21f9 100644 --- a/packages/types/src/envelope.ts +++ b/packages/types/src/envelope.ts @@ -109,5 +109,11 @@ export type ReplayEnvelope = [ReplayEnvelopeHeaders, [ReplayEventItem, ReplayRec export type CheckInEnvelope = BaseEnvelope; export type StatsdEnvelope = BaseEnvelope; -export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ReplayEnvelope | CheckInEnvelope; +export type Envelope = + | EventEnvelope + | SessionEnvelope + | ClientReportEnvelope + | ReplayEnvelope + | CheckInEnvelope + | StatsdEnvelope; export type EnvelopeItem = Envelope[1][number]; diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 627879493365..615bf71ff785 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -42,6 +42,8 @@ export type { UserFeedbackItem, CheckInItem, CheckInEnvelope, + StatsdItem, + StatsdEnvelope, } from './envelope'; export type { ExtendedError } from './error'; export type { Event, EventHint, EventType, ErrorEvent, TransactionEvent } from './event'; @@ -136,3 +138,4 @@ export type { export type { BrowserClientReplayOptions, BrowserClientProfilingOptions } from './browseroptions'; export type { CheckIn, MonitorConfig, FinishedCheckIn, InProgressCheckIn, SerializedCheckIn } from './checkin'; +export type { Metric, CounterMetric, GaugeMetric, DistributionMetric, SetMetric } from './metrics'; diff --git a/packages/types/src/metrics.ts b/packages/types/src/metrics.ts new file mode 100644 index 000000000000..b55096950b2f --- /dev/null +++ b/packages/types/src/metrics.ts @@ -0,0 +1,32 @@ +import type { MeasurementUnit } from './measurement'; +import type { Primitive } from './misc'; + +export interface BaseMetric { + name: string; + timestamp: number; + unit?: MeasurementUnit; + tags?: { [key: string]: Primitive }; +} + +export interface CounterMetric extends BaseMetric { + value: number; +} + +export interface GaugeMetric extends BaseMetric { + value: number; + first: number; + min: number; + max: number; + sum: number; + count: number; +} + +export interface DistributionMetric extends BaseMetric { + value: number[]; +} + +export interface SetMetric extends BaseMetric { + value: Set; +} + +export type Metric = CounterMetric | GaugeMetric | DistributionMetric | SetMetric; From e9e03e15e49a0729648e296ebc66fd1987f15603 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Thu, 30 Nov 2023 09:56:09 +0000 Subject: [PATCH 20/20] meta(changelog): Update changelog for 7.84.0 --- CHANGELOG.md | 232 ++++++++++++++++++++++++++++----------------------- 1 file changed, 129 insertions(+), 103 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03dadf042f89..67ef36fba32e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,30 @@ - "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott +## 7.84.0 + +### Important Changes + +- **ref(nextjs): Set `automaticVercelMonitors` to be `false` by default (#9697)** + +From this version onwards the default for the `automaticVercelMonitors` option in the Next.js SDK is set to false. +Previously, if you made use of Vercel Crons the SDK automatically instrumented the relevant routes to create Sentry monitors. +Because this feature will soon be generally available, we are now flipping the default to avoid situations where quota is used unexpectedly. + +If you want to continue using this feature, make sure to set the `automaticVercelMonitors` flag to `true` in your `next.config.js` Sentry settings. + +### Other Changes + +- chore(astro): Add 4.0.0 preview versions to `astro` peer dependency range (#9696) +- feat(metrics): Add interfaces for metrics (#9698) +- feat(web-vitals): Vendor in INP from web-vitals library (#9690) +- fix(astro): Avoid adding the Sentry Vite plugin in dev mode (#9688) +- fix(nextjs): Don't match files called `middleware` in node_modules (#9686) +- fix(remix): Don't capture error responses that are not 5xx on Remix v2. (#9655) +- fix(tracing): Don't attach resource size if null (#9669) +- fix(utils): Regex match port to stop accidental replace (#9676) +- fix(utils): Try catch new URL when extracting query params (#9675) + ## 7.83.0 - chore(astro): Allow Astro 4.0 in peer dependencies (#9683) @@ -178,12 +202,12 @@ By using [tree shaking](https://docs.sentry.io/platforms/javascript/configuratio This release adds `Sentry.withMonitor()`, a wrapping function that wraps a callback with a cron monitor that will automatically report completions and failures: ```ts -import * as Sentry from '@sentry/node'; +import * as Sentry from "@sentry/node"; // withMonitor() will send checkin when callback is started/finished // works with async and sync callbacks. const result = Sentry.withMonitor( - 'dailyEmail', + "dailyEmail", () => { // withCheckIn return value is same return value here return sendEmail(); @@ -191,12 +215,12 @@ const result = Sentry.withMonitor( // Optional upsert options { schedule: { - type: 'crontab', - value: '0 * * * *', + type: "crontab", + value: "0 * * * *", }, // 🇨🇦🫡 - timezone: 'Canada/Eastern', - }, + timezone: "Canada/Eastern", + } ); ``` @@ -235,13 +259,12 @@ You can read more about [@sentry/opentelemetry in the Readme](https://github.com Starting with this release, you can configure the following build-time flags in order to reduce the SDK bundle size: -* `__RRWEB_EXCLUDE_CANVAS__` -* `__RRWEB_EXCLUDE_IFRAME__` -* `__RRWEB_EXCLUDE_SHADOW_DOM__` +- `__RRWEB_EXCLUDE_CANVAS__` +- `__RRWEB_EXCLUDE_IFRAME__` +- `__RRWEB_EXCLUDE_SHADOW_DOM__` You can read more about [tree shaking in our docs](https://docs.sentry.io/platforms/javascript/configuration/tree-shaking/). - ### Other Changes - build(deno): Prepare Deno SDK for release on npm (#9281) @@ -369,7 +392,7 @@ Here are benchmarks comparing the version 1 of rrweb to version 2 - fix(nextjs): Fix `RequestAsyncStorage` fallback path (#9126) - fix(node-otel): Suppress tracing for generated sentry spans (#9142) - fix(node): fill in span data from http request options object (#9112) -- fix(node): Fixes and improvements to ANR detection (#9128) +- fix(node): Fixes and improvements to ANR detection (#9128) - fix(sveltekit): Avoid data invalidation in wrapped client-side `load` functions (#9071) - ref(core): Refactor `InboundFilters` integration to use `processEvent` (#9020) - ref(wasm): Refactor Wasm integration to use `processEvent` (#9019) @@ -481,15 +504,15 @@ This release introduces a new set of top level APIs for the Performance Monitori ```js // Start a span that tracks the duration of expensiveFunction -const result = Sentry.startSpan({ name: 'important function' }, () => { +const result = Sentry.startSpan({ name: "important function" }, () => { return expensiveFunction(); }); // You can also mutate the span wrapping the callback to set data or status -Sentry.startSpan({ name: 'important function' }, (span) => { +Sentry.startSpan({ name: "important function" }, (span) => { // span is undefined if performance monitoring is turned off or if // the span was not sampled. This is done to reduce overhead. - span?.setData('version', '1.0.0'); + span?.setData("version", "1.0.0"); return expensiveFunction(); }); ``` @@ -499,8 +522,8 @@ If you don't want the span to finish when the callback returns, use `Sentry.star ```js // Start a span that tracks the duration of middleware function middleware(_req, res, next) { - return Sentry.startSpanManual({ name: 'middleware' }, (span, finish) => { - res.once('finish', () => { + return Sentry.startSpanManual({ name: "middleware" }, (span, finish) => { + res.once("finish", () => { span?.setHttpStatus(res.status); finish(); }); @@ -512,15 +535,15 @@ function middleware(_req, res, next) { `Sentry.startSpan` and `Sentry.startSpanManual` create a span and make it active for the duration of the callback. Any spans created while this active span is running will be added as a child span to it. If you want to create a span without making it active, use `Sentry.startInactiveSpan`. This is useful for creating parallel spans that are not related to each other. ```js -const span1 = Sentry.startInactiveSpan({ name: 'span1' }); +const span1 = Sentry.startInactiveSpan({ name: "span1" }); someWork(); -const span2 = Sentry.startInactiveSpan({ name: 'span2' }); +const span2 = Sentry.startInactiveSpan({ name: "span2" }); moreWork(); -const span3 = Sentry.startInactiveSpan({ name: 'span3' }); +const span3 = Sentry.startInactiveSpan({ name: "span3" }); evenMoreWork(); @@ -535,7 +558,7 @@ span3?.finish(); - build(eslint): Enforce that ts-expect-error is used (#8987) - feat(integration): Ensure `LinkedErrors` integration runs before all event processors (#8956) - feat(node-experimental): Keep breadcrumbs on transaction (#8967) -- feat(redux): Add 'attachReduxState' option (#8953) +- feat(redux): Add 'attachReduxState' option (#8953) - feat(remix): Accept `org`, `project` and `url` as args to upload script (#8985) - fix(utils): Prevent iterating over VueViewModel (#8981) - fix(utils): uuidv4 fix for cloudflare (#8968) @@ -706,7 +729,7 @@ Sentry.init({ - **feat(node-experimental): Add `@sentry/node-experimental` package as MVP for POTEL (#8609)** -This introduces a new, *experimental* package, `@sentry/node-experimental`. +This introduces a new, _experimental_ package, `@sentry/node-experimental`. This is a variant of the Node SDK which uses OpenTelemetry under the hood for performance instrumentation. Note that this package is very much WIP, considered unstable and may change at any time. @@ -735,8 +758,8 @@ You can optionally configure the min. replay duration (defaults to 5s): ```js new Replay({ - minReplayDuration: 10000 // in ms - note that this is capped at 15s max! -}) + minReplayDuration: 10000, // in ms - note that this is capped at 15s max! +}); ``` ### Other Changes @@ -829,7 +852,10 @@ This release adds support for [distributed tracing](https://docs.sentry.io/platf ```js Sentry.init({ - tracePropagationTargets: ["third-party-site.com", /^https:\/\/yourserver\.io\/api/], + tracePropagationTargets: [ + "third-party-site.com", + /^https:\/\/yourserver\.io\/api/, + ], }); ``` @@ -894,7 +920,7 @@ Instead of passing `tracePropagationTargets` to the `BrowserTracing` integration ```js Sentry.init({ - tracePropagationTargets: ['api.site.com'], + tracePropagationTargets: ["api.site.com"], }); ``` @@ -967,38 +993,40 @@ Event `ErrorEvent` captured as exception with message `Script error.` All SDKs now filter out health check transactions by default. These are transactions where the transaction name matches typical API health check calls, such as `/^.*healthy.*$/` or `/^. *heartbeat.*$/`. Take a look at [this list](https://github.com/getsentry/sentry-javascript/blob/8c6ad156829f7c4eec34e4a67e6dd866ba482d5d/packages/core/src/integrations/inboundfilters.ts#L8C2-L16) to learn which regexes we currently use to match transaction names. - We believe that these transactions do not provide value in most cases and we want to save you some of your quota by filtering them out by default. + We believe that these transactions do not provide value in most cases and we want to save you some of your quota by filtering them out by default. These filters are implemented as default values for the top level `ignoreTransactions` option. - You can disable this filtering by manually specifiying the `InboundFilters` integration and setting the `disableTransactionDefaults` option: + You can disable this filtering by manually specifiying the `InboundFilters` integration and setting the `disableTransactionDefaults` option: + ```js Sentry.init({ //... integrations: [new InboundFilters({ disableTransactionDefaults: true })], - }) + }); ``` - **feat(replay): Add `mutationBreadcrumbLimit` and `mutationLimit` to Replay Options (#8228)** - The previously experimental options `mutationBreadcumbLimit` and `mutationLimit` have been promoted to regular Replay integration options. + The previously experimental options `mutationBreadcumbLimit` and `mutationLimit` have been promoted to regular Replay integration options. A high number of DOM mutations (in a single event loop) can cause performance regressions in end-users' browsers. Use `mutationBreadcrumbLimit` to send a breadcrumb along with your recording if the mutation limit was reached. Use `mutationLimit` to stop recording if the mutation limit was reached. - **feat(sveltekit): Add source maps support for Vercel (lambda) (#8256)** + - feat(sveltekit): Auto-detect SvelteKit adapters (#8193) The SvelteKit SDK can now be used if you deploy your SvelteKit app to Vercel. By default, the SDK's Vite plugin will detect the used adapter and adjust the source map uploading config as necessary. - If you want to override the default adapter detection, you can specify the `adapter` option in the `sentrySvelteKit` options: + If you want to override the default adapter detection, you can specify the `adapter` option in the `sentrySvelteKit` options: ```js // vite.config.js export default defineConfig({ plugins: [ sentrySvelteKit({ - adapter: 'vercel', + adapter: "vercel", }), sveltekit(), ], @@ -1052,7 +1080,6 @@ Event `ErrorEvent` captured as exception with message `Script error.` - feat(replay): Capture slow clicks (experimental) (#8052) - ## 7.52.0 ### Important Next.js SDK changes: @@ -1098,7 +1125,7 @@ const nextConfig = { - feat(replay): Improve click target detection (#8026) - fix(node): Make sure we use same ID for checkIns (#8050) - fix(replay: Keep session active on key press (#8037) -- fix(replay): Move error sampling to before send (#8057) +- fix(replay): Move error sampling to before send (#8057) - fix(sveltekit): Wrap `load` when typed explicitly (#8049) **Replay `rrweb` changes:** @@ -1119,8 +1146,8 @@ Work in this release contributed by @sreetamdas. Thank you for your contribution `@sentry/sveltekit` now auto-wraps `load` functions in -* `+(page|layout).(ts|js)` files (universal loads) -* `+(page|layout).server.(ts|js)` files (server-only loads) +- `+(page|layout).(ts|js)` files (universal loads) +- `+(page|layout).server.(ts|js)` files (server-only loads) This means that you don't have to manually add the `wrapLoadWithSentry` and `wrapServerLoadWithSentry` functions around your load functions. The SDK will not interfere with already wrapped `load` functions. @@ -1140,12 +1167,12 @@ This release adds [Sentry cron monitoring](https://docs.sentry.io/product/crons/ Check-in monitoring allows you to track a job's progress by completing two check-ins: one at the start of your job and another at the end of your job. This two-step process allows Sentry to notify you if your job didn't start when expected (missed) or if it exceeded its maximum runtime (failed). ```ts -const Sentry = require('@sentry/node'); +const Sentry = require("@sentry/node"); // 🟡 Notify Sentry your job is running: const checkInId = Sentry.captureCheckIn({ - monitorSlug: '', - status: 'in_progress', + monitorSlug: "", + status: "in_progress", }); // Execute your scheduled task here... @@ -1154,8 +1181,8 @@ const checkInId = Sentry.captureCheckIn({ Sentry.captureCheckIn({ // make sure you pass in the checkInId generated by the first call to captureCheckIn checkInId, - monitorSlug: '', - status: 'ok', + monitorSlug: "", + status: "ok", }); ``` @@ -1165,8 +1192,8 @@ If your job execution fails, you can notify Sentry about the failure: // 🔴 Notify Sentry your job has failed: Sentry.captureCheckIn({ checkInId, - monitorSlug: '', - status: 'error', + monitorSlug: "", + status: "error", }); ``` @@ -1214,7 +1241,7 @@ You have to define an allowlist of URLs you want to capture additional informati ```js new Replay({ - networkDetailAllowUrls: ['https://sentry.io/api'], + networkDetailAllowUrls: ["https://sentry.io/api"], }); ``` @@ -1223,21 +1250,22 @@ You can configure this with some additional configuration: ```js new Replay({ - networkDetailAllowUrls: ['https://sentry.io/api'], + networkDetailAllowUrls: ["https://sentry.io/api"], // opt-out of capturing bodies networkCaptureBodies: false, // These headers are captured _in addition to_ the default headers - networkRequestHeaders: ['X-Custom-Header'], - networkResponseHeaders: ['X-Custom-Header', 'X-Custom-Header-2'] + networkRequestHeaders: ["X-Custom-Header"], + networkResponseHeaders: ["X-Custom-Header", "X-Custom-Header-2"], }); ``` Note that bodies will be truncated to a max length of ~150k characters. **- feat(replay): Changes of sampling behavior & public API** - - feat(replay): Change the behavior of error-based sampling (#7768) - - feat(replay): Change `flush()` API to record current event buffer (#7743) - - feat(replay): Change `stop()` to flush and remove current session (#7741) + +- feat(replay): Change the behavior of error-based sampling (#7768) +- feat(replay): Change `flush()` API to record current event buffer (#7743) +- feat(replay): Change `stop()` to flush and remove current session (#7741) We have changed the behavior of error-based sampling, as well as adding & adjusting APIs a bit to be more aligned with expectations. See [Sampling](./packages/replay/README.md#sampling) for details. @@ -1250,23 +1278,23 @@ We added a new transport to support multiplexing. With this, you can configure Sentry to send events to different DSNs, depending on a logic of your choosing: ```js -import { makeMultiplexedTransport } from '@sentry/core'; -import { init, captureException, makeFetchTransport } from '@sentry/browser'; +import { makeMultiplexedTransport } from "@sentry/core"; +import { init, captureException, makeFetchTransport } from "@sentry/browser"; function dsnFromFeature({ getEvent }) { const event = getEvent(); - switch(event?.tags?.feature) { - case 'cart': - return ['__CART_DSN__']; - case 'gallery': - return ['__GALLERY_DSN__']; + switch (event?.tags?.feature) { + case "cart": + return ["__CART_DSN__"]; + case "gallery": + return ["__GALLERY_DSN__"]; } - return [] + return []; } init({ - dsn: '__FALLBACK_DSN__', - transport: makeMultiplexedTransport(makeFetchTransport, dsnFromFeature) + dsn: "__FALLBACK_DSN__", + transport: makeMultiplexedTransport(makeFetchTransport, dsnFromFeature), }); ``` @@ -1340,15 +1368,15 @@ This release switches the SDK to use [`AsyncLocalStorage`](https://nodejs.org/ap If you want to manually add async context isolation to your application, you can use the new `runWithAsyncContext` API. ```js -import * as Sentry from '@sentry/node'; +import * as Sentry from "@sentry/node"; const requestHandler = (ctx, next) => { return new Promise((resolve, reject) => { Sentry.runWithAsyncContext(async () => { const hub = Sentry.getCurrentHub(); - hub.configureScope(scope => - scope.addEventProcessor(event => + hub.configureScope((scope) => + scope.addEventProcessor((event) => Sentry.addRequestDataToEvent(event, ctx.request, { include: { user: false, @@ -1379,8 +1407,8 @@ This release removes our `withSentryViteConfig` wrapper we previously instructed ```js // vite.config.js -import { sveltekit } from '@sveltejs/kit/vite'; -import { sentrySvelteKit } from '@sentry/sveltekit'; +import { sveltekit } from "@sveltejs/kit/vite"; +import { sentrySvelteKit } from "@sentry/sveltekit"; export default { plugins: [sentrySvelteKit(), sveltekit()], @@ -1448,6 +1476,7 @@ Sentry.captureUserFeedback(userFeedback); Note that feedback needs to be coupled to an event but as in the example above, you can just use `Sentry.captureMessage` to generate one. You could also collect feedback in a custom way if an error happens and use the SDK to send it along: + ```js Sentry.init({ dsn: '__DSN__', @@ -1482,7 +1511,7 @@ Please take a look at the [Migration docs](./MIGRATION.md/#remove-requirement-fo - fix(node): Disable `LocalVariables` integration on Node < v18 (#7748) - fix(node): Redact URL authority only in breadcrumbs and spans (#7740) - fix(react): Only show report dialog if event was sent to Sentry (#7754) -- fix(remix): Remove unnecessary dependencies (#7708) +- fix(remix): Remove unnecessary dependencies (#7708) - fix(replay): Ensure circular references are handled (#7752) - fix(sveltekit): Don't capture thrown `Redirect`s as exceptions (#7731) - fix(sveltekit): Log error to console by default in `handleErrorWithSentry` (#7674) @@ -1490,7 +1519,6 @@ Please take a look at the [Migration docs](./MIGRATION.md/#remove-requirement-fo Work in this release contributed by @de-don and @TrySound. Thank you for your contributions! - ## 7.46.0 ### Important Changes @@ -1509,8 +1537,8 @@ You can now easily filter out certain transactions from being sent to Sentry bas ```ts Sentry.init({ - ignoreTransactions: ['/api/healthcheck', '/ping'], -}) + ignoreTransactions: ["/api/healthcheck", "/ping"], +}); ``` - **feat(node)**: Undici integration (#7582) @@ -1522,7 +1550,7 @@ We've added an integration that automatically instruments [Undici](https://githu ```ts Sentry.init({ integrations: [new Sentry.Integrations.Undici()], -}) +}); ``` In our Next.js and SvelteKit SDKs, this integration is automatically added. @@ -1532,14 +1560,14 @@ In our Next.js and SvelteKit SDKs, this integration is automatically added. We've added a new middleware for [trpc](https://trpc.io/) that automatically adds TRPC information to Sentry transactions. This middleware is meant to be used in combination with a Sentry server integration (Next.js, Express, etc). ```ts -import { initTRPC } from '@trpc/server'; -import * as Sentry from '@sentry/node'; +import { initTRPC } from "@trpc/server"; +import * as Sentry from "@sentry/node"; const t = initTRPC.context().create(); const sentryMiddleware = t.middleware( Sentry.Handlers.trpcMiddleware({ attachRpcInput: true, - }), + }) ); const sentrifiedProcedure = t.procedure.use(sentryMiddleware); @@ -1625,7 +1653,6 @@ This release introduces the first alpha version of `@sentry/sveltekit`, our newe - fix(serverless): Explicitly export node package exports (#7457) - fix(vue): Do not depend on `window.location` for SSR environments (#7518) - **Replay `rrweb` changes:** `@sentry-internal/rrweb` was updated from 1.105.0 to 1.106.0: @@ -1647,7 +1674,6 @@ Work in this release contributed by @woochanleee and @baked-dev. Thank you for y - fix(node): Revert to dynamic `require` call to fix monkey patching (#7430) - fix(types): Fix node types & add E2E test (#7429) - ## 7.42.0 - feat(core): Add lifecycle hooks (#7370) @@ -1753,7 +1779,7 @@ This release includes changes and fixes around text masking and blocking in Repl SDK Changes: -- fix(replay): Fix svgs not getting unblocked (#7132) +- fix(replay): Fix svgs not getting unblocked (#7132) ## 7.37.1 @@ -2102,7 +2128,7 @@ which is available as an alpha release to integrate OpenTelemetry performance tr Give it a try and let us know if you have any feedback or problems with using it. (#6000) This release also deprecates the `tracingOrigins` option in favor of using `shouldCreateSpanForRequest` and `tracePropagationTargets`. - See [#6176](https://github.com/getsentry/sentry-javascript/pull/6176) for details. +See [#6176](https://github.com/getsentry/sentry-javascript/pull/6176) for details. - feat(node): Allow keepAlive override (#6161) - feat(tracing): Add `transaction.setContext` method (#6154) @@ -2229,7 +2255,7 @@ Work in this release contributed by @outsideris. Thank you for your contribution - feat(nextjs): Auto-wrap API routes (#5778) - feat(nextjs): Promote option to automatically wrap data fetchers and API routes to non-experimental (#5793) - feat(utils): Modern implementation of `getGlobalObject` (#5809) -- fix(gatsby): Include app-* entrypoints as they may include user source code (#5685) +- fix(gatsby): Include app-\* entrypoints as they may include user source code (#5685) - fix(nextjs): Handle `pathname` being passed in object in `instrumentServer` (#5782) - fix(nextjs): Pass request in sampling context of data fetchers wrapper transaction (#5784) - fix(nextjs): Reverse order of checks for instrumenting server (#5828) @@ -2354,7 +2380,7 @@ This release adds the [`tracePropagationTargets`](https://docs.sentry.io/platfor - fix(node): Adjust Express URL parameterization for RegEx routes (#5483) - fix(node): Check if router exists before it is instrumented (#5502) - fix(node): Correctly handle Windows paths when resolving module name (#5476) -- fix(node): Ensure that self._handler exists before calling it in LinkedErrors (#5497) +- fix(node): Ensure that self.\_handler exists before calling it in LinkedErrors (#5497) - ref(tracing): Simplify sample_rate serialization for DSC (#5475) ## 7.8.0 @@ -2437,7 +2463,7 @@ Work in this release contributed by @jkcorrea and @nfelger. Thank you for your c ## 7.4.1 -This release includes the first *published* version of `@sentry/remix`. +This release includes the first _published_ version of `@sentry/remix`. - build(remix): Make remix package public (#5349) @@ -2556,7 +2582,7 @@ If you are a regular consumer of the Sentry JavaScript SDK you only need to focu - Removed support for [Node v6](./MIGRATION.md#dropping-support-for-nodejs-v6). (#4851) - Removed `@sentry/minimal` package in favour of using [`@sentry/hub`](./MIGRATION.md#removal-of-sentryminimal). (#4971) - Removed support for Opera browser pre v15 (#4923) -- Removed `ignoreSentryErrors` option from AWS lambda SDK. Errors originating from the SDK will now *always* be caught internally. (#4994) +- Removed `ignoreSentryErrors` option from AWS lambda SDK. Errors originating from the SDK will now _always_ be caught internally. (#4994) - Removed `Integrations.BrowserTracing` export from `@sentry/nextjs`. Please import `BrowserTracing` from `@sentry/nextjs` directly. - Removed static `id` property from `BrowserTracing` integration. - Removed `SDK_NAME` export from `@sentry/browser`, `@sentry/node`, `@sentry/tracing` and `@sentry/vue` packages. (#5040) @@ -2656,7 +2682,7 @@ Work in this release contributed by @MikevPeeren. Thank you for your contributio - feat(browser): Add new v7 Fetch Transport (#4765) - feat(browser): Add new v7 XHR Transport (#4803) - fix(core): Use correct version of event when tagging normalization (#4780) -- fix(core): Stop mangling _experiments (#4807) +- fix(core): Stop mangling \_experiments (#4807) - feat(node): Add new v7 http/s Transports (#4781) ## 6.19.2 @@ -2716,7 +2742,7 @@ Work in this release contributed by @Ignigena. Thank you for your contribution! ## 6.18.1 -- fix(ember): use _backburner if it exists (#4603) +- fix(ember): use \_backburner if it exists (#4603) - feat(gatsby): Upgrade Sentry Webpack Plugin to 1.18.8 (#4636) - feat(nextjs): Upgrade Sentry Webpack Plugin to 1.18.8 (#4643) - fix(nextjs): webpack as optional peer-dependency (#4634) @@ -2818,7 +2844,7 @@ This release contains several internal refactors that help reduce the bundle siz - feat(core): Add processing metadata to scope and event (#4252) - feat(core): Deprecate API class (#4281) - feat(ember): Update ember dependencies (#4253) -- fix(nextjs): Inject sentry.x.config.js into pages/_error (#4397) +- fix(nextjs): Inject sentry.x.config.js into pages/\_error (#4397) - fix(nextjs): Add sentry-cli existence check for enabling webpack plugin #4311 - ref(tracing): deprecate span status enum (#4299) - ref(tracing): Remove script evaluation span (#4433) @@ -2845,7 +2871,7 @@ Work in this release contributed by @KATT. Thank you for your contribution! - feat(angular): Add Angular 13 to peer dep (#4183) - fix(angular): Finish routing span before starting another one (#4191) - fix(angular): Use ui category for span operations (#4222) -- feat(ember): Use @types/ember__debug (#4173) +- feat(ember): Use @types/ember\_\_debug (#4173) - fix(ember): Use ui category for span operations (#4221) - feat(eslint-config): Enable array-callback-return rule (#4229) - ref(eslint-config): Update spaced-comment rule (#4235) @@ -2956,7 +2982,7 @@ Work in this release contributed by @tmilar, @deammer, and @freekii. Thank you f - fix(vue): Attach props only if VM is available (#3902) - feat(tracing): Add pg-native support to Postgres integration. (#3894) - ref(ember): Update addon to support Ember 4.0.0 (beta) (#3915) -- feat(react): Make Profiler _mountSpan attribute protected (#3904) +- feat(react): Make Profiler \_mountSpan attribute protected (#3904) - fix(ember): allow ember-beta to fail (#3910) - fix(tracing): Prevent metrics erroring module load in web workers (#3941) - misc(browser): Log when event is dropped by Dedupe integration (#3943) @@ -4287,8 +4313,8 @@ Here are some examples of how the new SDKs work. Please note that the API for al _Old_: ```js -Raven.config('___PUBLIC_DSN___', { - release: '1.3.0', +Raven.config("___PUBLIC_DSN___", { + release: "1.3.0", }).install(); ``` @@ -4296,8 +4322,8 @@ _New_: ```js Sentry.init({ - dsn: '___PUBLIC_DSN___', - release: '1.3.0', + dsn: "___PUBLIC_DSN___", + release: "1.3.0", }); ``` @@ -4306,14 +4332,14 @@ Sentry.init({ _Old_: ```js -Raven.setTagsContext({ key: 'value' }); +Raven.setTagsContext({ key: "value" }); ``` _New_: ```js Sentry.configureScope((scope) => { - scope.setTag('key', 'value'); + scope.setTag("key", "value"); }); ``` @@ -4336,7 +4362,7 @@ try { throwingFunction(); } catch (e) { Sentry.withScope((scope) => { - scope.setExtra('debug', false); + scope.setExtra("debug", false); Sentry.captureException(e); }); } @@ -4347,15 +4373,15 @@ try { _Old_: ```js -Raven.captureMessage('test', 'info', { extra: { debug: false } }); +Raven.captureMessage("test", "info", { extra: { debug: false } }); ``` _New_: ```js Sentry.withScope((scope) => { - scope.setExtra('debug', false); - Sentry.captureMessage('test', 'info'); + scope.setExtra("debug", false); + Sentry.captureMessage("test", "info"); }); ``` @@ -4365,11 +4391,11 @@ _Old_: ```js Raven.captureBreadcrumb({ - message: 'Item added to shopping cart', - category: 'action', + message: "Item added to shopping cart", + category: "action", data: { - isbn: '978-1617290541', - cartSize: '3', + isbn: "978-1617290541", + cartSize: "3", }, }); ``` @@ -4378,11 +4404,11 @@ _New_: ```js Sentry.addBreadcrumb({ - message: 'Item added to shopping cart', - category: 'action', + message: "Item added to shopping cart", + category: "action", data: { - isbn: '978-1617290541', - cartSize: '3', + isbn: "978-1617290541", + cartSize: "3", }, }); ```