@nx/angular 23.0.0-beta.11 → 23.0.0-beta.12
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/migrations.json +0 -533
- package/package.json +8 -8
- package/src/migrations/update-17-1-0/browser-target-to-build-target.d.ts +0 -4
- package/src/migrations/update-17-1-0/browser-target-to-build-target.d.ts.map +0 -1
- package/src/migrations/update-17-1-0/browser-target-to-build-target.js +0 -50
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.d.ts +0 -3
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.d.ts.map +0 -1
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.js +0 -75
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.d.ts +0 -3
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.d.ts.map +0 -1
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.js +0 -184
- package/src/migrations/update-17-1-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-17-1-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-17-1-0/update-angular-cli.js +0 -14
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.d.ts +0 -3
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.d.ts.map +0 -1
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.js +0 -37
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.d.ts +0 -3
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.d.ts.map +0 -1
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.js +0 -40
- package/src/migrations/update-17-3-0/add-autoprefixer-dependency.d.ts +0 -3
- package/src/migrations/update-17-3-0/add-autoprefixer-dependency.d.ts.map +0 -1
- package/src/migrations/update-17-3-0/add-autoprefixer-dependency.js +0 -25
- package/src/migrations/update-17-3-0/add-browser-sync-dependency.d.ts +0 -3
- package/src/migrations/update-17-3-0/add-browser-sync-dependency.d.ts.map +0 -1
- package/src/migrations/update-17-3-0/add-browser-sync-dependency.js +0 -25
- package/src/migrations/update-17-3-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-17-3-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-17-3-0/update-angular-cli.js +0 -14
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.d.ts +0 -3
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.d.ts.map +0 -1
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.js +0 -26
- package/src/migrations/update-18-1-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-18-1-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-18-1-0/update-angular-cli.js +0 -14
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.d.ts +0 -3
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.d.ts.map +0 -1
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.js +0 -53
- package/src/migrations/update-18-2-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-18-2-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-18-2-0/update-angular-cli.js +0 -14
- package/src/migrations/update-19-1-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-19-1-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-19-1-0/update-angular-cli.js +0 -14
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
async function default_1(tree) {
|
|
6
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
|
7
|
-
for (const [, project] of projects) {
|
|
8
|
-
if (project.projectType !== 'application') {
|
|
9
|
-
continue;
|
|
10
|
-
}
|
|
11
|
-
for (const target of Object.values(project.targets ?? {})) {
|
|
12
|
-
if (target.executor === '@nguniversal/builders:ssr-dev-server') {
|
|
13
|
-
target.executor = '@angular-devkit/build-angular:ssr-dev-server';
|
|
14
|
-
}
|
|
15
|
-
else if (target.executor === '@nguniversal/builders:prerender') {
|
|
16
|
-
target.executor = '@angular-devkit/build-angular:prerender';
|
|
17
|
-
updatePrerenderOptions(target);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
(0, devkit_1.updateProjectConfiguration)(tree, project.name, project);
|
|
21
|
-
}
|
|
22
|
-
// update options from nx.json target defaults
|
|
23
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
24
|
-
if (!nxJson.targetDefaults) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
for (const [targetOrExecutor, targetConfig] of Object.entries(nxJson.targetDefaults)) {
|
|
28
|
-
if (targetOrExecutor === '@nguniversal/builders:ssr-dev-server') {
|
|
29
|
-
nxJson.targetDefaults['@angular-devkit/build-angular:ssr-dev-server'] =
|
|
30
|
-
targetConfig;
|
|
31
|
-
delete nxJson.targetDefaults['@nguniversal/builders:ssr-dev-server'];
|
|
32
|
-
}
|
|
33
|
-
else if (targetOrExecutor === '@nguniversal/builders:prerender') {
|
|
34
|
-
nxJson.targetDefaults['@angular-devkit/build-angular:prerender'] =
|
|
35
|
-
targetConfig;
|
|
36
|
-
delete nxJson.targetDefaults['@nguniversal/builders:prerender'];
|
|
37
|
-
updatePrerenderOptions(targetConfig);
|
|
38
|
-
}
|
|
39
|
-
else if (targetConfig.executor === '@nguniversal/builders:ssr-dev-server') {
|
|
40
|
-
targetConfig.executor = '@angular-devkit/build-angular:ssr-dev-server';
|
|
41
|
-
}
|
|
42
|
-
else if (targetConfig.executor === '@nguniversal/builders:prerender') {
|
|
43
|
-
targetConfig.executor = '@angular-devkit/build-angular:prerender';
|
|
44
|
-
updatePrerenderOptions(targetConfig);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
48
|
-
// remove @nguniversal/builders from package.json
|
|
49
|
-
(0, devkit_1.removeDependenciesFromPackageJson)(tree, ['@nguniversal/builders'], ['@nguniversal/builders']);
|
|
50
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
51
|
-
}
|
|
52
|
-
function* allTargetOptions(target) {
|
|
53
|
-
if (target.options) {
|
|
54
|
-
yield [undefined, target.options];
|
|
55
|
-
}
|
|
56
|
-
if (!target.configurations) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
for (const [name, options] of Object.entries(target.configurations)) {
|
|
60
|
-
if (options !== undefined) {
|
|
61
|
-
yield [name, options];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function updatePrerenderOptions(config) {
|
|
66
|
-
for (const [, options] of allTargetOptions(config)) {
|
|
67
|
-
if (options.guessRoutes !== undefined) {
|
|
68
|
-
options.discoverRoutes = options.guessRoutes;
|
|
69
|
-
delete options.guessRoutes;
|
|
70
|
-
}
|
|
71
|
-
if (options.numProcesses !== undefined) {
|
|
72
|
-
delete options.numProcesses;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"replace-nguniversal-engines.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-17-1-0/replace-nguniversal-engines.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AA2BpB,yBAA+B,IAAI,EAAE,IAAI,iBA2GxC"}
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const version_utils_1 = require("../../generators/utils/version-utils");
|
|
7
|
-
const targets_1 = require("../../utils/targets");
|
|
8
|
-
const projects_1 = require("../utils/projects");
|
|
9
|
-
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
10
|
-
const UNIVERSAL_PACKAGES = [
|
|
11
|
-
'@nguniversal/common',
|
|
12
|
-
'@nguniversal/express-engine',
|
|
13
|
-
];
|
|
14
|
-
/**
|
|
15
|
-
* Regexp to match Universal packages.
|
|
16
|
-
* @nguniversal/common/engine
|
|
17
|
-
* @nguniversal/common
|
|
18
|
-
* @nguniversal/express-engine
|
|
19
|
-
**/
|
|
20
|
-
const NGUNIVERSAL_PACKAGE_REGEXP = /@nguniversal\/(common(\/engine)?|express-engine)/g;
|
|
21
|
-
const serverExecutors = [
|
|
22
|
-
'@angular-devkit/build-angular:server',
|
|
23
|
-
'@nx/angular:webpack-server',
|
|
24
|
-
];
|
|
25
|
-
async function default_1(tree) {
|
|
26
|
-
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
27
|
-
if (!UNIVERSAL_PACKAGES.some((pkg) => packageJson.dependencies?.[pkg] || packageJson.devDependencies?.[pkg])) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const projects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
|
31
|
-
'npm:@nguniversal/common',
|
|
32
|
-
'npm:@nguniversal/express-engine',
|
|
33
|
-
]);
|
|
34
|
-
for (const { data: project } of projects) {
|
|
35
|
-
if (project.projectType !== 'application') {
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
const serverMainFiles = new Map();
|
|
39
|
-
for (const target of Object.values(project.targets ?? {})) {
|
|
40
|
-
if (!serverExecutors.includes(target.executor)) {
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
43
|
-
const outputPath = project.targets.build?.options?.outputPath;
|
|
44
|
-
for (const [, { main }] of (0, targets_1.allTargetOptions)(target)) {
|
|
45
|
-
if (typeof main === 'string' &&
|
|
46
|
-
typeof outputPath === 'string' &&
|
|
47
|
-
tree.read(main, 'utf-8').includes('ngExpressEngine')) {
|
|
48
|
-
serverMainFiles.set(main, outputPath);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
// Replace all import specifiers in all files.
|
|
53
|
-
let hasExpressTokens = false;
|
|
54
|
-
const root = (0, ts_solution_setup_1.getProjectSourceRoot)(project, tree);
|
|
55
|
-
const tokensFilePath = `${root}/express.tokens.ts`;
|
|
56
|
-
(0, devkit_1.visitNotIgnoredFiles)(tree, root, (path) => {
|
|
57
|
-
if (!path.endsWith('.ts') || path.endsWith('.d.ts')) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
let content = tree.read(path, 'utf8');
|
|
61
|
-
if (!content.includes('@nguniversal/')) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
// Check if file is importing tokens
|
|
65
|
-
if (content.includes('@nguniversal/express-engine/tokens')) {
|
|
66
|
-
hasExpressTokens ||= true;
|
|
67
|
-
let tokensFileRelativePath = (0, devkit_1.normalizePath)((0, path_1.relative)((0, path_1.dirname)(path), tokensFilePath));
|
|
68
|
-
if (tokensFileRelativePath.charAt(0) !== '.') {
|
|
69
|
-
tokensFileRelativePath = './' + tokensFileRelativePath;
|
|
70
|
-
}
|
|
71
|
-
content = content.replaceAll('@nguniversal/express-engine/tokens', tokensFileRelativePath.slice(0, -3));
|
|
72
|
-
}
|
|
73
|
-
content = content.replaceAll(NGUNIVERSAL_PACKAGE_REGEXP, '@angular/ssr');
|
|
74
|
-
tree.write(path, content);
|
|
75
|
-
});
|
|
76
|
-
// Replace server file and add tokens file if needed
|
|
77
|
-
for (const [path, outputPath] of serverMainFiles.entries()) {
|
|
78
|
-
tree.rename(path, path + '.bak');
|
|
79
|
-
tree.write(path, getServerFileContents(outputPath, hasExpressTokens));
|
|
80
|
-
if (hasExpressTokens) {
|
|
81
|
-
tree.write(tokensFilePath, TOKENS_FILE_CONTENT);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
// Remove universal packages from deps
|
|
86
|
-
for (const name of UNIVERSAL_PACKAGES) {
|
|
87
|
-
(0, devkit_1.removeDependenciesFromPackageJson)(tree, [name], [name]);
|
|
88
|
-
}
|
|
89
|
-
const pkgVersions = (0, version_utils_1.versions)(tree);
|
|
90
|
-
(0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
91
|
-
'@angular/ssr': (0, version_utils_1.getInstalledPackageVersionInfo)(tree, '@angular-devkit/build-angular')
|
|
92
|
-
?.version ?? pkgVersions.angularDevkitVersion,
|
|
93
|
-
}, {});
|
|
94
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
95
|
-
}
|
|
96
|
-
const TOKENS_FILE_CONTENT = `
|
|
97
|
-
import { InjectionToken } from '@angular/core';
|
|
98
|
-
import { Request, Response } from 'express';
|
|
99
|
-
|
|
100
|
-
export const REQUEST = new InjectionToken<Request>('REQUEST');
|
|
101
|
-
export const RESPONSE = new InjectionToken<Response>('RESPONSE');
|
|
102
|
-
`;
|
|
103
|
-
function getServerFileContents(outputPath, hasExpressTokens) {
|
|
104
|
-
return (`
|
|
105
|
-
import 'zone.js/node';
|
|
106
|
-
|
|
107
|
-
import { APP_BASE_HREF } from '@angular/common';
|
|
108
|
-
import { CommonEngine } from '@angular/ssr';
|
|
109
|
-
import * as express from 'express';
|
|
110
|
-
import { existsSync } from 'node:fs';
|
|
111
|
-
import { join } from 'node:path';
|
|
112
|
-
import bootstrap from './src/main.server';` +
|
|
113
|
-
(hasExpressTokens
|
|
114
|
-
? `\nimport { REQUEST, RESPONSE } from './src/express.tokens';`
|
|
115
|
-
: '') +
|
|
116
|
-
`
|
|
117
|
-
|
|
118
|
-
// The Express app is exported so that it can be used by serverless Functions.
|
|
119
|
-
export function app(): express.Express {
|
|
120
|
-
const server = express();
|
|
121
|
-
const distFolder = join(process.cwd(), '${outputPath}');
|
|
122
|
-
const indexHtml = existsSync(join(distFolder, 'index.original.html'))
|
|
123
|
-
? join(distFolder, 'index.original.html')
|
|
124
|
-
: join(distFolder, 'index.html');
|
|
125
|
-
|
|
126
|
-
const commonEngine = new CommonEngine();
|
|
127
|
-
|
|
128
|
-
server.set('view engine', 'html');
|
|
129
|
-
server.set('views', distFolder);
|
|
130
|
-
|
|
131
|
-
// Example Express Rest API endpoints
|
|
132
|
-
// server.get('/api/**', (req, res) => { });
|
|
133
|
-
// Serve static files from /browser
|
|
134
|
-
server.get('*.*', express.static(distFolder, {
|
|
135
|
-
maxAge: '1y'
|
|
136
|
-
}));
|
|
137
|
-
|
|
138
|
-
// All regular routes use the Angular engine
|
|
139
|
-
server.get('*', (req, res, next) => {
|
|
140
|
-
const { protocol, originalUrl, baseUrl, headers } = req;
|
|
141
|
-
|
|
142
|
-
commonEngine
|
|
143
|
-
.render({
|
|
144
|
-
bootstrap,
|
|
145
|
-
documentFilePath: indexHtml,
|
|
146
|
-
url: \`\${protocol}://\${headers.host}\${originalUrl}\`,
|
|
147
|
-
publicPath: distFolder,
|
|
148
|
-
providers: [
|
|
149
|
-
{ provide: APP_BASE_HREF, useValue: baseUrl },` +
|
|
150
|
-
(hasExpressTokens
|
|
151
|
-
? '\n { provide: RESPONSE, useValue: res },\n { provide: REQUEST, useValue: req }\n'
|
|
152
|
-
: '') +
|
|
153
|
-
`],
|
|
154
|
-
})
|
|
155
|
-
.then((html) => res.send(html))
|
|
156
|
-
.catch((err) => next(err));
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
return server;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function run(): void {
|
|
163
|
-
const port = process.env['PORT'] || 4000;
|
|
164
|
-
|
|
165
|
-
// Start up the Node server
|
|
166
|
-
const server = app();
|
|
167
|
-
server.listen(port, () => {
|
|
168
|
-
console.log(\`Node Express server listening on http://localhost:\${port}\`);
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Webpack will replace 'require' with '__webpack_require__'
|
|
173
|
-
// '__non_webpack_require__' is a proxy to Node 'require'
|
|
174
|
-
// The below code is to ensure that the server is run only when not requiring the bundle.
|
|
175
|
-
declare const __non_webpack_require__: NodeRequire;
|
|
176
|
-
const mainModule = __non_webpack_require__.main;
|
|
177
|
-
const moduleFilename = mainModule && mainModule.filename || '';
|
|
178
|
-
if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
|
|
179
|
-
run();
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export default bootstrap;
|
|
183
|
-
`);
|
|
184
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-angular-cli.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-17-1-0/update-angular-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,yBAA+B,IAAI,EAAE,IAAI,iBAaxC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.angularCliVersion = void 0;
|
|
4
|
-
exports.default = default_1;
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
exports.angularCliVersion = '~17.0.0';
|
|
7
|
-
async function default_1(tree) {
|
|
8
|
-
const { devDependencies, dependencies } = (0, devkit_1.readJson)(tree, 'package.json');
|
|
9
|
-
const hasAngularCli = devDependencies?.['@angular/cli'] || dependencies?.['@angular/cli'];
|
|
10
|
-
if (hasAngularCli) {
|
|
11
|
-
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@angular/cli': exports.angularCliVersion });
|
|
12
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-zone-js-deep-import.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-17-1-0/update-zone-js-deep-import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAG1E,yBAA+B,IAAI,EAAE,IAAI,iBAyCxC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const projects_1 = require("../utils/projects");
|
|
6
|
-
async function default_1(tree) {
|
|
7
|
-
const angularProjects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
|
8
|
-
'npm:@angular/core',
|
|
9
|
-
]);
|
|
10
|
-
if (!angularProjects.length) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
const zoneJsImportRegex = /(['"`])zone\.js\/dist\/zone(['"`])/g;
|
|
14
|
-
const zoneJsTestingImportRegex = /(['"`])zone\.js\/dist\/zone-testing(['"`])/g;
|
|
15
|
-
for (const graphNode of angularProjects) {
|
|
16
|
-
(0, devkit_1.visitNotIgnoredFiles)(tree, graphNode.data.root, (file) => {
|
|
17
|
-
// we are only interested in .ts files
|
|
18
|
-
if (!file.endsWith('.ts')) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
let content = tree.read(file, 'utf-8');
|
|
22
|
-
let wasUpdated = false;
|
|
23
|
-
if (zoneJsImportRegex.test(content)) {
|
|
24
|
-
content = content.replace(zoneJsImportRegex, '$1zone.js$2');
|
|
25
|
-
wasUpdated = true;
|
|
26
|
-
}
|
|
27
|
-
if (zoneJsTestingImportRegex.test(content)) {
|
|
28
|
-
content = content.replace(zoneJsTestingImportRegex, '$1zone.js/testing$2');
|
|
29
|
-
wasUpdated = true;
|
|
30
|
-
}
|
|
31
|
-
if (wasUpdated) {
|
|
32
|
-
tree.write(file, content);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
37
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rename-webpack-dev-server.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-17-2-0/rename-webpack-dev-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,yBAA+B,IAAI,EAAE,IAAI,iBA6CxC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
async function default_1(tree) {
|
|
6
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
|
7
|
-
for (const [, project] of projects) {
|
|
8
|
-
if (project.projectType !== 'application') {
|
|
9
|
-
continue;
|
|
10
|
-
}
|
|
11
|
-
for (const target of Object.values(project.targets ?? {})) {
|
|
12
|
-
if (target.executor === '@nx/angular:webpack-dev-server' ||
|
|
13
|
-
target.executor === '@nrwl/angular:webpack-dev-server') {
|
|
14
|
-
target.executor = '@nx/angular:dev-server';
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
(0, devkit_1.updateProjectConfiguration)(tree, project.name, project);
|
|
18
|
-
}
|
|
19
|
-
// update options from nx.json target defaults
|
|
20
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
21
|
-
if (!nxJson.targetDefaults) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
for (const [targetOrExecutor, targetConfig] of Object.entries(nxJson.targetDefaults)) {
|
|
25
|
-
if (targetOrExecutor === '@nx/angular:webpack-dev-server') {
|
|
26
|
-
nxJson.targetDefaults['@nx/angular:dev-server'] = targetConfig;
|
|
27
|
-
delete nxJson.targetDefaults['@nx/angular:webpack-dev-server'];
|
|
28
|
-
}
|
|
29
|
-
else if (targetOrExecutor === '@nrwl/angular:webpack-dev-server') {
|
|
30
|
-
nxJson.targetDefaults['@nx/angular:dev-server'] = targetConfig;
|
|
31
|
-
delete nxJson.targetDefaults['@nrwl/angular:webpack-dev-server'];
|
|
32
|
-
}
|
|
33
|
-
else if (targetConfig.executor === '@nx/angular:webpack-dev-server' ||
|
|
34
|
-
targetConfig.executor === '@nrwl/angular:webpack-dev-server') {
|
|
35
|
-
targetConfig.executor = '@nx/angular:dev-server';
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
39
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
40
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-autoprefixer-dependency.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-17-3-0/add-autoprefixer-dependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,yBAA+B,IAAI,EAAE,IAAI,iBA6BxC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
async function default_1(tree) {
|
|
6
|
-
const autprefixerVersion = (0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'autoprefixer');
|
|
7
|
-
if (autprefixerVersion) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
|
11
|
-
for (const project of projects.values()) {
|
|
12
|
-
if (project.projectType !== 'library') {
|
|
13
|
-
continue;
|
|
14
|
-
}
|
|
15
|
-
for (const target of Object.values(project.targets ?? {})) {
|
|
16
|
-
if (target.executor !== '@nx/angular:ng-packagr-lite' &&
|
|
17
|
-
target.executor !== '@nx/angular:package') {
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, { autoprefixer: '^10.4.0' });
|
|
21
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-browser-sync-dependency.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-17-3-0/add-browser-sync-dependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,yBAA+B,IAAI,EAAE,IAAI,iBA6BxC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
async function default_1(tree) {
|
|
6
|
-
const browserSyncVersion = (0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'browser-sync');
|
|
7
|
-
if (browserSyncVersion) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
|
11
|
-
for (const project of projects.values()) {
|
|
12
|
-
if (project.projectType !== 'application') {
|
|
13
|
-
continue;
|
|
14
|
-
}
|
|
15
|
-
for (const target of Object.values(project.targets ?? {})) {
|
|
16
|
-
if (target.executor !== '@angular-devkit/build-angular:ssr-dev-server' &&
|
|
17
|
-
target.executor !== '@nx/angular:module-federation-dev-ssr') {
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, { 'browser-sync': '^3.0.0' });
|
|
21
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-angular-cli.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-17-3-0/update-angular-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,yBAA+B,IAAI,EAAE,IAAI,iBAaxC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.angularCliVersion = void 0;
|
|
4
|
-
exports.default = default_1;
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
exports.angularCliVersion = '~17.1.0';
|
|
7
|
-
async function default_1(tree) {
|
|
8
|
-
const { devDependencies, dependencies } = (0, devkit_1.readJson)(tree, 'package.json');
|
|
9
|
-
const hasAngularCli = devDependencies?.['@angular/cli'] || dependencies?.['@angular/cli'];
|
|
10
|
-
if (hasAngularCli) {
|
|
11
|
-
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@angular/cli': exports.angularCliVersion });
|
|
12
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-mf-env-var-to-target-defaults.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,IAAI,EAIV,MAAM,YAAY,CAAC;AAGpB,yBAA+B,IAAI,EAAE,IAAI,iBAOxC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const add_mf_env_to_inputs_1 = require("../../generators/utils/add-mf-env-to-inputs");
|
|
6
|
-
async function default_1(tree) {
|
|
7
|
-
if (!isWebpackBrowserUsed(tree)) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
(0, add_mf_env_to_inputs_1.addMfEnvToTargetDefaultInputs)(tree);
|
|
11
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
12
|
-
}
|
|
13
|
-
function isWebpackBrowserUsed(tree) {
|
|
14
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
|
15
|
-
for (const project of projects.values()) {
|
|
16
|
-
const targets = project.targets || {};
|
|
17
|
-
for (const [_, target] of Object.entries(targets)) {
|
|
18
|
-
if (target.executor === '@nx/angular:webpack-browser' &&
|
|
19
|
-
(tree.exists((0, devkit_1.joinPathFragments)(project.root, 'module-federation.config.ts')) ||
|
|
20
|
-
tree.exists((0, devkit_1.joinPathFragments)(project.root, 'module-federation.config.js')))) {
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-angular-cli.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-18-1-0/update-angular-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,yBAA+B,IAAI,EAAE,IAAI,iBAaxC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.angularCliVersion = void 0;
|
|
4
|
-
exports.default = default_1;
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
exports.angularCliVersion = '~17.2.0';
|
|
7
|
-
async function default_1(tree) {
|
|
8
|
-
const { devDependencies, dependencies } = (0, devkit_1.readJson)(tree, 'package.json');
|
|
9
|
-
const hasAngularCli = devDependencies?.['@angular/cli'] || dependencies?.['@angular/cli'];
|
|
10
|
-
if (hasAngularCli) {
|
|
11
|
-
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@angular/cli': exports.angularCliVersion });
|
|
12
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fix-target-defaults-inputs.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-18-1-1/fix-target-defaults-inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,IAAI,EAMV,MAAM,YAAY,CAAC;AAEpB,yBAA+B,IAAI,EAAE,IAAI,iBAOxC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
async function default_1(tree) {
|
|
6
|
-
if (!isWebpackBrowserUsed(tree)) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
ensureTargetDefaultsContainProductionInputs(tree);
|
|
10
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
11
|
-
}
|
|
12
|
-
function ensureTargetDefaultsContainProductionInputs(tree) {
|
|
13
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
14
|
-
const webpackExecutor = '@nx/angular:webpack-browser';
|
|
15
|
-
const mfEnvVar = 'NX_MF_DEV_SERVER_STATIC_REMOTES';
|
|
16
|
-
nxJson.targetDefaults[webpackExecutor] ??= {};
|
|
17
|
-
nxJson.targetDefaults[webpackExecutor].inputs ??= [
|
|
18
|
-
'production',
|
|
19
|
-
'^production',
|
|
20
|
-
{ env: mfEnvVar },
|
|
21
|
-
];
|
|
22
|
-
if (!nxJson.targetDefaults[webpackExecutor].inputs.includes('production')) {
|
|
23
|
-
nxJson.targetDefaults[webpackExecutor].inputs.push('production');
|
|
24
|
-
}
|
|
25
|
-
if (!nxJson.targetDefaults[webpackExecutor].inputs.includes('^production')) {
|
|
26
|
-
nxJson.targetDefaults[webpackExecutor].inputs.push('^production');
|
|
27
|
-
}
|
|
28
|
-
let mfEnvVarExists = false;
|
|
29
|
-
for (const input of nxJson.targetDefaults[webpackExecutor].inputs) {
|
|
30
|
-
if (typeof input === 'object' && input['env'] === mfEnvVar) {
|
|
31
|
-
mfEnvVarExists = true;
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (!mfEnvVarExists) {
|
|
36
|
-
nxJson.targetDefaults[webpackExecutor].inputs.push({ env: mfEnvVar });
|
|
37
|
-
}
|
|
38
|
-
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
39
|
-
}
|
|
40
|
-
function isWebpackBrowserUsed(tree) {
|
|
41
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
|
42
|
-
for (const project of projects.values()) {
|
|
43
|
-
const targets = project.targets || {};
|
|
44
|
-
for (const [_, target] of Object.entries(targets)) {
|
|
45
|
-
if (target.executor === '@nx/angular:webpack-browser' &&
|
|
46
|
-
(tree.exists((0, devkit_1.joinPathFragments)(project.root, 'module-federation.config.ts')) ||
|
|
47
|
-
tree.exists((0, devkit_1.joinPathFragments)(project.root, 'module-federation.config.js')))) {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-angular-cli.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-18-2-0/update-angular-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,yBAA+B,IAAI,EAAE,IAAI,iBAaxC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.angularCliVersion = void 0;
|
|
4
|
-
exports.default = default_1;
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
exports.angularCliVersion = '~17.3.0';
|
|
7
|
-
async function default_1(tree) {
|
|
8
|
-
const { devDependencies, dependencies } = (0, devkit_1.readJson)(tree, 'package.json');
|
|
9
|
-
const hasAngularCli = devDependencies?.['@angular/cli'] || dependencies?.['@angular/cli'];
|
|
10
|
-
if (hasAngularCli) {
|
|
11
|
-
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@angular/cli': exports.angularCliVersion });
|
|
12
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-angular-cli.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-19-1-0/update-angular-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,yBAA+B,IAAI,EAAE,IAAI,iBAaxC"}
|