diff --git a/packages/remix/package.json b/packages/remix/package.json index 475d1cc81b09..43d9ca5f9918 100644 --- a/packages/remix/package.json +++ b/packages/remix/package.json @@ -21,12 +21,12 @@ "@sentry/node": "7.1.1", "@sentry/react": "7.1.1", "@sentry/tracing": "7.1.1", + "@sentry/types": "7.1.1", "@sentry/utils": "7.1.1", "@sentry/webpack-plugin": "1.18.9", "tslib": "^1.9.3" }, "devDependencies": { - "@sentry/types": "7.1.1", "@types/webpack": "^4.41.31", "@remix-run/node": "^1.4.3", "@remix-run/react": "^1.4.3" @@ -43,27 +43,25 @@ } }, "scripts": { - "build": "run-p build:rollup", + "build": "run-p build:rollup build:types", "build:dev": "run-s build", - "build:esm": "tsc -p tsconfig.esm.json", "build:rollup": "rollup -c rollup.npm.config.js", "build:types": "tsc -p tsconfig.types.json", - "build:watch": "run-p build:esm:watch", + "build:watch": "run-p build:rollup:watch build:types:watch", "build:dev:watch": "run-s build:watch", - "build:esm:watch": "tsc -p tsconfig.esm.json --watch", "build:rollup:watch": "rollup -c rollup.npm.config.js --watch", "build:types:watch": "tsc -p tsconfig.types.json --watch", "build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build", - "clean": "rimraf build coverage", + "circularDepCheck": "madge --circular src/index.ts", + "clean": "rimraf build coverage sentry-remix-*.tgz", "fix": "run-s fix:eslint fix:prettier", "fix:eslint": "eslint . --format stylish --fix", "fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"", - "link:yarn": "yarn link", "lint": "run-s lint:prettier lint:eslint", "lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish", "lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"", "test": "run-s test:unit", - "test:unit": "jest --passWithNoTests", + "test:unit": "jest", "test:watch": "jest --watch" }, "volta": { diff --git a/packages/remix/src/flags.ts b/packages/remix/src/flags.ts deleted file mode 100644 index fb99adbc2aa7..000000000000 --- a/packages/remix/src/flags.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking - * for users. - * - * Debug flags need to be declared in each package individually and must not be imported across package boundaries, - * because some build tools have trouble tree-shaking imported guards. - * - * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder. - * - * Debug flag files will contain "magic strings" like `__SENTRY_DEBUG__` that may get replaced with actual values during - * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not - * replaced. - */ - -declare const __SENTRY_DEBUG__: boolean; - -/** Flag that is true for debug builds, false otherwise. */ -export const IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__; diff --git a/packages/remix/src/performance/client.tsx b/packages/remix/src/performance/client.tsx index a55d4fec54a4..911f911e5a92 100644 --- a/packages/remix/src/performance/client.tsx +++ b/packages/remix/src/performance/client.tsx @@ -2,8 +2,6 @@ import { Transaction, TransactionContext } from '@sentry/types'; import { getGlobalObject, logger } from '@sentry/utils'; import * as React from 'react'; -import { IS_DEBUG_BUILD } from '../flags'; - const DEFAULT_TAGS = { 'routing.instrumentation': 'remix-router', } as const; @@ -85,7 +83,7 @@ export function remixRouterInstrumentation(useEffect: UseEffect, useLocation: Us export function withSentryRouteTracing

, R extends React.FC

>(OrigApp: R): R { // Early return when any of the required functions is not available. if (!_useEffect || !_useLocation || !_useMatches || !_customStartTransaction) { - IS_DEBUG_BUILD && logger.warn('Remix SDK was unable to wrap your root because of one or more missing parameters.'); + __DEBUG_BUILD__ && logger.warn('Remix SDK was unable to wrap your root because of one or more missing parameters.'); // @ts-ignore Setting more specific React Component typing for `R` generic above // will break advanced type inference done by react router params diff --git a/packages/remix/test/tsconfig.json b/packages/remix/test/tsconfig.json new file mode 100644 index 000000000000..074ceb45a9db --- /dev/null +++ b/packages/remix/test/tsconfig.json @@ -0,0 +1,8 @@ +// TODO Once https://github.com/microsoft/TypeScript/issues/33094 is done (if it ever is), this file can disappear, as +// it's purely a placeholder to satisfy VSCode. + +{ + "extends": "../tsconfig.test.json", + + "include": ["./**/*"] +} diff --git a/packages/remix/tsconfig.esm.json b/packages/remix/tsconfig.esm.json deleted file mode 100644 index 0b86c52918cc..000000000000 --- a/packages/remix/tsconfig.esm.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - - "compilerOptions": { - "module": "es6", - "outDir": "build/esm" - } -}