@flowscripter/dynamic-cli-framework 5.4.9 → 5.4.10

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.
@@ -1 +1 @@
1
- {"version":3,"file":"PluginAddSubCommand.d.ts","sourceRoot":"","sources":["../../../../../src/service/plugin/command/PluginAddSubCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AASxE,qBAAa,mBAAoB,YAAW,UAAU;IACpD,QAAQ,CAAC,IAAI,SAAS;IACtB,QAAQ,CAAC,WAAW,6BAA6B;IACjD,QAAQ,CAAC,mBAAmB,SAAS;IACrC,QAAQ,CAAC,OAAO,UAAM;IACtB,QAAQ,CAAC,WAAW;;;;QAMlB;IAEI,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqFrE;CACF"}
1
+ {"version":3,"file":"PluginAddSubCommand.d.ts","sourceRoot":"","sources":["../../../../../src/service/plugin/command/PluginAddSubCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AASxE,qBAAa,mBAAoB,YAAW,UAAU;IACpD,QAAQ,CAAC,IAAI,SAAS;IACtB,QAAQ,CAAC,WAAW,6BAA6B;IACjD,QAAQ,CAAC,mBAAmB,SAAS;IACrC,QAAQ,CAAC,OAAO,UAAM;IACtB,QAAQ,CAAC,WAAW;;;;QAMlB;IAEI,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsGrE;CACF"}
@@ -57,6 +57,17 @@ export class PluginAddSubCommand {
57
57
  const installLabel = descriptor.version && descriptor.version !== "latest"
58
58
  ? `${descriptor.pluginId}@${descriptor.version}`
59
59
  : descriptor.pluginId;
60
+ // If the exact same plugin+version is already installed, there's nothing to do - avoids a
61
+ // needless reinstall and the registry round-trip below.
62
+ if (descriptor.version && descriptor.version !== "latest") {
63
+ for await (const installed of pluginService.listInstalled()) {
64
+ if (installed.pluginId === descriptor.pluginId &&
65
+ installed.version === descriptor.version) {
66
+ await printerService.print(`Plugin ${descriptor.pluginId}@${installed.version} is already installed.\n`, Icon.INFORMATION);
67
+ return;
68
+ }
69
+ }
70
+ }
60
71
  // Confirm the package (and specific version/tag, if requested) actually exists on the
61
72
  // remote marketplace before invoking the package manager - so a non-existent plugin or
62
73
  // version is reported clearly instead of failing later (and less clearly) inside
@@ -1 +1 @@
1
- {"version":3,"file":"PluginRemoveSubCommand.d.ts","sourceRoot":"","sources":["../../../../../src/service/plugin/command/PluginRemoveSubCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAMxE,qBAAa,sBAAuB,YAAW,UAAU;IACvD,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,WAAW,uCAAuC;IAC3D,QAAQ,CAAC,mBAAmB,SAAS;IACrC,QAAQ,CAAC,OAAO,UAAM;IACtB,QAAQ,CAAC,WAAW;;;;QAMlB;IAEI,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYrE;CACF"}
1
+ {"version":3,"file":"PluginRemoveSubCommand.d.ts","sourceRoot":"","sources":["../../../../../src/service/plugin/command/PluginRemoveSubCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAMxE,qBAAa,sBAAuB,YAAW,UAAU;IACvD,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,WAAW,uCAAuC;IAC3D,QAAQ,CAAC,mBAAmB,SAAS;IACrC,QAAQ,CAAC,OAAO,UAAM;IACtB,QAAQ,CAAC,WAAW;;;;QAMlB;IAEI,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBrE;CACF"}
@@ -17,6 +17,17 @@ export class PluginRemoveSubCommand {
17
17
  const printerService = context.getServiceById(PRINTER_SERVICE_ID);
18
18
  const pluginService = context.getServiceById(PLUGIN_SERVICE_ID);
19
19
  const pluginId = argumentValues["pluginId"];
20
+ let isInstalled = false;
21
+ for await (const installed of pluginService.listInstalled()) {
22
+ if (installed.pluginId === pluginId) {
23
+ isInstalled = true;
24
+ break;
25
+ }
26
+ }
27
+ if (!isInstalled) {
28
+ await printerService.print(`Plugin ${pluginId} is not installed.\n`, Icon.INFORMATION);
29
+ return;
30
+ }
20
31
  await printerService.showSpinner(`Removing plugin: ${pluginId}...`);
21
32
  try {
22
33
  await pluginService.uninstall(pluginId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowscripter/dynamic-cli-framework",
3
- "version": "5.4.9",
3
+ "version": "5.4.10",
4
4
  "description": "A framework for developing CLI applications which supports dynamic discovery and installation of new commands",
5
5
  "keywords": [
6
6
  "bun",
@@ -73,6 +73,23 @@ export class PluginAddSubCommand implements SubCommand {
73
73
  ? `${descriptor.pluginId}@${descriptor.version}`
74
74
  : descriptor.pluginId;
75
75
 
76
+ // If the exact same plugin+version is already installed, there's nothing to do - avoids a
77
+ // needless reinstall and the registry round-trip below.
78
+ if (descriptor.version && descriptor.version !== "latest") {
79
+ for await (const installed of pluginService.listInstalled()) {
80
+ if (
81
+ installed.pluginId === descriptor.pluginId &&
82
+ installed.version === descriptor.version
83
+ ) {
84
+ await printerService.print(
85
+ `Plugin ${descriptor.pluginId}@${installed.version} is already installed.\n`,
86
+ Icon.INFORMATION,
87
+ );
88
+ return;
89
+ }
90
+ }
91
+ }
92
+
76
93
  // Confirm the package (and specific version/tag, if requested) actually exists on the
77
94
  // remote marketplace before invoking the package manager - so a non-existent plugin or
78
95
  // version is reported clearly instead of failing later (and less clearly) inside
@@ -25,6 +25,19 @@ export class PluginRemoveSubCommand implements SubCommand {
25
25
  const pluginService = context.getServiceById(PLUGIN_SERVICE_ID) as PluginService;
26
26
 
27
27
  const pluginId = argumentValues["pluginId"] as string;
28
+
29
+ let isInstalled = false;
30
+ for await (const installed of pluginService.listInstalled()) {
31
+ if (installed.pluginId === pluginId) {
32
+ isInstalled = true;
33
+ break;
34
+ }
35
+ }
36
+ if (!isInstalled) {
37
+ await printerService.print(`Plugin ${pluginId} is not installed.\n`, Icon.INFORMATION);
38
+ return;
39
+ }
40
+
28
41
  await printerService.showSpinner(`Removing plugin: ${pluginId}...`);
29
42
  try {
30
43
  await pluginService.uninstall(pluginId);