@reliverse/dler 1.7.80 → 1.7.81

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.
@@ -10,32 +10,26 @@ declare const _default: import("@reliverse/rempts").Command<{
10
10
  "dev-only": {
11
11
  type: "boolean";
12
12
  description: string;
13
- default: false;
14
13
  };
15
14
  "prod-only": {
16
15
  type: "boolean";
17
16
  description: string;
18
- default: false;
19
17
  };
20
18
  "peer-only": {
21
19
  type: "boolean";
22
20
  description: string;
23
- default: false;
24
21
  };
25
22
  "optional-only": {
26
23
  type: "boolean";
27
24
  description: string;
28
- default: false;
29
25
  };
30
26
  "catalogs-only": {
31
27
  type: "boolean";
32
28
  description: string;
33
- default: false;
34
29
  };
35
30
  "dry-run": {
36
31
  type: "boolean";
37
32
  description: string;
38
- default: false;
39
33
  };
40
34
  concurrency: {
41
35
  type: "number";
@@ -45,7 +39,6 @@ declare const _default: import("@reliverse/rempts").Command<{
45
39
  "with-check-script": {
46
40
  type: "boolean";
47
41
  description: string;
48
- default: false;
49
42
  };
50
43
  linker: {
51
44
  type: "string";
@@ -53,22 +46,19 @@ declare const _default: import("@reliverse/rempts").Command<{
53
46
  allowed: string[];
54
47
  default: string;
55
48
  };
56
- "no-install": {
49
+ "with-install": {
57
50
  type: "boolean";
58
51
  description: string;
59
- default: false;
60
52
  alias: string;
61
53
  };
62
54
  global: {
63
55
  type: "boolean";
64
56
  description: string;
65
- default: false;
66
57
  alias: string;
67
58
  };
68
59
  interactive: {
69
60
  type: "boolean";
70
61
  description: string;
71
- default: false;
72
62
  };
73
63
  filter: {
74
64
  type: "array";
@@ -77,7 +67,6 @@ declare const _default: import("@reliverse/rempts").Command<{
77
67
  "update-catalogs": {
78
68
  type: "boolean";
79
69
  description: string;
80
- default: false;
81
70
  };
82
71
  }>;
83
72
  export default _default;
@@ -348,33 +348,27 @@ export default defineCommand({
348
348
  },
349
349
  "dev-only": {
350
350
  type: "boolean",
351
- description: "Update only devDependencies",
352
- default: false
351
+ description: "Update only devDependencies"
353
352
  },
354
353
  "prod-only": {
355
354
  type: "boolean",
356
- description: "Update only dependencies (production)",
357
- default: false
355
+ description: "Update only dependencies (production)"
358
356
  },
359
357
  "peer-only": {
360
358
  type: "boolean",
361
- description: "Update only peerDependencies",
362
- default: false
359
+ description: "Update only peerDependencies"
363
360
  },
364
361
  "optional-only": {
365
362
  type: "boolean",
366
- description: "Update only optionalDependencies",
367
- default: false
363
+ description: "Update only optionalDependencies"
368
364
  },
369
365
  "catalogs-only": {
370
366
  type: "boolean",
371
- description: "Update only catalog dependencies",
372
- default: false
367
+ description: "Update only catalog dependencies"
373
368
  },
374
369
  "dry-run": {
375
370
  type: "boolean",
376
- description: "Show what would be updated without making changes",
377
- default: false
371
+ description: "Show what would be updated without making changes"
378
372
  },
379
373
  concurrency: {
380
374
  type: "number",
@@ -383,8 +377,7 @@ export default defineCommand({
383
377
  },
384
378
  "with-check-script": {
385
379
  type: "boolean",
386
- description: "Run `bun check` after updating (exclusive for bun environment at the moment)",
387
- default: false
380
+ description: "Run `bun check` after updating (exclusive for bun environment at the moment)"
388
381
  },
389
382
  linker: {
390
383
  type: "string",
@@ -392,22 +385,19 @@ export default defineCommand({
392
385
  allowed: ["isolated", "hoisted"],
393
386
  default: "hoisted"
394
387
  },
395
- "no-install": {
388
+ "with-install": {
396
389
  type: "boolean",
397
- description: "Skip the install step after updating dependencies",
398
- default: false,
399
- alias: "no-i"
390
+ description: "Run the install step after updating dependencies",
391
+ alias: "with-i"
400
392
  },
401
393
  global: {
402
394
  type: "boolean",
403
395
  description: "Update global packages instead of local dependencies",
404
- default: false,
405
396
  alias: "g"
406
397
  },
407
398
  interactive: {
408
399
  type: "boolean",
409
- description: "Interactively select which dependencies to update",
410
- default: false
400
+ description: "Interactively select which dependencies to update"
411
401
  },
412
402
  filter: {
413
403
  type: "array",
@@ -415,8 +405,7 @@ export default defineCommand({
415
405
  },
416
406
  "update-catalogs": {
417
407
  type: "boolean",
418
- description: "Update catalog dependencies to latest versions",
419
- default: false
408
+ description: "Update catalog dependencies to latest versions"
420
409
  }
421
410
  }),
422
411
  async run({ args }) {
@@ -706,21 +695,29 @@ export default defineCommand({
706
695
  for (const update of toUpdate) {
707
696
  const dep = update.package;
708
697
  const newVersion = `^${update.latestVersion}`;
709
- const location = update.location;
710
- if (location === "dependencies" && dependencies[dep]) {
698
+ let updated = false;
699
+ if (dependencies[dep]) {
711
700
  if (!updatedPackageJson.dependencies) updatedPackageJson.dependencies = {};
712
701
  updatedPackageJson.dependencies[dep] = newVersion;
713
- } else if (location === "devDependencies" && devDependencies[dep]) {
702
+ updated = true;
703
+ }
704
+ if (devDependencies[dep]) {
714
705
  if (!updatedPackageJson.devDependencies) updatedPackageJson.devDependencies = {};
715
706
  updatedPackageJson.devDependencies[dep] = newVersion;
716
- } else if (location === "peerDependencies" && peerDependencies[dep]) {
707
+ updated = true;
708
+ }
709
+ if (peerDependencies[dep]) {
717
710
  if (!updatedPackageJson.peerDependencies) updatedPackageJson.peerDependencies = {};
718
711
  updatedPackageJson.peerDependencies[dep] = newVersion;
719
- } else if (location === "optionalDependencies" && optionalDependencies[dep]) {
712
+ updated = true;
713
+ }
714
+ if (optionalDependencies[dep]) {
720
715
  if (!updatedPackageJson.optionalDependencies)
721
716
  updatedPackageJson.optionalDependencies = {};
722
717
  updatedPackageJson.optionalDependencies[dep] = newVersion;
723
- } else if (location === "catalog" && catalog[dep]) {
718
+ updated = true;
719
+ }
720
+ if (catalog[dep]) {
724
721
  if (!updatedPackageJson.workspaces) updatedPackageJson.workspaces = {};
725
722
  if (!updatedPackageJson.workspaces.catalog)
726
723
  updatedPackageJson.workspaces.catalog = {};
@@ -728,9 +725,10 @@ export default defineCommand({
728
725
  if (updatedPackageJson.catalog) {
729
726
  updatedPackageJson.catalog[dep] = newVersion;
730
727
  }
731
- } else if (location?.startsWith("catalogs.")) {
732
- const catalogName = location.split(".")[1];
733
- if (catalogName) {
728
+ updated = true;
729
+ }
730
+ Object.keys(catalogs).forEach((catalogName) => {
731
+ if (catalogs[catalogName][dep]) {
734
732
  if (!updatedPackageJson.workspaces)
735
733
  updatedPackageJson.workspaces = {};
736
734
  if (!updatedPackageJson.workspaces.catalogs)
@@ -742,8 +740,9 @@ export default defineCommand({
742
740
  if (updatedPackageJson.catalogs && updatedPackageJson.catalogs[catalogName]) {
743
741
  updatedPackageJson.catalogs[catalogName][dep] = newVersion;
744
742
  }
743
+ updated = true;
745
744
  }
746
- }
745
+ });
747
746
  }
748
747
  await fs.writeFile(
749
748
  packageJsonPath,
@@ -751,12 +750,12 @@ export default defineCommand({
751
750
  "utf8"
752
751
  );
753
752
  relinka("success", `Updated ${toUpdate.length} dependencies in package.json`);
754
- if (args["no-install"]) {
753
+ if (args["with-install"] !== true) {
755
754
  const packageManager2 = await detectPackageManager(process.cwd());
756
755
  const installCommand = packageManager2 ? `${packageManager2.command} install` : "your package manager's install command";
757
756
  relinka(
758
757
  "info",
759
- `Skipped install step due to --no-install flag. Run '${installCommand}' to apply the changes.`
758
+ `Skipped install step. Use --with-install flag to run '${installCommand}' after updating.`
760
759
  );
761
760
  return;
762
761
  }
@@ -1,5 +1,5 @@
1
1
  import { endPrompt, startPrompt } from "@reliverse/rempts";
2
- const version = "1.7.80";
2
+ const version = "1.7.81";
3
3
  export async function showStartPrompt(isDev) {
4
4
  await startPrompt({
5
5
  titleColor: "inverse",
package/package.json CHANGED
@@ -52,7 +52,7 @@
52
52
  "license": "MIT",
53
53
  "name": "@reliverse/dler",
54
54
  "type": "module",
55
- "version": "1.7.80",
55
+ "version": "1.7.81",
56
56
  "keywords": [
57
57
  "reliverse",
58
58
  "cli",