Skip to content

Commit 4e32433

Browse files
author
Angular Builds
committed
f96914f0d build: update webpack to version 5.35.0
1 parent b4b4da9 commit 4e32433

17 files changed

+67
-38
lines changed

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ application | Generates a new basic app definition in the "projects" subfolder o
2828
class | Creates a new, generic class definition in the given or default project
2929
component | Creates a new, generic component definition in the given or default project
3030
directive | Creates a new, generic directive definition in the given or default project
31-
e2e | Generates a new, generic end-to-end test definition for the given or default project
3231
enum | Generates a new, generic enum definition for the given or default project
3332
guard | Generates a new, generic route guard definition in the given or default project
3433
interceptor | Creates a new, generic interceptor definition in the given or default project
@@ -40,10 +39,9 @@ pipe | Creates a new, generic pipe definition in the given or default project
4039
resolver | Creates a new, generic resolver definition in the given or default project
4140
service | Creates a new, generic service definition in the given or default project
4241
service-worker | Pass this schematic to the "run" command to create a service worker
43-
universal | Pass this schematic to the "run" command to set up server-side rendering for an app
4442
web-worker | Creates a new, generic web worker definition in the given or default project
4543
workspace | Initializes an empty workspace and adds the necessary dependencies required by an Angular application
4644

4745
## Disclaimer
4846

49-
While the schematics when executed via the Angular CLI and their associated options are considered stable, the programmatic APIs are not considered officially supported and are not subject to the breaking change guarantees of SemVer.
47+
While the schematics when executed via the Angular CLI and their associated options are considered stable, the programmatic APIs are not considered officially supported and are not subject to the breaking change guarantees of SemVer.

application/index.js

+6-13
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function addAppToWorkspaceFile(options, appDir) {
110110
},
111111
];
112112
}
113-
const inlineStyleLanguage = options.style && options.style !== schema_1.Style.Css && options.style !== schema_1.Style.Styl
113+
const inlineStyleLanguage = (options === null || options === void 0 ? void 0 : options.style) !== schema_1.Style.Css
114114
? options.style
115115
: undefined;
116116
const project = {
@@ -129,7 +129,6 @@ function addAppToWorkspaceFile(options, appDir) {
129129
main: `${sourceRoot}/main.ts`,
130130
polyfills: `${sourceRoot}/polyfills.ts`,
131131
tsConfig: `${projectRoot}tsconfig.app.json`,
132-
aot: true,
133132
inlineStyleLanguage,
134133
assets: [
135134
`${sourceRoot}/favicon.ico`,
@@ -147,16 +146,15 @@ function addAppToWorkspaceFile(options, appDir) {
147146
replace: `${sourceRoot}/environments/environment.ts`,
148147
with: `${sourceRoot}/environments/environment.prod.ts`,
149148
}],
150-
buildOptimizer: true,
151-
optimization: true,
152149
outputHashing: 'all',
153-
sourceMap: false,
154-
namedChunks: false,
155-
extractLicenses: true,
156-
vendorChunk: false,
157150
},
158151
development: {
152+
buildOptimizer: false,
153+
optimization: false,
159154
vendorChunk: true,
155+
extractLicenses: false,
156+
sourceMap: true,
157+
namedChunks: true,
160158
},
161159
},
162160
},
@@ -243,10 +241,6 @@ function default_1(options) {
243241
? core_1.normalize(options.projectRoot || '')
244242
: core_1.join(core_1.normalize(newProjectRoot), core_1.strings.dasherize(options.name));
245243
const sourceDir = `${appDir}/src/app`;
246-
const e2eOptions = {
247-
relatedAppName: options.name,
248-
rootSelector: appRootSelector,
249-
};
250244
return schematics_1.chain([
251245
addAppToWorkspaceFile(options, appDir),
252246
schematics_1.mergeWith(schematics_1.apply(schematics_1.url('./files'), [
@@ -296,7 +290,6 @@ function default_1(options) {
296290
}),
297291
schematics_1.move(sourceDir),
298292
]), schematics_1.MergeStrategy.Overwrite),
299-
options.minimal ? schematics_1.noop() : schematics_1.schematic('e2e', e2eOptions),
300293
options.skipPackageJson ? schematics_1.noop() : addDependenciesToPackageJson(options),
301294
options.lintFix ? lint_fix_1.applyLintFix(appDir) : schematics_1.noop(),
302295
]);

application/schema.d.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ export declare enum Style {
7777
Css = "css",
7878
Less = "less",
7979
Sass = "sass",
80-
Scss = "scss",
81-
Styl = "styl"
80+
Scss = "scss"
8281
}
8382
/**
8483
* The view encapsulation strategy to use in the new app.

application/schema.js

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ var Style;
1212
Style["Less"] = "less";
1313
Style["Sass"] = "sass";
1414
Style["Scss"] = "scss";
15-
Style["Styl"] = "styl";
1615
})(Style = exports.Style || (exports.Style = {}));
1716
/**
1817
* The view encapsulation strategy to use in the new app.

application/schema.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060
"css",
6161
"scss",
6262
"sass",
63-
"less",
64-
"styl"
63+
"less"
6564
],
6665
"x-prompt": {
6766
"message": "Which stylesheet format would you like to use?",
@@ -70,8 +69,7 @@
7069
{ "value": "css", "label": "CSS" },
7170
{ "value": "scss", "label": "SCSS [ https://sass-lang.com/documentation/syntax#scss ]" },
7271
{ "value": "sass", "label": "Sass [ https://sass-lang.com/documentation/syntax#the-indented-syntax ]" },
73-
{ "value": "less", "label": "Less [ http://lesscss.org ]" },
74-
{ "value": "styl", "label": "Stylus [ https://stylus-lang.com ]" }
72+
{ "value": "less", "label": "Less [ http://lesscss.org ]" }
7573
]
7674
},
7775
"x-user-analytics": 5

component/schema.d.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ export declare enum Style {
9797
Css = "css",
9898
Less = "less",
9999
Sass = "sass",
100-
Scss = "scss",
101-
Styl = "styl"
100+
Scss = "scss"
102101
}
103102
/**
104103
* The view encapsulation strategy to use in the new component.

component/schema.js

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ var Style;
2020
Style["Less"] = "less";
2121
Style["Sass"] = "sass";
2222
Style["Scss"] = "scss";
23-
Style["Styl"] = "styl";
2423
})(Style = exports.Style || (exports.Style = {}));
2524
/**
2625
* The view encapsulation strategy to use in the new component.

component/schema.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@
8484
"css",
8585
"scss",
8686
"sass",
87-
"less",
88-
"styl"
87+
"less"
8988
],
9089
"x-user-analytics": 5
9190
},

e2e/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
99
*/
1010
const core_1 = require("@angular-devkit/core");
1111
const schematics_1 = require("@angular-devkit/schematics");
12+
const dependencies_1 = require("../utility/dependencies");
1213
const json_file_1 = require("../utility/json-file");
1314
const paths_1 = require("../utility/paths");
1415
const workspace_1 = require("../utility/workspace");
@@ -57,6 +58,11 @@ function default_1(options) {
5758
}),
5859
schematics_1.move(root),
5960
])),
61+
host => dependencies_1.addPackageJsonDependency(host, {
62+
type: dependencies_1.NodeDependencyType.Dev,
63+
name: 'protractor',
64+
version: '~7.0.0',
65+
}),
6066
addScriptsToPackageJson(),
6167
]);
6268
};

migrations/update-12/update-angular-config.js

+43-1
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,34 @@
88
*/
99
Object.defineProperty(exports, "__esModule", { value: true });
1010
const workspace_1 = require("../../utility/workspace");
11+
const BrowserBuilderOptions = [
12+
['aot', false, true],
13+
['vendorChunk', true, false],
14+
['extractLicenses', true, false],
15+
['buildOptimizer', false, true],
16+
['sourceMap', true, false],
17+
['optimization', false, true],
18+
['namedChunks', false, true],
19+
];
20+
const ServerBuilderOptions = [
21+
['sourceMap', true, false],
22+
['optimization', false, true],
23+
];
1124
function default_1() {
1225
return workspace_1.updateWorkspace(workspace => {
1326
for (const [, target] of workspace_1.allWorkspaceTargets(workspace)) {
14-
if (!target.builder.startsWith('@angular-devkit/build-angular')) {
27+
if (!(target === null || target === void 0 ? void 0 : target.builder.startsWith('@angular-devkit/build-angular'))) {
1528
continue;
1629
}
30+
// Only interested in Angular Devkit browser and server builders
31+
switch (target.builder) {
32+
case '@angular-devkit/build-angular:server':
33+
updateOptions(target, ServerBuilderOptions);
34+
break;
35+
case '@angular-devkit/build-angular:browser':
36+
updateOptions(target, BrowserBuilderOptions);
37+
break;
38+
}
1739
for (const [, options] of workspace_1.allTargetOptions(target)) {
1840
delete options.experimentalRollupPass;
1941
delete options.lazyModules;
@@ -22,3 +44,23 @@ function default_1() {
2244
});
2345
}
2446
exports.default = default_1;
47+
function updateOptions(target, optionsToUpdate) {
48+
if (!target.options) {
49+
target.options = {};
50+
}
51+
const configurationOptions = target.configurations && Object.values(target.configurations);
52+
for (const [optionName, oldDefault, newDefault] of optionsToUpdate) {
53+
let value = target.options[optionName];
54+
if (value === newDefault) {
55+
// Value is same as new default
56+
delete target.options[optionName];
57+
}
58+
else if (value === undefined) {
59+
// Value is not defined, hence the default in the builder was used.
60+
target.options[optionName] = oldDefault;
61+
value = oldDefault;
62+
}
63+
// Remove overrides in configurations which are no longer needed.
64+
configurationOptions === null || configurationOptions === void 0 ? void 0 : configurationOptions.filter(o => o && o[optionName] === value).forEach(o => o && delete o[optionName]);
65+
}
66+
}

ng-new/schema.d.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ export declare enum Style {
116116
Css = "css",
117117
Less = "less",
118118
Sass = "sass",
119-
Scss = "scss",
120-
Styl = "styl"
119+
Scss = "scss"
121120
}
122121
/**
123122
* The view encapsulation strategy to use in the initial project.

ng-new/schema.js

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ var Style;
2222
Style["Less"] = "less";
2323
Style["Sass"] = "sass";
2424
Style["Scss"] = "scss";
25-
Style["Styl"] = "styl";
2625
})(Style = exports.Style || (exports.Style = {}));
2726
/**
2827
* The view encapsulation strategy to use in the initial project.

ng-new/schema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"style": {
108108
"description": "The file extension or preprocessor to use for style files.",
109109
"type": "string",
110-
"enum": ["css", "scss", "sass", "less", "styl"],
110+
"enum": ["css", "scss", "sass", "less"],
111111
"x-user-analytics": 5
112112
},
113113
"skipTests": {

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
],
1616
"schematics": "./collection.json",
1717
"dependencies": {
18-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#c3cc50e6b",
19-
"@angular-devkit/schematics": "github:angular/angular-devkit-schematics-builds#c3cc50e6b",
18+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#f96914f0d",
19+
"@angular-devkit/schematics": "github:angular/angular-devkit-schematics-builds#f96914f0d",
2020
"jsonc-parser": "3.0.0"
2121
},
2222
"repository": {

uniqueId

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Tue Apr 20 2021 16:11:19 GMT+0000 (Coordinated Universal Time)
1+
Wed Apr 21 2021 20:25:32 GMT+0000 (Coordinated Universal Time)

workspace/files/README.md.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
2020

2121
## Running end-to-end tests
2222

23-
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
23+
Run `ng e2e` to execute the end-to-end tests via a platform of your choice.
2424

2525
## Further help
2626

workspace/files/package.json.template

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"karma-coverage": "~2.0.3",
3636
"karma-jasmine": "~4.0.0",
3737
"karma-jasmine-html-reporter": "^1.5.0",
38-
"protractor": "~7.0.0",
3938
"ts-node": "~9.1.1",<% } %>
4039
"typescript": "<%= latestVersions.TypeScript %>"
4140
}

0 commit comments

Comments
 (0)