Skip to content

Commit 3a0ec5d

Browse files
HazATkamilogorek
authored andcommitted
feat: atomic @sentry/utils used only with submodule imports (#1413)
* feat: Add .gitignore for utils * fix: Utils submodule import * feat: Build from src into root for utils, Remove browser packages * feat: Move jest config into package.json to be consitent * fix: Lint error
1 parent 50d0005 commit 3a0ec5d

35 files changed

+109
-354
lines changed

packages/browser/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"rimraf": "^2.6.2",
3939
"rollup": "^0.58.2",
4040
"rollup-plugin-commonjs": "^9.1.3",
41-
"rollup-plugin-node-builtins": "^2.1.2",
4241
"rollup-plugin-node-resolve": "^3.3.0",
4342
"rollup-plugin-npm": "^2.0.0",
4443
"rollup-plugin-typescript2": "^0.13.0",

packages/browser/rollup.config.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import commonjs from 'rollup-plugin-commonjs';
22
import uglify from 'rollup-plugin-uglify';
33
import resolve from 'rollup-plugin-node-resolve';
44
import typescript from 'rollup-plugin-typescript2';
5-
import builtins from 'rollup-plugin-node-builtins';
65

76
export default [
87
{
@@ -13,14 +12,8 @@ export default [
1312
exports: 'named',
1413
interop: false,
1514
},
16-
external: [
17-
'@sentry/core',
18-
'@sentry/hub',
19-
'@sentry/minimal',
20-
'@sentry/utils',
21-
],
15+
external: ['@sentry/core', '@sentry/hub', '@sentry/minimal'],
2216
plugins: [
23-
builtins(),
2417
typescript({
2518
tsconfig: 'tsconfig.build.json',
2619
}),
@@ -39,12 +32,9 @@ export default [
3932
format: 'iife',
4033
name: 'Sentry',
4134
sourcemap: true,
42-
interop: false,
43-
extend: true,
4435
},
4536
context: 'window',
4637
plugins: [
47-
builtins(),
4838
typescript({
4939
tsconfig: 'tsconfig.build.json',
5040
tsconfigOverride: { compilerOptions: { declaration: false } },

packages/browser/src/backend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Backend, DSN, Options, SentryError } from '@sentry/core';
22
import { addBreadcrumb, captureEvent } from '@sentry/minimal';
33
import { SentryEvent } from '@sentry/types';
4-
import { supportsFetch } from '@sentry/utils';
4+
import { supportsFetch } from '@sentry/utils/supports';
55
import { Raven } from './raven';
66
import { FetchTransport, XHRTransport } from './transports';
77

packages/browser/src/integrations/onunhandledrejection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { captureException } from '@sentry/minimal';
22
import { Integration } from '@sentry/types';
3-
import { getGlobalObject } from '@sentry/utils';
3+
import { getGlobalObject } from '@sentry/utils/misc';
44

55
const global: any = getGlobalObject();
66

packages/browser/src/integrations/tracekit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isError, isErrorEvent } from '@sentry/utils/dist/is';
1+
import { isError, isErrorEvent } from '@sentry/utils/is';
22

33
/*
44
TraceKit - Cross brower stack traces

packages/browser/src/transports/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
Transport,
66
TransportOptions,
77
} from '@sentry/types';
8-
import { urlEncode } from '@sentry/utils';
8+
import { urlEncode } from '@sentry/utils/object';
99

1010
/** Base Transport class implementation */
1111
export abstract class BaseTransport implements Transport {

packages/browser/src/transports/fetch.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { SentryEvent } from '@sentry/types';
2-
import {
3-
getGlobalObject,
4-
serialize,
5-
supportsReferrerPolicy,
6-
} from '@sentry/utils';
2+
import { getGlobalObject } from '@sentry/utils/misc';
3+
import { serialize } from '@sentry/utils/object';
4+
import { supportsReferrerPolicy } from '@sentry/utils/supports';
75
import { BaseTransport } from './base';
86

97
const global: any = getGlobalObject();

packages/browser/src/transports/xhr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { SentryEvent } from '@sentry/types';
2-
import { serialize } from '@sentry/utils';
2+
import { serialize } from '@sentry/utils/object';
33
import { BaseTransport } from './base';
44

55
/** `XHR` based transport */

packages/core/jest.config.js

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

packages/core/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,17 @@
4040
"fix:tslint": "tslint --fix -t stylish -p .",
4141
"test": "jest",
4242
"test:watch": "jest --watch --notify"
43+
},
44+
"jest": {
45+
"collectCoverage": true,
46+
"transform": { "^.+\\.ts$": "ts-jest" },
47+
"moduleFileExtensions": ["js", "ts"],
48+
"testEnvironment": "node",
49+
"testMatch": ["**/*.test.ts"],
50+
"globals": {
51+
"ts-jest": {
52+
"tsConfigFile": "./tsconfig.json"
53+
}
54+
}
4355
}
4456
}

0 commit comments

Comments
 (0)