@zuplo/cli 7.4.1 → 7.4.3

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.
Files changed (85) hide show
  1. package/node_modules/@inquirer/checkbox/package.json +5 -4
  2. package/node_modules/@inquirer/confirm/dist/index.d.ts +1 -1
  3. package/node_modules/@inquirer/confirm/package.json +4 -3
  4. package/node_modules/@inquirer/core/README.md +9 -3
  5. package/node_modules/@inquirer/core/dist/lib/hook-engine.d.ts +2 -8
  6. package/node_modules/@inquirer/core/dist/lib/use-memo.js +1 -1
  7. package/node_modules/@inquirer/core/dist/lib/use-state.d.ts +5 -2
  8. package/node_modules/@inquirer/core/dist/lib/use-state.js +7 -2
  9. package/node_modules/@inquirer/core/package.json +5 -4
  10. package/node_modules/@inquirer/editor/dist/index.d.ts +1 -1
  11. package/node_modules/@inquirer/editor/package.json +5 -4
  12. package/node_modules/@inquirer/expand/README.md +1 -1
  13. package/node_modules/@inquirer/expand/package.json +4 -3
  14. package/node_modules/@inquirer/external-editor/README.md +13 -0
  15. package/node_modules/@inquirer/external-editor/package.json +4 -3
  16. package/node_modules/@inquirer/figures/package.json +4 -3
  17. package/node_modules/@inquirer/input/package.json +4 -3
  18. package/node_modules/@inquirer/number/dist/index.d.ts +1 -1
  19. package/node_modules/@inquirer/number/dist/index.js +1 -6
  20. package/node_modules/@inquirer/number/dist/is-step-of.d.ts +1 -0
  21. package/node_modules/@inquirer/number/dist/is-step-of.js +22 -0
  22. package/node_modules/@inquirer/number/package.json +4 -3
  23. package/node_modules/@inquirer/password/package.json +4 -3
  24. package/node_modules/@inquirer/rawlist/package.json +4 -3
  25. package/node_modules/@inquirer/search/README.md +9 -8
  26. package/node_modules/@inquirer/search/dist/index.d.ts +1 -0
  27. package/node_modules/@inquirer/search/dist/index.js +6 -1
  28. package/node_modules/@inquirer/search/package.json +5 -4
  29. package/node_modules/@inquirer/select/package.json +5 -4
  30. package/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.d.ts.map +1 -1
  31. package/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.js +4 -2
  32. package/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs +4 -2
  33. package/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.d.ts.map +1 -1
  34. package/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.js +5 -5
  35. package/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs +5 -5
  36. package/node_modules/@posthog/core/dist/error-tracking/parsers/base.d.ts.map +1 -1
  37. package/node_modules/@posthog/core/dist/error-tracking/parsers/base.js +2 -1
  38. package/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs +2 -1
  39. package/node_modules/@posthog/core/dist/posthog-core.d.ts.map +1 -1
  40. package/node_modules/@posthog/core/dist/posthog-core.js +1 -0
  41. package/node_modules/@posthog/core/dist/posthog-core.mjs +1 -0
  42. package/node_modules/@posthog/core/package.json +1 -1
  43. package/node_modules/@posthog/core/src/error-tracking/coercers/error-coercer.ts +8 -2
  44. package/node_modules/@posthog/core/src/error-tracking/coercers/error-event-coercer.spec.ts +33 -0
  45. package/node_modules/@posthog/core/src/error-tracking/coercers/error-event-coercer.ts +13 -6
  46. package/node_modules/@posthog/core/src/error-tracking/error-properties-builder.coerce.spec.ts +15 -0
  47. package/node_modules/@posthog/core/src/error-tracking/parsers/base.spec.ts +34 -0
  48. package/node_modules/@posthog/core/src/error-tracking/parsers/base.ts +10 -2
  49. package/node_modules/@posthog/core/src/posthog-core.ts +1 -0
  50. package/node_modules/@zuplo/core/customer.cli.minified.js +239 -239
  51. package/node_modules/@zuplo/core/index.minified.js +253 -253
  52. package/node_modules/@zuplo/core/package.json +1 -1
  53. package/node_modules/@zuplo/graphql/package.json +1 -1
  54. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  55. package/node_modules/@zuplo/otel/package.json +1 -1
  56. package/node_modules/@zuplo/runtime/out/esm/{chunk-JKIKT5LB.js → chunk-NHSMO7UN.js} +103 -103
  57. package/node_modules/@zuplo/runtime/out/esm/chunk-NHSMO7UN.js.map +1 -0
  58. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  59. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
  60. package/node_modules/@zuplo/runtime/out/types/index.d.ts +61 -4
  61. package/node_modules/@zuplo/runtime/package.json +1 -1
  62. package/node_modules/negotiator/lib/accept.js +54 -0
  63. package/node_modules/negotiator/lib/charset.js +10 -34
  64. package/node_modules/negotiator/lib/encoding.js +9 -30
  65. package/node_modules/negotiator/lib/language.js +15 -36
  66. package/node_modules/negotiator/lib/mediaType.js +16 -134
  67. package/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
  68. package/node_modules/negotiator/node_modules/content-type/README.md +71 -0
  69. package/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
  70. package/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
  71. package/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
  72. package/node_modules/negotiator/node_modules/content-type/package.json +52 -0
  73. package/node_modules/negotiator/package.json +16 -10
  74. package/package.json +11 -11
  75. package/node_modules/@inquirer/external-editor/dist/errors/CreateFileError.d.ts +0 -10
  76. package/node_modules/@inquirer/external-editor/dist/errors/CreateFileError.js +0 -13
  77. package/node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.d.ts +0 -10
  78. package/node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.js +0 -13
  79. package/node_modules/@inquirer/external-editor/dist/errors/ReadFileError.d.ts +0 -10
  80. package/node_modules/@inquirer/external-editor/dist/errors/ReadFileError.js +0 -13
  81. package/node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.d.ts +0 -10
  82. package/node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.js +0 -13
  83. package/node_modules/@zuplo/runtime/out/esm/chunk-JKIKT5LB.js.map +0 -1
  84. package/node_modules/negotiator/HISTORY.md +0 -114
  85. /package/node_modules/@zuplo/runtime/out/esm/{chunk-JKIKT5LB.js.LEGAL.txt → chunk-NHSMO7UN.js.LEGAL.txt} +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/checkbox",
3
- "version": "5.2.1",
3
+ "version": "5.2.2",
4
4
  "description": "Inquirer checkbox prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -68,11 +68,12 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@inquirer/ansi": "^2.0.7",
71
- "@inquirer/core": "^11.2.1",
72
- "@inquirer/figures": "^2.0.7",
71
+ "@inquirer/core": "^12.0.0",
72
+ "@inquirer/figures": "^2.0.8",
73
73
  "@inquirer/type": "^4.0.7"
74
74
  },
75
75
  "devDependencies": {
76
+ "@repo/tsconfig": "0.0.0",
76
77
  "typescript": "^6.0.2"
77
78
  },
78
79
  "peerDependencies": {
@@ -88,5 +89,5 @@
88
89
  },
89
90
  "main": "./dist/index.js",
90
91
  "types": "./dist/index.d.ts",
91
- "gitHead": "b43359d803733b1a7c4638addcc270987fb894c3"
92
+ "gitHead": "999706755afbdcae271f62decbd9bcd05560905b"
92
93
  }
@@ -2,7 +2,7 @@ import { type Theme } from '@inquirer/core';
2
2
  import type { PartialDeep } from '@inquirer/type';
3
3
  type ConfirmConfig = {
4
4
  message: string;
5
- default?: boolean;
5
+ default?: boolean | undefined;
6
6
  transformer?: (value: boolean) => string;
7
7
  theme?: PartialDeep<Theme>;
8
8
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/confirm",
3
- "version": "6.1.1",
3
+ "version": "6.2.0",
4
4
  "description": "Inquirer confirm prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -67,10 +67,11 @@
67
67
  "tsc": "tsc"
68
68
  },
69
69
  "dependencies": {
70
- "@inquirer/core": "^11.2.1",
70
+ "@inquirer/core": "^12.0.0",
71
71
  "@inquirer/type": "^4.0.7"
72
72
  },
73
73
  "devDependencies": {
74
+ "@repo/tsconfig": "0.0.0",
74
75
  "typescript": "^6.0.2"
75
76
  },
76
77
  "peerDependencies": {
@@ -86,5 +87,5 @@
86
87
  },
87
88
  "main": "./dist/index.js",
88
89
  "types": "./dist/index.d.ts",
89
- "gitHead": "b43359d803733b1a7c4638addcc270987fb894c3"
90
+ "gitHead": "999706755afbdcae271f62decbd9bcd05560905b"
90
91
  }
@@ -49,9 +49,7 @@ const input = createPrompt((config, done) => {
49
49
  });
50
50
 
51
51
  // And it is then called as
52
- const answer = await input({
53
- /* config */
54
- });
52
+ const answer = await input({/* config */});
55
53
  ```
56
54
 
57
55
  ## Hooks
@@ -64,6 +62,14 @@ State lets a component “remember” information like user input. For example,
64
62
 
65
63
  `useState` declares a state variable that you can update directly.
66
64
 
65
+ The setter also accepts an updater function to compute the next state from the current one (mirroring React):
66
+
67
+ ```ts
68
+ const [index, setIndex] = useState(0);
69
+
70
+ setIndex((current) => current + 1);
71
+ ```
72
+
67
73
  ```ts
68
74
  import { createPrompt, useState } from '@inquirer/core';
69
75
 
@@ -2,17 +2,11 @@ import type { InquirerReadline } from '@inquirer/type';
2
2
  export declare function withHooks<T>(rl: InquirerReadline, cb: (cycle: (render: () => void) => void) => T): T;
3
3
  export declare function readline(): InquirerReadline;
4
4
  export declare function withUpdates<Args extends unknown[], R>(fn: (...args: Args) => R): (...args: Args) => R;
5
- type SetPointer<Value> = {
5
+ type Pointer<Value> = {
6
6
  get(): Value;
7
7
  set(value: Value): void;
8
- initialized: true;
8
+ initialized: boolean;
9
9
  };
10
- type UnsetPointer<Value> = {
11
- get(): void;
12
- set(value: Value): void;
13
- initialized: false;
14
- };
15
- type Pointer<Value> = SetPointer<Value> | UnsetPointer<Value>;
16
10
  export declare function withPointer<Value, ReturnValue>(cb: (pointer: Pointer<Value>) => ReturnValue): ReturnValue;
17
11
  export declare function handleChange(): void;
18
12
  export declare const effectScheduler: {
@@ -2,7 +2,7 @@ import { withPointer } from "./hook-engine.js";
2
2
  export function useMemo(fn, dependencies) {
3
3
  return withPointer((pointer) => {
4
4
  const prev = pointer.get();
5
- if (!prev ||
5
+ if (!pointer.initialized ||
6
6
  prev.dependencies.length !== dependencies.length ||
7
7
  prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
8
8
  const value = fn();
@@ -1,4 +1,7 @@
1
1
  type NotFunction<T> = T extends (...args: never) => unknown ? never : T;
2
- export declare function useState<Value>(defaultValue: NotFunction<Value> | (() => Value)): [Value, (newValue: Value) => void];
3
- export declare function useState<Value>(defaultValue?: NotFunction<Value> | (() => Value)): [Value | undefined, (newValue?: Value) => void];
2
+ type Reducer<Value> = (currentValue: Value) => Value;
3
+ type SetState<Value> = (newValue: NotFunction<Value> | Reducer<Value>) => void;
4
+ type OptionalSetState<Value> = (newValue?: NotFunction<Value> | Reducer<Value>) => void;
5
+ export declare function useState<Value>(defaultValue: NotFunction<Value> | (() => Value)): [Value, SetState<Value>];
6
+ export declare function useState<Value>(defaultValue?: NotFunction<Value> | (() => Value)): [Value | undefined, OptionalSetState<Value | undefined>];
4
7
  export {};
@@ -3,12 +3,17 @@ import { withPointer, handleChange } from "./hook-engine.js";
3
3
  function isFactory(value) {
4
4
  return typeof value === 'function';
5
5
  }
6
+ function isReducer(value) {
7
+ return typeof value === 'function';
8
+ }
6
9
  export function useState(defaultValue) {
7
10
  return withPointer((pointer) => {
8
11
  const setState = AsyncResource.bind(function setState(newValue) {
12
+ const currentValue = pointer.get();
13
+ const nextValue = isReducer(newValue) ? newValue(currentValue) : newValue;
9
14
  // Noop if the value is still the same.
10
- if (pointer.get() !== newValue) {
11
- pointer.set(newValue);
15
+ if (!Object.is(currentValue, nextValue)) {
16
+ pointer.set(nextValue);
12
17
  // Trigger re-render
13
18
  handleChange();
14
19
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/core",
3
- "version": "11.2.1",
3
+ "version": "12.0.0",
4
4
  "description": "Core Inquirer prompt API",
5
5
  "keywords": [
6
6
  "answer",
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@inquirer/ansi": "^2.0.7",
71
- "@inquirer/figures": "^2.0.7",
71
+ "@inquirer/figures": "^2.0.8",
72
72
  "@inquirer/type": "^4.0.7",
73
73
  "cli-width": "^4.1.0",
74
74
  "fast-wrap-ansi": "^0.2.0",
@@ -76,8 +76,9 @@
76
76
  "signal-exit": "^4.1.0"
77
77
  },
78
78
  "devDependencies": {
79
+ "@repo/tsconfig": "0.0.0",
79
80
  "@types/mute-stream": "^0.0.4",
80
- "@types/node": "^25.5.2",
81
+ "@types/node": "^26.1.1",
81
82
  "typescript": "^6.0.2"
82
83
  },
83
84
  "peerDependencies": {
@@ -93,5 +94,5 @@
93
94
  },
94
95
  "main": "./dist/index.js",
95
96
  "types": "./dist/index.d.ts",
96
- "gitHead": "b43359d803733b1a7c4638addcc270987fb894c3"
97
+ "gitHead": "999706755afbdcae271f62decbd9bcd05560905b"
97
98
  }
@@ -10,7 +10,7 @@ type EditorTheme = {
10
10
  };
11
11
  type EditorConfig = {
12
12
  message: string;
13
- default?: string;
13
+ default?: string | undefined;
14
14
  postfix?: string;
15
15
  waitForUserInput?: boolean;
16
16
  validate?: (value: string) => boolean | string | Promise<string | boolean>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/editor",
3
- "version": "5.2.2",
3
+ "version": "5.3.0",
4
4
  "description": "Inquirer multiline editor prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -67,11 +67,12 @@
67
67
  "tsc": "tsc"
68
68
  },
69
69
  "dependencies": {
70
- "@inquirer/core": "^11.2.1",
71
- "@inquirer/external-editor": "^3.0.3",
70
+ "@inquirer/core": "^12.0.0",
71
+ "@inquirer/external-editor": "^3.0.4",
72
72
  "@inquirer/type": "^4.0.7"
73
73
  },
74
74
  "devDependencies": {
75
+ "@repo/tsconfig": "0.0.0",
75
76
  "typescript": "^6.0.2"
76
77
  },
77
78
  "peerDependencies": {
@@ -87,5 +88,5 @@
87
88
  },
88
89
  "main": "./dist/index.js",
89
90
  "types": "./dist/index.d.ts",
90
- "gitHead": "bfd8710229e3d3c9784bef3bbfbd84c7bd09bb9e"
91
+ "gitHead": "999706755afbdcae271f62decbd9bcd05560905b"
91
92
  }
@@ -112,7 +112,7 @@ Here's each property:
112
112
 
113
113
  - `value`: The value is what will be returned by `await expand()`.
114
114
  - `name`: The string displayed in the choice list. It'll default to the stringify `value`.
115
- - `key`: The input the use must provide to select the choice. Must be a lowercase single alpha-numeric character string.
115
+ - `key`: The input the use must provide to select the choice. Must be a lowercase single alphanumeric character string.
116
116
 
117
117
  ## Theming
118
118
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/expand",
3
- "version": "5.1.1",
3
+ "version": "5.1.2",
4
4
  "description": "Inquirer checkbox prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -67,10 +67,11 @@
67
67
  "tsc": "tsc"
68
68
  },
69
69
  "dependencies": {
70
- "@inquirer/core": "^11.2.1",
70
+ "@inquirer/core": "^12.0.0",
71
71
  "@inquirer/type": "^4.0.7"
72
72
  },
73
73
  "devDependencies": {
74
+ "@repo/tsconfig": "0.0.0",
74
75
  "typescript": "^6.0.2"
75
76
  },
76
77
  "peerDependencies": {
@@ -86,5 +87,5 @@
86
87
  },
87
88
  "main": "./dist/index.js",
88
89
  "types": "./dist/index.d.ts",
89
- "gitHead": "b43359d803733b1a7c4638addcc270987fb894c3"
90
+ "gitHead": "999706755afbdcae271f62decbd9bcd05560905b"
90
91
  }
@@ -77,6 +77,19 @@ try {
77
77
  }
78
78
  ```
79
79
 
80
+ ### Windows editor commands
81
+
82
+ On Windows, prefer setting `$VISUAL` or `$EDITOR` to the editor executable
83
+ rather than a `.cmd` or `.bat` shim. This package launches the editor directly
84
+ instead of through a shell so editor arguments and temporary file paths are not
85
+ interpreted as shell commands.
86
+
87
+ For example, use `Code.exe` with `--wait` instead of `code.cmd`:
88
+
89
+ ```powershell
90
+ setx VISUAL '"C:\Program Files\Microsoft VS Code\Code.exe" --wait'
91
+ ```
92
+
80
93
  #### API
81
94
 
82
95
  **Convenience Functions**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/external-editor",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "Edit a string with the users preferred text editor using $VISUAL or $ENVIRONMENT",
5
5
  "keywords": [
6
6
  "answer",
@@ -76,8 +76,9 @@
76
76
  "iconv-lite": "^0.7.2"
77
77
  },
78
78
  "devDependencies": {
79
+ "@repo/tsconfig": "0.0.0",
79
80
  "@types/chardet": "^1.0.0",
80
- "@types/node": "^25.5.2",
81
+ "@types/node": "^26.1.1",
81
82
  "typescript": "^6.0.2"
82
83
  },
83
84
  "peerDependencies": {
@@ -93,5 +94,5 @@
93
94
  },
94
95
  "main": "./dist/index.js",
95
96
  "types": "./dist/index.d.ts",
96
- "gitHead": "bfd8710229e3d3c9784bef3bbfbd84c7bd09bb9e"
97
+ "gitHead": "999706755afbdcae271f62decbd9bcd05560905b"
97
98
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/figures",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "Vendored version of figures, for CJS compatibility",
5
5
  "keywords": [
6
6
  "answer",
@@ -68,7 +68,8 @@
68
68
  "tsc": "tsc"
69
69
  },
70
70
  "devDependencies": {
71
- "@types/node": "^25.5.2",
71
+ "@repo/tsconfig": "0.0.0",
72
+ "@types/node": "^26.1.1",
72
73
  "typescript": "^6.0.2"
73
74
  },
74
75
  "engines": {
@@ -76,5 +77,5 @@
76
77
  },
77
78
  "main": "./dist/index.js",
78
79
  "types": "./dist/index.d.ts",
79
- "gitHead": "b43359d803733b1a7c4638addcc270987fb894c3"
80
+ "gitHead": "2073546b459fd91d71f4f778ddf7b4c5417bb8b5"
80
81
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/input",
3
- "version": "5.1.2",
3
+ "version": "5.1.3",
4
4
  "description": "Inquirer input text prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -67,10 +67,11 @@
67
67
  "tsc": "tsc"
68
68
  },
69
69
  "dependencies": {
70
- "@inquirer/core": "^11.2.1",
70
+ "@inquirer/core": "^12.0.0",
71
71
  "@inquirer/type": "^4.0.7"
72
72
  },
73
73
  "devDependencies": {
74
+ "@repo/tsconfig": "0.0.0",
74
75
  "typescript": "^6.0.2"
75
76
  },
76
77
  "peerDependencies": {
@@ -86,5 +87,5 @@
86
87
  },
87
88
  "main": "./dist/index.js",
88
89
  "types": "./dist/index.d.ts",
89
- "gitHead": "bfd8710229e3d3c9784bef3bbfbd84c7bd09bb9e"
90
+ "gitHead": "999706755afbdcae271f62decbd9bcd05560905b"
90
91
  }
@@ -2,7 +2,7 @@ import { type Theme } from '@inquirer/core';
2
2
  import type { PartialDeep } from '@inquirer/type';
3
3
  declare const _default: <Required extends boolean>(config: {
4
4
  message: string;
5
- default?: number | undefined;
5
+ default?: number | undefined | undefined;
6
6
  min?: number | undefined;
7
7
  max?: number | undefined;
8
8
  step?: number | "any" | undefined;
@@ -1,10 +1,5 @@
1
1
  import { createPrompt, useState, useKeypress, usePrefix, isBackspaceKey, isEnterKey, isTabKey, makeTheme, } from '@inquirer/core';
2
- function isStepOf(value, step, min) {
3
- const valuePow = value * Math.pow(10, 6);
4
- const stepPow = step * Math.pow(10, 6);
5
- const minPow = min * Math.pow(10, 6);
6
- return (valuePow - (Number.isFinite(min) ? minPow : 0)) % stepPow === 0;
7
- }
2
+ import { isStepOf } from "./is-step-of.js";
8
3
  function validateNumber(value, { min, max, step, }) {
9
4
  if (value == null || Number.isNaN(value)) {
10
5
  return false;
@@ -0,0 +1 @@
1
+ export declare function isStepOf(value: number, step: number, min: number): boolean;
@@ -0,0 +1,22 @@
1
+ function toDecimal(value) {
2
+ const [coefficient = '', exponent = '0'] = value.toString().toLowerCase().split('e');
3
+ const [integer = '', fraction = ''] = coefficient.split('.');
4
+ return {
5
+ significand: BigInt(`${integer}${fraction}`),
6
+ exponent: Number(exponent) - fraction.length,
7
+ };
8
+ }
9
+ export function isStepOf(value, step, min) {
10
+ if (!Number.isFinite(value) || !Number.isFinite(step) || step === 0) {
11
+ return false;
12
+ }
13
+ const valueDecimal = toDecimal(value);
14
+ const stepDecimal = toDecimal(step);
15
+ const minDecimal = Number.isFinite(min) ? toDecimal(min) : undefined;
16
+ const exponent = Math.min(valueDecimal.exponent, stepDecimal.exponent, minDecimal?.exponent ?? Infinity);
17
+ const toInteger = (decimal) => decimal.significand * 10n ** BigInt(decimal.exponent - exponent);
18
+ const valueInteger = toInteger(valueDecimal);
19
+ const stepInteger = toInteger(stepDecimal);
20
+ const minInteger = minDecimal ? toInteger(minDecimal) : 0n;
21
+ return (valueInteger - minInteger) % stepInteger === 0n;
22
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/number",
3
- "version": "4.1.1",
3
+ "version": "4.2.0",
4
4
  "description": "Inquirer number prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -67,10 +67,11 @@
67
67
  "tsc": "tsc"
68
68
  },
69
69
  "dependencies": {
70
- "@inquirer/core": "^11.2.1",
70
+ "@inquirer/core": "^12.0.0",
71
71
  "@inquirer/type": "^4.0.7"
72
72
  },
73
73
  "devDependencies": {
74
+ "@repo/tsconfig": "0.0.0",
74
75
  "typescript": "^6.0.2"
75
76
  },
76
77
  "peerDependencies": {
@@ -86,5 +87,5 @@
86
87
  },
87
88
  "main": "./dist/index.js",
88
89
  "types": "./dist/index.d.ts",
89
- "gitHead": "b43359d803733b1a7c4638addcc270987fb894c3"
90
+ "gitHead": "999706755afbdcae271f62decbd9bcd05560905b"
90
91
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/password",
3
- "version": "5.1.1",
3
+ "version": "5.1.2",
4
4
  "description": "Inquirer password prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -68,10 +68,11 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@inquirer/ansi": "^2.0.7",
71
- "@inquirer/core": "^11.2.1",
71
+ "@inquirer/core": "^12.0.0",
72
72
  "@inquirer/type": "^4.0.7"
73
73
  },
74
74
  "devDependencies": {
75
+ "@repo/tsconfig": "0.0.0",
75
76
  "typescript": "^6.0.2"
76
77
  },
77
78
  "peerDependencies": {
@@ -87,5 +88,5 @@
87
88
  },
88
89
  "main": "./dist/index.js",
89
90
  "types": "./dist/index.d.ts",
90
- "gitHead": "b43359d803733b1a7c4638addcc270987fb894c3"
91
+ "gitHead": "999706755afbdcae271f62decbd9bcd05560905b"
91
92
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/rawlist",
3
- "version": "5.3.1",
3
+ "version": "5.3.2",
4
4
  "description": "Inquirer rawlist prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -67,10 +67,11 @@
67
67
  "tsc": "tsc"
68
68
  },
69
69
  "dependencies": {
70
- "@inquirer/core": "^11.2.1",
70
+ "@inquirer/core": "^12.0.0",
71
71
  "@inquirer/type": "^4.0.7"
72
72
  },
73
73
  "devDependencies": {
74
+ "@repo/tsconfig": "0.0.0",
74
75
  "typescript": "^6.0.2"
75
76
  },
76
77
  "peerDependencies": {
@@ -86,5 +87,5 @@
86
87
  },
87
88
  "main": "./dist/index.js",
88
89
  "types": "./dist/index.d.ts",
89
- "gitHead": "b43359d803733b1a7c4638addcc270987fb894c3"
90
+ "gitHead": "999706755afbdcae271f62decbd9bcd05560905b"
90
91
  }
@@ -76,14 +76,15 @@ const answer = await search({
76
76
 
77
77
  ## Options
78
78
 
79
- | Property | Type | Required | Description |
80
- | -------- | ---------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
81
- | message | `string` | yes | The question to ask |
82
- | source | `(term: string \| void) => Promise<Choice[]>` | yes | This function returns the choices relevant to the search term. |
83
- | pageSize | `number` | no | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. |
84
- | default | `Value` | no | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item. |
85
- | validate | `Value => boolean \| string \| Promise<boolean \| string>` | no | On submit, validate the answer. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
86
- | theme | [See Theming](#Theming) | no | Customize look of the prompt. |
79
+ | Property | Type | Required | Description |
80
+ | ------------ | ---------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
81
+ | message | `string` | yes | The question to ask |
82
+ | source | `(term: string \| void) => Promise<Choice[]>` | yes | This function returns the choices relevant to the search term. |
83
+ | pageSize | `number` | no | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. |
84
+ | default | `Value` | no | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item. |
85
+ | initialValue | `string` | no | The value used to pre-populate the search input. `source` will be called with this value as the initial search term. |
86
+ | validate | `Value => boolean \| string \| Promise<boolean \| string>` | no | On submit, validate the answer. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
87
+ | theme | [See Theming](#Theming) | no | Customize look of the prompt. |
87
88
 
88
89
  ### `source` function
89
90
 
@@ -27,6 +27,7 @@ declare const _default: <const Value>(config: {
27
27
  validate?: ((value: Value) => boolean | string | Promise<string | boolean>) | undefined;
28
28
  pageSize?: number | undefined;
29
29
  default?: NoInfer<Value> | undefined;
30
+ initialValue?: string | undefined;
30
31
  theme?: PartialDeep<Theme<SearchTheme>> | undefined;
31
32
  }, context?: import("@inquirer/type").Context) => Promise<Value>;
32
33
  export default _default;
@@ -45,7 +45,7 @@ export default createPrompt((config, done) => {
45
45
  const { pageSize = 7, validate = () => true } = config;
46
46
  const theme = makeTheme(searchTheme, config.theme);
47
47
  const [status, setStatus] = useState('loading');
48
- const [searchTerm, setSearchTerm] = useState('');
48
+ const [searchTerm, setSearchTerm] = useState(config.initialValue ?? '');
49
49
  const [searchResults, setSearchResults] = useState([]);
50
50
  const [searchError, setSearchError] = useState();
51
51
  const defaultApplied = useRef(false);
@@ -56,6 +56,11 @@ export default createPrompt((config, done) => {
56
56
  return { first, last };
57
57
  }, [searchResults]);
58
58
  const [active = bounds.first, setActive] = useState();
59
+ useEffect((rl) => {
60
+ if (config.initialValue) {
61
+ rl.write(config.initialValue);
62
+ }
63
+ }, []);
59
64
  useEffect(() => {
60
65
  const controller = new AbortController();
61
66
  setStatus('loading');
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/search",
3
- "version": "4.2.1",
3
+ "version": "4.3.0",
4
4
  "description": "Inquirer search prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -67,11 +67,12 @@
67
67
  "tsc": "tsc"
68
68
  },
69
69
  "dependencies": {
70
- "@inquirer/core": "^11.2.1",
71
- "@inquirer/figures": "^2.0.7",
70
+ "@inquirer/core": "^12.0.0",
71
+ "@inquirer/figures": "^2.0.8",
72
72
  "@inquirer/type": "^4.0.7"
73
73
  },
74
74
  "devDependencies": {
75
+ "@repo/tsconfig": "0.0.0",
75
76
  "typescript": "^6.0.2"
76
77
  },
77
78
  "peerDependencies": {
@@ -87,5 +88,5 @@
87
88
  },
88
89
  "main": "./dist/index.js",
89
90
  "types": "./dist/index.d.ts",
90
- "gitHead": "b43359d803733b1a7c4638addcc270987fb894c3"
91
+ "gitHead": "999706755afbdcae271f62decbd9bcd05560905b"
91
92
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/select",
3
- "version": "5.2.1",
3
+ "version": "5.2.2",
4
4
  "description": "Inquirer select/list prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -68,11 +68,12 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@inquirer/ansi": "^2.0.7",
71
- "@inquirer/core": "^11.2.1",
72
- "@inquirer/figures": "^2.0.7",
71
+ "@inquirer/core": "^12.0.0",
72
+ "@inquirer/figures": "^2.0.8",
73
73
  "@inquirer/type": "^4.0.7"
74
74
  },
75
75
  "devDependencies": {
76
+ "@repo/tsconfig": "0.0.0",
76
77
  "typescript": "^6.0.2"
77
78
  },
78
79
  "peerDependencies": {
@@ -88,5 +89,5 @@
88
89
  },
89
90
  "main": "./dist/index.js",
90
91
  "types": "./dist/index.d.ts",
91
- "gitHead": "b43359d803733b1a7c4638addcc270987fb894c3"
92
+ "gitHead": "999706755afbdcae271f62decbd9bcd05560905b"
92
93
  }
@@ -1 +1 @@
1
- {"version":3,"file":"error-coercer.d.ts","sourceRoot":"","sources":["../../../src/error-tracking/coercers/error-coercer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE/E,qBAAa,YAAa,YAAW,oBAAoB,CAAC,KAAK,CAAC;IAC9D,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,KAAK;IAIjC,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,eAAe,GAAG,aAAa;IAUvD,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,QAAQ;CAGjB"}
1
+ {"version":3,"file":"error-coercer.d.ts","sourceRoot":"","sources":["../../../src/error-tracking/coercers/error-coercer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE/E,qBAAa,YAAa,YAAW,oBAAoB,CAAC,KAAK,CAAC;IAC9D,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,KAAK;IAIjC,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,eAAe,GAAG,aAAa;IAgBvD,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,QAAQ;CAGjB"}