@memberjunction/installer 0.0.1 → 5.6.0
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/dist/InstallerEngine.d.ts +182 -0
- package/dist/InstallerEngine.d.ts.map +1 -0
- package/dist/InstallerEngine.js +571 -0
- package/dist/InstallerEngine.js.map +1 -0
- package/dist/adapters/FileSystemAdapter.d.ts +197 -0
- package/dist/adapters/FileSystemAdapter.d.ts.map +1 -0
- package/dist/adapters/FileSystemAdapter.js +355 -0
- package/dist/adapters/FileSystemAdapter.js.map +1 -0
- package/dist/adapters/GitHubReleaseProvider.d.ts +197 -0
- package/dist/adapters/GitHubReleaseProvider.d.ts.map +1 -0
- package/dist/adapters/GitHubReleaseProvider.js +348 -0
- package/dist/adapters/GitHubReleaseProvider.js.map +1 -0
- package/dist/adapters/ProcessRunner.d.ts +174 -0
- package/dist/adapters/ProcessRunner.d.ts.map +1 -0
- package/dist/adapters/ProcessRunner.js +264 -0
- package/dist/adapters/ProcessRunner.js.map +1 -0
- package/dist/adapters/SqlServerAdapter.d.ts +78 -0
- package/dist/adapters/SqlServerAdapter.d.ts.map +1 -0
- package/dist/adapters/SqlServerAdapter.js +120 -0
- package/dist/adapters/SqlServerAdapter.js.map +1 -0
- package/dist/errors/InstallerError.d.ts +92 -0
- package/dist/errors/InstallerError.d.ts.map +1 -0
- package/dist/errors/InstallerError.js +66 -0
- package/dist/errors/InstallerError.js.map +1 -0
- package/dist/events/InstallerEvents.d.ts +255 -0
- package/dist/events/InstallerEvents.d.ts.map +1 -0
- package/dist/events/InstallerEvents.js +96 -0
- package/dist/events/InstallerEvents.js.map +1 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/models/Diagnostics.d.ts +121 -0
- package/dist/models/Diagnostics.d.ts.map +1 -0
- package/dist/models/Diagnostics.js +75 -0
- package/dist/models/Diagnostics.js.map +1 -0
- package/dist/models/InstallConfig.d.ts +139 -0
- package/dist/models/InstallConfig.d.ts.map +1 -0
- package/dist/models/InstallConfig.js +207 -0
- package/dist/models/InstallConfig.js.map +1 -0
- package/dist/models/InstallPlan.d.ts +189 -0
- package/dist/models/InstallPlan.d.ts.map +1 -0
- package/dist/models/InstallPlan.js +117 -0
- package/dist/models/InstallPlan.js.map +1 -0
- package/dist/models/InstallState.d.ts +173 -0
- package/dist/models/InstallState.d.ts.map +1 -0
- package/dist/models/InstallState.js +203 -0
- package/dist/models/InstallState.js.map +1 -0
- package/dist/models/VersionInfo.d.ts +53 -0
- package/dist/models/VersionInfo.d.ts.map +1 -0
- package/dist/models/VersionInfo.js +2 -0
- package/dist/models/VersionInfo.js.map +1 -0
- package/dist/phases/CodeGenPhase.d.ts +364 -0
- package/dist/phases/CodeGenPhase.d.ts.map +1 -0
- package/dist/phases/CodeGenPhase.js +1086 -0
- package/dist/phases/CodeGenPhase.js.map +1 -0
- package/dist/phases/ConfigurePhase.d.ts +86 -0
- package/dist/phases/ConfigurePhase.d.ts.map +1 -0
- package/dist/phases/ConfigurePhase.js +439 -0
- package/dist/phases/ConfigurePhase.js.map +1 -0
- package/dist/phases/DatabaseProvisionPhase.d.ts +82 -0
- package/dist/phases/DatabaseProvisionPhase.d.ts.map +1 -0
- package/dist/phases/DatabaseProvisionPhase.js +284 -0
- package/dist/phases/DatabaseProvisionPhase.js.map +1 -0
- package/dist/phases/DependencyPhase.d.ts +88 -0
- package/dist/phases/DependencyPhase.d.ts.map +1 -0
- package/dist/phases/DependencyPhase.js +237 -0
- package/dist/phases/DependencyPhase.js.map +1 -0
- package/dist/phases/MigratePhase.d.ts +70 -0
- package/dist/phases/MigratePhase.d.ts.map +1 -0
- package/dist/phases/MigratePhase.js +96 -0
- package/dist/phases/MigratePhase.js.map +1 -0
- package/dist/phases/PlatformCompatPhase.d.ts +193 -0
- package/dist/phases/PlatformCompatPhase.d.ts.map +1 -0
- package/dist/phases/PlatformCompatPhase.js +587 -0
- package/dist/phases/PlatformCompatPhase.js.map +1 -0
- package/dist/phases/PreflightPhase.d.ts +119 -0
- package/dist/phases/PreflightPhase.d.ts.map +1 -0
- package/dist/phases/PreflightPhase.js +394 -0
- package/dist/phases/PreflightPhase.js.map +1 -0
- package/dist/phases/ScaffoldPhase.d.ts +99 -0
- package/dist/phases/ScaffoldPhase.d.ts.map +1 -0
- package/dist/phases/ScaffoldPhase.js +235 -0
- package/dist/phases/ScaffoldPhase.js.map +1 -0
- package/dist/phases/SmokeTestPhase.d.ts +111 -0
- package/dist/phases/SmokeTestPhase.d.ts.map +1 -0
- package/dist/phases/SmokeTestPhase.js +426 -0
- package/dist/phases/SmokeTestPhase.js.map +1 -0
- package/package.json +26 -7
- package/README.md +0 -45
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase F — Platform Compatibility
|
|
3
|
+
*
|
|
4
|
+
* Detects and fixes cross-platform issues in npm scripts that would
|
|
5
|
+
* prevent the MemberJunction workspace from building or running on Windows.
|
|
6
|
+
*
|
|
7
|
+
* **F1: Cross-platform script patching** (Windows only):
|
|
8
|
+
* - **Unix env vars** (`FOO=bar command`) — prefixed with `cross-env`.
|
|
9
|
+
* - **Bash conditionals** (`if [ -d dir ]; then ...`) — rewritten to
|
|
10
|
+
* `node -e` equivalents that work in `cmd.exe`.
|
|
11
|
+
* - **Single-quoted globs** (`'src/**'`) — replaced with double quotes
|
|
12
|
+
* (single quotes are literal in `cmd.exe`, breaking glob expansion).
|
|
13
|
+
*
|
|
14
|
+
* On non-Windows platforms, these issues are only warned about (not patched).
|
|
15
|
+
*
|
|
16
|
+
* **F2: Heap size advisory** (Node >= 24):
|
|
17
|
+
* - Informs users that `--max-old-space-size` flags may no longer be needed
|
|
18
|
+
* since Node 24+ has improved memory management.
|
|
19
|
+
*
|
|
20
|
+
* **F3: TypeScript build hygiene** (all platforms):
|
|
21
|
+
* - Ensures `tsconfig.json` files exclude test directories (`__tests__`,
|
|
22
|
+
* `*.test.ts`, `*.spec.ts`) so that test-only compilation errors don't
|
|
23
|
+
* block production builds. This fixes a known issue where release packages
|
|
24
|
+
* ship test files referencing features from a newer version.
|
|
25
|
+
*
|
|
26
|
+
* **F4: Stale entity file cleanup** (all platforms):
|
|
27
|
+
* - Removes old-name entity files from `MJCoreEntities/src/custom/` that
|
|
28
|
+
* were superseded by MJ-prefixed versions during the 5.x entity rename.
|
|
29
|
+
* The published packages may ship both old and new files (e.g.,
|
|
30
|
+
* `UserViewEntity.ts` alongside `MJUserViewEntityExtended.ts`). The old
|
|
31
|
+
* files cause build errors (private property type conflicts) and runtime
|
|
32
|
+
* issues (duplicate `@RegisterClass` registrations).
|
|
33
|
+
*
|
|
34
|
+
* @module phases/PlatformCompatPhase
|
|
35
|
+
* @see PreflightPhase — provides the detected OS used for conditional patching.
|
|
36
|
+
*/
|
|
37
|
+
import path from 'node:path';
|
|
38
|
+
import { FileSystemAdapter } from '../adapters/FileSystemAdapter.js';
|
|
39
|
+
/**
|
|
40
|
+
* Regex matching Unix-only env var syntax like `FOO=bar some-command`.
|
|
41
|
+
* These scripts fail on Windows where `cmd.exe` doesn't support inline env vars.
|
|
42
|
+
*/
|
|
43
|
+
const UNIX_ENV_PATTERN = /^([A-Z_]+=\S+\s+)+/;
|
|
44
|
+
/**
|
|
45
|
+
* Regex matching bash conditional syntax: `if [ ... ]; then ... fi`.
|
|
46
|
+
* These scripts fail on Windows where `cmd.exe` doesn't support `[` test syntax.
|
|
47
|
+
*/
|
|
48
|
+
const BASH_CONDITIONAL_PATTERN = /^if\s+\[/;
|
|
49
|
+
/**
|
|
50
|
+
* Regex matching single-quoted file path or glob arguments in npm scripts.
|
|
51
|
+
*
|
|
52
|
+
* On Windows `cmd.exe`, single quotes are passed literally to commands
|
|
53
|
+
* (they're NOT quote characters in `cmd.exe`). This breaks any tool
|
|
54
|
+
* receiving a path with embedded quotes — both glob patterns like
|
|
55
|
+
* `cpy 'src/lib/styles/**'` and plain paths like `cpy 'src/lib/_tokens.scss'`.
|
|
56
|
+
* Double quotes work correctly on both platforms.
|
|
57
|
+
*
|
|
58
|
+
* We match single-quoted args containing `/` (path separator) or `*` (glob
|
|
59
|
+
* wildcard). As an additional safety net, `node -e "..."` and `node -p "..."`
|
|
60
|
+
* blocks are stripped before testing this pattern, so JS string delimiters
|
|
61
|
+
* like `require.resolve('turbo')` are never matched even if they contain
|
|
62
|
+
* `/` or `*`.
|
|
63
|
+
*/
|
|
64
|
+
const SINGLE_QUOTED_ARG_PATTERN = /'[^']*[/*][^']*'/;
|
|
65
|
+
/**
|
|
66
|
+
* Phase F — Detects and patches cross-platform incompatibilities in npm scripts.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* const platform = new PlatformCompatPhase();
|
|
71
|
+
* const result = await platform.Run({
|
|
72
|
+
* Dir: '/path/to/install',
|
|
73
|
+
* DetectedOS: 'windows',
|
|
74
|
+
* Emitter: emitter,
|
|
75
|
+
* });
|
|
76
|
+
* console.log(`Patched ${result.ScriptsPatched.length} file(s)`);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export class PlatformCompatPhase {
|
|
80
|
+
constructor() {
|
|
81
|
+
this.fileSystem = new FileSystemAdapter();
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Execute the platform compatibility phase.
|
|
85
|
+
*
|
|
86
|
+
* Scans all `package.json` files in the workspace for platform-specific
|
|
87
|
+
* script issues and patches them on Windows. Also emits a heap size
|
|
88
|
+
* advisory for Node >= 24.
|
|
89
|
+
*
|
|
90
|
+
* @param context - Platform compat input with directory, detected OS, and emitter.
|
|
91
|
+
* @returns List of patched files and whether cross-env was added.
|
|
92
|
+
*/
|
|
93
|
+
async Run(context) {
|
|
94
|
+
const { Emitter: emitter } = context;
|
|
95
|
+
const patchedFiles = [];
|
|
96
|
+
let crossEnvNeeded = false;
|
|
97
|
+
// F1: Cross-platform script fix
|
|
98
|
+
emitter.Emit('step:progress', {
|
|
99
|
+
Type: 'step:progress',
|
|
100
|
+
Phase: 'platform',
|
|
101
|
+
Message: 'Scanning package.json files for platform-specific scripts...',
|
|
102
|
+
});
|
|
103
|
+
const packageJsonFiles = await this.fileSystem.FindFiles(context.Dir, 'package.json', 5);
|
|
104
|
+
for (const pkgPath of packageJsonFiles) {
|
|
105
|
+
const result = await this.checkAndPatchPackageJson(pkgPath, context.DetectedOS, emitter);
|
|
106
|
+
if (result.Patched) {
|
|
107
|
+
patchedFiles.push(pkgPath);
|
|
108
|
+
}
|
|
109
|
+
if (result.NeedsCrossEnv) {
|
|
110
|
+
crossEnvNeeded = true;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (patchedFiles.length > 0) {
|
|
114
|
+
emitter.Emit('log', {
|
|
115
|
+
Type: 'log',
|
|
116
|
+
Level: 'info',
|
|
117
|
+
Message: `Patched ${patchedFiles.length} package.json file(s) for cross-platform compatibility.`,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
emitter.Emit('log', {
|
|
122
|
+
Type: 'log',
|
|
123
|
+
Level: 'info',
|
|
124
|
+
Message: 'No platform-specific script issues detected.',
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// F2: Heap size advisory
|
|
128
|
+
await this.checkHeapAdvisory(context.Dir, emitter);
|
|
129
|
+
// F3: TypeScript build hygiene — exclude test files from tsconfig compilation
|
|
130
|
+
const tsconfigsPatched = await this.ensureTsconfigTestExclusions(context.Dir, emitter);
|
|
131
|
+
// F4: Remove stale pre-MJ-prefix entity files that cause build errors
|
|
132
|
+
const staleFilesRemoved = await this.removeStaleEntityFiles(context.Dir, emitter);
|
|
133
|
+
return {
|
|
134
|
+
ScriptsPatched: patchedFiles,
|
|
135
|
+
CrossEnvNeeded: crossEnvNeeded,
|
|
136
|
+
TsconfigsPatched: tsconfigsPatched,
|
|
137
|
+
StaleFilesRemoved: staleFilesRemoved,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
// ---------------------------------------------------------------------------
|
|
141
|
+
// F1: Cross-env detection and patching
|
|
142
|
+
// ---------------------------------------------------------------------------
|
|
143
|
+
async checkAndPatchPackageJson(pkgPath, detectedOS, emitter) {
|
|
144
|
+
let content;
|
|
145
|
+
try {
|
|
146
|
+
content = await this.fileSystem.ReadText(pkgPath);
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
return { Patched: false, NeedsCrossEnv: false };
|
|
150
|
+
}
|
|
151
|
+
let pkg;
|
|
152
|
+
try {
|
|
153
|
+
pkg = JSON.parse(content);
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
return { Patched: false, NeedsCrossEnv: false };
|
|
157
|
+
}
|
|
158
|
+
if (!pkg.scripts)
|
|
159
|
+
return { Patched: false, NeedsCrossEnv: false };
|
|
160
|
+
const envVarScripts = [];
|
|
161
|
+
const bashScripts = [];
|
|
162
|
+
const singleQuoteScripts = [];
|
|
163
|
+
for (const [name, script] of Object.entries(pkg.scripts)) {
|
|
164
|
+
if (this.hasUnixEnvSyntax(script) && !script.startsWith('cross-env ')) {
|
|
165
|
+
envVarScripts.push(name);
|
|
166
|
+
}
|
|
167
|
+
if (this.hasBashConditionalSyntax(script)) {
|
|
168
|
+
bashScripts.push(name);
|
|
169
|
+
}
|
|
170
|
+
if (this.hasSingleQuotedGlobs(script)) {
|
|
171
|
+
singleQuoteScripts.push(name);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (envVarScripts.length === 0 && bashScripts.length === 0 && singleQuoteScripts.length === 0) {
|
|
175
|
+
return { Patched: false, NeedsCrossEnv: false };
|
|
176
|
+
}
|
|
177
|
+
const pkgName = path.basename(path.dirname(pkgPath));
|
|
178
|
+
// On non-Windows, just warn
|
|
179
|
+
if (detectedOS !== 'windows') {
|
|
180
|
+
if (envVarScripts.length > 0) {
|
|
181
|
+
emitter.Emit('warn', {
|
|
182
|
+
Type: 'warn',
|
|
183
|
+
Phase: 'platform',
|
|
184
|
+
Message: `${pkgName}/package.json has Unix-only env syntax in: ${envVarScripts.join(', ')}. These won't work on Windows.`,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
if (bashScripts.length > 0) {
|
|
188
|
+
emitter.Emit('warn', {
|
|
189
|
+
Type: 'warn',
|
|
190
|
+
Phase: 'platform',
|
|
191
|
+
Message: `${pkgName}/package.json has bash-only syntax in: ${bashScripts.join(', ')}. These won't work on Windows.`,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
return { Patched: false, NeedsCrossEnv: false };
|
|
195
|
+
}
|
|
196
|
+
// On Windows, patch scripts
|
|
197
|
+
let needsCrossEnv = false;
|
|
198
|
+
const hasCrossEnv = !!(pkg.devDependencies?.['cross-env'] ?? pkg.dependencies?.['cross-env']);
|
|
199
|
+
for (const name of envVarScripts) {
|
|
200
|
+
const original = pkg.scripts[name];
|
|
201
|
+
pkg.scripts[name] = `cross-env ${original}`;
|
|
202
|
+
emitter.Emit('step:progress', {
|
|
203
|
+
Type: 'step:progress',
|
|
204
|
+
Phase: 'platform',
|
|
205
|
+
Message: `Patched env-var script "${name}" in ${pkgName}/package.json`,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
if (envVarScripts.length > 0 && !hasCrossEnv) {
|
|
209
|
+
pkg.devDependencies = pkg.devDependencies ?? {};
|
|
210
|
+
pkg.devDependencies['cross-env'] = '^7.0.3';
|
|
211
|
+
needsCrossEnv = true;
|
|
212
|
+
emitter.Emit('step:progress', {
|
|
213
|
+
Type: 'step:progress',
|
|
214
|
+
Phase: 'platform',
|
|
215
|
+
Message: `Added cross-env as devDependency in ${pkgName}/package.json`,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
for (const name of bashScripts) {
|
|
219
|
+
const original = pkg.scripts[name];
|
|
220
|
+
const replacement = this.rewriteBashConditional(original);
|
|
221
|
+
if (replacement) {
|
|
222
|
+
pkg.scripts[name] = replacement;
|
|
223
|
+
emitter.Emit('step:progress', {
|
|
224
|
+
Type: 'step:progress',
|
|
225
|
+
Phase: 'platform',
|
|
226
|
+
Message: `Rewrote bash script "${name}" in ${pkgName}/package.json for Windows compatibility`,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
emitter.Emit('warn', {
|
|
231
|
+
Type: 'warn',
|
|
232
|
+
Phase: 'platform',
|
|
233
|
+
Message: `Could not auto-patch bash script "${name}" in ${pkgName}/package.json. You may need to fix it manually.`,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
for (const name of singleQuoteScripts) {
|
|
238
|
+
pkg.scripts[name] = this.replaceSingleQuotes(pkg.scripts[name]);
|
|
239
|
+
emitter.Emit('step:progress', {
|
|
240
|
+
Type: 'step:progress',
|
|
241
|
+
Phase: 'platform',
|
|
242
|
+
Message: `Replaced single-quoted globs in "${name}" in ${pkgName}/package.json for Windows compatibility`,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
// Write back the patched package.json
|
|
246
|
+
const updatedContent = JSON.stringify(pkg, null, 2) + '\n';
|
|
247
|
+
await this.fileSystem.WriteText(pkgPath, updatedContent);
|
|
248
|
+
return { Patched: true, NeedsCrossEnv: needsCrossEnv };
|
|
249
|
+
}
|
|
250
|
+
hasUnixEnvSyntax(script) {
|
|
251
|
+
return UNIX_ENV_PATTERN.test(script);
|
|
252
|
+
}
|
|
253
|
+
hasBashConditionalSyntax(script) {
|
|
254
|
+
return BASH_CONDITIONAL_PATTERN.test(script);
|
|
255
|
+
}
|
|
256
|
+
hasSingleQuotedGlobs(script) {
|
|
257
|
+
// Don't flag scripts where all single quotes live inside node -e/node -p code
|
|
258
|
+
const stripped = this.stripEmbeddedNodeCode(script);
|
|
259
|
+
return SINGLE_QUOTED_ARG_PATTERN.test(stripped);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Replaces single-quoted file path/glob arguments with double-quoted equivalents.
|
|
263
|
+
* e.g. cpy 'src/lib/styles/**' → cpy "src/lib/styles/**"
|
|
264
|
+
*
|
|
265
|
+
* Only replaces single-quoted args containing `/` or `*` (file paths and globs).
|
|
266
|
+
* As a safety net, `node -e "..."` and `node -p "..."` embedded code blocks are
|
|
267
|
+
* preserved verbatim — single quotes inside those are JS string delimiters that
|
|
268
|
+
* must not be converted to double quotes.
|
|
269
|
+
*/
|
|
270
|
+
replaceSingleQuotes(script) {
|
|
271
|
+
return this.withEmbeddedNodeCodePreserved(script, (segment) => segment.replace(/'([^']*[/*][^']*)'/g, '"$1"'));
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Regex matching `node -e "..."` or `node -p "..."` inline code blocks.
|
|
275
|
+
* Captures the entire block so we can exclude it from single-quote replacement.
|
|
276
|
+
*/
|
|
277
|
+
static { this.NODE_EVAL_PATTERN = /node\s+-[ep]\s+"[^"]*"/g; }
|
|
278
|
+
/**
|
|
279
|
+
* Returns the script with all `node -e "..."` / `node -p "..."` blocks removed,
|
|
280
|
+
* so callers can test the remaining text for patterns without false positives
|
|
281
|
+
* from embedded JS code.
|
|
282
|
+
*/
|
|
283
|
+
stripEmbeddedNodeCode(script) {
|
|
284
|
+
return script.replace(PlatformCompatPhase.NODE_EVAL_PATTERN, '');
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Applies `transform` to every part of `script` that is NOT inside a
|
|
288
|
+
* `node -e "..."` or `node -p "..."` block, preserving those blocks verbatim.
|
|
289
|
+
*/
|
|
290
|
+
withEmbeddedNodeCodePreserved(script, transform) {
|
|
291
|
+
const parts = [];
|
|
292
|
+
let lastIndex = 0;
|
|
293
|
+
for (const match of script.matchAll(PlatformCompatPhase.NODE_EVAL_PATTERN)) {
|
|
294
|
+
// Transform the gap before this node -e block
|
|
295
|
+
parts.push(transform(script.slice(lastIndex, match.index)));
|
|
296
|
+
// Keep the node -e block untouched
|
|
297
|
+
parts.push(match[0]);
|
|
298
|
+
lastIndex = match.index + match[0].length;
|
|
299
|
+
}
|
|
300
|
+
// Transform the remainder after the last node -e block (or the whole string if none)
|
|
301
|
+
parts.push(transform(script.slice(lastIndex)));
|
|
302
|
+
return parts.join('');
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Rewrites bash conditional scripts to cross-platform Node.js equivalents.
|
|
306
|
+
*
|
|
307
|
+
* Strategy: replace the entire script with a single `node -e` that performs
|
|
308
|
+
* the condition check and branch logic inline, then chains the actual commands
|
|
309
|
+
* with && / ||. This avoids nested quoting issues.
|
|
310
|
+
*
|
|
311
|
+
* Returns null if the script can't be auto-rewritten.
|
|
312
|
+
*/
|
|
313
|
+
rewriteBashConditional(script) {
|
|
314
|
+
// Pattern: if [ -d DIR ]; then THEN_BODY; else ELSE_BODY; fi
|
|
315
|
+
const dirIfElse = script.match(/^if\s+\[\s+-d\s+(\S+)\s+\];\s*then\s+(.*?);\s*else\s+(.*?);\s*fi$/);
|
|
316
|
+
if (dirIfElse) {
|
|
317
|
+
const dir = dirIfElse[1];
|
|
318
|
+
const thenBody = this.rewriteBashCommands(dirIfElse[2].trim());
|
|
319
|
+
const elseBody = this.rewriteBashCommands(dirIfElse[3].trim());
|
|
320
|
+
// node -e exits 0 if dir exists, 1 if not.
|
|
321
|
+
// cmd.exe: A && B || C → if A succeeds run B, if A fails run C
|
|
322
|
+
const check = `node -e "if(!require('fs').existsSync('${dir}'))process.exit(1)"`;
|
|
323
|
+
return `${check} && (${thenBody}) || (${elseBody})`;
|
|
324
|
+
}
|
|
325
|
+
// Pattern: if [ -f FILE ]; then THEN_BODY; fi
|
|
326
|
+
const fileIf = script.match(/^if\s+\[\s+-f\s+(\S+)\s+\];\s*then\s+(.*?);\s*fi$/);
|
|
327
|
+
if (fileIf) {
|
|
328
|
+
const file = fileIf[1];
|
|
329
|
+
const thenBody = this.rewriteBashCommands(fileIf[2].trim());
|
|
330
|
+
const check = `node -e "if(!require('fs').existsSync('${file}'))process.exit(1)"`;
|
|
331
|
+
return `${check} && (${thenBody}) || echo Skipped`;
|
|
332
|
+
}
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Rewrites bash-only commands within a command chain to cross-platform equivalents.
|
|
337
|
+
* Replaces: `touch FILE`, `rm FILE`
|
|
338
|
+
* Leaves other commands (npm, mj, tsc, echo, etc.) unchanged.
|
|
339
|
+
* Handles `&&` chains and `||` fallbacks.
|
|
340
|
+
*/
|
|
341
|
+
rewriteBashCommands(chain) {
|
|
342
|
+
// Split on && but preserve || fallbacks
|
|
343
|
+
// e.g. "rm .needs-manifest-rebuild && (mj codegen ... || echo warning)"
|
|
344
|
+
return chain.replace(/\btouch\s+(\S+)/g, (_match, file) => {
|
|
345
|
+
return `node -e "require('fs').writeFileSync('${file}','')"`;
|
|
346
|
+
}).replace(/\brm\s+(\S+)/g, (_match, file) => {
|
|
347
|
+
return `node -e "try{require('fs').unlinkSync('${file}')}catch(e){}"`;
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
// ---------------------------------------------------------------------------
|
|
351
|
+
// F3: TypeScript build hygiene — exclude test files from tsconfig
|
|
352
|
+
// ---------------------------------------------------------------------------
|
|
353
|
+
/**
|
|
354
|
+
* Standard test-file exclusion patterns added to tsconfig `exclude` arrays.
|
|
355
|
+
* These ensure that `tsc` doesn't compile test files during production builds.
|
|
356
|
+
* Vitest handles its own compilation via its config, so tests still run fine.
|
|
357
|
+
*/
|
|
358
|
+
static { this.TEST_EXCLUDE_PATTERNS = [
|
|
359
|
+
'src/__tests__/**',
|
|
360
|
+
'src/**/*.test.ts',
|
|
361
|
+
'src/**/*.spec.ts',
|
|
362
|
+
]; }
|
|
363
|
+
/**
|
|
364
|
+
* Scans all `tsconfig.json` files under `packages/` and adds test-file
|
|
365
|
+
* exclusion patterns where missing. This prevents test files that reference
|
|
366
|
+
* newer or unreleased APIs from breaking the production build.
|
|
367
|
+
*
|
|
368
|
+
* @returns Number of tsconfig files that were patched.
|
|
369
|
+
*/
|
|
370
|
+
async ensureTsconfigTestExclusions(dir, emitter) {
|
|
371
|
+
emitter.Emit('step:progress', {
|
|
372
|
+
Type: 'step:progress',
|
|
373
|
+
Phase: 'platform',
|
|
374
|
+
Message: 'Checking tsconfig.json files for test-file exclusions...',
|
|
375
|
+
});
|
|
376
|
+
const tsconfigFiles = await this.fileSystem.FindFiles(dir, 'tsconfig.json', 5);
|
|
377
|
+
let patchedCount = 0;
|
|
378
|
+
for (const tsconfigPath of tsconfigFiles) {
|
|
379
|
+
const patched = await this.patchTsconfigIfNeeded(tsconfigPath);
|
|
380
|
+
if (patched) {
|
|
381
|
+
patchedCount++;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (patchedCount > 0) {
|
|
385
|
+
emitter.Emit('log', {
|
|
386
|
+
Type: 'log',
|
|
387
|
+
Level: 'info',
|
|
388
|
+
Message: `Added test-file exclusions to ${patchedCount} tsconfig.json file(s).`,
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
return patchedCount;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Patches a single tsconfig.json to exclude test files if not already excluded.
|
|
395
|
+
* Only patches files that include `src/**` patterns (package tsconfigs).
|
|
396
|
+
*
|
|
397
|
+
* @returns `true` if the file was modified.
|
|
398
|
+
*/
|
|
399
|
+
async patchTsconfigIfNeeded(tsconfigPath) {
|
|
400
|
+
let content;
|
|
401
|
+
try {
|
|
402
|
+
content = await this.fileSystem.ReadText(tsconfigPath);
|
|
403
|
+
}
|
|
404
|
+
catch {
|
|
405
|
+
return false;
|
|
406
|
+
}
|
|
407
|
+
let tsconfig;
|
|
408
|
+
try {
|
|
409
|
+
tsconfig = JSON.parse(content);
|
|
410
|
+
}
|
|
411
|
+
catch {
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
// Only patch tsconfigs that include src/** (package-level configs)
|
|
415
|
+
const includePatterns = tsconfig.include ?? [];
|
|
416
|
+
const includesSrc = includePatterns.some((p) => p.includes('src/') || p.includes('src\\') || p === 'src/**/*' || p === 'src/**');
|
|
417
|
+
if (!includesSrc) {
|
|
418
|
+
return false;
|
|
419
|
+
}
|
|
420
|
+
// Check if test exclusions are already present
|
|
421
|
+
const excludePatterns = tsconfig.exclude ?? [];
|
|
422
|
+
const existingExcludes = new Set(excludePatterns.map((p) => p.toLowerCase()));
|
|
423
|
+
const missingPatterns = PlatformCompatPhase.TEST_EXCLUDE_PATTERNS.filter((pattern) => !existingExcludes.has(pattern.toLowerCase()));
|
|
424
|
+
if (missingPatterns.length === 0) {
|
|
425
|
+
return false; // Already has all needed exclusions
|
|
426
|
+
}
|
|
427
|
+
// Patch: add missing test exclusion patterns
|
|
428
|
+
tsconfig.exclude = [...excludePatterns, ...missingPatterns];
|
|
429
|
+
const updatedContent = JSON.stringify(tsconfig, null, 2) + '\n';
|
|
430
|
+
await this.fileSystem.WriteText(tsconfigPath, updatedContent);
|
|
431
|
+
return true;
|
|
432
|
+
}
|
|
433
|
+
// ---------------------------------------------------------------------------
|
|
434
|
+
// F4: Stale entity file cleanup
|
|
435
|
+
// ---------------------------------------------------------------------------
|
|
436
|
+
/**
|
|
437
|
+
* Removes stale entity files from `packages/MJCoreEntities/src/custom/` that
|
|
438
|
+
* were superseded by MJ-prefixed versions during the 5.x entity rename.
|
|
439
|
+
*
|
|
440
|
+
* The published npm packages may ship both old-name and new-name files (e.g.,
|
|
441
|
+
* `UserViewEntity.ts` alongside `MJUserViewEntityExtended.ts`). The old files
|
|
442
|
+
* are unreferenced by `index.ts` but still compiled by `tsc`, causing build
|
|
443
|
+
* errors (TS2322: private property type conflicts) and potential runtime issues
|
|
444
|
+
* (duplicate `@RegisterClass` registrations for the same entity).
|
|
445
|
+
*
|
|
446
|
+
* Detection strategy: reads `index.ts` to identify active custom exports,
|
|
447
|
+
* then deletes any `.ts` files in `custom/` that contain `@RegisterClass`
|
|
448
|
+
* but are not referenced by any `index.ts` export line.
|
|
449
|
+
*
|
|
450
|
+
* @returns Number of stale files removed.
|
|
451
|
+
*/
|
|
452
|
+
async removeStaleEntityFiles(dir, emitter) {
|
|
453
|
+
const coreEntitiesSrc = path.join(dir, 'packages', 'MJCoreEntities', 'src');
|
|
454
|
+
const indexPath = path.join(coreEntitiesSrc, 'index.ts');
|
|
455
|
+
if (!(await this.fileSystem.FileExists(indexPath))) {
|
|
456
|
+
return 0; // MJCoreEntities not present
|
|
457
|
+
}
|
|
458
|
+
// Build the set of active custom file paths from index.ts exports
|
|
459
|
+
const indexContent = await this.fileSystem.ReadText(indexPath);
|
|
460
|
+
const activeFiles = this.extractActiveCustomFiles(indexContent, coreEntitiesSrc);
|
|
461
|
+
if (activeFiles.size === 0) {
|
|
462
|
+
return 0; // No custom exports found
|
|
463
|
+
}
|
|
464
|
+
// Scan custom/ directory for stale .ts files with @RegisterClass
|
|
465
|
+
const customDir = path.join(coreEntitiesSrc, 'custom');
|
|
466
|
+
if (!(await this.fileSystem.DirectoryExists(customDir))) {
|
|
467
|
+
return 0;
|
|
468
|
+
}
|
|
469
|
+
const staleFiles = await this.findStaleEntityFiles(customDir, activeFiles);
|
|
470
|
+
if (staleFiles.length === 0) {
|
|
471
|
+
return 0;
|
|
472
|
+
}
|
|
473
|
+
emitter.Emit('step:progress', {
|
|
474
|
+
Type: 'step:progress',
|
|
475
|
+
Phase: 'platform',
|
|
476
|
+
Message: `Found ${staleFiles.length} stale pre-rename entity file(s) in MJCoreEntities — removing...`,
|
|
477
|
+
});
|
|
478
|
+
// Delete stale files
|
|
479
|
+
let removedCount = 0;
|
|
480
|
+
for (const staleFile of staleFiles) {
|
|
481
|
+
const relName = path.relative(coreEntitiesSrc, staleFile).replace(/\\/g, '/');
|
|
482
|
+
try {
|
|
483
|
+
await this.fileSystem.RemoveFile(staleFile);
|
|
484
|
+
removedCount++;
|
|
485
|
+
emitter.Emit('step:progress', {
|
|
486
|
+
Type: 'step:progress',
|
|
487
|
+
Phase: 'platform',
|
|
488
|
+
Message: `Removed stale entity file: ${relName}`,
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
catch {
|
|
492
|
+
emitter.Emit('warn', {
|
|
493
|
+
Type: 'warn',
|
|
494
|
+
Phase: 'platform',
|
|
495
|
+
Message: `Could not remove stale entity file: ${relName}. This may cause build errors.`,
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
if (removedCount > 0) {
|
|
500
|
+
emitter.Emit('log', {
|
|
501
|
+
Type: 'log',
|
|
502
|
+
Level: 'info',
|
|
503
|
+
Message: `Removed ${removedCount} stale entity file(s) from MJCoreEntities.`,
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
return removedCount;
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Extracts the set of active custom file paths from `index.ts` export lines.
|
|
510
|
+
*
|
|
511
|
+
* Parses lines like `export * from './custom/MJUserViewEntityExtended'`
|
|
512
|
+
* and resolves them to absolute paths with `.ts` extensions.
|
|
513
|
+
*/
|
|
514
|
+
extractActiveCustomFiles(indexContent, srcDir) {
|
|
515
|
+
const activeFiles = new Set();
|
|
516
|
+
const exportPattern = /export\s+\*\s+from\s+['"]\.\/custom\/([^'"]+)['"]/g;
|
|
517
|
+
let match;
|
|
518
|
+
while ((match = exportPattern.exec(indexContent)) !== null) {
|
|
519
|
+
const relPath = match[1] + '.ts';
|
|
520
|
+
activeFiles.add(path.normalize(path.join(srcDir, 'custom', relPath)));
|
|
521
|
+
}
|
|
522
|
+
return activeFiles;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Recursively finds `.ts` files in a directory that:
|
|
526
|
+
* 1. Are NOT in the `activeFiles` set (not exported by `index.ts`)
|
|
527
|
+
* 2. Contain `@RegisterClass` (indicating entity registration, not utilities)
|
|
528
|
+
*/
|
|
529
|
+
async findStaleEntityFiles(dirPath, activeFiles) {
|
|
530
|
+
const staleFiles = [];
|
|
531
|
+
const entries = await this.fileSystem.ListDirectoryEntries(dirPath);
|
|
532
|
+
for (const entry of entries) {
|
|
533
|
+
const fullPath = path.join(dirPath, entry);
|
|
534
|
+
if (await this.fileSystem.DirectoryExists(fullPath)) {
|
|
535
|
+
// Recurse into subdirectories
|
|
536
|
+
const subStale = await this.findStaleEntityFiles(fullPath, activeFiles);
|
|
537
|
+
staleFiles.push(...subStale);
|
|
538
|
+
}
|
|
539
|
+
else if (entry.endsWith('.ts') && !activeFiles.has(path.normalize(fullPath))) {
|
|
540
|
+
// Check if it's a stale entity file (contains @RegisterClass)
|
|
541
|
+
try {
|
|
542
|
+
const content = await this.fileSystem.ReadText(fullPath);
|
|
543
|
+
if (content.includes('@RegisterClass')) {
|
|
544
|
+
staleFiles.push(fullPath);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
catch {
|
|
548
|
+
// Can't read — skip
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
return staleFiles;
|
|
553
|
+
}
|
|
554
|
+
// ---------------------------------------------------------------------------
|
|
555
|
+
// F2: Heap size advisory
|
|
556
|
+
// ---------------------------------------------------------------------------
|
|
557
|
+
async checkHeapAdvisory(dir, emitter) {
|
|
558
|
+
const nodeMatch = process.version.match(/^v?(\d+)/);
|
|
559
|
+
const majorVersion = nodeMatch ? parseInt(nodeMatch[1], 10) : 0;
|
|
560
|
+
if (majorVersion >= 24) {
|
|
561
|
+
emitter.Emit('log', {
|
|
562
|
+
Type: 'log',
|
|
563
|
+
Level: 'info',
|
|
564
|
+
Message: 'Node 24+ detected. The --max-old-space-size flags in start scripts may no longer be necessary. You can remove them if memory usage is acceptable without them.',
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
// Check for heap flags in scripts
|
|
568
|
+
const packageJsonFiles = await this.fileSystem.FindFiles(dir, 'package.json', 2);
|
|
569
|
+
for (const pkgPath of packageJsonFiles) {
|
|
570
|
+
try {
|
|
571
|
+
const content = await this.fileSystem.ReadText(pkgPath);
|
|
572
|
+
if (content.includes('--max-old-space-size')) {
|
|
573
|
+
const pkgName = path.basename(path.dirname(pkgPath));
|
|
574
|
+
emitter.Emit('log', {
|
|
575
|
+
Type: 'log',
|
|
576
|
+
Level: 'verbose',
|
|
577
|
+
Message: `${pkgName}/package.json contains --max-old-space-size flags (left as-is).`,
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
catch {
|
|
582
|
+
// skip
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
//# sourceMappingURL=PlatformCompatPhase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlatformCompatPhase.js","sourceRoot":"","sources":["../../src/phases/PlatformCompatPhase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE;;;GAGG;AACH,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAE9C;;;GAGG;AACH,MAAM,wBAAwB,GAAG,UAAU,CAAC;AAE5C;;;;;;;;;;;;;;GAcG;AACH,MAAM,yBAAyB,GAAG,kBAAkB,CAAC;AAgDrD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,mBAAmB;IAAhC;QACU,eAAU,GAAG,IAAI,iBAAiB,EAAE,CAAC;IAilB/C,CAAC;IA/kBC;;;;;;;;;OASG;IACH,KAAK,CAAC,GAAG,CAAC,OAA8B;QACtC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QACrC,MAAM,YAAY,GAAa,EAAE,CAAC;QAClC,IAAI,cAAc,GAAG,KAAK,CAAC;QAE3B,gCAAgC;QAChC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE;YAC5B,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,8DAA8D;SACxE,CAAC,CAAC;QAEH,MAAM,g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