@xrystal/core 3.55.10 → 3.55.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/package.json
CHANGED
package/x/bin/commands/sync.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import { runWorkspaceSelfHeal } from '../helpers/workspace-heal.mjs'
|
|
|
10
10
|
import { printSyncProjectResult, syncOneProject } from '../helpers/sync-project.mjs'
|
|
11
11
|
import { ensureSyncProjectTmp, previewSyncProjectTmp } from '../helpers/sync-tmp.mjs'
|
|
12
12
|
import { formatSyncHelp } from '../helpers/cli-help.mjs'
|
|
13
|
-
import { findWorkspaceRoot, resolveWorkspaceOuterTmp } from '../helpers/workspace-resolve.mjs'
|
|
13
|
+
import { findWorkspaceRoot, readTmpFile, resolveWorkspaceOuterTmp } from '../helpers/workspace-resolve.mjs'
|
|
14
14
|
|
|
15
15
|
/** Sync tsconfig + @xrystal/core pin from tmp.yml layout. */
|
|
16
16
|
export function registerSyncCommand(cli, { cliName = CLI_PRIMARY_NAME } = {}) {
|
|
@@ -73,8 +73,18 @@ export function registerSyncCommand(cli, { cliName = CLI_PRIMARY_NAME } = {}) {
|
|
|
73
73
|
|
|
74
74
|
if (scope.entries.length === 0) {
|
|
75
75
|
console.log(chalk.yellow('\n no projects to sync'))
|
|
76
|
-
if (scope.mode === 'workspace-all') {
|
|
77
|
-
|
|
76
|
+
if (scope.mode === 'workspace-all' && scope.workspaceRoot) {
|
|
77
|
+
let slotHint = 'api/ web/ mobile/'
|
|
78
|
+
try {
|
|
79
|
+
const wsTmp = resolveWorkspaceOuterTmp(scope.workspaceRoot)
|
|
80
|
+
if (wsTmp) {
|
|
81
|
+
const folders = Object.values(readTmpFile(wsTmp).folderStructure)
|
|
82
|
+
if (folders.length) slotHint = folders.map((f) => `${f}/`).join(' ')
|
|
83
|
+
}
|
|
84
|
+
} catch {
|
|
85
|
+
// keep default hint
|
|
86
|
+
}
|
|
87
|
+
console.log(chalk.gray(` link services under ${slotHint} then re-run`))
|
|
78
88
|
}
|
|
79
89
|
printCommandFooter({ version: coreVersion })
|
|
80
90
|
return
|
|
@@ -6,6 +6,7 @@ import path5 from "node:path";
|
|
|
6
6
|
// source/utils/helpers/workspace/index.ts
|
|
7
7
|
import fs2 from "node:fs";
|
|
8
8
|
import path4 from "node:path";
|
|
9
|
+
import yaml2 from "yaml";
|
|
9
10
|
|
|
10
11
|
// source/utils/models/enums/index.ts
|
|
11
12
|
var GlobalTypeEnum;
|
|
@@ -13,6 +14,7 @@ var GlobalTypeEnum;
|
|
|
13
14
|
GlobalTypeEnum2["WORKSPACE"] = "workspace";
|
|
14
15
|
GlobalTypeEnum2["API_SERVICE"] = "api-service";
|
|
15
16
|
GlobalTypeEnum2["FRONTEND"] = "frontend";
|
|
17
|
+
GlobalTypeEnum2["CORE_LIBRARY"] = "core-library";
|
|
16
18
|
})(GlobalTypeEnum ||= {});
|
|
17
19
|
|
|
18
20
|
// source/utils/constants/index.ts
|
|
@@ -220,6 +222,8 @@ function normalizeGlobalType(value) {
|
|
|
220
222
|
return "api-service" /* API_SERVICE */;
|
|
221
223
|
if (raw === "frontend" /* FRONTEND */)
|
|
222
224
|
return "frontend" /* FRONTEND */;
|
|
225
|
+
if (raw === "core-library" /* CORE_LIBRARY */)
|
|
226
|
+
return "core-library" /* CORE_LIBRARY */;
|
|
223
227
|
throw new Error(`${defaults_default.packageName}: configs.global.type must be one of ${Object.values(GlobalTypeEnum).join("|")} (got "${String(value)}")`);
|
|
224
228
|
}
|
|
225
229
|
|
|
@@ -262,9 +266,9 @@ function readTmpFile(filePath) {
|
|
|
262
266
|
return out;
|
|
263
267
|
}
|
|
264
268
|
function parseFolderStructure(text) {
|
|
265
|
-
const fsBlock = text.match(/folder-structure:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? "";
|
|
269
|
+
const fsBlock = text.match(/(?:^|\n)[ \t]+slots:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? text.match(/(?:^|\n)[ \t]+folder-structure:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? text.match(/(?:^|\n)slots:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? text.match(/(?:^|\n)folder-structure:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? "";
|
|
266
270
|
if (/^[ \t]+admin:/m.test(fsBlock)) {
|
|
267
|
-
throw new Error("configs.
|
|
271
|
+
throw new Error("configs.slots.admin removed — put admin panels under web/ (e.g. web/admin-ui)");
|
|
268
272
|
}
|
|
269
273
|
const readSlot = (key) => {
|
|
270
274
|
const scalar = fsBlock.match(new RegExp(`^[ \\t]+${key}:\\s*(.+?)(?:\\s+#.*)?$`, "m"));
|
|
@@ -343,8 +347,10 @@ function findWorkspaceAnchor(startDir = process.cwd()) {
|
|
|
343
347
|
try {
|
|
344
348
|
meta = readTmpFile(candidate);
|
|
345
349
|
} catch {
|
|
346
|
-
|
|
350
|
+
meta = readBrokenWorkspaceTmpMeta(candidate);
|
|
347
351
|
}
|
|
352
|
+
if (!meta)
|
|
353
|
+
continue;
|
|
348
354
|
if (meta.globalType !== "workspace" /* WORKSPACE */)
|
|
349
355
|
continue;
|
|
350
356
|
try {
|
|
@@ -363,6 +369,50 @@ function findWorkspaceAnchor(startDir = process.cwd()) {
|
|
|
363
369
|
}
|
|
364
370
|
return null;
|
|
365
371
|
}
|
|
372
|
+
function readBrokenWorkspaceTmpMeta(filePath) {
|
|
373
|
+
if (!fs2.existsSync(filePath))
|
|
374
|
+
return null;
|
|
375
|
+
let text;
|
|
376
|
+
try {
|
|
377
|
+
text = fs2.readFileSync(filePath, "utf8");
|
|
378
|
+
} catch {
|
|
379
|
+
return null;
|
|
380
|
+
}
|
|
381
|
+
const typeMatch = text.match(/global:\s*\n(?:[ \t]+[^\n]+\n)*?[ \t]+type:\s*(.+?)\s*(?:#.*)?$/m);
|
|
382
|
+
if (!typeMatch || parseScalar(typeMatch[1]) !== "workspace" /* WORKSPACE */)
|
|
383
|
+
return null;
|
|
384
|
+
const out = {
|
|
385
|
+
path: filePath,
|
|
386
|
+
globalType: "workspace" /* WORKSPACE */,
|
|
387
|
+
folderStructure: { ...DEFAULT_FOLDER_STRUCTURE }
|
|
388
|
+
};
|
|
389
|
+
const projectMatch = text.match(/^project:\s*\n(?:[ \t]+[^\n]+\n)*?[ \t]+name:\s*(.+?)\s*(?:#.*)?$/m) ?? text.match(/^project:\s*\n[ \t]+name:\s*(.+?)\s*(?:#.*)?$/m);
|
|
390
|
+
if (projectMatch)
|
|
391
|
+
out.projectName = parseScalar(projectMatch[1]);
|
|
392
|
+
const rootBlock = text.match(/paths:\s*\n(?:[ \t]+[^\n]+\n)*?[ \t]+root:\s*(.+?)\s*(?:#.*)?$/m);
|
|
393
|
+
if (rootBlock)
|
|
394
|
+
out.pathsRoot = parseScalar(rootBlock[1]);
|
|
395
|
+
const tmpBlock = text.match(/paths:\s*\n(?:[ \t]+[^\n]+\n)*?[ \t]+tmp:\s*(.+?)\s*(?:#.*)?$/m);
|
|
396
|
+
if (tmpBlock)
|
|
397
|
+
out.pathsTmp = parseScalar(tmpBlock[1]);
|
|
398
|
+
const fsBlock = text.match(/(?:^|\n)[ \t]+slots:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? text.match(/(?:^|\n)[ \t]+folder-structure:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? text.match(/(?:^|\n)slots:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? text.match(/(?:^|\n)folder-structure:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? "";
|
|
399
|
+
for (const slot of ["api" /* API */, "web" /* WEB */, "mobile" /* MOBILE */]) {
|
|
400
|
+
const scalar = fsBlock.match(new RegExp(`^[ \\t]+${slot}:\\s*(.+?)(?:\\s+#.*)?$`, "m"));
|
|
401
|
+
if (scalar)
|
|
402
|
+
out.folderStructure[slot] = parseScalar(scalar[1]);
|
|
403
|
+
}
|
|
404
|
+
return out;
|
|
405
|
+
}
|
|
406
|
+
function readWorkspaceTmpMeta(filePath) {
|
|
407
|
+
try {
|
|
408
|
+
return readTmpFile(filePath);
|
|
409
|
+
} catch {
|
|
410
|
+
const broken = readBrokenWorkspaceTmpMeta(filePath);
|
|
411
|
+
if (broken)
|
|
412
|
+
return broken;
|
|
413
|
+
throw new Error(`Unable to read workspace tmp: ${filePath}`);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
366
416
|
function listShallowTmpCandidates(dir) {
|
|
367
417
|
const out = [];
|
|
368
418
|
const direct = path4.join(dir, TMP_FILE);
|
|
@@ -447,7 +497,7 @@ function resolveRepoRootFromTmpMeta(tmpPath, meta) {
|
|
|
447
497
|
}
|
|
448
498
|
function scanWorkspaceProjects(workspaceRoot) {
|
|
449
499
|
const outerTmp = resolveWorkspaceOuterTmp(workspaceRoot);
|
|
450
|
-
const wsMeta =
|
|
500
|
+
const wsMeta = readWorkspaceTmpMeta(outerTmp ?? path4.join(workspaceRoot, TMP_FILE));
|
|
451
501
|
const fsMap = wsMeta.folderStructure;
|
|
452
502
|
const entries = [];
|
|
453
503
|
const mismatches = [];
|
|
@@ -490,6 +540,8 @@ function scanWorkspaceProjects(workspaceRoot) {
|
|
|
490
540
|
}
|
|
491
541
|
continue;
|
|
492
542
|
}
|
|
543
|
+
if (kind !== "api-service" /* API_SERVICE */ && kind !== "frontend" /* FRONTEND */)
|
|
544
|
+
continue;
|
|
493
545
|
const key = `${kind}:${name}`;
|
|
494
546
|
if (seen.has(key))
|
|
495
547
|
continue;
|
|
@@ -261,7 +261,7 @@ function readTmpFile(filePath) {
|
|
|
261
261
|
return out;
|
|
262
262
|
}
|
|
263
263
|
function parseFolderStructure(text) {
|
|
264
|
-
const fsBlock = text.match(/(?:^|\n)[ \t]
|
|
264
|
+
const fsBlock = text.match(/(?:^|\n)[ \t]+slots:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? text.match(/(?:^|\n)[ \t]+folder-structure:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? text.match(/(?:^|\n)slots:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? text.match(/(?:^|\n)folder-structure:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? "";
|
|
265
265
|
if (/^[ \t]+admin:/m.test(fsBlock)) {
|
|
266
266
|
throw new Error("configs.slots.admin removed — put admin panels under web/ (e.g. web/admin-ui)");
|
|
267
267
|
}
|
|
@@ -395,7 +395,7 @@ function readBrokenWorkspaceTmpMeta(filePath) {
|
|
|
395
395
|
const tmpBlock = text.match(/paths:\s*\n(?:[ \t]+[^\n]+\n)*?[ \t]+tmp:\s*(.+?)\s*(?:#.*)?$/m);
|
|
396
396
|
if (tmpBlock)
|
|
397
397
|
out.pathsTmp = parseScalar(tmpBlock[1]);
|
|
398
|
-
const fsBlock = text.match(/(?:^|\n)[ \t]
|
|
398
|
+
const fsBlock = text.match(/(?:^|\n)[ \t]+slots:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? text.match(/(?:^|\n)[ \t]+folder-structure:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? text.match(/(?:^|\n)slots:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? text.match(/(?:^|\n)folder-structure:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1] ?? "";
|
|
399
399
|
for (const slot of ["api" /* API */, "web" /* WEB */, "mobile" /* MOBILE */]) {
|
|
400
400
|
const scalar = fsBlock.match(new RegExp(`^[ \\t]+${slot}:\\s*(.+?)(?:\\s+#.*)?$`, "m"));
|
|
401
401
|
if (scalar)
|
|
@@ -669,6 +669,7 @@ function healWorkspaceOuterTmpStructure(workspaceRoot) {
|
|
|
669
669
|
}
|
|
670
670
|
const slotsKey = "slots";
|
|
671
671
|
const legacyKey = "folder-structure";
|
|
672
|
+
const topLevelSlots = isPlainObject(doc[slotsKey]) ? doc[slotsKey] : isPlainObject(doc[legacyKey]) ? doc[legacyKey] : null;
|
|
672
673
|
let slotsMap;
|
|
673
674
|
if (isPlainObject(configs[slotsKey])) {
|
|
674
675
|
slotsMap = configs[slotsKey];
|
|
@@ -678,9 +679,23 @@ function healWorkspaceOuterTmpStructure(workspaceRoot) {
|
|
|
678
679
|
delete configs[legacyKey];
|
|
679
680
|
notes.push("folder-structure → slots");
|
|
680
681
|
} else {
|
|
681
|
-
slotsMap = { ...DEFAULT_FOLDER_STRUCTURE };
|
|
682
|
+
slotsMap = topLevelSlots ? {} : { ...DEFAULT_FOLDER_STRUCTURE };
|
|
682
683
|
configs[slotsKey] = slotsMap;
|
|
683
|
-
notes.push("slots");
|
|
684
|
+
notes.push(topLevelSlots ? "top-level slots → configs.slots" : "slots");
|
|
685
|
+
}
|
|
686
|
+
if (topLevelSlots) {
|
|
687
|
+
for (const [key, value] of Object.entries(topLevelSlots)) {
|
|
688
|
+
if (typeof value === "string" && value.trim()) {
|
|
689
|
+
slotsMap[key] = value.trim();
|
|
690
|
+
} else if (value !== undefined) {
|
|
691
|
+
slotsMap[key] = value;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
delete doc[slotsKey];
|
|
695
|
+
delete doc[legacyKey];
|
|
696
|
+
if (!notes.includes("top-level slots → configs.slots")) {
|
|
697
|
+
notes.push("top-level slots → configs.slots");
|
|
698
|
+
}
|
|
684
699
|
}
|
|
685
700
|
if ("admin" in slotsMap) {
|
|
686
701
|
delete slotsMap.admin;
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
export { resolveRedisSocketOptions } from './resolve-socket.js';
|
|
2
|
-
import { createClient } from 'redis';
|
|
2
|
+
import { createClient, createSentinel } from 'redis';
|
|
3
3
|
import { bindLoaderTmpSync } from '../../utils/helpers/tmp/loader-tmp-sync.js';
|
|
4
4
|
import { readInfraLoaderEnabled } from '../../utils/helpers/loader-options/index.js';
|
|
5
5
|
import { InfraLoaderEnum } from '../../utils/models/enums/index.js';
|
|
6
6
|
import { resolveRedisSocketOptions } from './resolve-socket.js';
|
|
7
|
+
function parseSentinelRootNodes(csv) {
|
|
8
|
+
return csv
|
|
9
|
+
.split(',')
|
|
10
|
+
.map((part) => part.trim())
|
|
11
|
+
.filter(Boolean)
|
|
12
|
+
.map((part) => {
|
|
13
|
+
const [host, port] = part.split(':');
|
|
14
|
+
return { host: host.trim(), port: Number.parseInt(port || '26379', 10) };
|
|
15
|
+
})
|
|
16
|
+
.filter((n) => n.host.length > 0);
|
|
17
|
+
}
|
|
7
18
|
export default class RedisForCore {
|
|
8
19
|
#client = null;
|
|
9
20
|
#system;
|
|
@@ -36,14 +47,36 @@ export default class RedisForCore {
|
|
|
36
47
|
if (!uri) {
|
|
37
48
|
return;
|
|
38
49
|
}
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
50
|
+
const socketOpts = resolveRedisSocketOptions(uri);
|
|
51
|
+
const sentinelHosts = process.env.REDIS_SENTINEL_HOSTS?.trim();
|
|
52
|
+
const sentinelMaster = process.env.REDIS_SENTINEL_MASTER?.trim() || 'mymaster';
|
|
53
|
+
let client;
|
|
54
|
+
if (sentinelHosts) {
|
|
55
|
+
const rootNodes = parseSentinelRootNodes(sentinelHosts);
|
|
56
|
+
if (rootNodes.length === 0) {
|
|
57
|
+
throw new Error('REDIS_SENTINEL_HOSTS is set but empty after parse');
|
|
58
|
+
}
|
|
59
|
+
client = (await createSentinel({
|
|
60
|
+
name: sentinelMaster,
|
|
61
|
+
sentinelRootNodes: rootNodes,
|
|
62
|
+
nodeClientOptions: {
|
|
63
|
+
url: uri,
|
|
64
|
+
socket: socketOpts,
|
|
65
|
+
},
|
|
66
|
+
sentinelClientOptions: {
|
|
67
|
+
socket: socketOpts,
|
|
68
|
+
},
|
|
69
|
+
}).connect());
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
client = (await createClient({
|
|
73
|
+
url: uri,
|
|
74
|
+
socket: socketOpts,
|
|
75
|
+
}).connect());
|
|
76
|
+
}
|
|
43
77
|
client.on('error', (err) => {
|
|
44
78
|
console.error(`Redis ${err}`);
|
|
45
79
|
});
|
|
46
|
-
await client.connect();
|
|
47
80
|
this.#client = client;
|
|
48
81
|
};
|
|
49
82
|
teardown = async () => {
|
|
@@ -44,9 +44,11 @@ export function readTmpFile(filePath) {
|
|
|
44
44
|
return out;
|
|
45
45
|
}
|
|
46
46
|
export function parseFolderStructure(text) {
|
|
47
|
-
//
|
|
48
|
-
const fsBlock = text.match(/(?:^|\n)[ \t]
|
|
49
|
-
?? text.match(/(?:^|\n)[ \t]
|
|
47
|
+
// Prefer indented configs.slots / configs.folder-structure over accidental top-level keys.
|
|
48
|
+
const fsBlock = text.match(/(?:^|\n)[ \t]+slots:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1]
|
|
49
|
+
?? text.match(/(?:^|\n)[ \t]+folder-structure:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1]
|
|
50
|
+
?? text.match(/(?:^|\n)slots:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1]
|
|
51
|
+
?? text.match(/(?:^|\n)folder-structure:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1]
|
|
50
52
|
?? '';
|
|
51
53
|
if (/^[ \t]+admin:/m.test(fsBlock)) {
|
|
52
54
|
throw new Error('configs.slots.admin removed — put admin panels under web/ (e.g. web/admin-ui)');
|
|
@@ -195,8 +197,11 @@ export function readBrokenWorkspaceTmpMeta(filePath) {
|
|
|
195
197
|
if (tmpBlock)
|
|
196
198
|
out.pathsTmp = parseScalar(tmpBlock[1]);
|
|
197
199
|
// Preserve known good slot folder names even when admin is present.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
+
// Prefer indented configs.slots over accidental top-level keys.
|
|
201
|
+
const fsBlock = text.match(/(?:^|\n)[ \t]+slots:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1]
|
|
202
|
+
?? text.match(/(?:^|\n)[ \t]+folder-structure:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1]
|
|
203
|
+
?? text.match(/(?:^|\n)slots:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1]
|
|
204
|
+
?? text.match(/(?:^|\n)folder-structure:\s*\n((?:[ \t]+[^\n]+\n?)*)/)?.[1]
|
|
200
205
|
?? '';
|
|
201
206
|
for (const slot of [WorkspaceSlotEnum.API, WorkspaceSlotEnum.WEB, WorkspaceSlotEnum.MOBILE]) {
|
|
202
207
|
const scalar = fsBlock.match(new RegExp(`^[ \\t]+${slot}:\\s*(.+?)(?:\\s+#.*)?$`, 'm'));
|
|
@@ -494,6 +499,12 @@ export function healWorkspaceOuterTmpStructure(workspaceRoot) {
|
|
|
494
499
|
}
|
|
495
500
|
const slotsKey = 'slots';
|
|
496
501
|
const legacyKey = 'folder-structure';
|
|
502
|
+
// Accidental top-level slots / folder-structure (outside configs) — migrate, don't ignore.
|
|
503
|
+
const topLevelSlots = isPlainObject(doc[slotsKey])
|
|
504
|
+
? doc[slotsKey]
|
|
505
|
+
: isPlainObject(doc[legacyKey])
|
|
506
|
+
? doc[legacyKey]
|
|
507
|
+
: null;
|
|
497
508
|
let slotsMap;
|
|
498
509
|
if (isPlainObject(configs[slotsKey])) {
|
|
499
510
|
slotsMap = configs[slotsKey];
|
|
@@ -505,9 +516,26 @@ export function healWorkspaceOuterTmpStructure(workspaceRoot) {
|
|
|
505
516
|
notes.push('folder-structure → slots');
|
|
506
517
|
}
|
|
507
518
|
else {
|
|
508
|
-
|
|
519
|
+
// Defaults when nothing on disk; empty map when migrating top-level custom names.
|
|
520
|
+
slotsMap = topLevelSlots ? {} : { ...DEFAULT_FOLDER_STRUCTURE };
|
|
509
521
|
configs[slotsKey] = slotsMap;
|
|
510
|
-
notes.push('slots');
|
|
522
|
+
notes.push(topLevelSlots ? 'top-level slots → configs.slots' : 'slots');
|
|
523
|
+
}
|
|
524
|
+
// Overlay / migrate top-level custom names into configs.slots, then drop the orphan key.
|
|
525
|
+
if (topLevelSlots) {
|
|
526
|
+
for (const [key, value] of Object.entries(topLevelSlots)) {
|
|
527
|
+
if (typeof value === 'string' && value.trim()) {
|
|
528
|
+
slotsMap[key] = value.trim();
|
|
529
|
+
}
|
|
530
|
+
else if (value !== undefined) {
|
|
531
|
+
slotsMap[key] = value;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
delete doc[slotsKey];
|
|
535
|
+
delete doc[legacyKey];
|
|
536
|
+
if (!notes.includes('top-level slots → configs.slots')) {
|
|
537
|
+
notes.push('top-level slots → configs.slots');
|
|
538
|
+
}
|
|
511
539
|
}
|
|
512
540
|
if ('admin' in slotsMap) {
|
|
513
541
|
delete slotsMap.admin;
|