@reliverse/dler 1.7.79 → 1.7.80
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/bin/app/update/cmd.js
CHANGED
|
@@ -425,15 +425,15 @@ export default defineCommand({
|
|
|
425
425
|
return await handleGlobalUpdates(args);
|
|
426
426
|
}
|
|
427
427
|
if (args["update-catalogs"]) {
|
|
428
|
-
const
|
|
429
|
-
if (!
|
|
428
|
+
const packageManager2 = await detectPackageManager(process.cwd());
|
|
429
|
+
if (!packageManager2) {
|
|
430
430
|
relinka("error", "Could not detect package manager");
|
|
431
431
|
return process.exit(1);
|
|
432
432
|
}
|
|
433
|
-
if (!isCatalogSupported(
|
|
433
|
+
if (!isCatalogSupported(packageManager2)) {
|
|
434
434
|
relinka(
|
|
435
435
|
"error",
|
|
436
|
-
`Catalogs are not supported by ${
|
|
436
|
+
`Catalogs are not supported by ${packageManager2.name}. Only Bun supports catalogs.`
|
|
437
437
|
);
|
|
438
438
|
return process.exit(1);
|
|
439
439
|
}
|
|
@@ -518,34 +518,48 @@ export default defineCommand({
|
|
|
518
518
|
});
|
|
519
519
|
});
|
|
520
520
|
} else {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
...devDependencies,
|
|
524
|
-
...peerDependencies,
|
|
525
|
-
...optionalDependencies
|
|
526
|
-
};
|
|
521
|
+
const allDeps = {};
|
|
522
|
+
const allDepSources = {};
|
|
527
523
|
Object.keys(dependencies).forEach((dep) => {
|
|
528
|
-
|
|
524
|
+
const version = dependencies[dep];
|
|
525
|
+
if (version) {
|
|
526
|
+
allDeps[dep] = version;
|
|
527
|
+
allDepSources[dep] = "dependencies";
|
|
528
|
+
}
|
|
529
529
|
});
|
|
530
530
|
Object.keys(devDependencies).forEach((dep) => {
|
|
531
|
-
|
|
531
|
+
const version = devDependencies[dep];
|
|
532
|
+
if (version) {
|
|
533
|
+
allDeps[dep] = version;
|
|
534
|
+
allDepSources[dep] = "devDependencies";
|
|
535
|
+
}
|
|
532
536
|
});
|
|
533
537
|
Object.keys(peerDependencies).forEach((dep) => {
|
|
534
|
-
|
|
538
|
+
const version = peerDependencies[dep];
|
|
539
|
+
if (version) {
|
|
540
|
+
allDeps[dep] = version;
|
|
541
|
+
allDepSources[dep] = "peerDependencies";
|
|
542
|
+
}
|
|
535
543
|
});
|
|
536
544
|
Object.keys(optionalDependencies).forEach((dep) => {
|
|
537
|
-
|
|
545
|
+
const version = optionalDependencies[dep];
|
|
546
|
+
if (version) {
|
|
547
|
+
allDeps[dep] = version;
|
|
548
|
+
allDepSources[dep] = "optionalDependencies";
|
|
549
|
+
}
|
|
538
550
|
});
|
|
539
551
|
Object.keys(catalog).forEach((dep) => {
|
|
540
|
-
|
|
541
|
-
|
|
552
|
+
allDeps[dep] = catalog[dep];
|
|
553
|
+
allDepSources[dep] = "catalog";
|
|
542
554
|
});
|
|
543
555
|
Object.keys(catalogs).forEach((catalogName) => {
|
|
544
556
|
Object.keys(catalogs[catalogName]).forEach((dep) => {
|
|
545
|
-
|
|
546
|
-
|
|
557
|
+
allDeps[dep] = catalogs[catalogName][dep];
|
|
558
|
+
allDepSources[dep] = `catalogs.${catalogName}`;
|
|
547
559
|
});
|
|
548
560
|
});
|
|
561
|
+
targetDeps = allDeps;
|
|
562
|
+
Object.assign(depSources, allDepSources);
|
|
549
563
|
}
|
|
550
564
|
const depsToUpdate = Object.keys(targetDeps);
|
|
551
565
|
let filteredDeps = [];
|
|
@@ -737,39 +751,36 @@ export default defineCommand({
|
|
|
737
751
|
"utf8"
|
|
738
752
|
);
|
|
739
753
|
relinka("success", `Updated ${toUpdate.length} dependencies in package.json`);
|
|
740
|
-
if (
|
|
741
|
-
const
|
|
742
|
-
|
|
743
|
-
try {
|
|
744
|
-
if (args.filter && args.filter.length > 0) {
|
|
745
|
-
const filterArgs = args.filter.flatMap((filter) => ["--filter", filter]);
|
|
746
|
-
await runInstallCommandWithFilter(packageManager, effectiveLinker, filterArgs);
|
|
747
|
-
} else {
|
|
748
|
-
await runInstallCommand(packageManager, effectiveLinker);
|
|
749
|
-
}
|
|
750
|
-
if (packageManager.name === "bun" && packageJson.scripts?.check && args["with-check-script"]) {
|
|
751
|
-
await $`bun check`;
|
|
752
|
-
}
|
|
753
|
-
} catch (error) {
|
|
754
|
-
relinka(
|
|
755
|
-
"warn",
|
|
756
|
-
`Install failed: ${error instanceof Error ? error.message : String(error)}`
|
|
757
|
-
);
|
|
758
|
-
relinka(
|
|
759
|
-
"info",
|
|
760
|
-
`Run '${packageManager.command} install' manually to apply the changes`
|
|
761
|
-
);
|
|
762
|
-
}
|
|
763
|
-
} else {
|
|
764
|
-
relinka("warn", "Could not detect package manager. Please run install manually.");
|
|
765
|
-
}
|
|
766
|
-
} else {
|
|
767
|
-
const packageManager = await detectPackageManager(process.cwd());
|
|
768
|
-
const installCommand = packageManager ? `${packageManager.command} install` : "your package manager's install command";
|
|
754
|
+
if (args["no-install"]) {
|
|
755
|
+
const packageManager2 = await detectPackageManager(process.cwd());
|
|
756
|
+
const installCommand = packageManager2 ? `${packageManager2.command} install` : "your package manager's install command";
|
|
769
757
|
relinka(
|
|
770
758
|
"info",
|
|
771
759
|
`Skipped install step due to --no-install flag. Run '${installCommand}' to apply the changes.`
|
|
772
760
|
);
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
const packageManager = await detectPackageManager(process.cwd());
|
|
764
|
+
if (packageManager) {
|
|
765
|
+
try {
|
|
766
|
+
if (args.filter && args.filter.length > 0) {
|
|
767
|
+
const filterArgs = args.filter.flatMap((filter) => ["--filter", filter]);
|
|
768
|
+
await runInstallCommandWithFilter(packageManager, effectiveLinker, filterArgs);
|
|
769
|
+
} else {
|
|
770
|
+
await runInstallCommand(packageManager, effectiveLinker);
|
|
771
|
+
}
|
|
772
|
+
if (packageManager.name === "bun" && packageJson.scripts?.check && args["with-check-script"]) {
|
|
773
|
+
await $`bun check`;
|
|
774
|
+
}
|
|
775
|
+
} catch (error) {
|
|
776
|
+
relinka(
|
|
777
|
+
"warn",
|
|
778
|
+
`Install failed: ${error instanceof Error ? error.message : String(error)}`
|
|
779
|
+
);
|
|
780
|
+
relinka("info", `Run '${packageManager.command} install' manually to apply the changes`);
|
|
781
|
+
}
|
|
782
|
+
} else {
|
|
783
|
+
relinka("warn", "Could not detect package manager. Please run install manually.");
|
|
773
784
|
}
|
|
774
785
|
} catch (error) {
|
|
775
786
|
relinka(
|