@nx/angular 17.1.0-beta.0 → 17.1.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/nx-angular.mjs +1 -1
- package/migrations.json +135 -0
- package/ng-package.json +0 -1
- package/package.json +15 -20
- package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.d.ts +1 -1
- package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js +112 -60
- package/src/builders/module-federation-dev-server/schema.d.ts +23 -7
- package/src/builders/module-federation-dev-server/schema.json +13 -3
- package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.d.ts +1 -1
- package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.js +13 -8
- package/src/builders/webpack-browser/schema.json +7 -7
- package/src/builders/webpack-browser/webpack-browser.impl.js +0 -2
- package/src/builders/webpack-dev-server/lib/normalize-options.d.ts +2 -2
- package/src/builders/webpack-dev-server/lib/normalize-options.js +11 -5
- package/src/builders/webpack-dev-server/schema.d.ts +22 -7
- package/src/builders/webpack-dev-server/schema.json +9 -3
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.js +24 -13
- package/src/builders/webpack-server/schema.d.ts +0 -1
- package/src/builders/webpack-server/schema.json +1 -13
- package/src/builders/webpack-server/validate-options.js +0 -7
- package/src/builders/webpack-server/webpack-server.impl.js +0 -8
- package/src/executors/browser-esbuild/browser-esbuild.impl.js +0 -2
- package/src/executors/browser-esbuild/schema.json +5 -4
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.js +20 -12
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ngc/compile-source-files.js +10 -1
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/styles/stylesheet-processor.js +0 -13
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +10 -1
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +0 -13
- package/src/executors/utilities/ng-compiler-cli.d.ts +15 -0
- package/src/executors/utilities/ng-compiler-cli.js +28 -0
- package/src/generators/application/application.js +7 -17
- package/src/generators/application/files/base/tsconfig.app.json__tpl__ +1 -1
- package/src/generators/application/files/base/tsconfig.json__tpl__ +3 -2
- package/src/generators/application/files/ng-module/src/app/app.module.ts__tpl__ +1 -1
- package/src/generators/application/files/ng-module/src/app/nx-welcome.component.ts__tpl__ +2 -2
- package/src/generators/application/files/ng-module/src/main.ts__tpl__ +2 -8
- package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +2 -2
- package/src/generators/application/files/standalone-components/src/app/nx-welcome.component.ts__tpl__ +2 -2
- package/src/generators/application/lib/add-e2e.js +7 -1
- package/src/generators/application/lib/add-unit-test-runner.js +11 -1
- package/src/generators/application/lib/create-files.js +10 -5
- package/src/generators/application/lib/create-project.js +46 -38
- package/src/generators/application/lib/normalize-options.d.ts +1 -1
- package/src/generators/application/lib/normalize-options.js +14 -3
- package/src/generators/application/lib/normalized-schema.d.ts +2 -0
- package/src/generators/application/schema.d.ts +1 -0
- package/src/generators/application/schema.json +13 -6
- package/src/generators/component/component.js +0 -1
- package/src/generators/component/lib/index.d.ts +0 -1
- package/src/generators/component/lib/index.js +0 -1
- package/src/generators/component/lib/normalize-options.js +1 -0
- package/src/generators/component/schema.json +2 -2
- package/src/generators/directive/directive.js +0 -1
- package/src/generators/directive/lib/index.d.ts +0 -1
- package/src/generators/directive/lib/index.js +0 -1
- package/src/generators/directive/lib/normalize-options.js +1 -0
- package/src/generators/directive/schema.json +2 -2
- package/src/generators/federate-module/federate-module.js +1 -0
- package/src/generators/federate-module/lib/add-remote.d.ts +1 -1
- package/src/generators/federate-module/lib/add-remote.js +2 -11
- package/src/generators/federate-module/schema.json +9 -9
- package/src/generators/host/files/common/v17+/src/main.server.ts__tmpl__ +67 -0
- package/src/generators/host/host.js +5 -9
- package/src/generators/host/lib/index.d.ts +1 -1
- package/src/generators/host/lib/index.js +1 -1
- package/src/generators/host/lib/update-ssr-setup.d.ts +3 -0
- package/src/generators/host/lib/{add-ssr.js → update-ssr-setup.js} +8 -14
- package/src/generators/host/schema.json +2 -2
- package/src/generators/library/lib/normalize-options.js +1 -0
- package/src/generators/library/library.js +10 -6
- package/src/generators/library/schema.json +12 -12
- package/src/generators/ng-add/migrators/projects/app.migrator.js +50 -7
- package/src/generators/ngrx/lib/generate-files.js +1 -10
- package/src/generators/ngrx/lib/validate-options.js +0 -23
- package/src/generators/ngrx/schema.json +2 -2
- package/src/generators/ngrx-feature-store/lib/generate-files.js +1 -12
- package/src/generators/ngrx-feature-store/lib/validate-options.js +0 -22
- package/src/generators/ngrx-feature-store/schema.json +2 -2
- package/src/generators/ngrx-root-store/lib/normalize-options.js +1 -1
- package/src/generators/ngrx-root-store/lib/validate-options.js +0 -15
- package/src/generators/ngrx-root-store/schema.json +1 -1
- package/src/generators/pipe/lib/index.d.ts +0 -1
- package/src/generators/pipe/lib/index.js +0 -1
- package/src/generators/pipe/lib/normalize-options.js +1 -0
- package/src/generators/pipe/pipe.js +0 -1
- package/src/generators/pipe/schema.json +2 -2
- package/src/generators/remote/files/common/v17+/src/main.server.ts__tmpl__ +74 -0
- package/src/generators/remote/lib/index.d.ts +1 -1
- package/src/generators/remote/lib/index.js +1 -1
- package/src/generators/remote/lib/{add-ssr.d.ts → update-ssr-setup.d.ts} +1 -1
- package/src/generators/remote/lib/{add-ssr.js → update-ssr-setup.js} +9 -13
- package/src/generators/remote/remote.js +4 -9
- package/src/generators/remote/schema.json +2 -2
- package/src/generators/scam-to-standalone/scam-to-standalone.js +0 -7
- package/src/generators/scam-to-standalone/schema.json +1 -1
- package/src/generators/setup-mf/lib/add-remote-entry.js +2 -11
- package/src/generators/setup-mf/lib/fix-bootstrap.js +3 -12
- package/src/generators/setup-mf/lib/index.d.ts +1 -1
- package/src/generators/setup-mf/lib/index.js +1 -1
- package/src/generators/setup-mf/lib/normalize-options.js +1 -0
- package/src/generators/{component/lib/validate-options.d.ts → setup-mf/lib/update-tsconfig.d.ts} +1 -1
- package/src/generators/setup-mf/lib/update-tsconfig.js +19 -0
- package/src/generators/setup-mf/schema.json +2 -2
- package/src/generators/setup-mf/setup-mf.js +1 -7
- package/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ +54 -0
- package/src/generators/setup-ssr/files/{ngmodule/base → server/server-builder/pre-v17}/__serverFileName__ +3 -4
- package/src/generators/setup-ssr/files/{standalone → server/server-builder/v17+}/__serverFileName__ +25 -16
- package/src/generators/setup-ssr/lib/add-dependencies.d.ts +2 -0
- package/src/generators/setup-ssr/lib/add-dependencies.js +32 -0
- package/src/generators/setup-ssr/lib/generate-files.d.ts +1 -1
- package/src/generators/setup-ssr/lib/generate-files.js +10 -13
- package/src/generators/setup-ssr/lib/generate-server-ts-config.d.ts +4 -0
- package/src/generators/setup-ssr/lib/generate-server-ts-config.js +26 -0
- package/src/generators/setup-ssr/lib/index.d.ts +3 -0
- package/src/generators/setup-ssr/lib/index.js +3 -0
- package/src/generators/setup-ssr/lib/normalize-options.js +7 -1
- package/src/generators/setup-ssr/lib/set-router-initial-navigation.d.ts +3 -0
- package/src/generators/setup-ssr/lib/set-router-initial-navigation.js +93 -0
- package/src/generators/setup-ssr/lib/update-project-config.d.ts +2 -1
- package/src/generators/setup-ssr/lib/update-project-config.js +24 -6
- package/src/generators/setup-ssr/lib/validate-options.js +15 -2
- package/src/generators/setup-ssr/schema.json +3 -3
- package/src/generators/setup-ssr/setup-ssr.js +16 -12
- package/src/generators/utils/create-ts-config.d.ts +1 -0
- package/src/generators/utils/create-ts-config.js +2 -3
- package/src/generators/utils/project.js +4 -4
- package/src/generators/utils/testing.js +12 -0
- package/src/generators/utils/validations.d.ts +0 -1
- package/src/generators/utils/validations.js +1 -14
- package/src/generators/utils/version-utils.js +2 -2
- package/src/migrations/update-17-1-0/browser-target-to-build-target.d.ts +3 -0
- package/src/migrations/update-17-1-0/browser-target-to-build-target.js +50 -0
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.d.ts +2 -0
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.js +75 -0
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.d.ts +2 -0
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.js +185 -0
- package/src/migrations/update-17-1-0/stub-performance-mark-in-jest-test-setup.d.ts +2 -0
- package/src/migrations/update-17-1-0/stub-performance-mark-in-jest-test-setup.js +63 -0
- package/src/migrations/update-17-1-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-17-1-0/update-angular-cli.js +23 -0
- package/src/utils/backward-compatible-versions.d.ts +1 -1
- package/src/utils/backward-compatible-versions.js +18 -18
- package/src/utils/nx-devkit/ast-utils.js +4 -2
- package/src/utils/versions.d.ts +6 -6
- package/src/utils/versions.js +6 -6
- package/src/builders/webpack-browser/validate-options.d.ts +0 -2
- package/src/builders/webpack-browser/validate-options.js +0 -40
- package/src/executors/browser-esbuild/lib/validate-options.d.ts +0 -2
- package/src/executors/browser-esbuild/lib/validate-options.js +0 -40
- package/src/generators/application/files/tsconfig.editor.json__tpl__ +0 -5
- package/src/generators/application/files/v14/.browserlistrc__tpl__ +0 -16
- package/src/generators/application/files/v14/src/environments/environment.prod.ts__tpl__ +0 -3
- package/src/generators/application/files/v14/src/environments/environment.ts__tpl__ +0 -16
- package/src/generators/application/files/v14/src/polyfills.ts__tpl__ +0 -53
- package/src/generators/component/lib/validate-options.js +0 -8
- package/src/generators/directive/lib/validate-options.d.ts +0 -3
- package/src/generators/directive/lib/validate-options.js +0 -8
- package/src/generators/host/lib/add-ssr.d.ts +0 -3
- package/src/generators/ngrx/files/no-inject/__directory__/__fileName__.effects.ts__tmpl__ +0 -22
- package/src/generators/ngrx/files/no-inject/__directory__/__fileName__.facade.ts__tmpl__ +0 -27
- package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.effects.ts__tmpl__ +0 -22
- package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.facade.ts__tmpl__ +0 -27
- package/src/generators/pipe/lib/validate-options.d.ts +0 -3
- package/src/generators/pipe/lib/validate-options.js +0 -8
- package/src/generators/setup-mf/lib/set-tsconfig-target.d.ts +0 -3
- package/src/generators/setup-mf/lib/set-tsconfig-target.js +0 -16
- package/src/generators/setup-ssr/files/ngmodule/v14/src/__main__ +0 -11
- /package/src/generators/host/files/common/{src → pre-v17/src}/main.server.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.actions.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.effects.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.effects.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.facade.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.facade.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.models.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.reducer.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.reducer.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.selectors.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.selectors.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.actions.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.effects.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.effects.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.facade.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.facade.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.models.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.reducer.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.reducer.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.selectors.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.selectors.ts__tmpl__ +0 -0
- /package/src/generators/remote/files/common/{src → pre-v17/src}/main.server.ts__tmpl__ +0 -0
- /package/src/generators/setup-ssr/files/{base → root}/tsconfig.server.json__tpl__ +0 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const version_utils_1 = require("../../generators/utils/version-utils");
|
|
6
|
+
const projects_1 = require("../utils/projects");
|
|
7
|
+
const UNIVERSAL_PACKAGES = [
|
|
8
|
+
'@nguniversal/common',
|
|
9
|
+
'@nguniversal/express-engine',
|
|
10
|
+
];
|
|
11
|
+
/**
|
|
12
|
+
* Regexp to match Universal packages.
|
|
13
|
+
* @nguniversal/common/engine
|
|
14
|
+
* @nguniversal/common
|
|
15
|
+
* @nguniversal/express-engine
|
|
16
|
+
**/
|
|
17
|
+
const NGUNIVERSAL_PACKAGE_REGEXP = /@nguniversal\/(common(\/engine)?|express-engine)/g;
|
|
18
|
+
async function default_1(tree) {
|
|
19
|
+
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
20
|
+
if (!UNIVERSAL_PACKAGES.some((pkg) => packageJson.dependencies?.[pkg] || packageJson.devDependencies?.[pkg])) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const projects = await (0, projects_1.getProjectsFilteredByDependencies)(tree, [
|
|
24
|
+
'npm:@angular/core',
|
|
25
|
+
]);
|
|
26
|
+
for (const { project } of projects) {
|
|
27
|
+
if (project.projectType !== 'application') {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const serverMainFiles = new Map();
|
|
31
|
+
for (const target of Object.values(project.targets ?? {})) {
|
|
32
|
+
if (target.executor !== '@angular-devkit/build-angular:server') {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const outputPath = project.targets.build?.options?.outputPath;
|
|
36
|
+
for (const [, { main }] of allTargetOptions(target)) {
|
|
37
|
+
if (typeof main === 'string' &&
|
|
38
|
+
typeof outputPath === 'string' &&
|
|
39
|
+
tree.read(main, 'utf-8').includes('ngExpressEngine')) {
|
|
40
|
+
serverMainFiles.set(main, outputPath);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// Replace all import specifiers in all files.
|
|
45
|
+
let hasExpressTokens = false;
|
|
46
|
+
const root = project.sourceRoot ?? `${project.root}/src`;
|
|
47
|
+
const tokensFilePath = `${root}/express.tokens.ts`;
|
|
48
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, root, (path) => {
|
|
49
|
+
const content = tree.read(path, 'utf8');
|
|
50
|
+
let updatedContent = content;
|
|
51
|
+
// Check if file is importing tokens
|
|
52
|
+
if (content.includes('@nguniversal/express-engine/tokens')) {
|
|
53
|
+
hasExpressTokens ||= true;
|
|
54
|
+
let tokensFileRelativePath = (0, path_1.relative)((0, path_1.dirname)((0, devkit_1.normalizePath)(path)), (0, devkit_1.normalizePath)(tokensFilePath));
|
|
55
|
+
if (tokensFileRelativePath.charAt(0) !== '.') {
|
|
56
|
+
tokensFileRelativePath = './' + tokensFileRelativePath;
|
|
57
|
+
}
|
|
58
|
+
updatedContent = updatedContent.replaceAll('@nguniversal/express-engine/tokens', tokensFileRelativePath.slice(0, -3));
|
|
59
|
+
}
|
|
60
|
+
updatedContent = updatedContent.replaceAll(NGUNIVERSAL_PACKAGE_REGEXP, '@angular/ssr');
|
|
61
|
+
tree.write(path, updatedContent);
|
|
62
|
+
});
|
|
63
|
+
// Replace server file and add tokens file if needed
|
|
64
|
+
for (const [path, outputPath] of serverMainFiles.entries()) {
|
|
65
|
+
tree.rename(path, path + '.bak');
|
|
66
|
+
tree.write(path, getServerFileContents(outputPath, hasExpressTokens));
|
|
67
|
+
if (hasExpressTokens) {
|
|
68
|
+
tree.write(tokensFilePath, TOKENS_FILE_CONTENT);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Remove universal packages from deps
|
|
73
|
+
for (const name of UNIVERSAL_PACKAGES) {
|
|
74
|
+
(0, devkit_1.removeDependenciesFromPackageJson)(tree, [name], [name]);
|
|
75
|
+
}
|
|
76
|
+
const pkgVersions = (0, version_utils_1.versions)(tree);
|
|
77
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
78
|
+
'@angular/ssr': (0, version_utils_1.getInstalledPackageVersionInfo)(tree, '@angular-devkit/build-angular')
|
|
79
|
+
?.version ?? pkgVersions.angularDevkitVersion,
|
|
80
|
+
}, {});
|
|
81
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
82
|
+
}
|
|
83
|
+
exports.default = default_1;
|
|
84
|
+
function* allTargetOptions(target) {
|
|
85
|
+
if (target.options) {
|
|
86
|
+
yield [undefined, target.options];
|
|
87
|
+
}
|
|
88
|
+
if (!target.configurations) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
for (const [name, options] of Object.entries(target.configurations)) {
|
|
92
|
+
if (options !== undefined) {
|
|
93
|
+
yield [name, options];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const TOKENS_FILE_CONTENT = `
|
|
98
|
+
import { InjectionToken } from '@angular/core';
|
|
99
|
+
import { Request, Response } from 'express';
|
|
100
|
+
|
|
101
|
+
export const REQUEST = new InjectionToken<Request>('REQUEST');
|
|
102
|
+
export const RESPONSE = new InjectionToken<Response>('RESPONSE');
|
|
103
|
+
`;
|
|
104
|
+
function getServerFileContents(outputPath, hasExpressTokens) {
|
|
105
|
+
return (`
|
|
106
|
+
import 'zone.js/node';
|
|
107
|
+
|
|
108
|
+
import { APP_BASE_HREF } from '@angular/common';
|
|
109
|
+
import { CommonEngine } from '@angular/ssr';
|
|
110
|
+
import * as express from 'express';
|
|
111
|
+
import { existsSync } from 'node:fs';
|
|
112
|
+
import { join } from 'node:path';
|
|
113
|
+
import bootstrap from './src/main.server';` +
|
|
114
|
+
(hasExpressTokens
|
|
115
|
+
? `\nimport { REQUEST, RESPONSE } from './src/express.tokens';`
|
|
116
|
+
: '') +
|
|
117
|
+
`
|
|
118
|
+
|
|
119
|
+
// The Express app is exported so that it can be used by serverless Functions.
|
|
120
|
+
export function app(): express.Express {
|
|
121
|
+
const server = express();
|
|
122
|
+
const distFolder = join(process.cwd(), '${outputPath}');
|
|
123
|
+
const indexHtml = existsSync(join(distFolder, 'index.original.html'))
|
|
124
|
+
? join(distFolder, 'index.original.html')
|
|
125
|
+
: join(distFolder, 'index.html');
|
|
126
|
+
|
|
127
|
+
const commonEngine = new CommonEngine();
|
|
128
|
+
|
|
129
|
+
server.set('view engine', 'html');
|
|
130
|
+
server.set('views', distFolder);
|
|
131
|
+
|
|
132
|
+
// Example Express Rest API endpoints
|
|
133
|
+
// server.get('/api/**', (req, res) => { });
|
|
134
|
+
// Serve static files from /browser
|
|
135
|
+
server.get('*.*', express.static(distFolder, {
|
|
136
|
+
maxAge: '1y'
|
|
137
|
+
}));
|
|
138
|
+
|
|
139
|
+
// All regular routes use the Angular engine
|
|
140
|
+
server.get('*', (req, res, next) => {
|
|
141
|
+
const { protocol, originalUrl, baseUrl, headers } = req;
|
|
142
|
+
|
|
143
|
+
commonEngine
|
|
144
|
+
.render({
|
|
145
|
+
bootstrap,
|
|
146
|
+
documentFilePath: indexHtml,
|
|
147
|
+
url: \`\${protocol}://\${headers.host}\${originalUrl}\`,
|
|
148
|
+
publicPath: distFolder,
|
|
149
|
+
providers: [
|
|
150
|
+
{ provide: APP_BASE_HREF, useValue: baseUrl },` +
|
|
151
|
+
(hasExpressTokens
|
|
152
|
+
? '\n { provide: RESPONSE, useValue: res },\n { provide: REQUEST, useValue: req }\n'
|
|
153
|
+
: '') +
|
|
154
|
+
`],
|
|
155
|
+
})
|
|
156
|
+
.then((html) => res.send(html))
|
|
157
|
+
.catch((err) => next(err));
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
return server;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function run(): void {
|
|
164
|
+
const port = process.env['PORT'] || 4000;
|
|
165
|
+
|
|
166
|
+
// Start up the Node server
|
|
167
|
+
const server = app();
|
|
168
|
+
server.listen(port, () => {
|
|
169
|
+
console.log(\`Node Express server listening on http://localhost:\${port}\`);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Webpack will replace 'require' with '__webpack_require__'
|
|
174
|
+
// '__non_webpack_require__' is a proxy to Node 'require'
|
|
175
|
+
// The below code is to ensure that the server is run only when not requiring the bundle.
|
|
176
|
+
declare const __non_webpack_require__: NodeRequire;
|
|
177
|
+
const mainModule = __non_webpack_require__.main;
|
|
178
|
+
const moduleFilename = mainModule && mainModule.filename || '';
|
|
179
|
+
if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
|
|
180
|
+
run();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export default bootstrap;
|
|
184
|
+
`);
|
|
185
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
5
|
+
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const ts = require("typescript");
|
|
8
|
+
const projects_1 = require("../utils/projects");
|
|
9
|
+
async function default_1(tree) {
|
|
10
|
+
const angularProjects = await (0, projects_1.getProjectsFilteredByDependencies)(tree, [
|
|
11
|
+
'npm:@angular/core',
|
|
12
|
+
]);
|
|
13
|
+
const jestConfigFiles = new Set();
|
|
14
|
+
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
15
|
+
(0, executor_options_utils_1.forEachExecutorOptionsInGraph)(projectGraph, '@nx/jest:jest', (options, projectName) => {
|
|
16
|
+
const projectConfig = angularProjects.find(({ project }) => projectName === project.name);
|
|
17
|
+
if (!projectConfig) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (options.jestConfig && tree.exists(options.jestConfig)) {
|
|
21
|
+
jestConfigFiles.add(options.jestConfig);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const setupFilePaths = [];
|
|
25
|
+
for (const jestConfigFile of jestConfigFiles) {
|
|
26
|
+
const projectSetupFilePaths = getSetupFilePaths(tree, jestConfigFile);
|
|
27
|
+
setupFilePaths.push(...projectSetupFilePaths);
|
|
28
|
+
}
|
|
29
|
+
for (const setupFilePath of setupFilePaths) {
|
|
30
|
+
if (!tree.exists(setupFilePath)) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
updateSetupFileWithPerformanceMarkStub(tree, setupFilePath);
|
|
34
|
+
}
|
|
35
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
36
|
+
}
|
|
37
|
+
exports.default = default_1;
|
|
38
|
+
function getSetupFilePaths(tree, jestConfigFile) {
|
|
39
|
+
const config = tree.read(jestConfigFile, 'utf-8');
|
|
40
|
+
const TS_QUERY_JEST_CONFIG_PREFIX = ':matches(ExportAssignment, BinaryExpression:has(Identifier[name="module"]):has(Identifier[name="exports"]))';
|
|
41
|
+
const setupFilePathNodes = tsquery_1.tsquery.query(config, `${TS_QUERY_JEST_CONFIG_PREFIX} > ObjectLiteralExpression PropertyAssignment:has(Identifier[name="setupFilesAfterEnv"]) > ArrayLiteralExpression StringLiteral`);
|
|
42
|
+
const rootDir = (0, path_1.dirname)(jestConfigFile);
|
|
43
|
+
const setupFilePaths = setupFilePathNodes.map((node) => node.text.replace('<rootDir>', rootDir));
|
|
44
|
+
return setupFilePaths;
|
|
45
|
+
}
|
|
46
|
+
function updateSetupFileWithPerformanceMarkStub(tree, setupFilePath) {
|
|
47
|
+
const setupFile = tree.read(setupFilePath, 'utf-8');
|
|
48
|
+
const setupFileSource = ts.createSourceFile(setupFilePath, setupFile, ts.ScriptTarget.Latest);
|
|
49
|
+
const TS_QUERY_PERFORMANCE_MARK_ACCESS = 'PropertyAccessExpression:has(Identifier[name=performance]):has(Identifier[name=mark])';
|
|
50
|
+
const TS_QUERY_PERFORMANCE_MARK_ASSIGNMENT = 'PropertyAccessExpression:has(Identifier[name=performance]) + EqualsToken + ObjectLiteralExpression:has(PropertyAssignment Identifier[name=mark])';
|
|
51
|
+
const performanceMarkNodes = tsquery_1.tsquery.query(setupFileSource, `:matches(${TS_QUERY_PERFORMANCE_MARK_ACCESS}, ${TS_QUERY_PERFORMANCE_MARK_ASSIGNMENT})`);
|
|
52
|
+
// there is already some access to performance.mark, so we assume it was handled already
|
|
53
|
+
if (performanceMarkNodes.length) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
tree.write(setupFilePath, `${setupFile}
|
|
57
|
+
/**
|
|
58
|
+
* Angular uses performance.mark() which is not supported by jsdom. Stub it out
|
|
59
|
+
* to avoid errors.
|
|
60
|
+
*/
|
|
61
|
+
global.performance.mark = jest.fn();
|
|
62
|
+
`);
|
|
63
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.angularCliVersion = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
exports.angularCliVersion = '~17.0.0-rc.4';
|
|
6
|
+
async function default_1(tree) {
|
|
7
|
+
let shouldFormat = false;
|
|
8
|
+
(0, devkit_1.updateJson)(tree, 'package.json', (json) => {
|
|
9
|
+
if (json.devDependencies?.['@angular/cli']) {
|
|
10
|
+
json.devDependencies['@angular/cli'] = exports.angularCliVersion;
|
|
11
|
+
shouldFormat = true;
|
|
12
|
+
}
|
|
13
|
+
else if (json.dependencies?.['@angular/cli']) {
|
|
14
|
+
json.dependencies['@angular/cli'] = exports.angularCliVersion;
|
|
15
|
+
shouldFormat = true;
|
|
16
|
+
}
|
|
17
|
+
return json;
|
|
18
|
+
});
|
|
19
|
+
if (shouldFormat) {
|
|
20
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.default = default_1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as latestVersions from './versions';
|
|
2
|
-
type SupportedVersions = '
|
|
2
|
+
type SupportedVersions = 'angularV15' | 'angularV16';
|
|
3
3
|
export type PackageVersionNames = Exclude<keyof typeof latestVersions, 'nxVersion'>;
|
|
4
4
|
export type PackageVersions = Record<PackageVersionNames, string>;
|
|
5
5
|
export declare const backwardCompatibleVersions: Record<SupportedVersions, PackageVersions>;
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.backwardCompatibleVersions = void 0;
|
|
4
4
|
exports.backwardCompatibleVersions = {
|
|
5
|
-
|
|
6
|
-
angularVersion: '~
|
|
7
|
-
angularDevkitVersion: '~
|
|
8
|
-
ngPackagrVersion: '~
|
|
9
|
-
ngrxVersion: '~
|
|
5
|
+
angularV15: {
|
|
6
|
+
angularVersion: '~15.2.0',
|
|
7
|
+
angularDevkitVersion: '~15.2.0',
|
|
8
|
+
ngPackagrVersion: '~15.2.2',
|
|
9
|
+
ngrxVersion: '~15.3.0',
|
|
10
10
|
rxjsVersion: '~7.8.0',
|
|
11
|
-
zoneJsVersion: '~0.
|
|
11
|
+
zoneJsVersion: '~0.12.0',
|
|
12
12
|
angularJsVersion: '1.7.9',
|
|
13
13
|
tsLibVersion: '^2.3.0',
|
|
14
|
-
ngUniversalVersion: '~
|
|
14
|
+
ngUniversalVersion: '~15.1.0',
|
|
15
15
|
corsVersion: '~2.8.5',
|
|
16
16
|
typesCorsVersion: '~2.8.5',
|
|
17
17
|
expressVersion: '~4.18.2',
|
|
18
18
|
typesExpressVersion: '4.17.14',
|
|
19
19
|
moduleFederationNodeVersion: '~1.0.5',
|
|
20
|
-
angularEslintVersion: '~
|
|
20
|
+
angularEslintVersion: '~15.0.0',
|
|
21
21
|
tailwindVersion: '^3.0.2',
|
|
22
22
|
postcssVersion: '^8.4.5',
|
|
23
23
|
postcssImportVersion: '~14.1.0',
|
|
@@ -25,27 +25,27 @@ exports.backwardCompatibleVersions = {
|
|
|
25
25
|
postcssUrlVersion: '~10.1.3',
|
|
26
26
|
autoprefixerVersion: '^10.4.0',
|
|
27
27
|
tsNodeVersion: '10.9.1',
|
|
28
|
-
jestPresetAngularVersion: '~
|
|
28
|
+
jestPresetAngularVersion: '~13.0.0',
|
|
29
29
|
typesNodeVersion: '16.11.7',
|
|
30
30
|
jasmineMarblesVersion: '^0.9.2',
|
|
31
31
|
jsoncEslintParserVersion: '^2.1.0',
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
angularVersion: '~
|
|
35
|
-
angularDevkitVersion: '~
|
|
36
|
-
ngPackagrVersion: '~
|
|
37
|
-
ngrxVersion: '~
|
|
33
|
+
angularV16: {
|
|
34
|
+
angularVersion: '~16.2.0',
|
|
35
|
+
angularDevkitVersion: '~16.2.0',
|
|
36
|
+
ngPackagrVersion: '~16.2.0',
|
|
37
|
+
ngrxVersion: '~16.0.0',
|
|
38
38
|
rxjsVersion: '~7.8.0',
|
|
39
|
-
zoneJsVersion: '~0.
|
|
39
|
+
zoneJsVersion: '~0.13.0',
|
|
40
40
|
angularJsVersion: '1.7.9',
|
|
41
41
|
tsLibVersion: '^2.3.0',
|
|
42
|
-
ngUniversalVersion: '~
|
|
42
|
+
ngUniversalVersion: '~16.2.0',
|
|
43
43
|
corsVersion: '~2.8.5',
|
|
44
44
|
typesCorsVersion: '~2.8.5',
|
|
45
45
|
expressVersion: '~4.18.2',
|
|
46
46
|
typesExpressVersion: '4.17.14',
|
|
47
47
|
moduleFederationNodeVersion: '~1.0.5',
|
|
48
|
-
angularEslintVersion: '~
|
|
48
|
+
angularEslintVersion: '~16.0.0',
|
|
49
49
|
tailwindVersion: '^3.0.2',
|
|
50
50
|
postcssVersion: '^8.4.5',
|
|
51
51
|
postcssImportVersion: '~14.1.0',
|
|
@@ -53,7 +53,7 @@ exports.backwardCompatibleVersions = {
|
|
|
53
53
|
postcssUrlVersion: '~10.1.3',
|
|
54
54
|
autoprefixerVersion: '^10.4.0',
|
|
55
55
|
tsNodeVersion: '10.9.1',
|
|
56
|
-
jestPresetAngularVersion: '~13.
|
|
56
|
+
jestPresetAngularVersion: '~13.1.0',
|
|
57
57
|
typesNodeVersion: '16.11.7',
|
|
58
58
|
jasmineMarblesVersion: '^0.9.2',
|
|
59
59
|
jsoncEslintParserVersion: '^2.1.0',
|
|
@@ -416,7 +416,8 @@ function getListOfRoutes(source) {
|
|
|
416
416
|
}
|
|
417
417
|
function isNgStandaloneApp(tree, projectName) {
|
|
418
418
|
const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
|
419
|
-
const mainFile = project.targets?.build?.options?.main
|
|
419
|
+
const mainFile = project.targets?.build?.options?.main ??
|
|
420
|
+
project.targets?.build?.options?.browser;
|
|
420
421
|
if (project.projectType !== 'application' || !mainFile) {
|
|
421
422
|
return false;
|
|
422
423
|
}
|
|
@@ -515,7 +516,8 @@ function readBootstrapInfo(host, app) {
|
|
|
515
516
|
const config = (0, devkit_1.readProjectConfiguration)(host, app);
|
|
516
517
|
let mainPath;
|
|
517
518
|
try {
|
|
518
|
-
mainPath =
|
|
519
|
+
mainPath =
|
|
520
|
+
config.targets.build.options.main ?? config.targets.build.options.browser;
|
|
519
521
|
}
|
|
520
522
|
catch (e) {
|
|
521
523
|
throw new Error('Main file cannot be located');
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const angularVersion = "~
|
|
3
|
-
export declare const angularDevkitVersion = "~
|
|
4
|
-
export declare const ngPackagrVersion = "~
|
|
2
|
+
export declare const angularVersion = "~17.0.0-rc.3";
|
|
3
|
+
export declare const angularDevkitVersion = "~17.0.0-rc.4";
|
|
4
|
+
export declare const ngPackagrVersion = "~17.0.0-rc.1";
|
|
5
5
|
export declare const ngrxVersion = "~16.0.0";
|
|
6
6
|
export declare const rxjsVersion = "~7.8.0";
|
|
7
|
-
export declare const zoneJsVersion = "~0.
|
|
7
|
+
export declare const zoneJsVersion = "~0.14.0";
|
|
8
8
|
export declare const angularJsVersion = "1.7.9";
|
|
9
9
|
export declare const tsLibVersion = "^2.3.0";
|
|
10
10
|
export declare const ngUniversalVersion = "~16.2.0";
|
|
@@ -13,7 +13,7 @@ export declare const typesCorsVersion = "~2.8.5";
|
|
|
13
13
|
export declare const expressVersion = "~4.18.2";
|
|
14
14
|
export declare const typesExpressVersion = "4.17.14";
|
|
15
15
|
export declare const moduleFederationNodeVersion = "~1.0.5";
|
|
16
|
-
export declare const angularEslintVersion = "~
|
|
16
|
+
export declare const angularEslintVersion = "~17.0.0-alpha.0";
|
|
17
17
|
export declare const tailwindVersion = "^3.0.2";
|
|
18
18
|
export declare const postcssVersion = "^8.4.5";
|
|
19
19
|
export declare const postcssImportVersion = "~14.1.0";
|
|
@@ -21,7 +21,7 @@ export declare const postcssPresetEnvVersion = "~7.5.0";
|
|
|
21
21
|
export declare const postcssUrlVersion = "~10.1.3";
|
|
22
22
|
export declare const autoprefixerVersion = "^10.4.0";
|
|
23
23
|
export declare const tsNodeVersion = "10.9.1";
|
|
24
|
-
export declare const jestPresetAngularVersion = "~13.1.
|
|
24
|
+
export declare const jestPresetAngularVersion = "~13.1.3";
|
|
25
25
|
export declare const typesNodeVersion = "16.11.7";
|
|
26
26
|
export declare const jasmineMarblesVersion = "^0.9.2";
|
|
27
27
|
export declare const jsoncEslintParserVersion = "^2.1.0";
|
package/src/utils/versions.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssPresetEnvVersion = exports.postcssImportVersion = exports.postcssVersion = exports.tailwindVersion = exports.angularEslintVersion = exports.moduleFederationNodeVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.ngUniversalVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
-
exports.angularVersion = '~
|
|
6
|
-
exports.angularDevkitVersion = '~
|
|
7
|
-
exports.ngPackagrVersion = '~
|
|
5
|
+
exports.angularVersion = '~17.0.0-rc.3';
|
|
6
|
+
exports.angularDevkitVersion = '~17.0.0-rc.4';
|
|
7
|
+
exports.ngPackagrVersion = '~17.0.0-rc.1';
|
|
8
8
|
exports.ngrxVersion = '~16.0.0';
|
|
9
9
|
exports.rxjsVersion = '~7.8.0';
|
|
10
|
-
exports.zoneJsVersion = '~0.
|
|
10
|
+
exports.zoneJsVersion = '~0.14.0';
|
|
11
11
|
exports.angularJsVersion = '1.7.9';
|
|
12
12
|
exports.tsLibVersion = '^2.3.0';
|
|
13
13
|
exports.ngUniversalVersion = '~16.2.0';
|
|
@@ -16,7 +16,7 @@ exports.typesCorsVersion = '~2.8.5';
|
|
|
16
16
|
exports.expressVersion = '~4.18.2';
|
|
17
17
|
exports.typesExpressVersion = '4.17.14';
|
|
18
18
|
exports.moduleFederationNodeVersion = '~1.0.5';
|
|
19
|
-
exports.angularEslintVersion = '~
|
|
19
|
+
exports.angularEslintVersion = '~17.0.0-alpha.0';
|
|
20
20
|
exports.tailwindVersion = '^3.0.2';
|
|
21
21
|
exports.postcssVersion = '^8.4.5';
|
|
22
22
|
exports.postcssImportVersion = '~14.1.0';
|
|
@@ -24,7 +24,7 @@ exports.postcssPresetEnvVersion = '~7.5.0';
|
|
|
24
24
|
exports.postcssUrlVersion = '~10.1.3';
|
|
25
25
|
exports.autoprefixerVersion = '^10.4.0';
|
|
26
26
|
exports.tsNodeVersion = '10.9.1';
|
|
27
|
-
exports.jestPresetAngularVersion = '~13.1.
|
|
27
|
+
exports.jestPresetAngularVersion = '~13.1.3';
|
|
28
28
|
exports.typesNodeVersion = '16.11.7';
|
|
29
29
|
exports.jasmineMarblesVersion = '^0.9.2';
|
|
30
30
|
exports.jsoncEslintParserVersion = '^2.1.0';
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateOptions = void 0;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const angular_version_utils_1 = require("../../executors/utilities/angular-version-utils");
|
|
7
|
-
function validateOptions(options) {
|
|
8
|
-
const angularVersionInfo = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
9
|
-
validatePolyfills(options, angularVersionInfo);
|
|
10
|
-
validateStyles(options, angularVersionInfo);
|
|
11
|
-
}
|
|
12
|
-
exports.validateOptions = validateOptions;
|
|
13
|
-
function validatePolyfills(options, { major, version }) {
|
|
14
|
-
if (major < 15 && Array.isArray(options.polyfills)) {
|
|
15
|
-
throw new Error((0, devkit_1.stripIndents) `The array syntax for the "polyfills" option is supported from Angular >= 15.0.0. You are currently using "${version}".
|
|
16
|
-
You can resolve this error by removing the "polyfills" option, setting it to a string value or migrating to Angular 15.0.0.`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function validateStyles(options, { major, version }) {
|
|
20
|
-
if (!options.styles || !options.styles.length) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
if (major < 15) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const stylusFiles = [];
|
|
27
|
-
options.styles.forEach((style) => {
|
|
28
|
-
const styleFile = typeof style === 'string' ? style : style.input;
|
|
29
|
-
if ((0, path_1.extname)(styleFile) === '.styl') {
|
|
30
|
-
stylusFiles.push(styleFile);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
if (stylusFiles.length) {
|
|
34
|
-
throw new Error((0, devkit_1.stripIndents) `Stylus is not supported since Angular v15. You're currently using "${version}".
|
|
35
|
-
You have the "styles" option with the following file(s) using the ".styl" extension: ${stylusFiles
|
|
36
|
-
.map((x) => `"${x}"`)
|
|
37
|
-
.join(', ')}.
|
|
38
|
-
Make sure to convert them to a supported extension (".css", ".scss", ".sass", ".less").`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateOptions = void 0;
|
|
4
|
-
const angular_version_utils_1 = require("../../utilities/angular-version-utils");
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const path_1 = require("path");
|
|
7
|
-
function validateOptions(options) {
|
|
8
|
-
const angularVersionInfo = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
9
|
-
validatePolyfills(options, angularVersionInfo);
|
|
10
|
-
validateStyles(options, angularVersionInfo);
|
|
11
|
-
}
|
|
12
|
-
exports.validateOptions = validateOptions;
|
|
13
|
-
function validatePolyfills(options, { major, version }) {
|
|
14
|
-
if (major < 15 && Array.isArray(options.polyfills)) {
|
|
15
|
-
throw new Error((0, devkit_1.stripIndents) `The array syntax for the "polyfills" option is supported from Angular >= 15.0.0. You are currently using "${version}".
|
|
16
|
-
You can resolve this error by removing the "polyfills" option, setting it to a string value or migrating to Angular 15.0.0.`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function validateStyles(options, { major, version }) {
|
|
20
|
-
if (!options.styles || !options.styles.length) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
if (major < 15) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const stylusFiles = [];
|
|
27
|
-
options.styles.forEach((style) => {
|
|
28
|
-
const styleFile = typeof style === 'string' ? style : style.input;
|
|
29
|
-
if ((0, path_1.extname)(styleFile) === '.styl') {
|
|
30
|
-
stylusFiles.push(styleFile);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
if (stylusFiles.length) {
|
|
34
|
-
throw new Error((0, devkit_1.stripIndents) `Stylus is not supported since Angular v15. You're currently using "${version}".
|
|
35
|
-
You have the "styles" option with the following file(s) using the ".styl" extension: ${stylusFiles
|
|
36
|
-
.map((x) => `"${x}"`)
|
|
37
|
-
.join(', ')}.
|
|
38
|
-
Make sure to convert them to a supported extension (".css", ".scss", ".sass", ".less").`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
|
2
|
-
# For additional information regarding the format and rule options, please see:
|
|
3
|
-
# https://github.com/browserslist/browserslist#queries
|
|
4
|
-
|
|
5
|
-
# For the full list of supported browsers by the Angular framework, please see:
|
|
6
|
-
# https://angular.io/guide/browser-support
|
|
7
|
-
|
|
8
|
-
# You can see what browsers were selected by your queries by running:
|
|
9
|
-
# npx browserslist
|
|
10
|
-
|
|
11
|
-
last 1 Chrome version
|
|
12
|
-
last 1 Firefox version
|
|
13
|
-
last 2 Edge major versions
|
|
14
|
-
last 2 Safari major versions
|
|
15
|
-
last 2 iOS major versions
|
|
16
|
-
Firefox ESR
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// This file can be replaced during build by using the `fileReplacements` array.
|
|
2
|
-
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
|
|
3
|
-
// The list of file replacements can be found in `angular.json`.
|
|
4
|
-
|
|
5
|
-
export const environment = {
|
|
6
|
-
production: false
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
* For easier debugging in development mode, you can import the following file
|
|
11
|
-
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
|
12
|
-
*
|
|
13
|
-
* This import should be commented out in production mode because it will have a negative impact
|
|
14
|
-
* on performance if an error is thrown.
|
|
15
|
-
*/
|
|
16
|
-
// import 'zone.js/plugins/zone-error';
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file includes polyfills needed by Angular and is loaded before the app.
|
|
3
|
-
* You can add your own extra polyfills to this file.
|
|
4
|
-
*
|
|
5
|
-
* This file is divided into 2 sections:
|
|
6
|
-
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
|
|
7
|
-
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
|
|
8
|
-
* file.
|
|
9
|
-
*
|
|
10
|
-
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
|
11
|
-
* automatically update themselves. This includes recent versions of Safari, Chrome (including
|
|
12
|
-
* Opera), Edge on the desktop, and iOS and Chrome on mobile.
|
|
13
|
-
*
|
|
14
|
-
* Learn more in https://angular.io/guide/browser-support
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/***************************************************************************************************
|
|
18
|
-
* BROWSER POLYFILLS
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* By default, zone.js will patch all possible macroTask and DomEvents
|
|
23
|
-
* user can disable parts of macroTask/DomEvents patch by setting following flags
|
|
24
|
-
* because those flags need to be set before `zone.js` being loaded, and webpack
|
|
25
|
-
* will put import in the top of bundle, so user need to create a separate file
|
|
26
|
-
* in this directory (for example: zone-flags.ts), and put the following flags
|
|
27
|
-
* into that file, and then add the following code before importing zone.js.
|
|
28
|
-
* import './zone-flags';
|
|
29
|
-
*
|
|
30
|
-
* The flags allowed in zone-flags.ts are listed here.
|
|
31
|
-
*
|
|
32
|
-
* The following flags will work for all browsers.
|
|
33
|
-
*
|
|
34
|
-
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
|
|
35
|
-
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
|
36
|
-
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
|
|
37
|
-
*
|
|
38
|
-
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
|
39
|
-
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
|
40
|
-
*
|
|
41
|
-
* (window as any).__Zone_enable_cross_context_check = true;
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
/***************************************************************************************************
|
|
46
|
-
* Zone JS is required by default for Angular itself.
|
|
47
|
-
*/
|
|
48
|
-
import 'zone.js'; // Included with Angular CLI.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/***************************************************************************************************
|
|
52
|
-
* APPLICATION IMPORTS
|
|
53
|
-
*/
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateOptions = void 0;
|
|
4
|
-
const validations_1 = require("../../utils/validations");
|
|
5
|
-
function validateOptions(tree, options) {
|
|
6
|
-
(0, validations_1.validateStandaloneOption)(tree, options.standalone);
|
|
7
|
-
}
|
|
8
|
-
exports.validateOptions = validateOptions;
|