@storm-software/pnpm-tools 0.7.6 → 0.7.8

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/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  # Changelog for Storm Ops - Pnpm Tools
4
4
 
5
+ ## [0.7.7](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.7.7) (04/28/2026)
6
+
7
+ ### Miscellaneous
8
+
9
+ - **pnpm-plugin:** Improve `update` CLI tool to process packages in parallel ([74ee5f885](https://github.com/storm-software/storm-ops/commit/74ee5f885))
10
+
11
+ ### Updated Dependencies
12
+
13
+ - Updated **package-constants** to **v0.1.14**
14
+ - Updated **testing-tools** to **v1.119.154**
15
+ - Updated **config-tools** to **v1.190.0**
16
+ - Updated **npm-tools** to **v0.6.117**
17
+ - Updated **config** to **v1.137.33**
18
+
19
+ ## [0.7.6](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.7.6) (04/26/2026)
20
+
21
+ ### Updated Dependencies
22
+
23
+ - Updated **package-constants** to **v0.1.13**
24
+ - Updated **testing-tools** to **v1.119.153**
25
+ - Updated **config-tools** to **v1.189.78**
26
+ - Updated **npm-tools** to **v0.6.116**
27
+ - Updated **config** to **v1.137.32**
28
+
5
29
  ## [0.7.5](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.7.5) (04/14/2026)
6
30
 
7
31
  ### Miscellaneous
package/bin/pnpm.cjs CHANGED
@@ -776,8 +776,8 @@ var CONSOLE_ICONS = {
776
776
  };
777
777
 
778
778
  // ../config-tools/src/logger/format-timestamp.ts
779
- var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
780
- return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
779
+ var formatTimestamp = (fullDateTime = false, date = /* @__PURE__ */ new Date()) => {
780
+ return fullDateTime ? `${date.toLocaleDateString()} ${date.toLocaleTimeString()}` : `${date.toLocaleTimeString()}`;
781
781
  };
782
782
 
783
783
  // ../config-tools/src/logger/get-log-level.ts
@@ -837,7 +837,12 @@ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
837
837
  };
838
838
 
839
839
  // ../config-tools/src/logger/console.ts
840
- var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
840
+ var getLogFn = (logLevel = LogLevel.INFO, config = {}, options = {}) => {
841
+ const {
842
+ chalk: _chalk = getChalk(),
843
+ fullDateTime = false,
844
+ hideDateTime = false
845
+ } = options;
841
846
  const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
842
847
  const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
843
848
  if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
@@ -848,9 +853,7 @@ var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
848
853
  return (message) => {
849
854
  console.error(
850
855
  `
851
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
852
- colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal
853
- )(
856
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(
854
857
  `[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `
855
858
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
856
859
  `
@@ -861,9 +864,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
861
864
  return (message) => {
862
865
  console.error(
863
866
  `
864
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
865
- colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger
866
- )(
867
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(
867
868
  `[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `
868
869
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
869
870
  `
@@ -874,9 +875,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
874
875
  return (message) => {
875
876
  console.warn(
876
877
  `
877
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
878
- colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning
879
- )(
878
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(
880
879
  `[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `
881
880
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
882
881
  `
@@ -887,9 +886,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
887
886
  return (message) => {
888
887
  console.info(
889
888
  `
890
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
891
- colors.success ?? DEFAULT_COLOR_CONFIG.dark.success
892
- )(
889
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(
893
890
  `[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `
894
891
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
895
892
  `
@@ -900,9 +897,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
900
897
  return (message) => {
901
898
  console.info(
902
899
  `
903
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
904
- colors.info ?? DEFAULT_COLOR_CONFIG.dark.info
905
- )(
900
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(
906
901
  `[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `
907
902
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
908
903
  `
@@ -913,9 +908,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
913
908
  return (message) => {
914
909
  console.debug(
915
910
  `
916
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
917
- colors.performance ?? DEFAULT_COLOR_CONFIG.dark.performance
918
- )(
911
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.performance ?? DEFAULT_COLOR_CONFIG.dark.performance)(
919
912
  `[${CONSOLE_ICONS[LogLevelLabel.PERFORMANCE]} Performance] `
920
913
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
921
914
  `
@@ -926,9 +919,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
926
919
  return (message) => {
927
920
  console.debug(
928
921
  `
929
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
930
- colors.debug ?? DEFAULT_COLOR_CONFIG.dark.debug
931
- )(
922
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.debug ?? DEFAULT_COLOR_CONFIG.dark.debug)(
932
923
  `[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `
933
924
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
934
925
  `
@@ -939,7 +930,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
939
930
  return (message) => {
940
931
  console.debug(
941
932
  `
942
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#bbbbbb")(
933
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex("#bbbbbb")(
943
934
  `[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `
944
935
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
945
936
  `
@@ -949,9 +940,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#bbbbbb")(
949
940
  return (message) => {
950
941
  console.log(
951
942
  `
952
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
953
- colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand
954
- )(
943
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(
955
944
  `[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `
956
945
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
957
946
  `
@@ -2176,12 +2165,13 @@ var INTERNAL_PACKAGES = [
2176
2165
  ];
2177
2166
 
2178
2167
  // src/cli/index.ts
2168
+ var import_chalk3 = require("chalk");
2179
2169
  var import_commander = require("commander");
2180
2170
 
2181
2171
  // package.json
2182
2172
  var package_default = {
2183
2173
  name: "@storm-software/pnpm-tools",
2184
- version: "0.7.5",
2174
+ version: "0.7.7",
2185
2175
  private: false,
2186
2176
  description: "A set of [pnpm](https://pnpm.io/) plugins and utilities for managing workspace packages/dependencies.",
2187
2177
  repository: {
@@ -2276,6 +2266,7 @@ var package_default = {
2276
2266
  "@storm-software/config-tools": "workspace:*",
2277
2267
  "@storm-software/npm-tools": "workspace:*",
2278
2268
  "@storm-software/package-constants": "workspace:*",
2269
+ chalk: "catalog:",
2279
2270
  commander: "catalog:",
2280
2271
  defu: "catalog:",
2281
2272
  prettier: "catalog:",
@@ -2491,7 +2482,10 @@ function createProgram(config) {
2491
2482
  ).option("--internal", "Whether to update all Storm Software packages.").option("--nx", "Whether to update Nx packages.").option(
2492
2483
  "--pnpm-plugin",
2493
2484
  "Whether to upgrade the Storm Software pnpm plugin."
2494
- ).option("--all", "Whether to update all packages.").action(updateAction);
2485
+ ).option(
2486
+ "--all",
2487
+ "Whether to update all packages (with the exception of the pnpm plugin)."
2488
+ ).action(updateAction);
2495
2489
  return program;
2496
2490
  } catch (error) {
2497
2491
  writeFatal(
@@ -2511,7 +2505,7 @@ async function updateAction(packages, options) {
2511
2505
  all,
2512
2506
  internal = all,
2513
2507
  nx = all,
2514
- pnpmPlugin = all,
2508
+ pnpmPlugin,
2515
2509
  prefix = "^"
2516
2510
  } = options || {};
2517
2511
  let packagesFound = false;
@@ -2521,50 +2515,63 @@ async function updateAction(packages, options) {
2521
2515
  pkgs.push(...INTERNAL_PACKAGES);
2522
2516
  }
2523
2517
  pkgs = pkgs.filter(Boolean).map((pkg) => pkg.trim().replaceAll("*", ""));
2518
+ let changed = [];
2524
2519
  if (pkgs.length > 0) {
2525
- writeInfo(
2520
+ writeDebug(
2526
2521
  `${brandIcon(_config)} Preparing to update the package version for ${pkgs.join(
2527
2522
  ", "
2528
2523
  )}.`,
2529
2524
  _config
2530
2525
  );
2531
- let catalog = await getCatalog();
2526
+ const catalog = await getCatalog();
2532
2527
  if (!catalog) {
2533
2528
  throw new Error(
2534
2529
  "No catalog found in the pnpm-workspace.yaml file of the current workspace."
2535
2530
  );
2536
2531
  }
2537
- for (const pkg of pkgs) {
2538
- const matchedPackages = Object.keys(catalog).filter(
2539
- (p) => pkg.endsWith("/") ? p.startsWith(pkg) : p === pkg
2540
- );
2541
- if (matchedPackages.length === 0) {
2542
- writeInfo(
2543
- `No packages found in the catalog matching the name/pattern "${pkg}".`,
2544
- _config
2532
+ const originalCatalog = { ...catalog };
2533
+ await Promise.all(
2534
+ pkgs.map(async (pkg) => {
2535
+ const matchedPackages = Object.keys(catalog).filter(
2536
+ (p) => pkg.endsWith("/") ? p.startsWith(pkg) : p === pkg
2545
2537
  );
2546
- } else {
2547
- writeDebug(
2548
- `${brandIcon(_config)} Found ${matchedPackages.length} packages matching "${pkg}" in the pnpm catalog file:
2538
+ if (matchedPackages.length === 0) {
2539
+ writeInfo(
2540
+ `No packages found in the catalog matching the name/pattern "${pkg}".`,
2541
+ _config
2542
+ );
2543
+ } else {
2544
+ writeDebug(
2545
+ `${brandIcon(_config)} Found ${matchedPackages.length} packages matching "${pkg}" in the pnpm catalog file:
2549
2546
 
2550
2547
  - ${matchedPackages.map((p) => `${p} (${catalog[p] || "unknown"})`).join("\n- ")}`,
2551
- _config
2552
- );
2553
- packagesFound = true;
2554
- for (const matchedPackage of matchedPackages) {
2555
- writeTrace(`- Upgrading ${matchedPackage}...`, _config);
2556
- const result = await upgradeCatalog(catalog, matchedPackage, {
2557
- tag,
2558
- prefix,
2559
- workspaceRoot: _config.workspaceRoot
2560
- });
2561
- if (result.updated) {
2562
- catalog = result.catalog;
2563
- packagesUpdated = true;
2564
- }
2548
+ _config
2549
+ );
2550
+ packagesFound = true;
2551
+ await Promise.all(
2552
+ matchedPackages.map(async (matchedPackage) => {
2553
+ writeTrace(`- Upgrading ${matchedPackage}...`, _config);
2554
+ const result = await upgradeCatalog(catalog, matchedPackage, {
2555
+ tag,
2556
+ prefix,
2557
+ workspaceRoot: _config.workspaceRoot
2558
+ });
2559
+ if (result.updated && result.catalog[matchedPackage]) {
2560
+ catalog[matchedPackage] = result.catalog[matchedPackage];
2561
+ packagesUpdated = true;
2562
+ }
2563
+ })
2564
+ );
2565
2565
  }
2566
- }
2567
- }
2566
+ })
2567
+ );
2568
+ changed = Object.keys(catalog).filter(
2569
+ (packageName) => originalCatalog[packageName] !== catalog[packageName]
2570
+ ).map((packageName) => ({
2571
+ packageName,
2572
+ previous: originalCatalog[packageName] || "unknown",
2573
+ current: catalog[packageName] || "unknown"
2574
+ }));
2568
2575
  if (packagesUpdated) {
2569
2576
  writeDebug(
2570
2577
  "Finalizing changes to the pnpm workspace's catalog dependencies",
@@ -2621,6 +2628,15 @@ async function updateAction(packages, options) {
2621
2628
  proc.stdout?.on("data", (data) => {
2622
2629
  console.log(data.toString());
2623
2630
  });
2631
+ writeSuccess(
2632
+ `${brandIcon(_config)} Successfully updated the version for the following package(s):
2633
+ ${changed.map(
2634
+ (pkg) => `- ${(0, import_chalk3.bold)(pkg.packageName)}: ${(0, import_chalk3.bold)((0, import_chalk3.red)(pkg.previous))} -> ${(0, import_chalk3.bold)(
2635
+ (0, import_chalk3.green)(pkg.current)
2636
+ )}`
2637
+ ).join("\n")}`,
2638
+ _config
2639
+ );
2624
2640
  }
2625
2641
  } catch (error) {
2626
2642
  writeFatal(
package/bin/pnpm.js CHANGED
@@ -754,8 +754,8 @@ var CONSOLE_ICONS = {
754
754
  };
755
755
 
756
756
  // ../config-tools/src/logger/format-timestamp.ts
757
- var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
758
- return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
757
+ var formatTimestamp = (fullDateTime = false, date = /* @__PURE__ */ new Date()) => {
758
+ return fullDateTime ? `${date.toLocaleDateString()} ${date.toLocaleTimeString()}` : `${date.toLocaleTimeString()}`;
759
759
  };
760
760
 
761
761
  // ../config-tools/src/logger/get-log-level.ts
@@ -815,7 +815,12 @@ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
815
815
  };
816
816
 
817
817
  // ../config-tools/src/logger/console.ts
818
- var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
818
+ var getLogFn = (logLevel = LogLevel.INFO, config = {}, options = {}) => {
819
+ const {
820
+ chalk: _chalk = getChalk(),
821
+ fullDateTime = false,
822
+ hideDateTime = false
823
+ } = options;
819
824
  const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
820
825
  const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
821
826
  if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
@@ -826,9 +831,7 @@ var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
826
831
  return (message) => {
827
832
  console.error(
828
833
  `
829
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
830
- colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal
831
- )(
834
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(
832
835
  `[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `
833
836
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
834
837
  `
@@ -839,9 +842,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
839
842
  return (message) => {
840
843
  console.error(
841
844
  `
842
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
843
- colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger
844
- )(
845
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(
845
846
  `[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `
846
847
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
847
848
  `
@@ -852,9 +853,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
852
853
  return (message) => {
853
854
  console.warn(
854
855
  `
855
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
856
- colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning
857
- )(
856
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(
858
857
  `[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `
859
858
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
860
859
  `
@@ -865,9 +864,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
865
864
  return (message) => {
866
865
  console.info(
867
866
  `
868
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
869
- colors.success ?? DEFAULT_COLOR_CONFIG.dark.success
870
- )(
867
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(
871
868
  `[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `
872
869
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
873
870
  `
@@ -878,9 +875,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
878
875
  return (message) => {
879
876
  console.info(
880
877
  `
881
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
882
- colors.info ?? DEFAULT_COLOR_CONFIG.dark.info
883
- )(
878
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(
884
879
  `[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `
885
880
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
886
881
  `
@@ -891,9 +886,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
891
886
  return (message) => {
892
887
  console.debug(
893
888
  `
894
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
895
- colors.performance ?? DEFAULT_COLOR_CONFIG.dark.performance
896
- )(
889
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.performance ?? DEFAULT_COLOR_CONFIG.dark.performance)(
897
890
  `[${CONSOLE_ICONS[LogLevelLabel.PERFORMANCE]} Performance] `
898
891
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
899
892
  `
@@ -904,9 +897,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
904
897
  return (message) => {
905
898
  console.debug(
906
899
  `
907
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
908
- colors.debug ?? DEFAULT_COLOR_CONFIG.dark.debug
909
- )(
900
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.debug ?? DEFAULT_COLOR_CONFIG.dark.debug)(
910
901
  `[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `
911
902
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
912
903
  `
@@ -917,7 +908,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
917
908
  return (message) => {
918
909
  console.debug(
919
910
  `
920
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#bbbbbb")(
911
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex("#bbbbbb")(
921
912
  `[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `
922
913
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
923
914
  `
@@ -927,9 +918,7 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#bbbbbb")(
927
918
  return (message) => {
928
919
  console.log(
929
920
  `
930
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
931
- colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand
932
- )(
921
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(
933
922
  `[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `
934
923
  )}${_chalk.bold.whiteBright(formatLogMessage(message))}
935
924
  `
@@ -2154,12 +2143,13 @@ var INTERNAL_PACKAGES = [
2154
2143
  ];
2155
2144
 
2156
2145
  // src/cli/index.ts
2146
+ import { bold, green, red } from "chalk";
2157
2147
  import { Command } from "commander";
2158
2148
 
2159
2149
  // package.json
2160
2150
  var package_default = {
2161
2151
  name: "@storm-software/pnpm-tools",
2162
- version: "0.7.5",
2152
+ version: "0.7.7",
2163
2153
  private: false,
2164
2154
  description: "A set of [pnpm](https://pnpm.io/) plugins and utilities for managing workspace packages/dependencies.",
2165
2155
  repository: {
@@ -2254,6 +2244,7 @@ var package_default = {
2254
2244
  "@storm-software/config-tools": "workspace:*",
2255
2245
  "@storm-software/npm-tools": "workspace:*",
2256
2246
  "@storm-software/package-constants": "workspace:*",
2247
+ chalk: "catalog:",
2257
2248
  commander: "catalog:",
2258
2249
  defu: "catalog:",
2259
2250
  prettier: "catalog:",
@@ -2469,7 +2460,10 @@ function createProgram(config) {
2469
2460
  ).option("--internal", "Whether to update all Storm Software packages.").option("--nx", "Whether to update Nx packages.").option(
2470
2461
  "--pnpm-plugin",
2471
2462
  "Whether to upgrade the Storm Software pnpm plugin."
2472
- ).option("--all", "Whether to update all packages.").action(updateAction);
2463
+ ).option(
2464
+ "--all",
2465
+ "Whether to update all packages (with the exception of the pnpm plugin)."
2466
+ ).action(updateAction);
2473
2467
  return program;
2474
2468
  } catch (error) {
2475
2469
  writeFatal(
@@ -2489,7 +2483,7 @@ async function updateAction(packages, options) {
2489
2483
  all,
2490
2484
  internal = all,
2491
2485
  nx = all,
2492
- pnpmPlugin = all,
2486
+ pnpmPlugin,
2493
2487
  prefix = "^"
2494
2488
  } = options || {};
2495
2489
  let packagesFound = false;
@@ -2499,50 +2493,63 @@ async function updateAction(packages, options) {
2499
2493
  pkgs.push(...INTERNAL_PACKAGES);
2500
2494
  }
2501
2495
  pkgs = pkgs.filter(Boolean).map((pkg) => pkg.trim().replaceAll("*", ""));
2496
+ let changed = [];
2502
2497
  if (pkgs.length > 0) {
2503
- writeInfo(
2498
+ writeDebug(
2504
2499
  `${brandIcon(_config)} Preparing to update the package version for ${pkgs.join(
2505
2500
  ", "
2506
2501
  )}.`,
2507
2502
  _config
2508
2503
  );
2509
- let catalog = await getCatalog();
2504
+ const catalog = await getCatalog();
2510
2505
  if (!catalog) {
2511
2506
  throw new Error(
2512
2507
  "No catalog found in the pnpm-workspace.yaml file of the current workspace."
2513
2508
  );
2514
2509
  }
2515
- for (const pkg of pkgs) {
2516
- const matchedPackages = Object.keys(catalog).filter(
2517
- (p) => pkg.endsWith("/") ? p.startsWith(pkg) : p === pkg
2518
- );
2519
- if (matchedPackages.length === 0) {
2520
- writeInfo(
2521
- `No packages found in the catalog matching the name/pattern "${pkg}".`,
2522
- _config
2510
+ const originalCatalog = { ...catalog };
2511
+ await Promise.all(
2512
+ pkgs.map(async (pkg) => {
2513
+ const matchedPackages = Object.keys(catalog).filter(
2514
+ (p) => pkg.endsWith("/") ? p.startsWith(pkg) : p === pkg
2523
2515
  );
2524
- } else {
2525
- writeDebug(
2526
- `${brandIcon(_config)} Found ${matchedPackages.length} packages matching "${pkg}" in the pnpm catalog file:
2516
+ if (matchedPackages.length === 0) {
2517
+ writeInfo(
2518
+ `No packages found in the catalog matching the name/pattern "${pkg}".`,
2519
+ _config
2520
+ );
2521
+ } else {
2522
+ writeDebug(
2523
+ `${brandIcon(_config)} Found ${matchedPackages.length} packages matching "${pkg}" in the pnpm catalog file:
2527
2524
 
2528
2525
  - ${matchedPackages.map((p) => `${p} (${catalog[p] || "unknown"})`).join("\n- ")}`,
2529
- _config
2530
- );
2531
- packagesFound = true;
2532
- for (const matchedPackage of matchedPackages) {
2533
- writeTrace(`- Upgrading ${matchedPackage}...`, _config);
2534
- const result = await upgradeCatalog(catalog, matchedPackage, {
2535
- tag,
2536
- prefix,
2537
- workspaceRoot: _config.workspaceRoot
2538
- });
2539
- if (result.updated) {
2540
- catalog = result.catalog;
2541
- packagesUpdated = true;
2542
- }
2526
+ _config
2527
+ );
2528
+ packagesFound = true;
2529
+ await Promise.all(
2530
+ matchedPackages.map(async (matchedPackage) => {
2531
+ writeTrace(`- Upgrading ${matchedPackage}...`, _config);
2532
+ const result = await upgradeCatalog(catalog, matchedPackage, {
2533
+ tag,
2534
+ prefix,
2535
+ workspaceRoot: _config.workspaceRoot
2536
+ });
2537
+ if (result.updated && result.catalog[matchedPackage]) {
2538
+ catalog[matchedPackage] = result.catalog[matchedPackage];
2539
+ packagesUpdated = true;
2540
+ }
2541
+ })
2542
+ );
2543
2543
  }
2544
- }
2545
- }
2544
+ })
2545
+ );
2546
+ changed = Object.keys(catalog).filter(
2547
+ (packageName) => originalCatalog[packageName] !== catalog[packageName]
2548
+ ).map((packageName) => ({
2549
+ packageName,
2550
+ previous: originalCatalog[packageName] || "unknown",
2551
+ current: catalog[packageName] || "unknown"
2552
+ }));
2546
2553
  if (packagesUpdated) {
2547
2554
  writeDebug(
2548
2555
  "Finalizing changes to the pnpm workspace's catalog dependencies",
@@ -2599,6 +2606,15 @@ async function updateAction(packages, options) {
2599
2606
  proc.stdout?.on("data", (data) => {
2600
2607
  console.log(data.toString());
2601
2608
  });
2609
+ writeSuccess(
2610
+ `${brandIcon(_config)} Successfully updated the version for the following package(s):
2611
+ ${changed.map(
2612
+ (pkg) => `- ${bold(pkg.packageName)}: ${bold(red(pkg.previous))} -> ${bold(
2613
+ green(pkg.current)
2614
+ )}`
2615
+ ).join("\n")}`,
2616
+ _config
2617
+ );
2602
2618
  }
2603
2619
  } catch (error) {
2604
2620
  writeFatal(
@@ -1 +1 @@
1
- 'use strict';var chunkNMRRXPMI_cjs=require('./chunk-NMRRXPMI.cjs'),chunkSKUBJVCJ_cjs=require('./chunk-SKUBJVCJ.cjs'),devkit=require('@nx/devkit'),fs=require('fs'),promises=require('fs/promises'),prettier=require('prettier');async function C(c=process.cwd(),i=chunkSKUBJVCJ_cjs.e(c)){let l=chunkSKUBJVCJ_cjs.d(c,"package.json"),m=await promises.readFile(l,"utf8");if(!m)throw new Error("No package.json file found in package root: "+c);let p=await chunkNMRRXPMI_cjs.b(i),a=JSON.parse(m),g=chunkSKUBJVCJ_cjs.d(i,"pnpm-workspace.yaml");if(!fs.existsSync(g))return console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${g}). Skipping pnpm catalog read for now.`),a;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!p)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`);let t=p[e];if(!t)throw new Error("Missing pnpm catalog version for "+e);o[e]=t;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let n;try{n=devkit.readCachedProjectGraph();}catch{await devkit.createProjectGraphAsync(),n=devkit.readCachedProjectGraph();}let d={};n&&await Promise.all(Object.keys(n.nodes).map(async r=>{let o=n.nodes[r];if(o?.data.root){let e=chunkSKUBJVCJ_cjs.d(i,o.data.root,"package.json");if(fs.existsSync(e)){let t=await promises.readFile(e,"utf8"),f=JSON.parse(t);f.private!==true&&(d[f.name]=f.version);}}}));for(let r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(d[e])o[e]=`^${d[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return promises.writeFile(l,await prettier.format(JSON.stringify(a),{parser:"json",proseWrap:"preserve",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-packagejson"]}))}exports.a=C;
1
+ 'use strict';var chunkXLCHGRVD_cjs=require('./chunk-XLCHGRVD.cjs'),chunkHIRBHP3T_cjs=require('./chunk-HIRBHP3T.cjs'),devkit=require('@nx/devkit'),fs=require('fs'),promises=require('fs/promises'),prettier=require('prettier');async function C(c=process.cwd(),i=chunkHIRBHP3T_cjs.e(c)){let l=chunkHIRBHP3T_cjs.d(c,"package.json"),m=await promises.readFile(l,"utf8");if(!m)throw new Error("No package.json file found in package root: "+c);let p=await chunkXLCHGRVD_cjs.b(i),a=JSON.parse(m),g=chunkHIRBHP3T_cjs.d(i,"pnpm-workspace.yaml");if(!fs.existsSync(g))return console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${g}). Skipping pnpm catalog read for now.`),a;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!p)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`);let t=p[e];if(!t)throw new Error("Missing pnpm catalog version for "+e);o[e]=t;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let n;try{n=devkit.readCachedProjectGraph();}catch{await devkit.createProjectGraphAsync(),n=devkit.readCachedProjectGraph();}let d={};n&&await Promise.all(Object.keys(n.nodes).map(async r=>{let o=n.nodes[r];if(o?.data.root){let e=chunkHIRBHP3T_cjs.d(i,o.data.root,"package.json");if(fs.existsSync(e)){let t=await promises.readFile(e,"utf8"),f=JSON.parse(t);f.private!==true&&(d[f.name]=f.version);}}}));for(let r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(d[e])o[e]=`^${d[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return promises.writeFile(l,await prettier.format(JSON.stringify(a),{parser:"json",proseWrap:"preserve",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-packagejson"]}))}exports.a=C;
@@ -1 +1 @@
1
- import {b}from'./chunk-ZFLNMMTA.js';import {d,e}from'./chunk-BSO4VVX3.js';import {readCachedProjectGraph,createProjectGraphAsync}from'@nx/devkit';import {existsSync}from'node:fs';import {readFile,writeFile}from'node:fs/promises';import {format}from'prettier';async function $(c=process.cwd(),i=e(c)){let l=d(c,"package.json"),m=await readFile(l,"utf8");if(!m)throw new Error("No package.json file found in package root: "+c);let p=await b(i),a=JSON.parse(m),g=d(i,"pnpm-workspace.yaml");if(!existsSync(g))return console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${g}). Skipping pnpm catalog read for now.`),a;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!p)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`);let t=p[e];if(!t)throw new Error("Missing pnpm catalog version for "+e);o[e]=t;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let n;try{n=readCachedProjectGraph();}catch{await createProjectGraphAsync(),n=readCachedProjectGraph();}let d$1={};n&&await Promise.all(Object.keys(n.nodes).map(async r=>{let o=n.nodes[r];if(o?.data.root){let e=d(i,o.data.root,"package.json");if(existsSync(e)){let t=await readFile(e,"utf8"),f=JSON.parse(t);f.private!==true&&(d$1[f.name]=f.version);}}}));for(let r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(d$1[e])o[e]=`^${d$1[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return writeFile(l,await format(JSON.stringify(a),{parser:"json",proseWrap:"preserve",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-packagejson"]}))}export{$ as a};
1
+ import {b}from'./chunk-JYFEXORX.js';import {d,e}from'./chunk-RWGEWYBT.js';import {readCachedProjectGraph,createProjectGraphAsync}from'@nx/devkit';import {existsSync}from'node:fs';import {readFile,writeFile}from'node:fs/promises';import {format}from'prettier';async function $(c=process.cwd(),i=e(c)){let l=d(c,"package.json"),m=await readFile(l,"utf8");if(!m)throw new Error("No package.json file found in package root: "+c);let p=await b(i),a=JSON.parse(m),g=d(i,"pnpm-workspace.yaml");if(!existsSync(g))return console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${g}). Skipping pnpm catalog read for now.`),a;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!p)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`);let t=p[e];if(!t)throw new Error("Missing pnpm catalog version for "+e);o[e]=t;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let n;try{n=readCachedProjectGraph();}catch{await createProjectGraphAsync(),n=readCachedProjectGraph();}let d$1={};n&&await Promise.all(Object.keys(n.nodes).map(async r=>{let o=n.nodes[r];if(o?.data.root){let e=d(i,o.data.root,"package.json");if(existsSync(e)){let t=await readFile(e,"utf8"),f=JSON.parse(t);f.private!==true&&(d$1[f.name]=f.version);}}}));for(let r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(d$1[e])o[e]=`^${d$1[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return writeFile(l,await format(JSON.stringify(a),{parser:"json",proseWrap:"preserve",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-packagejson"]}))}export{$ as a};