Skip to content

Commit 16c6a17

Browse files
jbedardalexeagle
authored andcommitted
chore: upgrade typescript and angular (bazel-contrib#2625)
Co-authored-by: Alex Eagle <[email protected]>
1 parent c3ed02d commit 16c6a17

File tree

18 files changed

+335
-137
lines changed

18 files changed

+335
-137
lines changed

internal/linker/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
99
});
1010
};
1111
Object.defineProperty(exports, "__esModule", { value: true });
12+
exports.main = exports.reduceModules = void 0;
1213
const fs = require("fs");
1314
const path = require("path");
1415
const { runfiles: _defaultRunfiles, _BAZEL_OUT_REGEX } = require('../runfiles/index.js');

internal/node/BUILD.bazel

+2
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,6 @@ generated_file_test(
5858
name = "checked_in_node_patches",
5959
src = "node_patches.js",
6060
generated = "//packages/node-patches:bundle",
61+
# For some reason rollup produces different, non-matching output with --config=no-runfiles
62+
tags = ["fix-windows"],
6163
)

internal/npm_install/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* THIS FILE GENERATED FROM .ts; see BUILD.bazel */ /* clang-format off */'use strict';
22
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.printIndexBzl = exports.printPackageBin = exports.parsePackage = exports.getDirectDependencySet = exports.main = void 0;
34
const fs = require("fs");
45
const path = require("path");
56
const crypto = require("crypto");

internal/runfiles/index.js

+31-23
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// clang-format off
22
'use strict';
33

4-
Object.defineProperty(exports, '__esModule', { value: true });
5-
64
var path = require('path');
75
var fs = require('fs');
86

@@ -11,18 +9,33 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
119
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
1210
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
1311

12+
function getDefaultExportFromCjs (x) {
13+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
14+
}
15+
16+
function createCommonjsModule(fn) {
17+
var module = { exports: {} };
18+
return fn(module, module.exports), module.exports;
19+
}
20+
21+
var paths = createCommonjsModule(function (module, exports) {
22+
Object.defineProperty(exports, "__esModule", { value: true });
23+
exports.BAZEL_OUT_REGEX = void 0;
1424
// NB: on windows thanks to legacy 8-character path segments it might be like
1525
// c:/b/ojvxx6nx/execroot/build_~1/bazel-~1/x64_wi~1/bin/internal/npm_in~1/test
16-
var BAZEL_OUT_REGEX = /(\/bazel-out\/|\/bazel-~1\/x64_wi~1\/)/;
26+
exports.BAZEL_OUT_REGEX = /(\/bazel-out\/|\/bazel-~1\/x64_wi~1\/)/;
27+
});
28+
29+
var runfiles$1 = createCommonjsModule(function (module, exports) {
30+
Object.defineProperty(exports, "__esModule", { value: true });
31+
exports.Runfiles = void 0;
32+
1733

18-
var paths = /*#__PURE__*/Object.defineProperty({
19-
BAZEL_OUT_REGEX: BAZEL_OUT_REGEX
20-
}, '__esModule', {value: true});
2134

2235
/**
2336
* Class that provides methods for resolving Bazel runfiles.
2437
*/
25-
class Runfiles$1 {
38+
class Runfiles {
2639
constructor(_env) {
2740
this._env = _env;
2841
// If Bazel sets a variable pointing to a runfiles manifest,
@@ -180,25 +193,20 @@ class Runfiles$1 {
180193
return this._resolve(dirname, path__default['default'].join(path__default['default'].basename(moduleBase), moduleTail || ''));
181194
}
182195
}
183-
var Runfiles_1 = Runfiles$1;
196+
exports.Runfiles = Runfiles;
197+
});
184198

185-
var runfiles$1 = /*#__PURE__*/Object.defineProperty({
186-
Runfiles: Runfiles_1
187-
}, '__esModule', {value: true});
199+
var runfiles = createCommonjsModule(function (module, exports) {
200+
Object.defineProperty(exports, "__esModule", { value: true });
201+
exports.runfiles = exports._BAZEL_OUT_REGEX = exports.Runfiles = void 0;
188202

189-
var Runfiles = runfiles$1.Runfiles;
203+
Object.defineProperty(exports, "Runfiles", { enumerable: true, get: function () { return runfiles$1.Runfiles; } });
190204

191-
var _BAZEL_OUT_REGEX = paths.BAZEL_OUT_REGEX;
205+
Object.defineProperty(exports, "_BAZEL_OUT_REGEX", { enumerable: true, get: function () { return paths.BAZEL_OUT_REGEX; } });
192206
/** Instance of the runfile helpers. */
193-
var runfiles_2 = new runfiles$1.Runfiles(process.env);
207+
exports.runfiles = new runfiles$1.Runfiles(process.env);
208+
});
194209

195-
var runfiles = /*#__PURE__*/Object.defineProperty({
196-
Runfiles: Runfiles,
197-
_BAZEL_OUT_REGEX: _BAZEL_OUT_REGEX,
198-
runfiles: runfiles_2
199-
}, '__esModule', {value: true});
210+
var index = /*@__PURE__*/getDefaultExportFromCjs(runfiles);
200211

201-
exports.Runfiles = Runfiles;
202-
exports._BAZEL_OUT_REGEX = _BAZEL_OUT_REGEX;
203-
exports.default = runfiles;
204-
exports.runfiles = runfiles_2;
212+
module.exports = index;

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"yarn": ">=1.13.0"
1515
},
1616
"devDependencies": {
17-
"@angular/common": "^9.1.0",
18-
"@angular/compiler": "^9.1.0",
19-
"@angular/compiler-cli": "^9.1.0",
20-
"@angular/core": "^9.1.0",
17+
"@angular/common": "^11.2.11",
18+
"@angular/compiler": "^11.2.11",
19+
"@angular/compiler-cli": "^11.2.11",
20+
"@angular/core": "^11.2.11",
2121
"@babel/cli": "^7.6.2",
2222
"@babel/core": "^7.6.2",
2323
"@babel/preset-env": "^7.6.2",
@@ -92,11 +92,11 @@
9292
"tsickle": "0.38.0",
9393
"tsutils": "2.27.2",
9494
"typeorm": "0.2.18",
95-
"typescript": "^3.7.5",
95+
"typescript": "4.0.2",
9696
"unidiff": "1.0.1",
9797
"yarn": "1.22.0",
9898
"c8": "7.5.0",
99-
"zone.js": "0.8.29"
99+
"zone.js": "^0.11.4"
100100
},
101101
"// resolutions/**/jest-serializer": "need to resolve to a version that doesn't have a /// <reference path='../v8.d.ts' /> in build/index.d.ts which exposes a bug in ts_library",
102102
"resolutions": {

packages/esbuild/test/typescript/bundle.golden.txt

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ var require_module_dynamic = __commonJS((exports, module) => {
3232
})(function(require2, exports2) {
3333
"use strict";
3434
Object.defineProperty(exports2, "__esModule", {value: true});
35+
exports2.getId = void 0;
3536
exports2.getId = () => "dynamic-id";
3637
});
3738
});

packages/protractor/test/protractor/conf.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ exports.config = {
3333

3434
browser.baseUrl = `http://localhost:${port}`;
3535

36-
return new Promise(resolve => {
36+
return new Promise<void>(resolve => {
3737
app.listen(port, () => {
3838
resolve();
3939
});

packages/rollup/test/multi_linker/BUILD.bazel

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ rollup_bundle(
1616
name = "bundle",
1717
config_file = "rollup.config.js",
1818
entry_point = "main.js",
19+
sourcemap = "hidden",
1920
deps = [
2021
"tsconfig",
2122
"@rollup_test_multi_linker_deps//@rollup/plugin-commonjs",

packages/rollup/test/multi_linker/golden.js_

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ function commonjsRequire () {
1414

1515
var lib = createCommonjsModule(function (module, exports) {
1616
exports.__esModule = true;
17+
exports.key = void 0;
1718
exports.key = 'rollup';
1819
});
1920

2021
var key = lib.key;
2122
console.log(key);
22-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVuZGxlLmpzIiwic291cmNlcyI6WyJsaWIuanMiLCJtYWluLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcbmV4cG9ydHMua2V5ID0gJ3JvbGx1cCc7XG4iLCJ2YXIga2V5ID0gcmVxdWlyZSgnLi9saWInKS5rZXk7XG5jb25zb2xlLmxvZyhrZXkpO1xuIl0sIm5hbWVzIjpbInJlcXVpcmUkJDAiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7OztBQUNBLGtCQUFrQixHQUFHLElBQUksQ0FBQztBQUMxQixXQUFXLEdBQUcsUUFBUTs7O0FDRnRCLElBQUksR0FBRyxHQUFHQSxHQUFnQixDQUFDLEdBQUcsQ0FBQztBQUMvQixPQUFPLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyJ9

packages/typescript/internal/worker/index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,13 @@ function getWatchProgram(args) {
5151
return cachedWatchedProgram;
5252
}
5353
function emitOnce(args) {
54-
var _a;
5554
return __awaiter(this, void 0, void 0, function* () {
5655
const watchProgram = getWatchProgram(args);
5756
if (consolidateChangesCallback) {
5857
consolidateChangesCallback();
5958
}
6059
workerRequestTimestamp = Date.now();
61-
const result = yield ((_a = watchProgram) === null || _a === void 0 ? void 0 : _a.getProgram().emit(undefined, undefined, {
60+
const result = yield (watchProgram === null || watchProgram === void 0 ? void 0 : watchProgram.getProgram().emit(undefined, undefined, {
6261
isCancellationRequested: function (timestamp) {
6362
return timestamp !== workerRequestTimestamp;
6463
}.bind(null, workerRequestTimestamp),
@@ -94,7 +93,7 @@ function main() {
9493
argsFilePath = argsFilePath.slice(1);
9594
}
9695
const args = fs.readFileSync(argsFilePath).toString().split('\n');
97-
emitOnce(args).finally(() => { var _a; return (_a = cachedWatchedProgram) === null || _a === void 0 ? void 0 : _a.close(); });
96+
emitOnce(args).finally(() => cachedWatchedProgram === null || cachedWatchedProgram === void 0 ? void 0 : cachedWatchedProgram.close());
9897
}
9998
}
10099
if (require.main === module) {

packages/typescript/test/errorchecks/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ts_library(
1818
name = "erroneous",
1919
srcs = glob(["*.ts"]),
2020
expected_diagnostics = [
21-
"TS2322: Type '\"not a number\"' is not assignable to type 'number'",
21+
"TS2322: Type 'string' is not assignable to type 'number'",
2222
"TS2304: Cannot find name 'TypeThatDoesNotExist'",
2323
],
2424
)

packages/typescript/test/target_module_attributes/override_output_test.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ describe('googmodule', () => {
1616
});
1717

1818
it('should have es5 in devmode', () => {
19-
expect(fs.readFileSync(devmodeOutput, {
20-
encoding: 'utf-8'
21-
})).toContain(`exports.a = function () { return 'hello world'; };`);
19+
const devoutput = fs.readFileSync(devmodeOutput, {encoding: 'utf-8'});
20+
21+
expect(devoutput).toContain(`a = function () { return 'hello world'; };`);
22+
expect(devoutput).toContain(`exports.a = `);
2223
});
2324

2425
it('should have amd module syntax in prodmode', () => {
@@ -28,8 +29,9 @@ describe('googmodule', () => {
2829
});
2930

3031
it('should have es5 in prodmode', () => {
31-
expect(fs.readFileSync(prodmodeOutput, {
32-
encoding: 'utf-8'
33-
})).toContain(`exports.a = function () { return 'hello world'; };`);
32+
const prodoutput = fs.readFileSync(prodmodeOutput, {encoding: 'utf-8'});
33+
34+
expect(prodoutput).toContain(`a = function () { return 'hello world'; };`);
35+
expect(prodoutput).toContain(`exports.a = `);
3436
});
3537
});
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
"use strict";
22
exports.__esModule = true;
3+
exports.a = void 0;
34
exports.a = 'hello world';
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.a = void 0;
34
exports.a = 'hello world';
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
"use strict";
22
exports.__esModule = true;
3+
exports.a = void 0;
34
exports.a = 'hello world';
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
"use strict";
22
exports.__esModule = true;
3+
exports.a = void 0;
34
exports.a = 1;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
"use strict";
22
exports.__esModule = true;
3+
exports.a = void 0;
34
exports.a = 'hello';

0 commit comments

Comments
 (0)