everything-dev 1.51.7 → 1.52.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.
Files changed (87) hide show
  1. package/dist/api-contract.cjs +61 -16
  2. package/dist/api-contract.cjs.map +1 -1
  3. package/dist/api-contract.mjs +60 -17
  4. package/dist/api-contract.mjs.map +1 -1
  5. package/dist/app.cjs +1 -1
  6. package/dist/app.cjs.map +1 -1
  7. package/dist/app.mjs +1 -1
  8. package/dist/app.mjs.map +1 -1
  9. package/dist/cli/init.cjs +76 -52
  10. package/dist/cli/init.cjs.map +1 -1
  11. package/dist/cli/init.d.cts +15 -7
  12. package/dist/cli/init.d.cts.map +1 -1
  13. package/dist/cli/init.d.mts +15 -7
  14. package/dist/cli/init.d.mts.map +1 -1
  15. package/dist/cli/init.mjs +70 -47
  16. package/dist/cli/init.mjs.map +1 -1
  17. package/dist/cli/sync.cjs +34 -5
  18. package/dist/cli/sync.cjs.map +1 -1
  19. package/dist/cli/sync.mjs +35 -6
  20. package/dist/cli/sync.mjs.map +1 -1
  21. package/dist/cli/upgrade.cjs +151 -93
  22. package/dist/cli/upgrade.cjs.map +1 -1
  23. package/dist/cli/upgrade.mjs +138 -80
  24. package/dist/cli/upgrade.mjs.map +1 -1
  25. package/dist/cli/utils/helpers.cjs +25 -0
  26. package/dist/cli/utils/helpers.cjs.map +1 -0
  27. package/dist/cli/utils/helpers.mjs +23 -0
  28. package/dist/cli/utils/helpers.mjs.map +1 -0
  29. package/dist/cli.cjs +84 -72
  30. package/dist/cli.cjs.map +1 -1
  31. package/dist/cli.mjs +84 -72
  32. package/dist/cli.mjs.map +1 -1
  33. package/dist/code-artifacts.cjs +1 -1
  34. package/dist/code-artifacts.mjs +1 -1
  35. package/dist/config.cjs +44 -4
  36. package/dist/config.cjs.map +1 -1
  37. package/dist/config.d.cts +1 -1
  38. package/dist/config.d.cts.map +1 -1
  39. package/dist/config.d.mts +1 -1
  40. package/dist/config.d.mts.map +1 -1
  41. package/dist/config.mjs +44 -4
  42. package/dist/config.mjs.map +1 -1
  43. package/dist/contract.cjs +9 -4
  44. package/dist/contract.cjs.map +1 -1
  45. package/dist/contract.d.cts +34 -24
  46. package/dist/contract.d.cts.map +1 -1
  47. package/dist/contract.d.mts +34 -24
  48. package/dist/contract.d.mts.map +1 -1
  49. package/dist/contract.meta.cjs +2 -1
  50. package/dist/contract.meta.cjs.map +1 -1
  51. package/dist/contract.meta.d.cts +3 -0
  52. package/dist/contract.meta.d.mts +3 -0
  53. package/dist/contract.meta.mjs +2 -1
  54. package/dist/contract.meta.mjs.map +1 -1
  55. package/dist/contract.mjs +9 -4
  56. package/dist/contract.mjs.map +1 -1
  57. package/dist/dag.cjs +176 -0
  58. package/dist/dag.cjs.map +1 -0
  59. package/dist/dag.d.cts +24 -0
  60. package/dist/dag.d.cts.map +1 -0
  61. package/dist/dag.d.mts +24 -0
  62. package/dist/dag.d.mts.map +1 -0
  63. package/dist/dag.mjs +167 -0
  64. package/dist/dag.mjs.map +1 -0
  65. package/dist/index.cjs +2 -0
  66. package/dist/index.d.cts +2 -2
  67. package/dist/index.d.mts +2 -2
  68. package/dist/index.mjs +2 -2
  69. package/dist/infra/planner.cjs +1 -1
  70. package/dist/infra/planner.mjs +1 -1
  71. package/dist/near-cli.cjs +1 -1
  72. package/dist/near-cli.mjs +1 -1
  73. package/dist/plugin.cjs +27 -18
  74. package/dist/plugin.cjs.map +1 -1
  75. package/dist/plugin.d.cts +57 -11
  76. package/dist/plugin.d.mts +57 -11
  77. package/dist/plugin.mjs +28 -19
  78. package/dist/plugin.mjs.map +1 -1
  79. package/dist/types.cjs +41 -6
  80. package/dist/types.cjs.map +1 -1
  81. package/dist/types.d.cts +118 -3
  82. package/dist/types.d.cts.map +1 -1
  83. package/dist/types.d.mts +118 -3
  84. package/dist/types.d.mts.map +1 -1
  85. package/dist/types.mjs +40 -7
  86. package/dist/types.mjs.map +1 -1
  87. package/package.json +6 -1
@@ -1,9 +1,9 @@
1
1
  const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
- const require_merge = require('../merge.cjs');
3
2
  const require_config = require('../config.cjs');
4
3
  const require_timing = require('./timing.cjs');
5
4
  const require_shared_deps = require('../shared-deps.cjs');
6
5
  const require_save_config = require('../utils/save-config.cjs');
6
+ const require_helpers = require('./utils/helpers.cjs');
7
7
  const require_cli_init = require('./init.cjs');
8
8
  const require_framework_version = require('./framework-version.cjs');
9
9
  const require_sync = require('./sync.cjs');
@@ -14,6 +14,7 @@ node_process = require_runtime.__toESM(node_process, 1);
14
14
  let _clack_prompts = require("@clack/prompts");
15
15
  _clack_prompts = require_runtime.__toESM(_clack_prompts, 1);
16
16
  let glob = require("glob");
17
+ let node_child_process = require("node:child_process");
17
18
 
18
19
  //#region src/cli/upgrade.ts
19
20
  const FRAMEWORK_PACKAGES = ["everything-dev", "every-plugin"];
@@ -48,7 +49,6 @@ const OBSOLETE_FILES = [
48
49
  "ui/scripts/generate-metadata.ts",
49
50
  ".github/dependabot.yml",
50
51
  ".github/templates/dependabot.yml",
51
- ".github/renovate.json",
52
52
  ".github/workflows/packages-release.yml",
53
53
  ".github/workflows/publish.yml",
54
54
  ".github/workflows/release-sync.yml",
@@ -62,11 +62,8 @@ function extractSemver(value) {
62
62
  if (!value) return null;
63
63
  return value.match(/\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?/)?.[0] ?? null;
64
64
  }
65
- function readJsonFile(filePath) {
66
- return JSON.parse((0, node_fs.readFileSync)(filePath, "utf-8"));
67
- }
68
65
  function readRootPackageJson(projectDir) {
69
- return readJsonFile((0, node_path.join)(projectDir, "package.json"));
66
+ return require_helpers.readJsonFile((0, node_path.join)(projectDir, "package.json"));
70
67
  }
71
68
  function readRootCatalogEntry(projectDir, packageName) {
72
69
  return readRootPackageJson(projectDir).workspaces?.catalog?.[packageName];
@@ -148,23 +145,23 @@ function packageObjectNeedsCatalogRefs(pkg, packageNames) {
148
145
  return false;
149
146
  }
150
147
  function packageFileNeedsCatalogRefs(filePath, packageNames) {
151
- return packageObjectNeedsCatalogRefs(readJsonFile(filePath), packageNames);
148
+ return packageObjectNeedsCatalogRefs(require_helpers.readJsonFile(filePath), packageNames);
152
149
  }
153
150
  function updatePackageFileCatalogRefs(filePath, packageNames) {
154
- const pkg = readJsonFile(filePath);
151
+ const pkg = require_helpers.readJsonFile(filePath);
155
152
  const modified = syncPackageObjectCatalogRefs(pkg, packageNames);
156
153
  if (modified) (0, node_fs.writeFileSync)(filePath, `${JSON.stringify(pkg, null, 2)}\n`);
157
154
  return modified;
158
155
  }
159
156
  function updatePackageFileAuthCoreRef(filePath) {
160
- const pkg = readJsonFile(filePath);
157
+ const pkg = require_helpers.readJsonFile(filePath);
161
158
  const modified = ensureAuthCoreCatalogRef(pkg);
162
159
  if (modified) (0, node_fs.writeFileSync)(filePath, `${JSON.stringify(pkg, null, 2)}\n`);
163
160
  return modified;
164
161
  }
165
162
  function syncRootCatalogWithParent(projectDir, parentCatalog) {
166
163
  const pkgPath = (0, node_path.join)(projectDir, "package.json");
167
- const pkg = readJsonFile(pkgPath);
164
+ const pkg = require_helpers.readJsonFile(pkgPath);
168
165
  let modified = syncPackageObjectCatalogRefs(pkg, Object.keys(parentCatalog));
169
166
  if (!pkg.workspaces || typeof pkg.workspaces !== "object") {
170
167
  pkg.workspaces = {
@@ -192,7 +189,7 @@ async function readExtendedRootSource(projectDir) {
192
189
  extendsChain: []
193
190
  };
194
191
  const localConfig = JSON.parse((0, node_fs.readFileSync)(configPath, "utf-8"));
195
- let extendsRef = getExtendsRef(localConfig);
192
+ let extendsRef = require_helpers.getExtendsRef(localConfig);
196
193
  if (!extendsRef?.startsWith("bos://")) return {
197
194
  catalog: {},
198
195
  repository: typeof localConfig.repository === "string" ? localConfig.repository : void 0,
@@ -206,7 +203,7 @@ async function readExtendedRootSource(projectDir) {
206
203
  if (visited.has(extendsRef)) throw new Error(`Circular extends detected while resolving upgrade source: ${extendsRef}`);
207
204
  visited.add(extendsRef);
208
205
  extendsChain.push(extendsRef);
209
- const parsed = parseBosRef(extendsRef);
206
+ const parsed = require_helpers.parseBosRef(extendsRef);
210
207
  if (!parsed) break;
211
208
  rootRef = extendsRef;
212
209
  let parentConfig;
@@ -216,11 +213,11 @@ async function readExtendedRootSource(projectDir) {
216
213
  break;
217
214
  }
218
215
  if (typeof parentConfig.repository === "string") repository = parentConfig.repository;
219
- const nextExtendsRef = getExtendsRef(parentConfig);
216
+ const nextExtendsRef = require_helpers.getExtendsRef(parentConfig);
220
217
  if (!nextExtendsRef?.startsWith("bos://")) break;
221
218
  extendsRef = nextExtendsRef;
222
219
  }
223
- const parsed = parseBosRef(rootRef);
220
+ const parsed = require_helpers.parseBosRef(rootRef);
224
221
  if (!parsed) return {
225
222
  catalog: {},
226
223
  repository,
@@ -236,18 +233,6 @@ async function readExtendedRootSource(projectDir) {
236
233
  extendsChain: source.extendsChain.length > 0 ? source.extendsChain : extendsChain
237
234
  };
238
235
  }
239
- function getExtendsRef(config) {
240
- if (typeof config.extends === "string") return config.extends;
241
- if (config.extends && typeof config.extends === "object") return require_merge.resolveExtendsRef(config.extends, "production");
242
- }
243
- function parseBosRef(ref) {
244
- const match = ref.match(/^bos:\/\/([^/]+)\/(.+)$/);
245
- if (!match?.[1] || !match[2]) return null;
246
- return {
247
- account: match[1],
248
- gateway: match[2]
249
- };
250
- }
251
236
  function parseTargetedRef(ref) {
252
237
  const hashIndex = ref.indexOf("#");
253
238
  if (hashIndex === -1) return { configRef: ref };
@@ -446,9 +431,9 @@ async function loadParentPluginOptions(projectDir) {
446
431
  const configPath = (0, node_path.join)(projectDir, "bos.config.json");
447
432
  if (!(0, node_fs.existsSync)(configPath)) return null;
448
433
  const localConfig = JSON.parse((0, node_fs.readFileSync)(configPath, "utf-8"));
449
- const extendsRef = getExtendsRef(localConfig);
434
+ const extendsRef = require_helpers.getExtendsRef(localConfig);
450
435
  if (!extendsRef?.startsWith("bos://")) return null;
451
- const parsed = parseBosRef(extendsRef);
436
+ const parsed = require_helpers.parseBosRef(extendsRef);
452
437
  if (!parsed) return null;
453
438
  let parentConfig;
454
439
  try {
@@ -528,8 +513,8 @@ async function migrateChildRootPackageJson(projectDir) {
528
513
  const configPath = (0, node_path.join)(projectDir, "bos.config.json");
529
514
  const pkgPath = (0, node_path.join)(projectDir, "package.json");
530
515
  if (!(0, node_fs.existsSync)(configPath) || !(0, node_fs.existsSync)(pkgPath)) return false;
531
- if (!getExtendsRef(readJsonFile(configPath))?.startsWith("bos://")) return false;
532
- const pkg = readJsonFile(pkgPath);
516
+ if (!require_helpers.getExtendsRef(require_helpers.readJsonFile(configPath))?.startsWith("bos://")) return false;
517
+ const pkg = require_helpers.readJsonFile(pkgPath);
533
518
  let changed = false;
534
519
  if (pkg.private !== true) {
535
520
  pkg.private = true;
@@ -564,7 +549,11 @@ async function migrateChildRootPackageJson(projectDir) {
564
549
  scripts[key] = value;
565
550
  changed = true;
566
551
  }
567
- for (const obsoleteScript of ["sync-catalog", "init"]) if (obsoleteScript in scripts) {
552
+ for (const obsoleteScript of [
553
+ ...require_cli_init.getParentOnlyScriptKeys(projectDir),
554
+ "sync-catalog",
555
+ "init"
556
+ ]) if (obsoleteScript in scripts) {
568
557
  delete scripts[obsoleteScript];
569
558
  changed = true;
570
559
  }
@@ -630,7 +619,7 @@ async function rewriteLegacyUiImports(projectDir) {
630
619
  }
631
620
  return migrated;
632
621
  }
633
- const LEGACY_DIST_IMPORT_REWRITES = [["from \"everything-dev/dist/", "from \"everything-dev/"], ["from 'everything-dev/dist/", "from 'everything-dev/"]];
622
+ const LEGACY_DIST_IMPORT_REWRITES = [["from \"everything-dev/", "from \"everything-dev/"], ["from 'everything-dev/", "from 'everything-dev/"]];
634
623
  function escapeRegex(s) {
635
624
  return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
636
625
  }
@@ -775,6 +764,73 @@ async function rewriteLegacyDistImports(projectDir) {
775
764
  }
776
765
  return migrated;
777
766
  }
767
+ async function runMigrationPhase(projectDir, options, parentSource) {
768
+ const timings = [];
769
+ const migratedBosConfigs = await require_timing.timePhase(timings, "migrate bos configs", () => migrateBosConfigFiles(projectDir));
770
+ const migratedRootPackageJson = await require_timing.timePhase(timings, "migrate root package", () => migrateChildRootPackageJson(projectDir));
771
+ let syncResult;
772
+ let addedPlugins = [];
773
+ if (!options.noSync && parentSource.extendsChain.length > 0) {
774
+ addedPlugins = await require_timing.timePhase(timings, "discover parent plugins", async () => {
775
+ if (options.dryRun) return [];
776
+ return addSelectedParentPlugins(projectDir);
777
+ });
778
+ syncResult = await require_timing.timePhase(timings, "sync template", () => require_sync.syncTemplate(projectDir, {
779
+ dryRun: false,
780
+ noInstall: true,
781
+ json: false
782
+ }));
783
+ }
784
+ await require_timing.timePhase(timings, "sync shared deps", async () => {
785
+ const configResult = await require_config.loadResolvedConfig({ cwd: projectDir });
786
+ if (!configResult) throw new Error("No bos.config.json found in current directory");
787
+ return require_shared_deps.syncResolvedSharedDeps({
788
+ configDir: projectDir,
789
+ hostMode: "local",
790
+ bosConfig: configResult.config
791
+ });
792
+ });
793
+ if (!options.noInstall) await require_timing.timePhase(timings, "generate types", () => require_cli_init.runTypesGen(projectDir));
794
+ const migratedFiles = await require_timing.timePhase(timings, "clean obsolete files", async () => {
795
+ const nextMigratedFiles = [
796
+ ...migratedBosConfigs,
797
+ ...migratedRootPackageJson ? ["package.json"] : [],
798
+ ...await rewriteLegacyUiImports(projectDir),
799
+ ...await rewriteLegacyPluginScopedLayerPatterns(projectDir),
800
+ ...await rewriteLegacyDistImports(projectDir)
801
+ ];
802
+ for (const file of OBSOLETE_FILES) {
803
+ const filePath = (0, node_path.join)(projectDir, file);
804
+ if ((0, node_fs.existsSync)(filePath)) {
805
+ (0, node_fs.rmSync)(filePath);
806
+ nextMigratedFiles.push(file);
807
+ }
808
+ }
809
+ const legacyPluginDbFiles = await (0, glob.glob)("plugins/*/src/db/{migrator,load-migrations}.ts", {
810
+ cwd: projectDir,
811
+ nodir: true,
812
+ dot: false,
813
+ absolute: false
814
+ });
815
+ for (const file of legacyPluginDbFiles) {
816
+ (0, node_fs.rmSync)((0, node_path.join)(projectDir, file));
817
+ nextMigratedFiles.push(file);
818
+ }
819
+ return nextMigratedFiles;
820
+ });
821
+ let changelogUrl;
822
+ const mainPkg = parentSource.catalog["everything-dev"];
823
+ if (mainPkg) changelogUrl = buildChangelogUrl(void 0, mainPkg, parentSource.repository);
824
+ return {
825
+ status: "upgraded",
826
+ packages: [],
827
+ sync: syncResult,
828
+ migrated: migratedFiles.length > 0 ? migratedFiles : void 0,
829
+ selectedPlugins: addedPlugins.length > 0 ? addedPlugins : void 0,
830
+ timings,
831
+ changelogUrl
832
+ };
833
+ }
778
834
  async function upgradeTemplate(projectDir, options) {
779
835
  const timings = [];
780
836
  if (!(0, node_fs.existsSync)((0, node_path.join)(projectDir, "package.json"))) return {
@@ -789,7 +845,7 @@ async function upgradeTemplate(projectDir, options) {
789
845
  const currentCatalogEntries = readRootPackageJson(projectDir).workspaces?.catalog ?? {};
790
846
  const workspacePkgPaths = await findWorkspacePackageJsons(projectDir);
791
847
  const hasCatalogRefRewrites = inheritedCatalogPackageNames.length > 0 && (packageObjectNeedsCatalogRefs(readRootPackageJson(projectDir), inheritedCatalogPackageNames) || workspacePkgPaths.some((pkgPath) => packageFileNeedsCatalogRefs(pkgPath, inheritedCatalogPackageNames)));
792
- const hasAuthCoreRefRewrites = packageObjectNeedsAuthCoreCatalogRef(readRootPackageJson(projectDir)) || workspacePkgPaths.some((pkgPath) => packageObjectNeedsAuthCoreCatalogRef(readJsonFile(pkgPath)));
848
+ const hasAuthCoreRefRewrites = packageObjectNeedsAuthCoreCatalogRef(readRootPackageJson(projectDir)) || workspacePkgPaths.some((pkgPath) => packageObjectNeedsAuthCoreCatalogRef(require_helpers.readJsonFile(pkgPath)));
793
849
  const { packages, catalogVersionUpdates } = await require_timing.timePhase(timings, "check package versions", async () => {
794
850
  const nextPackages = [];
795
851
  for (const name of FRAMEWORK_PACKAGES) {
@@ -839,79 +895,81 @@ async function upgradeTemplate(projectDir, options) {
839
895
  changelogUrl
840
896
  };
841
897
  }
898
+ if (options.migrationsOnly) return await runMigrationPhase(projectDir, options, parentSource);
842
899
  await require_timing.timePhase(timings, "apply package updates", async () => {
843
900
  if (inheritedCatalogPackageNames.length > 0) syncRootCatalogWithParent(projectDir, sourceRootCatalog);
844
901
  if (inheritedCatalogPackageNames.length > 0) for (const pkgPath of workspacePkgPaths) updatePackageFileCatalogRefs(pkgPath, inheritedCatalogPackageNames);
845
902
  });
846
- const migratedBosConfigs = await require_timing.timePhase(timings, "migrate bos configs", () => migrateBosConfigFiles(projectDir));
847
- const migratedRootPackageJson = await require_timing.timePhase(timings, "migrate root package", () => migrateChildRootPackageJson(projectDir));
848
- let syncResult;
849
- let addedPlugins = [];
850
- if (!options.noSync) {
851
- addedPlugins = await require_timing.timePhase(timings, "discover parent plugins", async () => {
852
- if (options.dryRun) return [];
853
- return addSelectedParentPlugins(projectDir);
854
- });
855
- syncResult = await require_timing.timePhase(timings, "sync template", () => require_sync.syncTemplate(projectDir, {
856
- dryRun: false,
857
- noInstall: true
858
- }));
859
- if (inheritedCatalogPackageNames.length > 0) syncRootCatalogWithParent(projectDir, sourceRootCatalog);
860
- }
861
- const sharedSync = await require_timing.timePhase(timings, "sync shared deps", async () => {
862
- const configResult = await require_config.loadResolvedConfig({ cwd: projectDir });
863
- if (!configResult) throw new Error("No bos.config.json found in current directory");
864
- return require_shared_deps.syncResolvedSharedDeps({
865
- configDir: projectDir,
866
- hostMode: "local",
867
- bosConfig: configResult.config
868
- });
869
- });
870
- if ((hasUpdates || addedPlugins.length > 0 || sharedSync.catalogChanged) && !options.noInstall) {
871
- await require_timing.timePhase(timings, "install dependencies", () => require_cli_init.runBunInstallForUpgrade(projectDir));
872
- await require_timing.timePhase(timings, "generate types", () => require_cli_init.runTypesGen(projectDir));
873
- }
874
- const migratedFiles = await require_timing.timePhase(timings, "clean obsolete files", async () => {
875
- const nextMigratedFiles = [
876
- ...migratedBosConfigs,
877
- ...migratedRootPackageJson ? ["package.json"] : [],
878
- ...await rewriteLegacyUiImports(projectDir),
879
- ...await rewriteLegacyPluginScopedLayerPatterns(projectDir),
880
- ...await rewriteLegacyDistImports(projectDir)
881
- ];
882
- for (const file of OBSOLETE_FILES) {
883
- const filePath = (0, node_path.join)(projectDir, file);
884
- if ((0, node_fs.existsSync)(filePath)) {
885
- (0, node_fs.rmSync)(filePath);
886
- nextMigratedFiles.push(file);
887
- }
888
- }
889
- const legacyPluginDbFiles = await (0, glob.glob)("plugins/*/src/db/{migrator,load-migrations}.ts", {
903
+ const needsInstall = (hasUpdates || hasCatalogUpdates) && !options.noInstall;
904
+ if (needsInstall) await require_timing.timePhase(timings, "install dependencies", () => require_cli_init.runBunInstallForUpgrade(projectDir));
905
+ if (needsInstall && hasFrameworkUpdates) {
906
+ const childResult = (0, node_child_process.spawnSync)((0, node_path.join)(projectDir, "node_modules", ".bin", "bos"), [
907
+ "upgrade",
908
+ "--migrations-only",
909
+ "--no-install",
910
+ ...options.noSync ? ["--no-sync"] : [],
911
+ "--json"
912
+ ], {
890
913
  cwd: projectDir,
891
- nodir: true,
892
- dot: false,
893
- absolute: false
914
+ stdio: [
915
+ "inherit",
916
+ "pipe",
917
+ "pipe"
918
+ ],
919
+ encoding: "utf-8",
920
+ env: {
921
+ ...node_process.default.env,
922
+ BOS_NO_BANNER: "1"
923
+ }
894
924
  });
895
- for (const file of legacyPluginDbFiles) {
896
- (0, node_fs.rmSync)((0, node_path.join)(projectDir, file));
897
- nextMigratedFiles.push(file);
898
- }
899
- return nextMigratedFiles;
900
- });
901
- let changelogUrl;
925
+ if (childResult.status !== 0) return {
926
+ status: "error",
927
+ packages: [...packages, ...catalogVersionUpdates.map((u) => ({
928
+ name: u.name,
929
+ from: u.from,
930
+ to: u.to
931
+ }))],
932
+ timings,
933
+ error: `Migration phase failed: ${childResult.stderr || childResult.stdout || "Unknown error"}`
934
+ };
935
+ try {
936
+ const childUpgrade = JSON.parse(childResult.stdout);
937
+ const mainPkg = packages.find((p) => p.name === "everything-dev");
938
+ const changelogUrl = mainPkg?.from && mainPkg.from !== mainPkg.to ? buildChangelogUrl(mainPkg.from, mainPkg.to, parentSource.repository) : void 0;
939
+ return {
940
+ ...childUpgrade,
941
+ packages: [...packages, ...catalogVersionUpdates.map((u) => ({
942
+ name: u.name,
943
+ from: u.from,
944
+ to: u.to
945
+ }))],
946
+ timings: [...timings, ...childUpgrade.timings ?? []],
947
+ changelogUrl
948
+ };
949
+ } catch {
950
+ return {
951
+ status: "error",
952
+ packages: [...packages, ...catalogVersionUpdates.map((u) => ({
953
+ name: u.name,
954
+ from: u.from,
955
+ to: u.to
956
+ }))],
957
+ timings,
958
+ error: "Failed to parse migration phase output"
959
+ };
960
+ }
961
+ }
962
+ const migrationResult = await runMigrationPhase(projectDir, options, parentSource);
902
963
  const mainPkg = packages.find((p) => p.name === "everything-dev");
903
- if (mainPkg?.from && mainPkg.from !== mainPkg.to) changelogUrl = buildChangelogUrl(mainPkg.from, mainPkg.to, parentSource.repository);
964
+ const changelogUrl = mainPkg?.from && mainPkg.from !== mainPkg.to ? buildChangelogUrl(mainPkg.from, mainPkg.to, parentSource.repository) : void 0;
904
965
  return {
905
- status: "upgraded",
966
+ ...migrationResult,
906
967
  packages: [...packages, ...catalogVersionUpdates.map((u) => ({
907
968
  name: u.name,
908
969
  from: u.from,
909
970
  to: u.to
910
971
  }))],
911
- sync: syncResult,
912
- migrated: migratedFiles.length > 0 ? migratedFiles : void 0,
913
- selectedPlugins: addedPlugins.length > 0 ? addedPlugins : void 0,
914
- timings,
972
+ timings: [...timings, ...migrationResult.timings ?? []],
915
973
  changelogUrl
916
974
  };
917
975
  }