8000 build: Lock in TypeScript to 3.7.5 (#2848) · ebeloded/sentry-javascript@341c968 · GitHub
[go: up one dir, main page]

Skip to content

Commit 341c968

Browse files
authored
build: Lock in TypeScript to 3.7.5 (getsentry#2848)
* build: Lock in TypeScript to 3.7.5 * build: Prevent anyone from ever changing typescript version * fix: Force SinonStub to work
1 parent beec03c commit 341c968

File tree

21 files changed

+51
-24
lines changed

21 files changed

+51
-24
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"scripts": {
4-
"build": "lerna run --stream --concurrency 1 --sort build",
4+
"build": "node ./scripts/verify-packages-versions.js && lerna run --stream --concurrency 1 --sort build",
55
"build:es5": "lerna run --stream --concurrency 1 --sort build:es5",
66
"build:esm": "lerna run --stream --concurrency 1 --sort build:esm",
77
"build:watch": "lerna run build:watch --stream --no-sort --concurrency 9999",
@@ -61,7 +61,7 @@
6161
"size-limit": "^4.5.5",
6262
"ts-jest": "^24.0.2",
6363
"typedoc": "^0.18.0",
64-
"typescript": "3.9.7"
64+
"typescript": "3.7.5"
6565
},
6666
"resolutions": {
6767
"**/agent-base": "5"

packages/angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"npm-run-all": "^4.1.2",
3232
"prettier": "1.17.0",
3333
"rimraf": "^2.6.3",
34-
"typescript": "3.9.7"
34+
"typescript": "3.7.5"
3535
},
3636
"scripts": {
3737
"build": "run-p build:es5 build:esm",

packages/apm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"rollup-plugin-node-resolve": "^4.2.3",
3838
"rollup-plugin-terser": "^4.0.4",
3939
"rollup-plugin-typescript2": "^0.21.0",
40-
"typescript": "3.9.7"
40+
"typescript": "3.7.5"
4141
},
4242
"scripts": {
4343
"build": "run-p build:es5 build:esm build:bundle",

packages/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"rollup-plugin-terser": "^4.0.4",
5252
"rollup-plugin-typescript2": "^0.21.0",
5353
"sinon": "^7.3.2",
54-
"typescript": "3.9.7",
54+
"typescript": "3.7.5",
5555
"webpack": "^4.30.0"
5656
},
5757
"scripts": {

packages/browser/test/unit/transports/fetch.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let transport: Transports.BaseTransport;
1818

1919
describe('FetchTransport', () => {
2020
beforeEach(() => {
21-
fetch = stub(window, 'fetch');
21+
fetch = (stub(window, 'fetch') as unknown) as SinonStub;
2222
transport = new Transports.FetchTransport({ dsn: testDsn });
2323
});
2424

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"npm-run-all": "^4.1.2",
3030
"prettier": "1.17.0",
3131
"rimraf": "^2.6.3",
32-
"typescript": "3.9.7"
32+
"typescript": "3.7.5"
3333
},
3434
"scripts": {
3535
"build": "run-p build:es5 build:esm",

packages/ember/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"loader.js": "^4.7.0",
7676
"npm-run-all": "^4.1.5",
7777
"qunit-dom": "^1.2.0",
78-
"typescript": "3.9.7"
78+
"typescript": "3.7.5"
7979
},
8080
"engines": {
8181
"node": "10.* || >= 12"

packages/eslint-config-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"devDependencies": {
3636
"eslint": "7.6.0",
37-
"typescript": "3.9.7"
37+
"typescript": "3.7.5"
3838
},
3939
"scripts": {
4040
"link:yarn": "yarn link",

packages/eslint-plugin-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"devDependencies": {
2525
"mocha": "^6.2.0",
2626
"prettier": "1.17.0",
27-
"typescript": "3.9.7"
27+
"typescript": "3.7.5"
2828
},
2929
"scripts": {
3030
"link:yarn": "yarn link",

packages/gatsby/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"prettier": "1.17.0",
4242
"react": "^16.13.1",
4343
"rimraf": "^2.6.3",
44-
"typescript": "3.9.7"
44+
"typescript": "3.7.5"
4545
},
4646
"scripts": {
4747
"build": "run-p build:es5 build:esm",

packages/hub/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"npm-run-all": "^4.1.2",
2828
"prettier": "1.17.0",
2929
"rimraf": "^2.6.3",
30-
"typescript": "3.9.7"
30+
"typescript": "3.7.5"
3131
},
3232
"scripts": {
3333
"build": "run-p build:es5 build:esm",

packages/integrations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"rollup-plugin-node-resolve": "^4.2.3",
3535
"rollup-plugin-terser": "^4.0.4",
3636
"rollup-plugin-typescript2": "^0.21.0",
37-
"typescript": "3.9.7"
37+
"typescript": "3.7.5"
3838
},
3939
"scripts": {
4040
"build": "run-p build:es5 build:esm build:bundle",

packages/minimal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"npm-run-all": "^4.1.2",
2828
"prettier": "1.17.0",
2929
"rimraf": "^2.6.3",
30-
"typescript": "3.9.7"
30+
"typescript": "3.7.5"
3131
},
3232
"scripts": {
3333
"build": "run-p build:es5 build:esm",

packages/node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"npm-run-all": "^4.1.2",
3939
"prettier": "1.17.0",
4040
"rimraf": "^2.6.3",
41-
"typescript": "3.9.7"
41+
"typescript": "3.7.5"
4242
},
4343
"scripts": {
4444
"build": "run-p build:es5 build:esm",

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"react-test-renderer": "^16.13.1",
5656
"redux": "^4.0.5",
5757
"rimraf": "^2.6.3",
58-
"typescript": "3.9.7"
58+
"typescript": "3.7.5"
5959
},
6060
"scripts": {
6161
"build": "run-p build:es5 build:esm",

packages/tracing/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"rollup-plugin-node-resolve": "^4.2.3",
4040
"rollup-plugin-terser": "^4.0.4",
4141
"rollup-plugin-typescript2": "^0.21.0",
42-
"typescript": "3.9.7"
42+
"typescript": "3.7.5"
4343
},
4444
"scripts": {
4545
"build": "run-p build:es5 build:esm build:bundle",

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"eslint": "7.6.0",
2121
"npm-run-all": "^4.1.2",
2222
"prettier": "1.17.0",
23-
"typescript": "3.9.7"
23+
"typescript": "3.7.5"
2424
},
2525
"scripts": {
2626
"build": "run-p build:es5 build:esm",

packages/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"peerDependencies": {
1818
"tslint": "5.16.0",
19-
"typescript": "3.9.7"
19+
"typescript": "3.7.5"
2020
},
2121
"scripts": {
2222
"link:yarn": "yarn link",

packages/utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"npm-run-all": "^4.1.2",
2828
"prettier": "1.17.0",
2929
"rimraf": "^2.6.3",
30-
"typescript": "3.9.7"
30+
"typescript": "3.7.5"
3131
},
3232
"scripts": {
3333
"build": "run-p build:es5 build:esm",

scripts/verify-packages-versions.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const pkg = require('../package.json');
2+
3+
const TYPESCRIPT_VERSION = '3.7.5';
4+
5+
if (pkg.devDependencies.typescript !== TYPESCRIPT_VERSION) {
6+
console.error(`
7+
[INCORRECT PACKAGE VERSION]: Expected TypeScript v${TYPESCRIPT_VERSION}, got v${pkg.devDependencies.typescript}
8+
9+
Starting version 3.9, TypeScript emits module exports using \`Object.defineProperty\`,
10+
with \`configurable: false\`, instead of \`exports.thing = module.thing;\` as it always used to do.
11+
This means, that any object mutation after the initial compilation are impossible and makes
12+
the package slightly less open for modifications, and prevent users from experimenting with it,
13+
and from implementing some of their scenarios.
14+
15+
If you REALLY know what you are doing, and you REALLY want to use a different version of TypeScript,
16+
modify \`TYPESCRIPT_VERSION\` constant at the top of this file.
17+
18+
change: https://github.com/getsentry/sentry-javascript/pull/2848
19+
ref: https://github.com/getsentry/sentry-javascript/issues/2845
20+
ref: https://twitter.com/wesleytodd/status/1297974661574262784
21+
22+
"Never upgrade a TypeScript version without a major package bump. Just don't." — Kamil
23+
`);
24+
process.exit(1);
25+
}
26+
27+
process.exit(0);

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17930,10 +17930,10 @@ typescript-memoize@^1.0.0-alpha.3:
1793017930
dependencies:
1793117931
core-js "2.4.1"
1793217932

17933-
typescript@3.9.7:
17934-
version "3.9.7"
17935-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
17936-
integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==
17933+
typescript@3.7.5:
17934+
version "3.7.5"
17935+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae"
17936+
integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==
1793717937

1793817938
ua-parser-js@^0.7.18:
1793917939
version "0.7.21"

0 commit comments

Comments
 (0)
0