@flowscripter/dynamic-cli-framework 5.1.4 → 5.1.5

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;CA6CvE"}
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;CAkDvE"}
@@ -19,7 +19,8 @@ export class PluginAddSubCommand {
19
19
  const printerService = context.getServiceById(PRINTER_SERVICE_ID);
20
20
  const pluginService = context.getServiceById(PLUGIN_SERVICE_ID);
21
21
  const { pluginId, version } = parsePluginSpecifier(argumentValues["pluginId"]);
22
- await printerService.info(`Searching for plugin: ${pluginId}\n`, Icon.INFORMATION);
22
+ const searchLabel = version ? `${pluginId}:${version}` : pluginId;
23
+ await printerService.info(`Searching for plugin: ${searchLabel}\n`, Icon.INFORMATION);
23
24
  let descriptor;
24
25
  for await (const d of pluginService.search({ text: pluginId })) {
25
26
  if (getPluginId(d) === pluginId || d.pluginId === pluginId) {
@@ -36,7 +37,7 @@ export class PluginAddSubCommand {
36
37
  // Search did not find an exact match - attempt direct install by plugin ID.
37
38
  // This handles cases where the package exists on the registry but is not
38
39
  // returned by search (e.g. recently published or low search ranking).
39
- await printerService.info(`Plugin not found via search, attempting direct install of ${pluginId}...\n`, Icon.INFORMATION);
40
+ await printerService.info(`Plugin not found via search, attempting direct install of ${searchLabel}...\n`, Icon.INFORMATION);
40
41
  const parts = pluginId.startsWith("@") ? pluginId.slice(1).split("/") : [undefined, pluginId];
41
42
  const scope = pluginId.startsWith("@") ? `@${parts[0]}` : undefined;
42
43
  const name = pluginId.startsWith("@") ? parts[1] : pluginId;
@@ -48,7 +49,10 @@ export class PluginAddSubCommand {
48
49
  extensionPoints: [],
49
50
  };
50
51
  }
51
- await printerService.info(`Installing ${descriptor.pluginId}...\n`, Icon.INFORMATION);
52
+ const installLabel = descriptor.version && descriptor.version !== "latest"
53
+ ? `${descriptor.pluginId}@${descriptor.version}`
54
+ : descriptor.pluginId;
55
+ await printerService.info(`Installing ${installLabel}...\n`, Icon.INFORMATION);
52
56
  await pluginService.install(descriptor);
53
57
  await printerService.print(`Plugin ${descriptor.pluginId} installed.\n`, Icon.SUCCESS);
54
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowscripter/dynamic-cli-framework",
3
- "version": "5.1.4",
3
+ "version": "5.1.5",
4
4
  "description": "A framework for developing CLI applications which supports dynamic discovery and installation of new commands",
5
5
  "keywords": [
6
6
  "bun",
@@ -28,7 +28,8 @@ export class PluginAddSubCommand implements SubCommand {
28
28
  const pluginService = context.getServiceById(PLUGIN_SERVICE_ID) as PluginService;
29
29
 
30
30
  const { pluginId, version } = parsePluginSpecifier(argumentValues["pluginId"] as string);
31
- await printerService.info(`Searching for plugin: ${pluginId}\n`, Icon.INFORMATION);
31
+ const searchLabel = version ? `${pluginId}:${version}` : pluginId;
32
+ await printerService.info(`Searching for plugin: ${searchLabel}\n`, Icon.INFORMATION);
32
33
 
33
34
  let descriptor: VersionedPluginDescriptor | undefined;
34
35
  for await (const d of pluginService.search({ text: pluginId })) {
@@ -49,7 +50,7 @@ export class PluginAddSubCommand implements SubCommand {
49
50
  // This handles cases where the package exists on the registry but is not
50
51
  // returned by search (e.g. recently published or low search ranking).
51
52
  await printerService.info(
52
- `Plugin not found via search, attempting direct install of ${pluginId}...\n`,
53
+ `Plugin not found via search, attempting direct install of ${searchLabel}...\n`,
53
54
  Icon.INFORMATION,
54
55
  );
55
56
  const parts = pluginId.startsWith("@") ? pluginId.slice(1).split("/") : [undefined, pluginId];
@@ -64,7 +65,11 @@ export class PluginAddSubCommand implements SubCommand {
64
65
  };
65
66
  }
66
67
 
67
- await printerService.info(`Installing ${descriptor.pluginId}...\n`, Icon.INFORMATION);
68
+ const installLabel =
69
+ descriptor.version && descriptor.version !== "latest"
70
+ ? `${descriptor.pluginId}@${descriptor.version}`
71
+ : descriptor.pluginId;
72
+ await printerService.info(`Installing ${installLabel}...\n`, Icon.INFORMATION);
68
73
  await pluginService.install(descriptor);
69
74
  await printerService.print(`Plugin ${descriptor.pluginId} installed.\n`, Icon.SUCCESS);
70
75
  }