@jakubmazanec/cli 0.3.9-unstable.ebf4a7da → 0.4.0-next.1ccffc71

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/README.md CHANGED
@@ -17,10 +17,13 @@ npm install @jakubmazanec/cli
17
17
  ⚠️ This is an [ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) package!
18
18
  It cannot be required from a CommonJS module.
19
19
 
20
+ <!-- prerequisites -->
21
+
20
22
  #### Prerequisites
21
23
 
22
- - Node.js 20 or later
24
+ - Node.js 22 or later
23
25
  - TypeScript 5 or later
26
+ <!-- prerequisites -->
24
27
 
25
28
  ## Usage
26
29
 
@@ -1,4 +1,5 @@
1
1
  import { type BoxProps } from 'ink';
2
+ import React from 'react';
2
3
  import { type SelectInputItem } from './SelectInputItem.js';
3
4
  /**
4
5
  * {@linkcode SelectInput} component props.
@@ -24,5 +25,5 @@ type SelectInputProps = BoxProps & {
24
25
  /**
25
26
  * Select input component.
26
27
  */
27
- export declare function SelectInput({ label, items, focus, initialIndex, limit: userDefinedLimit, onSelect, onHighlight, isComplete, ...boxProps }: SelectInputProps): JSX.Element;
28
+ export declare function SelectInput({ label, items, focus, initialIndex, limit: userDefinedLimit, onSelect, onHighlight, isComplete, ...boxProps }: SelectInputProps): React.JSX.Element;
28
29
  export {};
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../source/ui/form/SelectInput.tsx"],
4
- "sourcesContent": ["import {Box, type BoxProps, type Key, Text, useInput} from 'ink';\nimport _ from 'lodash';\nimport {useEffect, useRef, useState} from 'react';\n\nimport * as colors from '../colors.js';\nimport * as icons from '../icons.js';\nimport {rotate} from '../internals.js';\nimport {type SelectInputItem} from './SelectInputItem.js';\n\n/**\n * {@linkcode SelectInput} component props.\n */\ntype SelectInputProps = BoxProps & {\n /** Text to display as a label. */\n label: string;\n\n /** Items to display in a list. */\n items: SelectInputItem[];\n\n /** Should component listen to user's input? Useful in case there are multiple input components at the same time and input must be handled only by a specific component. */\n focus?: boolean | undefined;\n\n /** Index of initially selected item. */\n initialIndex?: number | undefined;\n\n /** Number of items to display. */\n limit?: number | undefined;\n\n /** Handler function that is called when item is selected. */\n onSelect?: ((item: SelectInputItem) => void) | undefined;\n\n /** Handler function that is called when item is highlighted. */\n onHighlight?: ((item: SelectInputItem) => void) | undefined;\n\n /** Indicates whether value has been accepted. Component then doesn't accept more input. */\n isComplete?: boolean | undefined;\n};\n\n/**\n * Select input component.\n */\nexport function SelectInput({\n label,\n items,\n focus = true,\n initialIndex = 0,\n limit: userDefinedLimit,\n onSelect,\n onHighlight,\n isComplete,\n ...boxProps\n}: SelectInputProps): JSX.Element {\n let [rotatedIndex, setRotatedIndex] = useState(0);\n let [selectedIndex, setSelectedIndex] = useState(initialIndex);\n let hasLimit = typeof userDefinedLimit === 'number' && items.length > userDefinedLimit;\n let limit = hasLimit ? Math.min(userDefinedLimit as number, items.length) : items.length;\n let previousItems = useRef<SelectInputItem[]>(items);\n\n useEffect(() => {\n if (\n !_.isEqual(\n previousItems.current.map((item) => item.value),\n items.map((item) => item.value),\n )\n ) {\n setRotatedIndex(0);\n setSelectedIndex(0);\n }\n\n previousItems.current = items;\n }, [items]);\n\n useInput(\n (input: string, key: Key) => {\n if (input === 'k' || key.upArrow) {\n let lastIndex = (hasLimit ? limit : items.length) - 1;\n let isAtFirstIndex = selectedIndex === 0;\n let nextIndex = hasLimit ? selectedIndex : lastIndex;\n let nextRotatedIndex = isAtFirstIndex ? rotatedIndex + 1 : rotatedIndex;\n let nextSelectedIndex = isAtFirstIndex ? nextIndex : selectedIndex - 1;\n\n setRotatedIndex(nextRotatedIndex);\n setSelectedIndex(nextSelectedIndex);\n\n let slicedItems = hasLimit ? rotate(items, nextRotatedIndex).slice(0, limit) : items;\n\n if (typeof onHighlight === 'function') {\n onHighlight(slicedItems[nextSelectedIndex] as SelectInputItem);\n }\n }\n\n if (input === 'j' || key.downArrow) {\n let isAtLastIndex = selectedIndex === (hasLimit ? limit : items.length) - 1;\n let nextIndex = hasLimit ? selectedIndex : 0;\n let nextRotatedIndex = isAtLastIndex ? rotatedIndex - 1 : rotatedIndex;\n let nextSelectedIndex = isAtLastIndex ? nextIndex : selectedIndex + 1;\n\n setRotatedIndex(nextRotatedIndex);\n setSelectedIndex(nextSelectedIndex);\n\n let slicedItems = hasLimit ? rotate(items, nextRotatedIndex).slice(0, limit) : items;\n\n if (typeof onHighlight === 'function') {\n onHighlight(slicedItems[nextSelectedIndex] as SelectInputItem);\n }\n }\n\n if (key.return) {\n let slicedItems = hasLimit ? rotate(items, rotatedIndex).slice(0, limit) : items;\n\n if (typeof onSelect === 'function') {\n onSelect(slicedItems[selectedIndex] as SelectInputItem);\n }\n }\n },\n {isActive: focus},\n );\n\n let visibleItems: SelectInputItem[] =\n hasLimit ? rotate(items, rotatedIndex).slice(0, limit) : items;\n\n return (\n <Box {...boxProps}>\n <Box marginRight={1}>\n <Text>{isComplete ? icons.success : icons.question}</Text>\n </Box>\n\n <Box flexDirection=\"column\">\n <Box marginRight={1}>\n <Text color={colors.highlighted}>{label}</Text>\n </Box>\n {isComplete ?\n <Text color={colors.body}>\n {items[selectedIndex]?.label ?? String(items[selectedIndex]?.value)}\n </Text>\n : <Box flexDirection=\"column\">\n {visibleItems.map((item, index) => {\n let isSelected = index === selectedIndex;\n\n return (\n <Box key={item.value}>\n <Box marginRight={1}>\n {isSelected ?\n <Text color={colors.selected}>{icons.selectedCircle}</Text>\n : <Text color={colors.unselected}>{icons.unselectedCircle}</Text>}\n </Box>\n <Text color={isSelected ? colors.highlighted : colors.muted}>{item.label}</Text>\n </Box>\n );\n })}\n </Box>\n }\n </Box>\n </Box>\n );\n}\n\n// partially based on https://github.com/vadimdemedes/ink-select-input/tree/309497ca641f55d8df0083ec2d07264f101358e4 (see https://github.com/vadimdemedes/ink-select-input/blob/309497ca641f55d8df0083ec2d07264f101358e4/license for license)\n"],
5
- "mappings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C,YAAI,aAAa,UAAU;AAE3B,eACE,qBAAC,OACC;AAAA,8BAAC,OAAI,aAAa,GACf,uBACC,oBAAC,QAAK,OAAO,OAAO,UAAW,gBAAM,gBAAe,IACpD,oBAAC,QAAK,OAAO,OAAO,YAAa,gBAAM,kBAAiB,GAC5D;AAAA,UACA,oBAAC,QAAK,OAAO,aAAa,OAAO,cAAc,OAAO,OAAQ,eAAK,OAAM;AAAA,aANjE,KAAK,KAOf;AAAA,MAEJ,CAAC,GACH;AAAA,OAEJ;AAAA,KACF;AAEJ;",
4
+ "sourcesContent": ["import {Box, type BoxProps, type Key, Text, useInput} from 'ink';\nimport _ from 'lodash';\nimport React, {useEffect, useRef, useState} from 'react';\n\nimport * as colors from '../colors.js';\nimport * as icons from '../icons.js';\nimport {rotate} from '../internals.js';\nimport {type SelectInputItem} from './SelectInputItem.js';\n\n/**\n * {@linkcode SelectInput} component props.\n */\ntype SelectInputProps = BoxProps & {\n /** Text to display as a label. */\n label: string;\n\n /** Items to display in a list. */\n items: SelectInputItem[];\n\n /** Should component listen to user's input? Useful in case there are multiple input components at the same time and input must be handled only by a specific component. */\n focus?: boolean | undefined;\n\n /** Index of initially selected item. */\n initialIndex?: number | undefined;\n\n /** Number of items to display. */\n limit?: number | undefined;\n\n /** Handler function that is called when item is selected. */\n onSelect?: ((item: SelectInputItem) => void) | undefined;\n\n /** Handler function that is called when item is highlighted. */\n onHighlight?: ((item: SelectInputItem) => void) | undefined;\n\n /** Indicates whether value has been accepted. Component then doesn't accept more input. */\n isComplete?: boolean | undefined;\n};\n\n/**\n * Select input component.\n */\nexport function SelectInput({\n label,\n items,\n focus = true,\n initialIndex = 0,\n limit: userDefinedLimit,\n onSelect,\n onHighlight,\n isComplete,\n ...boxProps\n}: SelectInputProps): React.JSX.Element {\n let [rotatedIndex, setRotatedIndex] = useState(0);\n let [selectedIndex, setSelectedIndex] = useState(initialIndex);\n let hasLimit = typeof userDefinedLimit === 'number' && items.length > userDefinedLimit;\n let limit = hasLimit ? Math.min(userDefinedLimit as number, items.length) : items.length;\n let previousItems = useRef<SelectInputItem[]>(items);\n\n useEffect(() => {\n if (\n !_.isEqual(\n previousItems.current.map((item) => item.value),\n items.map((item) => item.value),\n )\n ) {\n setRotatedIndex(0);\n setSelectedIndex(0);\n }\n\n previousItems.current = items;\n }, [items]);\n\n useInput(\n (input: string, key: Key) => {\n if (input === 'k' || key.upArrow) {\n let lastIndex = (hasLimit ? limit : items.length) - 1;\n let isAtFirstIndex = selectedIndex === 0;\n let nextIndex = hasLimit ? selectedIndex : lastIndex;\n let nextRotatedIndex = isAtFirstIndex ? rotatedIndex + 1 : rotatedIndex;\n let nextSelectedIndex = isAtFirstIndex ? nextIndex : selectedIndex - 1;\n\n setRotatedIndex(nextRotatedIndex);\n setSelectedIndex(nextSelectedIndex);\n\n let slicedItems = hasLimit ? rotate(items, nextRotatedIndex).slice(0, limit) : items;\n\n if (typeof onHighlight === 'function') {\n onHighlight(slicedItems[nextSelectedIndex] as SelectInputItem);\n }\n }\n\n if (input === 'j' || key.downArrow) {\n let isAtLastIndex = selectedIndex === (hasLimit ? limit : items.length) - 1;\n let nextIndex = hasLimit ? selectedIndex : 0;\n let nextRotatedIndex = isAtLastIndex ? rotatedIndex - 1 : rotatedIndex;\n let nextSelectedIndex = isAtLastIndex ? nextIndex : selectedIndex + 1;\n\n setRotatedIndex(nextRotatedIndex);\n setSelectedIndex(nextSelectedIndex);\n\n let slicedItems = hasLimit ? rotate(items, nextRotatedIndex).slice(0, limit) : items;\n\n if (typeof onHighlight === 'function') {\n onHighlight(slicedItems[nextSelectedIndex] as SelectInputItem);\n }\n }\n\n if (key.return) {\n let slicedItems = hasLimit ? rotate(items, rotatedIndex).slice(0, limit) : items;\n\n if (typeof onSelect === 'function') {\n onSelect(slicedItems[selectedIndex] as SelectInputItem);\n }\n }\n },\n {isActive: focus},\n );\n\n let visibleItems: SelectInputItem[] =\n hasLimit ? rotate(items, rotatedIndex).slice(0, limit) : items;\n\n return (\n <Box {...boxProps}>\n <Box marginRight={1}>\n <Text>{isComplete ? icons.success : icons.question}</Text>\n </Box>\n\n <Box flexDirection=\"column\">\n <Box marginRight={1}>\n <Text color={colors.highlighted}>{label}</Text>\n </Box>\n {isComplete ?\n <Text color={colors.body}>\n {items[selectedIndex]?.label ?? String(items[selectedIndex]?.value)}\n </Text>\n : <Box flexDirection=\"column\">\n {visibleItems.map((item, index) => {\n let isSelected = index === selectedIndex;\n\n return (\n <Box key={item.value}>\n <Box marginRight={1}>\n {isSelected ?\n <Text color={colors.selected}>{icons.selectedCircle}</Text>\n : <Text color={colors.unselected}>{icons.unselectedCircle}</Text>}\n </Box>\n <Text color={isSelected ? colors.highlighted : colors.muted}>{item.label}</Text>\n </Box>\n );\n })}\n </Box>\n }\n </Box>\n </Box>\n );\n}\n\n// partially based on https://github.com/vadimdemedes/ink-select-input/tree/309497ca641f55d8df0083ec2d07264f101358e4 (see https://github.com/vadimdemedes/ink-select-input/blob/309497ca641f55d8df0083ec2d07264f101358e4/license for license)\n"],
5
+ "mappings": ";AA4HQ,cAgBQ,YAhBR;AA5HR,SAAQ,KAA8B,MAAM,gBAAe;AAC3D,OAAO,OAAO;AACd,SAAe,WAAW,QAAQ,gBAAe;AAEjD,YAAY,YAAY;AACxB,YAAY,WAAW;AACvB,SAAQ,cAAa;AAmCd,gBAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAwC;AACtC,MAAI,CAAC,cAAc,eAAe,IAAI,SAAS,CAAC;AAChD,MAAI,CAAC,eAAe,gBAAgB,IAAI,SAAS,YAAY;AAC7D,MAAI,WAAW,OAAO,qBAAqB,YAAY,MAAM,SAAS;AACtE,MAAI,QAAQ,WAAW,KAAK,IAAI,kBAA4B,MAAM,MAAM,IAAI,MAAM;AAClF,MAAI,gBAAgB,OAA0B,KAAK;AAE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,EAAE,MAAM,GAAG,KAAK,IAAI;AAE3E,YAAI,OAAO,aAAa,YAAY;AAClC,mBAAS,YAAY,aAAa,CAAoB;AAAA,QACxD;AAAA,MACF;AAAA,IACF;AAAA,IACA,EAAC,UAAU,MAAK;AAAA,EAClB;AAEA,MAAI,eACF,WAAW,OAAO,OAAO,YAAY,EAAE,MAAM,GAAG,KAAK,IAAI;AAE3D,SACE,qBAAC,OAAK,GAAG,UACP;AAAA,wBAAC,OAAI,aAAa,GAChB,8BAAC,QAAM,uBAAa,MAAM,UAAU,MAAM,UAAS,GACrD;AAAA,IAEA,qBAAC,OAAI,eAAc,UACjB;AAAA,0BAAC,OAAI,aAAa,GAChB,8BAAC,QAAK,OAAO,OAAO,aAAc,iBAAM,GAC1C;AAAA,MACC,aACC,oBAAC,QAAK,OAAO,OAAO,MACjB,gBAAM,aAAa,GAAG,SAAS,OAAO,MAAM,aAAa,GAAG,KAAK,GACpE,IACA,oBAAC,OAAI,eAAc,UAChB,uBAAa,IAAI,CAAC,MAAM,UAAU;AACjC,YAAI,aAAa,UAAU;AAE3B,eACE,qBAAC,OACC;AAAA,8BAAC,OAAI,aAAa,GACf,uBACC,oBAAC,QAAK,OAAO,OAAO,UAAW,gBAAM,gBAAe,IACpD,oBAAC,QAAK,OAAO,OAAO,YAAa,gBAAM,kBAAiB,GAC5D;AAAA,UACA,oBAAC,QAAK,OAAO,aAAa,OAAO,cAAc,OAAO,OAAQ,eAAK,OAAM;AAAA,aANjE,KAAK,KAOf;AAAA,MAEJ,CAAC,GACH;AAAA,OAEJ;AAAA,KACF;AAEJ;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jakubmazanec/cli",
3
- "version": "0.3.9-unstable.ebf4a7da",
3
+ "version": "0.4.0-next.1ccffc71",
4
4
  "description": "TypeScript-first library for building CLIs.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,9 +17,9 @@
17
17
  "source"
18
18
  ],
19
19
  "scripts": {
20
- "build": "del-cli build tsconfig.tsbuildinfo && esbuild \"source/**/*\" --platform=node --target=node22.12 --outdir=build --sourcemap && tsc",
20
+ "build": "del-cli build tsconfig.tsbuildinfo && esbuild \"source/**/*\" --platform=node --target=node22.13 --outdir=build --sourcemap && tsc",
21
21
  "clean": "del-cli coverage build *.tsbuildinfo",
22
- "develop": "concurrently \"esbuild \"source/**/*\" --platform=node --target=node22.12 --outdir=build --sourcemap --watch\" \"tsc --watch\"",
22
+ "develop": "concurrently \"esbuild \"source/**/*\" --platform=node --target=node22.13 --outdir=build --sourcemap --watch\" \"tsc --watch\"",
23
23
  "document": "del-cli docs && typedoc --options typedoc.config.cjs",
24
24
  "format": "prettier . --write --ignore-unknown",
25
25
  "lint": "eslint .",
@@ -27,10 +27,10 @@
27
27
  "typecheck": "tsc --project tsconfig.typecheck.json"
28
28
  },
29
29
  "dependencies": {
30
- "@jakubmazanec/args": "^2.0.0",
31
- "@jakubmazanec/error": "^3.0.0",
32
- "@jakubmazanec/ts-utils": "^3.0.0",
33
- "@jakubmazanec/zod-utils": "^2.0.0",
30
+ "@jakubmazanec/args": "2.0.9-next.1ccffc71",
31
+ "@jakubmazanec/error": "3.0.9-next.1ccffc71",
32
+ "@jakubmazanec/ts-utils": "3.0.10-next.1ccffc71",
33
+ "@jakubmazanec/zod-utils": "2.0.9-next.1ccffc71",
34
34
  "chalk": "^5.4.1",
35
35
  "fs-extra": "^11.2.0",
36
36
  "latest-version": "^9.0.0",
@@ -39,33 +39,33 @@
39
39
  "zod": "^3.24.1"
40
40
  },
41
41
  "devDependencies": {
42
- "@jakubmazanec/eslint-config": "^4.1.0",
42
+ "@jakubmazanec/eslint-config": "4.1.3-next.1ccffc71",
43
43
  "@types/fs-extra": "^11.0.4",
44
- "@types/lodash": "^4.17.13",
45
- "@types/node": "^22.10.2",
46
- "@types/react": "^18.3.18",
44
+ "@types/lodash": "^4.17.14",
45
+ "@types/node": "^22.10.5",
46
+ "@types/react": "^19.0.3",
47
47
  "@vitest/coverage-v8": "^2.1.8",
48
48
  "concurrently": "^9.1.2",
49
49
  "cross-env": "^7.0.3",
50
50
  "del-cli": "^6.0.0",
51
51
  "esbuild": "^0.24.2",
52
- "eslint": "^9.17.0",
52
+ "eslint": "^9.18.0",
53
53
  "ink": "^5.1.0",
54
54
  "ink-testing-library": "^4.0.0",
55
55
  "prettier": "^3.4.2",
56
56
  "prettier-plugin-packagejson": "^2.5.6",
57
- "react": "^18.3.1",
57
+ "react": "^19.0.0",
58
58
  "typedoc": "^0.27.6",
59
- "typedoc-plugin-markdown": "^4.4.0",
60
- "typescript": "^5.7.2",
59
+ "typedoc-plugin-markdown": "^4.4.1",
60
+ "typescript": "^5.7.3",
61
61
  "vitest": "^2.1.8"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "ink": "5.x",
65
- "react": "18.x"
65
+ "react": "19.x"
66
66
  },
67
67
  "packageManager": "npm@10.9.0",
68
68
  "engines": {
69
- "node": "^22.12.0"
69
+ "node": "^22.13.0"
70
70
  }
71
71
  }
@@ -1,6 +1,6 @@
1
1
  import {Box, type BoxProps, type Key, Text, useInput} from 'ink';
2
2
  import _ from 'lodash';
3
- import {useEffect, useRef, useState} from 'react';
3
+ import React, {useEffect, useRef, useState} from 'react';
4
4
 
5
5
  import * as colors from '../colors.js';
6
6
  import * as icons from '../icons.js';
@@ -49,7 +49,7 @@ export function SelectInput({
49
49
  onHighlight,
50
50
  isComplete,
51
51
  ...boxProps
52
- }: SelectInputProps): JSX.Element {
52
+ }: SelectInputProps): React.JSX.Element {
53
53
  let [rotatedIndex, setRotatedIndex] = useState(0);
54
54
  let [selectedIndex, setSelectedIndex] = useState(initialIndex);
55
55
  let hasLimit = typeof userDefinedLimit === 'number' && items.length > userDefinedLimit;