feat(angular): update to angular 13.3.6

This commit includes the update to Angular 13.3.6
as well as the latest project defaults of an
Angular project in the example app.
This commit is contained in:
Kai Röder 2022-05-09 21:50:57 +02:00
parent c492710f4e
commit 6fae47a279
15 changed files with 130 additions and 121 deletions

View File

@ -66,8 +66,8 @@
"ts-dedent": "^2.0.0"
},
"devDependencies": {
"@angular/core": "^12.1.4",
"@angular/platform-browser-dynamic": "^12.1.4",
"@angular/core": "^13.3.6",
"@angular/platform-browser-dynamic": "^13.3.6",
"@emotion/jest": "^11.8.0",
"@storybook/addon-docs": "6.5.0-beta.1",
"@storybook/angular": "6.5.0-beta.1",

View File

@ -77,25 +77,25 @@
"webpack": ">=4.0.0 <6.0.0"
},
"devDependencies": {
"@angular-devkit/architect": "~0.1201.4",
"@angular-devkit/build-angular": "^12.1.4",
"@angular-devkit/core": "^12.1.4",
"@angular/cli": "^12.1.4",
"@angular/common": "^12.1.4",
"@angular/compiler": "^12.1.4",
"@angular/compiler-cli": "^12.1.4",
"@angular/core": "^12.1.4",
"@angular/elements": "^12.1.4",
"@angular/forms": "^12.1.4",
"@angular/platform-browser": "^12.1.4",
"@angular/platform-browser-dynamic": "^12.1.4",
"@nrwl/workspace": "^12.3.6",
"@angular-devkit/architect": "^0.1303.5",
"@angular-devkit/build-angular": "^13.3.5",
"@angular-devkit/core": "^13.3.5",
"@angular/cli": "^13.3.5",
"@angular/common": "^13.3.6",
"@angular/compiler": "^13.3.6",
"@angular/compiler-cli": "^13.3.6",
"@angular/core": "^13.3.6",
"@angular/elements": "^13.3.6",
"@angular/forms": "^13.3.6",
"@angular/platform-browser": "^13.3.6",
"@angular/platform-browser-dynamic": "^13.3.6",
"@nrwl/workspace": "^14.1.4",
"@types/autoprefixer": "^9.7.2",
"@types/tmp": "^0.2.3",
"cross-spawn": "^7.0.3",
"jest": "^26.6.3",
"jest-preset-angular": "^8.4.0",
"jest-specific-snapshot": "^4.0.0",
"jest": "^27.5.1",
"jest-preset-angular": "^11.1.2",
"jest-specific-snapshot": "^5.0.0",
"tmp": "^0.2.1",
"typescript": "^4.6.3",
"webpack": "5"

View File

@ -6,7 +6,6 @@ import {
Pipe,
Type,
ɵReflectionCapabilities as ReflectionCapabilities,
ɵCodegenComponentFactoryResolver,
} from '@angular/core';
const reflectionCapabilities = new ReflectionCapabilities();

View File

@ -106,7 +106,7 @@ const buildWebpackConfigOptions = async (
getSystemPath(workspaceRootNormalized),
projectBuildOptions.tsConfig as string
);
const tsConfig = importAngularCliReadTsconfigUtil().readTsconfig(tsConfigPath);
const tsConfig = await importAngularCliReadTsconfigUtil().readTsconfig(tsConfigPath);
const ts = await import('typescript');
const scriptTarget = tsConfig.options.target || ts.ScriptTarget.ES5;
@ -145,6 +145,7 @@ const buildWebpackConfigOptions = async (
};
return {
projectName: 'this-is-just-a-fake-name-for-getting-rid-of-the-error',
root: getSystemPath(workspaceRootNormalized),
// The dependency of `@angular-devkit/build-angular` to `@angular-devkit/core` is not exactly the same version as the one for storybook (node modules of node modules ^^)
logger: createConsoleLogger() as unknown as WebpackConfigOptions['logger'],

View File

@ -16,8 +16,8 @@ import {
relative,
resolve,
} from '@angular-devkit/core';
import { AssetPattern, AssetPatternClass } from '@angular-devkit/build-angular/src/browser/schema';
import { AssetPattern } from '@angular-devkit/build-angular';
import { AssetPatternClass } from '@angular-devkit/build-angular/src/builders/browser/schema';
export class MissingAssetSourceRootException extends BaseException {
constructor(path: string) {

View File

@ -1,5 +1,4 @@
import { OptimizationUnion } from '@angular-devkit/build-angular/src/browser/schema';
import { OptimizationUnion } from '@angular-devkit/build-angular';
import { NormalizedOptimizationOptions } from '@angular-devkit/build-angular/src/utils/normalize-optimization';
import { moduleIsAvailable } from './module-is-available';

View File

@ -1,15 +1,18 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
# Compiled output
/dist
/tmp
/out-tsc
/bazel-out
# dependencies
# Node
/node_modules
npm-debug.log
yarn-error.log
# IDEs and editors
/.idea
.idea/
.project
.classpath
.c9/
@ -17,25 +20,24 @@
.settings/
*.sublime-workspace
# IDE - VSCode
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# misc
/.sass-cache
# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
documentation.json
# System Files
# System files
.DS_Store
Thumbs.db
addon-jest.testresults.json
documentation.json

View File

@ -1,10 +1,11 @@
{
"extends": "../src/tsconfig.app.json",
"extends": "../tsconfig.app.json",
"exclude": [
"../src/karma.ts",
"../src/**/*.spec.ts"
],
"include": [
"../src/**/*"
"../src/**/*",
"preview.ts"
]
}
}

View File

@ -19,7 +19,7 @@
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"tsConfig": "tsconfig.app.json",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css", "src/styles.scss"],
"stylePreprocessorOptions": {
@ -118,13 +118,13 @@
"storybook": {
"builder": "@storybook/angular:start-storybook",
"options": {
"tsConfig": "src/tsconfig.app.json"
"tsConfig": "tsconfig.app.json"
}
},
"build-storybook": {
"builder": "@storybook/angular:build-storybook",
"options": {
"tsConfig": "src/tsconfig.app.json"
"tsConfig": "tsconfig.app.json"
}
}
}

View File

@ -19,25 +19,25 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@angular/common": "^12.1.4",
"@angular/compiler": "^12.1.4",
"@angular/core": "^12.1.4",
"@angular/forms": "^12.1.4",
"@angular/platform-browser": "^12.1.4",
"@angular/platform-browser-dynamic": "^12.1.4",
"@ngrx/store": "^12.0.0",
"@angular/common": "^13.3.6",
"@angular/compiler": "^13.3.6",
"@angular/core": "^13.3.6",
"@angular/forms": "^13.3.6",
"@angular/platform-browser": "^13.3.6",
"@angular/platform-browser-dynamic": "^13.3.6",
"@ngrx/store": "^13.2.0",
"core-js": "^3.8.2",
"rxjs": "^6.6.3",
"rxjs": "^6.6.7",
"sass": "^1.43.4",
"telejson": "^5.3.3",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^12.1.4",
"@angular-devkit/core": "^12.1.4",
"@angular/cli": "^12.1.4",
"@angular/compiler-cli": "^12.1.4",
"@angular/elements": "^12.1.4",
"@angular-devkit/build-angular": "^13.3.5",
"@angular-devkit/core": "^13.3.5",
"@angular/cli": "^13.3.5",
"@angular/compiler-cli": "^13.3.6",
"@angular/elements": "^13.3.6",
"@compodoc/compodoc": "^1.1.18",
"@storybook/addon-a11y": "6.5.0-beta.1",
"@storybook/addon-actions": "6.5.0-beta.1",

View File

@ -8,4 +8,7 @@ if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic()
.bootstrapModule(AppModule)
// eslint-disable-next-line
.catch((err) => console.error(err));

View File

@ -8,60 +8,45 @@
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
* automatically update themselves. This includes recent versions of Safari, Chrome (including
* Opera), Edge on the desktop, and iOS and Chrome on mobile.
*
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
* Learn more in https://angular.io/guide/browser-support
*/
/** *************************************************************************************************
* BROWSER POLYFILLS
*/
/* IE9, IE10 and IE11 requires all of the following polyfills. */
// import 'core-js/es6/symbol';
// import 'core-js/es6/object';
// import 'core-js/es6/function';
// import 'core-js/es6/parse-int';
// import 'core-js/es6/parse-float';
// import 'core-js/es6/number';
// import 'core-js/es6/math';
// import 'core-js/es6/string';
// import 'core-js/es6/date';
// import 'core-js/es6/array';
// import 'core-js/es6/regexp';
// import 'core-js/es6/map';
// import 'core-js/es6/weak-map';
// import 'core-js/es6/set';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/* Evergreen browsers require these. */
import 'core-js/es/reflect';
import 'core-js/proposals/reflect-metadata';
/**
* Required to support Web Animations `@angular/animation`.
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
* because those flags need to be set before `zone.js` being loaded, and webpack
* will put import in the top of bundle, so user need to create a separate file
* in this directory (for example: zone-flags.ts), and put the following flags
* into that file, and then add the following code before importing zone.js.
* import './zone-flags';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*
* (window as any).__Zone_enable_cross_context_check = true;
*
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/** *************************************************************************************************
* Zone JS is required by Angular itself.
* Zone JS is required by default for Angular itself.
*/
import 'zone.js'; // Included with Angular CLI.
/** *************************************************************************************************
* APPLICATION IMPORTS
*/
/**
* Date, currency, decimal and percent pipes.
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
*/
// import 'intl'; // Run `npm install --save intl`.
/**
* Need to import at least one locale-data with intl.
*/
// import 'intl/locale-data/jsonp/en';

View File

@ -1,15 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": [
"node"
]
},
"exclude": [
"karma.ts",
"**/*.spec.ts"
]
}

View File

@ -0,0 +1,17 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
],
"exclude": [
"**/*.stories.*"
]
}

View File

@ -6,22 +6,39 @@
},
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"declaration": false,
"downlevelIteration": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"lib": [
"es2020",
"dom"
],
"module": "es2020",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": false,
"noPropertyAccessFromIndexSignature": false,
"outDir": "./dist/out-tsc",
"skipLibCheck": true,
"target": "es5",
"sourceMap": true,
"strict": false,
"target": "es2017",
"typeRoots": [
"../../node_modules/@types",
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
}