@jakubmazanec/cli 0.2.1-unstable.f940d9d → 0.3.0-next.7a1e391

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
@@ -19,7 +19,7 @@ It cannot be required from a CommonJS module.
19
19
 
20
20
  #### Prerequisites
21
21
 
22
- - Node.js 16 or later
22
+ - Node.js 20 or later
23
23
  - TypeScript 5 or later
24
24
 
25
25
  ## Usage
@@ -1,3 +1,5 @@
1
- export { };
1
+ /**
2
+ * Command action.
3
+ */ export { };
2
4
 
3
5
  //# sourceMappingURL=CommandAction.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/program/CommandAction.ts"],"sourcesContent":["import {type OptionsConfig, type ParametersConfig, type Arguments} from '@jakubmazanec/args';\n\nimport {type Program} from './Program.js';\n\n/**\n * Command action.\n */\nexport type CommandAction<\n A extends string,\n B extends ParametersConfig | undefined = undefined,\n C extends OptionsConfig | undefined = undefined,\n D extends boolean = false,\n E extends boolean = false,\n> = (\n parsedArgs: Arguments<{\n commands: readonly [A];\n parameters: B;\n options: C;\n allowUnknownOptions: D;\n allowUnknownParameters: E;\n }>,\n program: Program,\n) => Promise<void>;\n"],"names":[],"mappings":"AAAA,WAsBmB"}
1
+ {"version":3,"sources":["../../src/program/CommandAction.ts"],"sourcesContent":["import {type OptionsConfig, type ParametersConfig, type Arguments} from '@jakubmazanec/args';\n\nimport {type Program} from './Program.js';\n\n/**\n * Command action.\n */\nexport type CommandAction<\n A extends string,\n B extends ParametersConfig | undefined = undefined,\n C extends OptionsConfig | undefined = undefined,\n D extends boolean = false,\n E extends boolean = false,\n> = (\n parsedArgs: Arguments<{\n commands: readonly [A];\n parameters: B;\n options: C;\n allowUnknownOptions: D;\n allowUnknownParameters: E;\n }>,\n program: Program,\n) => Promise<void>;\n"],"names":[],"mappings":"AAIA;;CAEC,GACD,WAemB"}
@@ -1,3 +1,5 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any -- needed */ export { };
1
+ /* eslint-disable @typescript-eslint/no-explicit-any -- needed */ /**
2
+ * Parsed command arguments type.
3
+ */ export { };
2
4
 
3
5
  //# sourceMappingURL=CommandArguments.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/program/CommandArguments.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any -- needed */\nimport {type Command} from './Command.js';\n\n/**\n * Parsed command arguments type.\n */\nexport type CommandArguments<C extends Command<any, any, any, any, any>> = ReturnType<\n C['parseArguments']\n>;\n"],"names":[],"mappings":"AAAA,+DAA+D,GAC/D,WAOE"}
1
+ {"version":3,"sources":["../../src/program/CommandArguments.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any -- needed */\nimport {type Command} from './Command.js';\n\n/**\n * Parsed command arguments type.\n */\nexport type CommandArguments<C extends Command<any, any, any, any, any>> = ReturnType<\n C['parseArguments']\n>;\n"],"names":[],"mappings":"AAAA,+DAA+D,GAG/D;;CAEC,GACD,WAEE"}
@@ -1,3 +1,5 @@
1
- export { };
1
+ /**
2
+ * {@link Command.constructor | Command constructor} options parameter.
3
+ */ export { };
2
4
 
3
5
  //# sourceMappingURL=CommandOptions.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/program/CommandOptions.ts"],"sourcesContent":["import {type OptionsConfig, type ParametersConfig} from '@jakubmazanec/args';\n\n/**\n * {@link Command.constructor | Command constructor} options parameter.\n */\nexport type CommandOptions<\n B extends ParametersConfig,\n C extends OptionsConfig,\n D extends boolean,\n E extends boolean,\n> = {\n description?: string;\n parameters?: B | undefined;\n options?: C | undefined;\n allowUnknownOptions?: D | undefined;\n allowUnknownParameters?: E | undefined;\n};\n"],"names":[],"mappings":"AAAA,WAgBE"}
1
+ {"version":3,"sources":["../../src/program/CommandOptions.ts"],"sourcesContent":["import {type OptionsConfig, type ParametersConfig} from '@jakubmazanec/args';\n\n/**\n * {@link Command.constructor | Command constructor} options parameter.\n */\nexport type CommandOptions<\n B extends ParametersConfig,\n C extends OptionsConfig,\n D extends boolean,\n E extends boolean,\n> = {\n description?: string;\n parameters?: B | undefined;\n options?: C | undefined;\n allowUnknownOptions?: D | undefined;\n allowUnknownParameters?: E | undefined;\n};\n"],"names":[],"mappings":"AAEA;;CAEC,GACD,WAWE"}
@@ -1,3 +1,5 @@
1
- export { };
1
+ /**
2
+ * {@link Program.create} options parameter.
3
+ */ export { };
2
4
 
3
5
  //# sourceMappingURL=ProgramCreateOptions.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/program/ProgramCreateOptions.ts"],"sourcesContent":["import {type ComponentType} from 'react';\nimport {type FallbackProps} from 'react-error-boundary';\n\n/**\n * {@link Program.create} options parameter.\n */\nexport type ProgramCreateOptions = {\n /** Program name. */\n name?: string | undefined;\n\n /** More readable program name. */\n displayName?: string | undefined;\n\n /** Program version. */\n version?: string | undefined;\n\n /** Program description. */\n description?: string | undefined;\n\n /** Program executable name. */\n bin?: string | undefined;\n\n /** Custom error boundary fallback component */\n ErrorBoundaryFallbackComponent?: ComponentType<FallbackProps>;\n\n /** Perform check whether a newer version of the program is available. */\n checkForUpdate?: boolean;\n};\n"],"names":[],"mappings":"AAAA,WA2BE"}
1
+ {"version":3,"sources":["../../src/program/ProgramCreateOptions.ts"],"sourcesContent":["import {type ComponentType} from 'react';\nimport {type FallbackProps} from 'react-error-boundary';\n\n/**\n * {@link Program.create} options parameter.\n */\nexport type ProgramCreateOptions = {\n /** Program name. */\n name?: string | undefined;\n\n /** More readable program name. */\n displayName?: string | undefined;\n\n /** Program version. */\n version?: string | undefined;\n\n /** Program description. */\n description?: string | undefined;\n\n /** Program executable name. */\n bin?: string | undefined;\n\n /** Custom error boundary fallback component */\n ErrorBoundaryFallbackComponent?: ComponentType<FallbackProps>;\n\n /** Perform check whether a newer version of the program is available. */\n checkForUpdate?: boolean;\n};\n"],"names":[],"mappings":"AAGA;;CAEC,GACD,WAqBE"}
@@ -1,3 +1,5 @@
1
- export { };
1
+ /**
2
+ * {@link Program.constructor | Program constructor} options parameter.
3
+ */ export { };
2
4
 
3
5
  //# sourceMappingURL=ProgramOptions.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/program/ProgramOptions.ts"],"sourcesContent":["import {type ComponentType} from 'react';\nimport {type FallbackProps} from 'react-error-boundary';\n\n/**\n * {@link Program.constructor | Program constructor} options parameter.\n */\nexport type ProgramOptions = {\n /** Program name. */\n name?: string | undefined;\n\n /** More readable program name. */\n displayName?: string | undefined;\n\n /** Program version. */\n version?: string | undefined;\n\n /** Program latest version. */\n latestVersion?: string | undefined;\n\n /** Program description. */\n description?: string | undefined;\n\n /** Program executable name. */\n bin?: string | undefined;\n\n /** Custom error boundary fallback component */\n ErrorBoundaryFallbackComponent?: ComponentType<FallbackProps> | undefined;\n\n /** Perform check whether a newer version of the program is available. */\n checkForUpdate?: boolean;\n};\n"],"names":[],"mappings":"AAAA,WA8BE"}
1
+ {"version":3,"sources":["../../src/program/ProgramOptions.ts"],"sourcesContent":["import {type ComponentType} from 'react';\nimport {type FallbackProps} from 'react-error-boundary';\n\n/**\n * {@link Program.constructor | Program constructor} options parameter.\n */\nexport type ProgramOptions = {\n /** Program name. */\n name?: string | undefined;\n\n /** More readable program name. */\n displayName?: string | undefined;\n\n /** Program version. */\n version?: string | undefined;\n\n /** Program latest version. */\n latestVersion?: string | undefined;\n\n /** Program description. */\n description?: string | undefined;\n\n /** Program executable name. */\n bin?: string | undefined;\n\n /** Custom error boundary fallback component */\n ErrorBoundaryFallbackComponent?: ComponentType<FallbackProps> | undefined;\n\n /** Perform check whether a newer version of the program is available. */\n checkForUpdate?: boolean;\n};\n"],"names":[],"mappings":"AAGA;;CAEC,GACD,WAwBE"}
@@ -1,3 +1,5 @@
1
- export { };
1
+ /**
2
+ * Form component.
3
+ */ export { };
2
4
 
3
5
  //# sourceMappingURL=Form.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/ui/form/Form.ts"],"sourcesContent":["import {type FC} from 'react';\n\nimport {type FormConfig} from './FormConfig.js';\nimport {type FormProps} from './FormProps.js';\n\n/**\n * Form component.\n */\nexport type Form<C extends FormConfig> = FC<FormProps<C>> & {config: C};\n"],"names":[],"mappings":"AAAA,WAQwE"}
1
+ {"version":3,"sources":["../../../src/ui/form/Form.ts"],"sourcesContent":["import {type FC} from 'react';\n\nimport {type FormConfig} from './FormConfig.js';\nimport {type FormProps} from './FormProps.js';\n\n/**\n * Form component.\n */\nexport type Form<C extends FormConfig> = FC<FormProps<C>> & {config: C};\n"],"names":[],"mappings":"AAKA;;CAEC,GACD,WAAwE"}
@@ -1,3 +1,5 @@
1
- export { };
1
+ /**
2
+ * Form configuration.
3
+ */ export { };
2
4
 
3
5
  //# sourceMappingURL=FormConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/ui/form/FormConfig.ts"],"sourcesContent":["import {type FormRowsConfig} from './FormRowsConfig.js';\n\n/**\n * Form configuration.\n */\nexport type FormConfig = {\n /** Form rows configuration. */\n rows: FormRowsConfig;\n};\n"],"names":[],"mappings":"AAAA,WAQE"}
1
+ {"version":3,"sources":["../../../src/ui/form/FormConfig.ts"],"sourcesContent":["import {type FormRowsConfig} from './FormRowsConfig.js';\n\n/**\n * Form configuration.\n */\nexport type FormConfig = {\n /** Form rows configuration. */\n rows: FormRowsConfig;\n};\n"],"names":[],"mappings":"AAEA;;CAEC,GACD,WAGE"}
@@ -1,3 +1,5 @@
1
- export { };
1
+ /**
2
+ * Form component props.
3
+ */ export { };
2
4
 
3
5
  //# sourceMappingURL=FormProps.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/ui/form/FormProps.ts"],"sourcesContent":["import {type BoxProps} from 'ink';\n\nimport {type FormConfig} from './FormConfig.js';\nimport {type FormRowConfig} from './FormRowConfig.js';\nimport {type FormValues} from './FormValues.js';\n\n/** A type that creates string literal union type with names of rows that need some props. */\ntype FormRowWithPropsNames<C extends FormConfig> = {\n [P in keyof C['rows']]: C['rows'][P]['type'] extends 'text'\n ? never\n : C['rows'][P]['type'] extends 'confirm'\n ? never\n : C['rows'][P]['type'] extends 'select'\n ? P\n : never;\n}[keyof C['rows']];\n\ntype FormPropsRow<C extends FormRowConfig> = C['type'] extends 'text'\n ? never\n : C['type'] extends 'confirm'\n ? never\n : C['type'] extends 'select'\n ? {\n choices: Array<{value: string; label: string}>;\n }\n : never;\n\ntype FormPropsRows<C extends FormConfig> = Pick<\n {\n [P in keyof C['rows']]: FormPropsRow<C['rows'][P]>;\n },\n FormRowWithPropsNames<C>\n>;\n\n/**\n * Form component props.\n */\nexport type FormProps<C extends FormConfig> = FormPropsRows<C> extends Record<\n number | string | symbol,\n never\n>\n ? BoxProps & {\n /** Props for each row. */\n rows?: null | undefined;\n\n /** Form values */\n values: FormValues<C>;\n\n /** Handler function that is called when value changes. */\n onChange?: ((formResult: FormValues<C>) => void) | undefined;\n\n /** Handler function that is called when the value is accepted. */\n onComplete: (formResult: FormValues<C>) => void;\n }\n : BoxProps & {\n /** Props for each row. */\n rows: FormPropsRows<C>;\n\n /** Form values */\n values: FormValues<C>;\n\n /** Handler function that is called when value changes. */\n onChange?: ((formResult: FormValues<C>) => void) | undefined;\n\n /** Handler function that is called when the value is accepted. */\n onComplete: (formResult: FormValues<C>) => void;\n };\n"],"names":[],"mappings":"AAAA,WAkEM"}
1
+ {"version":3,"sources":["../../../src/ui/form/FormProps.ts"],"sourcesContent":["import {type BoxProps} from 'ink';\n\nimport {type FormConfig} from './FormConfig.js';\nimport {type FormRowConfig} from './FormRowConfig.js';\nimport {type FormValues} from './FormValues.js';\n\n/** A type that creates string literal union type with names of rows that need some props. */\ntype FormRowWithPropsNames<C extends FormConfig> = {\n [P in keyof C['rows']]: C['rows'][P]['type'] extends 'text'\n ? never\n : C['rows'][P]['type'] extends 'confirm'\n ? never\n : C['rows'][P]['type'] extends 'select'\n ? P\n : never;\n}[keyof C['rows']];\n\ntype FormPropsRow<C extends FormRowConfig> = C['type'] extends 'text'\n ? never\n : C['type'] extends 'confirm'\n ? never\n : C['type'] extends 'select'\n ? {\n choices: Array<{value: string; label: string}>;\n }\n : never;\n\ntype FormPropsRows<C extends FormConfig> = Pick<\n {\n [P in keyof C['rows']]: FormPropsRow<C['rows'][P]>;\n },\n FormRowWithPropsNames<C>\n>;\n\n/**\n * Form component props.\n */\nexport type FormProps<C extends FormConfig> = FormPropsRows<C> extends Record<\n number | string | symbol,\n never\n>\n ? BoxProps & {\n /** Props for each row. */\n rows?: null | undefined;\n\n /** Form values */\n values: FormValues<C>;\n\n /** Handler function that is called when value changes. */\n onChange?: ((formResult: FormValues<C>) => void) | undefined;\n\n /** Handler function that is called when the value is accepted. */\n onComplete: (formResult: FormValues<C>) => void;\n }\n : BoxProps & {\n /** Props for each row. */\n rows: FormPropsRows<C>;\n\n /** Form values */\n values: FormValues<C>;\n\n /** Handler function that is called when value changes. */\n onChange?: ((formResult: FormValues<C>) => void) | undefined;\n\n /** Handler function that is called when the value is accepted. */\n onComplete: (formResult: FormValues<C>) => void;\n };\n"],"names":[],"mappings":"AAkCA;;CAEC,GACD,WA6BM"}
@@ -1,3 +1,5 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any -- needed */ export { };
1
+ /* eslint-disable @typescript-eslint/no-explicit-any -- needed */ /**
2
+ * Form result. It is the value of all form rows after the last one is accepted.
3
+ */ export { };
2
4
 
3
5
  //# sourceMappingURL=FormResult.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/ui/form/FormResult.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any -- needed */\nimport {type Form} from './Form.js';\nimport {type FormValues} from './FormValues.js';\n\n/**\n * Form result. It is the value of all form rows after the last one is accepted.\n */\nexport type FormResult<F extends Pick<Form<any>, 'config'>> = FormValues<F['config']>;\n"],"names":[],"mappings":"AAAA,+DAA+D,GAC/D,WAMsF"}
1
+ {"version":3,"sources":["../../../src/ui/form/FormResult.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any -- needed */\nimport {type Form} from './Form.js';\nimport {type FormValues} from './FormValues.js';\n\n/**\n * Form result. It is the value of all form rows after the last one is accepted.\n */\nexport type FormResult<F extends Pick<Form<any>, 'config'>> = FormValues<F['config']>;\n"],"names":[],"mappings":"AAAA,+DAA+D,GAI/D;;CAEC,GACD,WAAsF"}
@@ -1,3 +1,5 @@
1
- export { };
1
+ /**
2
+ * Form rows configuration.
3
+ */ export { };
2
4
 
3
5
  //# sourceMappingURL=FormRowsConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/ui/form/FormRowsConfig.ts"],"sourcesContent":["import {type FormRowConfig} from './FormRowConfig.js';\n\n/**\n * Form rows configuration.\n */\nexport type FormRowsConfig = Record<string, FormRowConfig>;\n"],"names":[],"mappings":"AAAA,WAK2D"}
1
+ {"version":3,"sources":["../../../src/ui/form/FormRowsConfig.ts"],"sourcesContent":["import {type FormRowConfig} from './FormRowConfig.js';\n\n/**\n * Form rows configuration.\n */\nexport type FormRowsConfig = Record<string, FormRowConfig>;\n"],"names":[],"mappings":"AAEA;;CAEC,GACD,WAA2D"}
@@ -1,3 +1,5 @@
1
- export { };
1
+ /**
2
+ * Form value.
3
+ */ export { };
2
4
 
3
5
  //# sourceMappingURL=FormValue.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/ui/form/FormValue.ts"],"sourcesContent":["import {type FormRowConfig} from './FormRowConfig.js';\n\nexport type StringFormValue = {value: string; isComplete: boolean};\n\n/**\n * Form value.\n */\nexport type FormValue<C extends FormRowConfig> = C['type'] extends 'text'\n ? StringFormValue\n : C['type'] extends 'select'\n ? StringFormValue\n : never;\n"],"names":[],"mappings":"AAAA,WAWU"}
1
+ {"version":3,"sources":["../../../src/ui/form/FormValue.ts"],"sourcesContent":["import {type FormRowConfig} from './FormRowConfig.js';\n\nexport type StringFormValue = {value: string; isComplete: boolean};\n\n/**\n * Form value.\n */\nexport type FormValue<C extends FormRowConfig> = C['type'] extends 'text'\n ? StringFormValue\n : C['type'] extends 'select'\n ? StringFormValue\n : never;\n"],"names":[],"mappings":"AAIA;;CAEC,GACD,WAIU"}
@@ -1,3 +1,5 @@
1
- export { };
1
+ /**
2
+ * Form values.
3
+ */ export { };
2
4
 
3
5
  //# sourceMappingURL=FormValues.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/ui/form/FormValues.ts"],"sourcesContent":["import {type FormConfig} from './FormConfig.js';\nimport {type FormValue} from './FormValue.js';\n\n/**\n * Form values.\n */\nexport type FormValues<C extends FormConfig> = {\n [P in keyof C['rows']]: FormValue<C['rows'][P]>;\n};\n"],"names":[],"mappings":"AAAA,WAQE"}
1
+ {"version":3,"sources":["../../../src/ui/form/FormValues.ts"],"sourcesContent":["import {type FormConfig} from './FormConfig.js';\nimport {type FormValue} from './FormValue.js';\n\n/**\n * Form values.\n */\nexport type FormValues<C extends FormConfig> = {\n [P in keyof C['rows']]: FormValue<C['rows'][P]>;\n};\n"],"names":[],"mappings":"AAGA;;CAEC,GACD,WAEE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jakubmazanec/cli",
3
- "version": "0.2.1-unstable.f940d9d",
3
+ "version": "0.3.0-next.7a1e391",
4
4
  "description": "TypeScript-first library for building CLIs.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,10 +27,10 @@
27
27
  "typecheck": "tsc --project tsconfig.typecheck.json"
28
28
  },
29
29
  "dependencies": {
30
- "@jakubmazanec/args": "1.0.3-unstable.f940d9d",
31
- "@jakubmazanec/error": "^2.0.0",
32
- "@jakubmazanec/ts-utils": "^2.1.0",
33
- "@jakubmazanec/zod-utils": "1.0.3-unstable.f940d9d",
30
+ "@jakubmazanec/args": "2.0.0-next.7a1e391",
31
+ "@jakubmazanec/error": "3.0.0-next.7a1e391",
32
+ "@jakubmazanec/ts-utils": "3.0.0-next.7a1e391",
33
+ "@jakubmazanec/zod-utils": "2.0.0-next.7a1e391",
34
34
  "chalk": "^5.2.0",
35
35
  "fs-extra": "^10.0.1",
36
36
  "latest-version": "^7.0.0",
@@ -42,7 +42,7 @@
42
42
  "@jest/globals": "^29.5.0",
43
43
  "@types/fs-extra": "^9.0.13",
44
44
  "@types/lodash": "^4.14.195",
45
- "@types/node": "^16.18.55",
45
+ "@types/node": "^20.8.5",
46
46
  "@types/react": "^18.0.26",
47
47
  "ink": "^3.2.0",
48
48
  "ink-testing-library": "^3.0.0",
@@ -58,8 +58,8 @@
58
58
  "optional": true
59
59
  }
60
60
  },
61
- "packageManager": "npm@8.19.4",
61
+ "packageManager": "npm@10.1.0",
62
62
  "engines": {
63
- "node": ">=16.20.0"
63
+ "node": "^20.8.0"
64
64
  }
65
65
  }