From 77da931934d09d6e11c6a8938043f3a4cc5aeb38 Mon Sep 17 00:00:00 2001 From: Amy Sorto <8575252+amysorto@users.noreply.github.com> Date: Wed, 20 Oct 2021 18:45:08 +0000 Subject: [PATCH] build: fix size-test integration tooling --- goldens/size-test.yaml | 36 +++++++++++++------------- integration/size-test/check-size.ts | 3 ++- integration/size-test/index-tmpl.ts | 4 +-- integration/size-test/index.bzl | 2 +- integration/size-test/rollup.config.js | 4 +-- package.json | 2 +- yarn.lock | 19 +------------- 7 files changed, 27 insertions(+), 43 deletions(-) diff --git a/goldens/size-test.yaml b/goldens/size-test.yaml index 18a2d511612a..74acb5d334f8 100644 --- a/goldens/size-test.yaml +++ b/goldens/size-test.yaml @@ -1,18 +1,18 @@ -cdk/drag-drop/all-directives: 155992 -cdk/drag-drop/basic: 153350 -material-experimental/mdc-chips/basic: 188046 -material-experimental/mdc-form-field/advanced: 222398 -material-experimental/mdc-form-field/basic: 220887 -material/autocomplete/without-optgroup: 208849 -material/button-toggle/standalone: 120922 -material/chips/basic: 163323 -material/datepicker/range-picker/without-form-field: 327618 -material/expansion/without-accordion: 134642 -material/form-field/advanced: 181543 -material/form-field/basic: 179958 -material/list/nav-list: 128590 -material/menu/without-lazy-content: 213952 -material/radio/without-group: 124057 -material/select/basic: 256497 -material/tabs/advanced: 183680 -material/tabs/basic: 182530 +cdk/drag-drop/all-directives: 160859 +cdk/drag-drop/basic: 158225 +material-experimental/mdc-chips/basic: 385551 +material-experimental/mdc-form-field/advanced: 417584 +material-experimental/mdc-form-field/basic: 416339 +material/autocomplete/without-optgroup: 392028 +material/button-toggle/standalone: 124412 +material/chips/basic: 320073 +material/datepicker/range-picker/without-form-field: 505044 +material/expansion/without-accordion: 330526 +material/form-field/advanced: 377468 +material/form-field/basic: 376144 +material/list/nav-list: 328072 +material/menu/without-lazy-content: 398590 +material/radio/without-group: 127571 +material/select/basic: 437305 +material/tabs/advanced: 369608 +material/tabs/basic: 368747 diff --git a/integration/size-test/check-size.ts b/integration/size-test/check-size.ts index c34bd6b813f8..ee4b4eaa3f2f 100644 --- a/integration/size-test/check-size.ts +++ b/integration/size-test/check-size.ts @@ -4,11 +4,12 @@ * amount, the script will fail with a non-zero exit code. */ -import * as chalk from 'chalk'; import {readFileSync, statSync, writeFileSync} from 'fs'; import {parse, stringify} from 'yaml'; import {runfiles} from '@bazel/runfiles'; +const chalk = require('chalk'); + /** * Absolute byte deviation from the expected value that is allowed. If the * size deviates by 500 bytes of the expected value, the script will fail. diff --git a/integration/size-test/index-tmpl.ts b/integration/size-test/index-tmpl.ts index e75ca02aeb1a..b415eb83a18d 100644 --- a/integration/size-test/index-tmpl.ts +++ b/integration/size-test/index-tmpl.ts @@ -1,4 +1,4 @@ import {platformBrowser} from '@angular/platform-browser'; -import {AppModuleNgFactory} from './$TEST_FILE.ngfactory'; +import {AppModule} from './$TEST_FILE'; -platformBrowser().bootstrapModuleFactory(AppModuleNgFactory); +platformBrowser().bootstrapModule(AppModule); diff --git a/integration/size-test/index.bzl b/integration/size-test/index.bzl index 25cf546f44c4..54ff065ed190 100644 --- a/integration/size-test/index.bzl +++ b/integration/size-test/index.bzl @@ -48,7 +48,7 @@ def size_test(name, file, deps): }, deps = [ ":%s_lib" % name, - "@npm//rollup-plugin-node-resolve", + "@npm//@rollup/plugin-node-resolve", "@npm//@angular-devkit/build-optimizer", ], # Link the workspace root so that files can be loaded from the workspace. diff --git a/integration/size-test/rollup.config.js b/integration/size-test/rollup.config.js index b7dd5499f2e4..a3e283a6958b 100644 --- a/integration/size-test/rollup.config.js +++ b/integration/size-test/rollup.config.js @@ -1,7 +1,7 @@ const { buildOptimizer, } = require('@angular-devkit/build-optimizer/src/build-optimizer/build-optimizer'); -const node = require('rollup-plugin-node-resolve'); +const {nodeResolve} = require('@rollup/plugin-node-resolve'); const buildOptimizerPlugin = { name: 'build-optimizer', @@ -28,7 +28,7 @@ const buildOptimizerPlugin = { module.exports = { plugins: [ buildOptimizerPlugin, - node({ + nodeResolve({ mainFields: ['es2020', 'module'], }), ], diff --git a/package.json b/package.json index 11048892547f..2b9d24835792 100644 --- a/package.json +++ b/package.json @@ -215,7 +215,7 @@ "send": "^0.17.1", "shelljs": "^0.8.3", "stylelint": "^13.13.1", - "terser": "^4.8.0", + "terser": "^5.9.0", "ts-node": "^10.2.1", "tsickle": "0.39.1", "tslint": "^6.1.3", diff --git a/yarn.lock b/yarn.lock index 0b26fe1744e7..9ea8ce92c8ff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14789,14 +14789,6 @@ source-map-support@^0.4.15, source-map-support@~0.4.0: dependencies: source-map "^0.5.6" -source-map-support@~0.5.12: - version "0.5.19" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - source-map-url@^0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" @@ -15507,7 +15499,7 @@ terser-webpack-plugin@^5.1.3: source-map "^0.6.1" terser "^5.7.2" -terser@5.9.0, terser@^5.7.2: +terser@5.9.0, terser@^5.7.2, terser@^5.9.0: version "5.9.0" resolved "https://registry.yarnpkg.com/terser/-/terser-5.9.0.tgz#47d6e629a522963240f2b55fcaa3c99083d2c351" integrity sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ== @@ -15516,15 +15508,6 @@ terser@5.9.0, terser@^5.7.2: source-map "~0.7.2" source-map-support "~0.5.20" -terser@^4.8.0: - version "4.8.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17" - integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw== - dependencies: - commander "^2.20.0" - source-map "~0.6.1" - source-map-support "~0.5.12" - test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e"