@flowscripter/flowscripter-io-cli 2.0.6 → 2.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowscripter/flowscripter-io-cli",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "CLI for https://github.com/flowscripter/pluggable-io-framework",
5
5
  "keywords": [
6
6
  "bun",
package/src/cli.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import {
2
+ type BaseCLIFeatureOptions,
2
3
  PrettyPrinterServiceProvider,
3
4
  SyntaxHighlighterServiceProvider,
4
5
  launchMultiCommandCLI,
@@ -16,6 +17,25 @@ import {
16
17
  } from "./pluginsDir.ts";
17
18
  import packageJson from "../package.json";
18
19
 
20
+ export function getCLIFeatureOptions(): BaseCLIFeatureOptions {
21
+ return {
22
+ argumentPrompterServiceEnabled: true,
23
+ // The spawn service lets plugin:add/plugin:remove quote the package manager output and
24
+ // clear it on success.
25
+ spawnServiceEnabled: true,
26
+ pluginServiceEnabled: true,
27
+ pluginServiceRemoteConfig: {
28
+ name: "npmjs",
29
+ registryUrl: "https://registry.npmjs.org",
30
+ packageJsonNamespace: PLUGGABLE_IO_FRAMEWORK_PACKAGE_JSON_NAMESPACE,
31
+ },
32
+ pluginServiceLocalConfig: {
33
+ nodeModulesPath: getPluginsNodeModulesPath(),
34
+ packageJsonNamespace: PLUGGABLE_IO_FRAMEWORK_PACKAGE_JSON_NAMESPACE,
35
+ },
36
+ };
37
+ }
38
+
19
39
  export async function cli(): Promise<void> {
20
40
  await launchMultiCommandCLI(
21
41
  [list, getProperties, setProperties, deleteCommand, copy, move, hash],
@@ -23,18 +43,6 @@ export async function cli(): Promise<void> {
23
43
  "flowscripter-io-cli",
24
44
  packageJson.version,
25
45
  [new PrettyPrinterServiceProvider(40), new SyntaxHighlighterServiceProvider(35)],
26
- {
27
- argumentPrompterServiceEnabled: true,
28
- pluginServiceEnabled: true,
29
- pluginServiceRemoteConfig: {
30
- name: "npmjs",
31
- registryUrl: "https://registry.npmjs.org",
32
- packageJsonNamespace: PLUGGABLE_IO_FRAMEWORK_PACKAGE_JSON_NAMESPACE,
33
- },
34
- pluginServiceLocalConfig: {
35
- nodeModulesPath: getPluginsNodeModulesPath(),
36
- packageJsonNamespace: PLUGGABLE_IO_FRAMEWORK_PACKAGE_JSON_NAMESPACE,
37
- },
38
- },
46
+ getCLIFeatureOptions(),
39
47
  );
40
48
  }
@@ -0,0 +1,10 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { getCLIFeatureOptions } from "../src/cli.ts";
3
+
4
+ describe("getCLIFeatureOptions", () => {
5
+ test("enables the spawn service alongside the plugin service", () => {
6
+ const options = getCLIFeatureOptions();
7
+ expect(options.pluginServiceEnabled).toBeTrue();
8
+ expect(options.spawnServiceEnabled).toBeTrue();
9
+ });
10
+ });