@mouryaamit/nx-polystack 1.11.3 → 1.11.11
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/README.md +3 -1
- package/dist/migrations.json +5 -0
- package/dist/src/cli/commands/adopt-compare.d.ts +8 -0
- package/dist/src/cli/commands/adopt-compare.js +9 -4
- package/dist/src/cli/commands/adopt-compare.js.map +1 -1
- package/dist/src/cli/commands/standalone-providers.d.ts +34 -0
- package/dist/src/cli/commands/standalone-providers.js +423 -0
- package/dist/src/cli/commands/standalone-providers.js.map +1 -0
- package/dist/src/cli/commands/upgrade-standalone.d.ts +14 -1
- package/dist/src/cli/commands/upgrade-standalone.js +107 -10
- package/dist/src/cli/commands/upgrade-standalone.js.map +1 -1
- package/dist/src/cli/commands/upgrade.d.ts +1 -1
- package/dist/src/cli/commands/upgrade.js +34 -2
- package/dist/src/cli/commands/upgrade.js.map +1 -1
- package/dist/src/cli/help.js +6 -4
- package/dist/src/cli/help.js.map +1 -1
- package/dist/src/executors/build/executor.d.ts +17 -0
- package/dist/src/executors/build/executor.js +67 -12
- package/dist/src/executors/build/executor.js.map +1 -1
- package/dist/src/executors/build/schema.json +7 -3
- package/dist/src/executors/flutter-build/executor.js +32 -1
- package/dist/src/executors/flutter-build/executor.js.map +1 -1
- package/dist/src/executors/flutter-build/schema.d.ts +8 -0
- package/dist/src/executors/flutter-build/schema.json +53 -0
- package/dist/src/generators/adopt/flutter.d.ts +32 -0
- package/dist/src/generators/adopt/flutter.js +305 -0
- package/dist/src/generators/adopt/flutter.js.map +1 -0
- package/dist/src/generators/adopt/generator.d.ts +17 -0
- package/dist/src/generators/adopt/generator.js +187 -17
- package/dist/src/generators/adopt/generator.js.map +1 -1
- package/dist/src/generators/adopt/old-script-refs.d.ts +12 -0
- package/dist/src/generators/adopt/old-script-refs.js +239 -0
- package/dist/src/generators/adopt/old-script-refs.js.map +1 -0
- package/dist/src/generators/adopt/pipeline.d.ts +3 -1
- package/dist/src/generators/adopt/pipeline.js +13 -2
- package/dist/src/generators/adopt/pipeline.js.map +1 -1
- package/dist/src/generators/adopt/schema.json +2 -2
- package/dist/src/generators/app/files/angular/tsconfig.app.json__template__ +1 -1
- package/dist/src/generators/app/files/angular/tsconfig.json__template__ +1 -1
- package/dist/src/generators/app/generator.js +9 -0
- package/dist/src/generators/app/generator.js.map +1 -1
- package/dist/src/generators/env/generator.js +23 -7
- package/dist/src/generators/env/generator.js.map +1 -1
- package/dist/src/generators/lib/angular-lib.js +15 -0
- package/dist/src/generators/lib/angular-lib.js.map +1 -1
- package/dist/src/generators/lib/files/angular/config/tsconfig.json__template__ +1 -1
- package/dist/src/generators/lib/files/pii/README.md__template__ +1 -1
- package/dist/src/generators/lib/files/pii/src/index.ts__template__ +2 -2
- package/dist/src/generators/lib/files/session/src/index.ts__template__ +2 -2
- package/dist/src/generators/lib/files/state/ngrx/README.md__template__ +2 -2
- package/dist/src/generators/lib/files/state/ngrx/src/index.ts__template__ +2 -2
- package/dist/src/generators/lib/types/state.js +13 -8
- package/dist/src/generators/lib/types/state.js.map +1 -1
- package/dist/src/generators/migrate/nx/build-scripts.d.ts +6 -0
- package/dist/src/generators/migrate/nx/build-scripts.js +33 -1
- package/dist/src/generators/migrate/nx/build-scripts.js.map +1 -1
- package/dist/src/generators/migrate/nx/env-encryption.d.ts +7 -0
- package/dist/src/generators/migrate/nx/env-encryption.js +34 -10
- package/dist/src/generators/migrate/nx/env-encryption.js.map +1 -1
- package/dist/src/generators/preset/generator.js +4 -1
- package/dist/src/generators/preset/generator.js.map +1 -1
- package/dist/src/generators/preset/schema.d.ts +1 -1
- package/dist/src/generators/preset/schema.json +1 -1
- package/dist/src/lib/helpers/inject-nonce.d.ts +10 -2
- package/dist/src/lib/helpers/inject-nonce.js +19 -4
- package/dist/src/lib/helpers/inject-nonce.js.map +1 -1
- package/dist/src/lib/release/flat-output.d.ts +33 -0
- package/dist/src/lib/release/flat-output.js +88 -0
- package/dist/src/lib/release/flat-output.js.map +1 -0
- package/dist/src/lib/release/htaccess-adopt.d.ts +8 -0
- package/dist/src/lib/release/htaccess-adopt.js +39 -14
- package/dist/src/lib/release/htaccess-adopt.js.map +1 -1
- package/dist/src/lib/upgrade/angular15.d.ts +23 -0
- package/dist/src/lib/upgrade/angular15.js +139 -0
- package/dist/src/lib/upgrade/angular15.js.map +1 -0
- package/dist/src/lib/upgrade/pins.d.ts +1 -1
- package/dist/src/lib/upgrade/pins.js +12 -1
- package/dist/src/lib/upgrade/pins.js.map +1 -1
- package/dist/src/lib/utils/angular-deps.d.ts +17 -0
- package/dist/src/lib/utils/angular-deps.js +29 -4
- package/dist/src/lib/utils/angular-deps.js.map +1 -1
- package/dist/src/lib/utils/angular-project.d.ts +1 -1
- package/dist/src/lib/utils/angular-project.js +7 -3
- package/dist/src/lib/utils/angular-project.js.map +1 -1
- package/dist/src/migrations/application-builder-flat-output/application-builder-flat-output.d.ts +9 -0
- package/dist/src/migrations/application-builder-flat-output/application-builder-flat-output.js +68 -0
- package/dist/src/migrations/application-builder-flat-output/application-builder-flat-output.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.adoptFlutterApp = exports.flutterAdoptCandidates = exports.buildsWeb = exports.FLUTTER_BUILD_EXECUTOR = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
6
|
+
const path = tslib_1.__importStar(require("path"));
|
|
7
|
+
const htaccess_1 = require("../../lib/release/htaccess");
|
|
8
|
+
const env_files_1 = require("../../lib/utils/env-files");
|
|
9
|
+
const project_json_files_1 = require("../../lib/utils/project-json-files");
|
|
10
|
+
const angular_project_json_1 = require("../migrate/angular-project-json");
|
|
11
|
+
const build_scripts_1 = require("../migrate/nx/build-scripts");
|
|
12
|
+
const isObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
13
|
+
const code = (s) => `\`${s}\``;
|
|
14
|
+
exports.FLUTTER_BUILD_EXECUTOR = '@mouryaamit/nx-polystack:flutter-build';
|
|
15
|
+
/** Commands of a run-commands target: options and every configuration. */
|
|
16
|
+
function commandsOf(target) {
|
|
17
|
+
const out = [];
|
|
18
|
+
const baseCwd = isObject(target['options']) ? target['options']['cwd'] : undefined;
|
|
19
|
+
const add = (o, config) => {
|
|
20
|
+
if (!isObject(o))
|
|
21
|
+
return;
|
|
22
|
+
const c0 = typeof o['cwd'] === 'string' ? o['cwd'] : baseCwd;
|
|
23
|
+
const cwd = typeof c0 === 'string' ? c0 : '.';
|
|
24
|
+
if (typeof o['command'] === 'string')
|
|
25
|
+
out.push({ config, cmd: o['command'], cwd });
|
|
26
|
+
if (Array.isArray(o['commands'])) {
|
|
27
|
+
for (const c of o['commands']) {
|
|
28
|
+
const cmd = typeof c === 'string' ? c : isObject(c) ? c['command'] : undefined;
|
|
29
|
+
if (typeof cmd === 'string')
|
|
30
|
+
out.push({ config, cmd, cwd });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
add(target['options']);
|
|
35
|
+
const configs = isObject(target['configurations']) ? target['configurations'] : {};
|
|
36
|
+
for (const [name, c] of Object.entries(configs))
|
|
37
|
+
add(c, name);
|
|
38
|
+
return out;
|
|
39
|
+
}
|
|
40
|
+
const escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
41
|
+
/** The older generated wrapper (tools/scripts/flutter/flutter-build.js): pstack update moves it. */
|
|
42
|
+
const LEGACY_WRAPPER = /\bflutter-build\.(?:c|m)?js\b/;
|
|
43
|
+
/** True when a command builds this app's web output (directly or through a build script). */
|
|
44
|
+
function buildsWeb(cmd, name) {
|
|
45
|
+
if (/\bflutter\s+build\s+web\b/.test(cmd))
|
|
46
|
+
return true;
|
|
47
|
+
if (!/\bnode\s+\S+\.(?:c|m)?js\b/.test(cmd) || LEGACY_WRAPPER.test(cmd))
|
|
48
|
+
return false;
|
|
49
|
+
const target = flag(cmd, ['target', 'platform']);
|
|
50
|
+
if (target !== undefined && target !== 'web')
|
|
51
|
+
return false;
|
|
52
|
+
return new RegExp(`--(?:project|app)(?:=|\\s+)(['"]?)${escapeRe(name)}\\1(?=\\s|$)`).test(cmd);
|
|
53
|
+
}
|
|
54
|
+
exports.buildsWeb = buildsWeb;
|
|
55
|
+
/** Flutter apps (pubspec.yaml next to project.json) whose web build does not use the plugin. */
|
|
56
|
+
function flutterAdoptCandidates(tree) {
|
|
57
|
+
const out = [];
|
|
58
|
+
for (const { name, root, json } of (0, project_json_files_1.readProjects)(tree)) {
|
|
59
|
+
if (!tree.exists(`${root}/pubspec.yaml`) || json['projectType'] === 'library')
|
|
60
|
+
continue;
|
|
61
|
+
const targets = isObject(json['targets']) ? json['targets'] : {};
|
|
62
|
+
if (Object.values(targets).some((t) => isObject(t) &&
|
|
63
|
+
(t['executor'] === exports.FLUTTER_BUILD_EXECUTOR ||
|
|
64
|
+
commandsOf(t).some((c) => LEGACY_WRAPPER.test(c.cmd)))))
|
|
65
|
+
continue;
|
|
66
|
+
const web = Object.entries(targets).find(([, t]) => isObject(t) &&
|
|
67
|
+
t['executor'] === 'nx:run-commands' &&
|
|
68
|
+
commandsOf(t).some((c) => buildsWeb(c.cmd, name)))?.[0];
|
|
69
|
+
out.push(web
|
|
70
|
+
? { name, root, webTarget: web }
|
|
71
|
+
: { name, root, reason: 'no run-commands target that runs `flutter build web`' });
|
|
72
|
+
}
|
|
73
|
+
return out.sort((a, b) => a.name.localeCompare(b.name));
|
|
74
|
+
}
|
|
75
|
+
exports.flutterAdoptCandidates = flutterAdoptCandidates;
|
|
76
|
+
/** A flag's value; undefined when missing or an interpolation (`{args.env}`, `${env}`). */
|
|
77
|
+
function flag(cmd, names) {
|
|
78
|
+
for (const n of names) {
|
|
79
|
+
const m = new RegExp(`(?:^|\\s)--?${n}(?:=|\\s+)(['"]?)([^\\s'"]+)\\1`).exec(cmd);
|
|
80
|
+
if (m)
|
|
81
|
+
return /[{}$]/.test(m[2]) ? undefined : m[2];
|
|
82
|
+
}
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
const ENV_NAME = { development: 'dev', production: 'prod' };
|
|
86
|
+
const envName = (e) => ENV_NAME[e] ?? (0, angular_project_json_1.releaseConfigName)(e);
|
|
87
|
+
/** Workspace-relative path in a command (`--output /abs/dist/x` or `dist/x`); undefined outside. */
|
|
88
|
+
function workspacePath(root, p) {
|
|
89
|
+
if (!p || p.includes('$'))
|
|
90
|
+
return undefined;
|
|
91
|
+
const abs = path.isAbsolute(p) ? p : path.join(root, p);
|
|
92
|
+
const rel = path.relative(root, abs).split(path.sep).join('/');
|
|
93
|
+
return rel && !rel.startsWith('..') ? rel : undefined;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Moves one Flutter app's web build to the flutter-build executor. Envs come from the old target's
|
|
97
|
+
* configurations and the npm scripts that build the app; dist and base href from the build script
|
|
98
|
+
* (per-app map) or the flutter command; env files from <root>/env/<env>.json (`{}` when there was
|
|
99
|
+
* none: the old build passed no defines); the .htaccess from <root>/web/.htaccess.
|
|
100
|
+
*/
|
|
101
|
+
function adoptFlutterApp(tree, app, scripts, buildScripts, pipeline) {
|
|
102
|
+
const { name, root, webTarget } = app;
|
|
103
|
+
const notes = [];
|
|
104
|
+
const pjPath = `${root}/project.json`;
|
|
105
|
+
const pj = JSON.parse(tree.read(pjPath, 'utf8') ?? '{}');
|
|
106
|
+
const targets = pj['targets'];
|
|
107
|
+
const old = targets[webTarget];
|
|
108
|
+
const commands = commandsOf(old);
|
|
109
|
+
// The npm scripts that build this app through the workspace's build script.
|
|
110
|
+
const custom = Object.entries(buildScripts.customBuilds).filter(([, cmd]) => buildsWeb(cmd, name));
|
|
111
|
+
const scriptTexts = buildScripts.customScripts
|
|
112
|
+
.map((s) => {
|
|
113
|
+
try {
|
|
114
|
+
return fs.readFileSync(path.join(tree.root, ...s.split('/')), 'utf8');
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return '';
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
.filter(Boolean);
|
|
121
|
+
// Envs: --env of the old configurations and of the npm scripts; else the config names. The
|
|
122
|
+
// names they were written with (production, prod) are kept to find the env files.
|
|
123
|
+
const envs = new Set();
|
|
124
|
+
const rawNames = new Map();
|
|
125
|
+
const explicitEnvFile = new Map();
|
|
126
|
+
const addEnv = (raw, cmd, cwd = '.') => {
|
|
127
|
+
const env = envName(raw);
|
|
128
|
+
envs.add(env);
|
|
129
|
+
rawNames.set(env, new Set([...(rawNames.get(env) ?? []), raw, env]));
|
|
130
|
+
const file = cmd ? flag(cmd, ['dart-define-from-file']) : undefined;
|
|
131
|
+
if (file && !explicitEnvFile.has(env))
|
|
132
|
+
explicitEnvFile.set(env, path.posix.join(cwd, file));
|
|
133
|
+
};
|
|
134
|
+
for (const { config, cmd, cwd } of commands) {
|
|
135
|
+
const e = flag(cmd, ['env']) ?? config;
|
|
136
|
+
if (e)
|
|
137
|
+
addEnv(e, cmd, cwd);
|
|
138
|
+
if (config && e !== config)
|
|
139
|
+
rawNames.get(envName(e))?.add(config);
|
|
140
|
+
}
|
|
141
|
+
for (const [, cmd] of custom) {
|
|
142
|
+
const e = flag(cmd, ['env', 'configuration', 'c']);
|
|
143
|
+
if (e)
|
|
144
|
+
addEnv(e);
|
|
145
|
+
}
|
|
146
|
+
if (envs.size === 0)
|
|
147
|
+
addEnv('prod');
|
|
148
|
+
const envList = [...envs].sort((a, b) => order(a) - order(b) || a.localeCompare(b));
|
|
149
|
+
// dist and base href.
|
|
150
|
+
const fromScripts = (field) => scriptTexts.map((t) => (0, build_scripts_1.appFieldInScript)(t, name, field)).find((v) => v !== undefined);
|
|
151
|
+
const flutterRun = commands.find((c) => /\bflutter\s+build\s+web\b/.test(c.cmd));
|
|
152
|
+
const flutterCmd = flutterRun?.cmd;
|
|
153
|
+
const output = flutterCmd ? flag(flutterCmd, ['output', 'o']) : undefined;
|
|
154
|
+
const dist = workspacePath(tree.root, fromScripts('dist')) ??
|
|
155
|
+
workspacePath(tree.root, output && flutterRun ? path.resolve(tree.root, flutterRun.cwd, output) : undefined) ??
|
|
156
|
+
`dist/${root}/web`;
|
|
157
|
+
const hrefs = { ...(buildScripts.baseHrefs.get(name) ?? {}) };
|
|
158
|
+
const cmdHref = flutterCmd ? flag(flutterCmd, ['base-href']) : undefined;
|
|
159
|
+
if (cmdHref && !hrefs['*'])
|
|
160
|
+
hrefs['*'] = cmdHref;
|
|
161
|
+
// Text of everything that stays as it was: a file those still name is copied, not moved.
|
|
162
|
+
const stays = [
|
|
163
|
+
JSON.stringify(Object.fromEntries(Object.entries(targets).filter(([k]) => k !== webTarget))),
|
|
164
|
+
JSON.stringify(readPackageScripts(tree, custom.map(([k]) => k))),
|
|
165
|
+
].join('\n');
|
|
166
|
+
const stillUsed = (file) => {
|
|
167
|
+
const rel = file.slice(root.length + 1);
|
|
168
|
+
return stays.includes(rel) || stays.includes(file);
|
|
169
|
+
};
|
|
170
|
+
// Env files: the --dart-define-from-file the old command passed, else <root>/env/<env>.json
|
|
171
|
+
// under any name the env had (prod, production) → environments/<app>/environment.<env>.json.
|
|
172
|
+
for (const env of envList) {
|
|
173
|
+
const to = (0, env_files_1.flutterEnvFile)(name, env);
|
|
174
|
+
if (tree.exists(to))
|
|
175
|
+
continue;
|
|
176
|
+
const explicit = explicitEnvFile.get(env);
|
|
177
|
+
const candidates = [
|
|
178
|
+
...(explicit ? [explicit] : []),
|
|
179
|
+
...[...(rawNames.get(env) ?? [env])].map((r) => `${root}/env/${r}.json`),
|
|
180
|
+
].map((f) => path.posix.normalize(f));
|
|
181
|
+
const from = candidates.find((f) => !f.startsWith('..') && tree.exists(f) && tree.isFile(f));
|
|
182
|
+
if (from) {
|
|
183
|
+
tree.write(to, tree.read(from));
|
|
184
|
+
if (stillUsed(from)) {
|
|
185
|
+
notes.push(`${code(from)} copied to ${code(to)} (kept: another target still uses it)`);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
tree.delete(from);
|
|
189
|
+
notes.push(`${code(from)} moved to ${code(to)}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
tree.write(to, '{}\n');
|
|
194
|
+
notes.push(`${code(to)} created empty (no ${code(`${root}/env/${env}.json`)}; add the app's ` +
|
|
195
|
+
'--dart-define values there)');
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// .htaccess: web/.htaccess → environments/<app>/htaccess.<env>.
|
|
199
|
+
const htSource = `${root}/web/.htaccess`;
|
|
200
|
+
let htaccess = false;
|
|
201
|
+
if (tree.exists(htSource)) {
|
|
202
|
+
htaccess = true;
|
|
203
|
+
const content = tree.read(htSource);
|
|
204
|
+
const written = [];
|
|
205
|
+
const kept = [];
|
|
206
|
+
for (const env of envList) {
|
|
207
|
+
const file = (0, htaccess_1.htaccessSourcePath)(name, env);
|
|
208
|
+
if (tree.exists(file))
|
|
209
|
+
kept.push(file);
|
|
210
|
+
else {
|
|
211
|
+
tree.write(file, content);
|
|
212
|
+
written.push(file);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
tree.delete(htSource);
|
|
216
|
+
notes.push(`${code(htSource)} became ${written.map(code).join(', ') || 'nothing new'}` +
|
|
217
|
+
(kept.length > 0 ? ` (kept ${kept.map(code).join(', ')})` : '') +
|
|
218
|
+
' (each web build copies its own env file as `.htaccess`)');
|
|
219
|
+
}
|
|
220
|
+
else if (envList.some((e) => tree.exists((0, htaccess_1.htaccessSourcePath)(name, e)))) {
|
|
221
|
+
htaccess = true;
|
|
222
|
+
}
|
|
223
|
+
// The new target. The script's post-build steps apply only to an app it built.
|
|
224
|
+
const viaScript = custom.length > 0 || commands.some((c) => /\bnode\s+\S+\.(?:c|m)?js\b/.test(c.cmd));
|
|
225
|
+
const options = { target: 'web', dist };
|
|
226
|
+
if (!htaccess)
|
|
227
|
+
options['htaccess'] = false;
|
|
228
|
+
if (viaScript && pipeline.nonce) {
|
|
229
|
+
options['secure'] = true;
|
|
230
|
+
const n = pipeline.nonce;
|
|
231
|
+
const nonce = {};
|
|
232
|
+
if (n.placeholder)
|
|
233
|
+
nonce['placeholder'] = n.placeholder;
|
|
234
|
+
if (n.tags)
|
|
235
|
+
nonce['tags'] = n.tags;
|
|
236
|
+
if (n.position)
|
|
237
|
+
nonce['position'] = n.position;
|
|
238
|
+
if (n.replaceTokens.length > 0)
|
|
239
|
+
nonce['replaceTokens'] = n.replaceTokens;
|
|
240
|
+
if (!n.addMeta)
|
|
241
|
+
nonce['addMeta'] = false;
|
|
242
|
+
if (Object.keys(nonce).length > 0)
|
|
243
|
+
options['nonce'] = nonce;
|
|
244
|
+
}
|
|
245
|
+
if (viaScript && pipeline.stripHtmlComments)
|
|
246
|
+
options['stripHtmlComments'] = true;
|
|
247
|
+
const configurations = {};
|
|
248
|
+
for (const env of envList) {
|
|
249
|
+
const href = hrefs[env] ?? hrefs['*'];
|
|
250
|
+
configurations[env] = href && href !== '/' ? { env, baseHref: href } : { env };
|
|
251
|
+
}
|
|
252
|
+
const target = {
|
|
253
|
+
executor: exports.FLUTTER_BUILD_EXECUTOR,
|
|
254
|
+
options,
|
|
255
|
+
configurations,
|
|
256
|
+
defaultConfiguration: envList.includes('dev') ? 'dev' : envList[0],
|
|
257
|
+
};
|
|
258
|
+
// Same key, same place in targets.
|
|
259
|
+
pj['targets'] = Object.fromEntries(Object.entries(targets).map(([k, v]) => [k, k === webTarget ? target : v]));
|
|
260
|
+
tree.write(pjPath, `${JSON.stringify(pj, null, 2)}\n`);
|
|
261
|
+
notes.push(`${code(webTarget)} builds with flutter-build into ${code(dist)} (${envList.join(', ')})` +
|
|
262
|
+
(Object.values(configurations).some((c) => c['baseHref'])
|
|
263
|
+
? `, base href ${code(String(hrefs[envList[0]] ?? hrefs['*']))}`
|
|
264
|
+
: ''));
|
|
265
|
+
const others = Object.entries(targets)
|
|
266
|
+
.filter(([k, t]) => k !== webTarget && isObject(t) && t['executor'] === 'nx:run-commands')
|
|
267
|
+
.map(([k]) => k);
|
|
268
|
+
if (others.length > 0) {
|
|
269
|
+
notes.push(`left as they were: ${others.map(code).join(', ')} (run-commands; the plugin's ` +
|
|
270
|
+
'flutter-build can run apk / ios builds too, with the same env files)');
|
|
271
|
+
}
|
|
272
|
+
// npm scripts: the ones that built through the script now run the target; standard names for
|
|
273
|
+
// envs no script covered.
|
|
274
|
+
const covered = new Set();
|
|
275
|
+
for (const [key, cmd] of custom) {
|
|
276
|
+
const e = flag(cmd, ['env', 'configuration', 'c']);
|
|
277
|
+
const env = e ? envName(e) : envList[0];
|
|
278
|
+
if (!envList.includes(env))
|
|
279
|
+
continue;
|
|
280
|
+
scripts[key] = `nx run ${name}:${webTarget}:${env}`;
|
|
281
|
+
covered.add(env);
|
|
282
|
+
}
|
|
283
|
+
for (const env of envList) {
|
|
284
|
+
if (!covered.has(env) && scripts[`build:${name}:${env}`] === undefined) {
|
|
285
|
+
scripts[`build:${name}:${env}`] = `nx run ${name}:${webTarget}:${env}`;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return { envs: envList, scripts, notes };
|
|
289
|
+
}
|
|
290
|
+
exports.adoptFlutterApp = adoptFlutterApp;
|
|
291
|
+
const ORDER = ['dev', 'uat', 'prod'];
|
|
292
|
+
const order = (e) => (ORDER.includes(e) ? ORDER.indexOf(e) : ORDER.length);
|
|
293
|
+
/** The workspace's npm scripts, without the ones adopt rewrites. */
|
|
294
|
+
function readPackageScripts(tree, rewritten) {
|
|
295
|
+
if (!tree.exists('package.json'))
|
|
296
|
+
return {};
|
|
297
|
+
try {
|
|
298
|
+
const all = (JSON.parse(tree.read('package.json', 'utf8') ?? '{}').scripts ?? {});
|
|
299
|
+
return Object.fromEntries(Object.entries(all).filter(([k]) => !rewritten.includes(k)));
|
|
300
|
+
}
|
|
301
|
+
catch {
|
|
302
|
+
return {};
|
|
303
|
+
}
|
|
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AAG,EAAE,CAAC;SACxE;KACF;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC3C,CAAC;AA5MD,0CA4MC;AAED,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACrC,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAEnF,oEAAoE;AACpE,SAAS,kBAAkB,CAAC,IAAU,EAAE,SAAmB;IACzD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;QAAE,OAAO,EAAE,CAAC;IAC5C,IAAI;QACF,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,IAAI,EAAE,CAG/E,CAAC;QACF,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACxF;IAAC,MAAM;QACN,OAAO,EAAE,CAAC;KACX;AACH,CAAC"}
|
|
@@ -32,6 +32,14 @@ export interface AdoptResult {
|
|
|
32
32
|
unreferenced: string[];
|
|
33
33
|
/** removeOldScripts looked (so the report's "Old scripts" section is current). */
|
|
34
34
|
oldScriptsChecked?: boolean;
|
|
35
|
+
/** What still named the removed scripts and was edited (`file:line: what`). */
|
|
36
|
+
referencesEdited?: string[];
|
|
37
|
+
/** Mentions of removed scripts left for a person to look at (`file:line`). */
|
|
38
|
+
referencesReview?: string[];
|
|
39
|
+
/** Flutter apps (also in adopted) whose web build moved to the flutter-build executor. */
|
|
40
|
+
flutter?: string[];
|
|
41
|
+
/** Apps already on the plugin whose build still copied a .htaccess, moved to the env files. */
|
|
42
|
+
htaccessMoved?: string[];
|
|
35
43
|
}
|
|
36
44
|
/** Angular apps of the workspace that build without the plugin: build target, no release target. */
|
|
37
45
|
export declare function adoptCandidates(tree: Tree): {
|
|
@@ -39,6 +47,15 @@ export declare function adoptCandidates(tree: Tree): {
|
|
|
39
47
|
root: string;
|
|
40
48
|
reason?: string;
|
|
41
49
|
}[];
|
|
50
|
+
/**
|
|
51
|
+
* Apps already on the plugin's release target whose build still copies a .htaccess (added by hand
|
|
52
|
+
* or copied from another app's project.json): the .htaccess becomes environments/<app>/htaccess.<env>
|
|
53
|
+
* as adopt does for the apps it moves, and leaves the build assets.
|
|
54
|
+
*/
|
|
55
|
+
export declare function strayHtaccessApps(tree: Tree): {
|
|
56
|
+
name: string;
|
|
57
|
+
root: string;
|
|
58
|
+
}[];
|
|
42
59
|
/**
|
|
43
60
|
* Sets npm scripts in package.json without reformatting the rest of the file: existing scripts
|
|
44
61
|
* are changed in place, new ones go after the app's last build script (or at the end of scripts).
|