Update to Angular 15

This commit is contained in:
2026-03-24 20:30:01 +01:00
parent 5e578a292a
commit e009dd4dd0
4 changed files with 2361 additions and 5393 deletions
+2305 -5351
View File
File diff suppressed because it is too large Load Diff
+21 -21
View File
@@ -18,8 +18,8 @@
"ts-watch": "npm run ts -- --watch", "ts-watch": "npm run ts -- --watch",
"ts-cov": "npm run ts -- --target es5", "ts-cov": "npm run ts -- --target es5",
"ts-cov-watch": "npm run ts -- --target es5 --watch", "ts-cov-watch": "npm run ts -- --target es5 --watch",
"webpack-prod": "node --max_old_space_size=8192 node_modules/webpack-cli/bin/cli --config webpack.prod.js --progress --color", "webpack-prod": "node --max_old_space_size=8192 node_modules/webpack-cli/bin/cli --config webpack.prod.mjs --progress --color",
"webpack-prod-parallel": "node --max_old_space_size=8192 node_modules/parallel-webpack/bin/run --config webpack.prod.js --progress --color", "webpack-prod-parallel": "node --max_old_space_size=8192 node_modules/parallel-webpack/bin/run --config webpack.prod.mjs --progress --color",
"webpack-main": "npm run webpack-prod -- --env.main", "webpack-main": "npm run webpack-prod -- --env.main",
"webpack-analyze": "npm run webpack-prod -- --env.analyze", "webpack-analyze": "npm run webpack-prod -- --env.analyze",
"webpack-debug": "npm run webpack-prod -- --env.debug", "webpack-debug": "npm run webpack-prod -- --env.debug",
@@ -50,24 +50,24 @@
"webpack-cli": "^7.0.2" "webpack-cli": "^7.0.2"
}, },
"dependencies": { "dependencies": {
"@angular-devkit/build-angular": "^14.2.13", "@angular-devkit/build-angular": "^15.2.11",
"@angular/animations": "^14.3.0", "@angular/animations": "^15.2.10",
"@angular/cdk": "^14.2.7", "@angular/cdk": "^15.2.9",
"@angular/common": "^14.3.0", "@angular/common": "^15.2.10",
"@angular/compiler": "^14.3.0", "@angular/compiler": "^15.2.10",
"@angular/compiler-cli": "^14.3.0", "@angular/compiler-cli": "^15.2.10",
"@angular/core": "^14.3.0", "@angular/core": "^15.2.10",
"@angular/forms": "^14.3.0", "@angular/forms": "^15.2.10",
"@angular/platform-browser": "^14.3.0", "@angular/platform-browser": "^15.2.10",
"@angular/platform-browser-dynamic": "^14.3.0", "@angular/platform-browser-dynamic": "^15.2.10",
"@angular/platform-server": "^14.3.0", "@angular/platform-server": "^15.2.10",
"@angular/router": "^14.3.0", "@angular/router": "^15.2.10",
"@encharm/cws": "^4.5.3", "@encharm/cws": "^4.5.3",
"@fortawesome/angular-fontawesome": "^0.11.1", "@fortawesome/angular-fontawesome": "^0.11.1",
"@fortawesome/fontawesome-svg-core": "^6.7.2", "@fortawesome/fontawesome-svg-core": "^6.7.2",
"@fortawesome/free-brands-svg-icons": "^6.7.2", "@fortawesome/free-brands-svg-icons": "^6.7.2",
"@fortawesome/free-solid-svg-icons": "^6.7.2", "@fortawesome/free-solid-svg-icons": "^6.7.2",
"@ngtools/webpack": "^14.2.13", "@ngtools/webpack": "^15.2.11",
"@passport-next/passport-facebook": "^3.1.2", "@passport-next/passport-facebook": "^3.1.2",
"@passport-next/passport-google-oauth2": "^1.0.0", "@passport-next/passport-google-oauth2": "^1.0.0",
"@types/base64-js": "^1.2.5", "@types/base64-js": "^1.2.5",
@@ -167,7 +167,7 @@
"moment": "^2.24.0", "moment": "^2.24.0",
"mongoose": "^5.6.11", "mongoose": "^5.6.11",
"morgan": "^1.9.1", "morgan": "^1.9.1",
"ngx-bootstrap": "^9.0.0", "ngx-bootstrap": "^11.0.2",
"node-ipc": "^9.1.1", "node-ipc": "^9.1.1",
"parallel-webpack": "^2.4.0", "parallel-webpack": "^2.4.0",
"passport": "^0.4.0", "passport": "^0.4.0",
@@ -181,9 +181,9 @@
"passport-vkontakte": "^0.3.2", "passport-vkontakte": "^0.3.2",
"postcss": "^8.5.8", "postcss": "^8.5.8",
"postcss-loader": "^8.2.1", "postcss-loader": "^8.2.1",
"pug": "^2.0.4", "pug": "^3.0.4",
"pug-html-loader": "^1.1.5", "pug-html-loader": "^1.1.7",
"pug-plugin-ng": "0.0.2", "pug-plugin-ng": "^0.0.3",
"raw-loader": "^4.0.2", "raw-loader": "^4.0.2",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"remap-istanbul": "^0.13.0", "remap-istanbul": "^0.13.0",
@@ -206,7 +206,7 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"tslint": "^5.19.0", "tslint": "^5.19.0",
"tsutils": "^3.17.1", "tsutils": "^3.17.1",
"typescript": "^4.7.4", "typescript": "~4.9",
"ua-parser-js": "^0.7.20", "ua-parser-js": "^0.7.20",
"webgl-debug": "^2.0.1", "webgl-debug": "^2.0.1",
"webpack-bundle-analyzer": "^5.2.0", "webpack-bundle-analyzer": "^5.2.0",
@@ -215,6 +215,6 @@
"workbox-cli": "^4.3.1", "workbox-cli": "^4.3.1",
"wrapper-webpack-plugin": "^2.2.2", "wrapper-webpack-plugin": "^2.2.2",
"yargs": "^14.0.0", "yargs": "^14.0.0",
"zone.js": "^0.11.8" "zone.js": "^0.12.0"
} }
} }
+15 -3
View File
@@ -5,7 +5,7 @@ const common = require('./webpack.common.js');
const compilerOptions = { const compilerOptions = {
...require('./tsconfig.json').compilerOptions, ...require('./tsconfig.json').compilerOptions,
target: 'es6', target: 'es6',
module: 'es2015', module: 'es2016',
}; };
module.exports = merge(common, { module.exports = merge(common, {
@@ -18,10 +18,21 @@ module.exports = merge(common, {
devtool: 'eval-cheap-source-map', devtool: 'eval-cheap-source-map',
devServer: { devServer: {
host: '0.0.0.0', host: '0.0.0.0',
port: 8090, port: 8091,
hot: true, hot: true,
historyApiFallback: true,
compress: false, compress: false,
allowedHosts: ['all'], client: {
progress: true,
overlay: {
errors: true,
warnings: false
}
},
static: {
publicPath: '/assets/scripts/',
},
allowedHosts: 'all',
headers: { headers: {
'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET', 'Access-Control-Allow-Methods': 'GET',
@@ -72,6 +83,7 @@ module.exports = merge(common, {
}, },
}, },
plugins: [ plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
DEVELOPMENT: true, TOOLS: true, SERVER: false, DEVELOPMENT: true, TOOLS: true, SERVER: false,
BETA: true, TIMING: true, TESTS: false BETA: true, TIMING: true, TESTS: false
+16 -14
View File
@@ -1,13 +1,15 @@
const path = require('path'); import path from 'path';
const webpack = require('webpack'); import webpack from 'webpack';
const { merge } = require('webpack-merge'); import { merge } from 'webpack-merge';
const TerserPlugin = require('terser-webpack-plugin'); import TerserPlugin from 'terser-webpack-plugin';
const WrapperPlugin = require('wrapper-webpack-plugin'); import WrapperPlugin from 'wrapper-webpack-plugin';
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
const { AngularWebpackPlugin } = require('@ngtools/webpack'); import { AngularWebpackPlugin } from '@ngtools/webpack';
const linkerPlugin = require('@angular/compiler-cli/linker/babel'); import linkerPlugin from '@angular/compiler-cli/linker/babel';
const common = require('./webpack.common.js'); import common from './webpack.common.js';
const fs = require('fs'); import fs from 'fs';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const r = p => JSON.parse(fs.readFileSync(p, 'utf8')); const r = p => JSON.parse(fs.readFileSync(p, 'utf8'));
@@ -32,8 +34,8 @@ const scripts = [
['bootstrap-tools', 'tools/tools.module#ToolsAppModule', 'assets', compilerOptions, 'tsconfig-aot-tools.json', 5, true], ['bootstrap-tools', 'tools/tools.module#ToolsAppModule', 'assets', compilerOptions, 'tsconfig-aot-tools.json', 5, true],
]; ];
const toolsScrips = ['bootstrap-tools', 'tools/tools.module#ToolsAppModule', 'assets', compilerOptions, 'tsconfig-aot-tools.json', 5, true];
const max = Math.max(...([...scripts, toolsScrips].map(e => e[0].length))); const max = Math.max(...([...scripts].map(e => e[0].length)));
function getScripts(args) { function getScripts(args) {
const { analyze, main, admin, tools, beta } = args; const { analyze, main, admin, tools, beta } = args;
if (tools || beta) { if (tools || beta) {
@@ -49,7 +51,7 @@ function getScripts(args) {
} }
} }
module.exports = (args = {}) => export default (args = {}) =>
getScripts(args) getScripts(args)
.map(([script, entry, outDir, compilerOptions, tsconfig, _ecma, TOOLS]) => merge(common, { .map(([script, entry, outDir, compilerOptions, tsconfig, _ecma, TOOLS]) => merge(common, {
mode: 'production', mode: 'production',
@@ -62,7 +64,7 @@ module.exports = (args = {}) =>
}, },
output: Object.assign({}, common.output, { output: Object.assign({}, common.output, {
filename: '[name]-[chunkhash:10].js', filename: '[name]-[chunkhash:10].js',
path: path.resolve(__dirname, 'build', outDir, 'scripts'), path: path.resolve(__dirname, 'dist', 'browser' , outDir, 'scripts'),
}), }),
devtool: script === 'bootstrap' ? 'source-map' : false, devtool: script === 'bootstrap' ? 'source-map' : false,
module: { module: {