@jakubmazanec/cli 0.2.1-unstable.f940d9d → 0.3.0-next.7305494
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 +1 -1
- package/dist/program/CommandAction.js +3 -1
- package/dist/program/CommandAction.js.map +1 -1
- package/dist/program/CommandArguments.js +3 -1
- package/dist/program/CommandArguments.js.map +1 -1
- package/dist/program/CommandOptions.js +3 -1
- package/dist/program/CommandOptions.js.map +1 -1
- package/dist/program/ProgramCreateOptions.js +3 -1
- package/dist/program/ProgramCreateOptions.js.map +1 -1
- package/dist/program/ProgramOptions.js +3 -1
- package/dist/program/ProgramOptions.js.map +1 -1
- package/dist/ui/form/Form.js +3 -1
- package/dist/ui/form/Form.js.map +1 -1
- package/dist/ui/form/FormConfig.js +3 -1
- package/dist/ui/form/FormConfig.js.map +1 -1
- package/dist/ui/form/FormProps.js +3 -1
- package/dist/ui/form/FormProps.js.map +1 -1
- package/dist/ui/form/FormResult.js +3 -1
- package/dist/ui/form/FormResult.js.map +1 -1
- package/dist/ui/form/FormRowsConfig.js +3 -1
- package/dist/ui/form/FormRowsConfig.js.map +1 -1
- package/dist/ui/form/FormValue.js +3 -1
- package/dist/ui/form/FormValue.js.map +1 -1
- package/dist/ui/form/FormValues.js +3 -1
- package/dist/ui/form/FormValues.js.map +1 -1
- package/dist/ui/form/SelectInput.d.ts +1 -1
- package/package.json +11 -17
package/README.md
CHANGED
|
@@ -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":"
|
|
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 +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,
|
|
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 +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":"
|
|
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 +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":"
|
|
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 +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":"
|
|
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"}
|
package/dist/ui/form/Form.js
CHANGED
package/dist/ui/form/Form.js.map
CHANGED
|
@@ -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":"
|
|
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 +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":"
|
|
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 +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":"
|
|
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 */
|
|
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,
|
|
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 +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":"
|
|
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 +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":"
|
|
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 +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":"
|
|
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.
|
|
3
|
+
"version": "0.3.0-next.7305494",
|
|
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": "
|
|
31
|
-
"@jakubmazanec/error": "
|
|
32
|
-
"@jakubmazanec/ts-utils": "
|
|
33
|
-
"@jakubmazanec/zod-utils": "
|
|
30
|
+
"@jakubmazanec/args": "2.0.0-next.7305494",
|
|
31
|
+
"@jakubmazanec/error": "3.0.0-next.7305494",
|
|
32
|
+
"@jakubmazanec/ts-utils": "3.0.0-next.7305494",
|
|
33
|
+
"@jakubmazanec/zod-utils": "2.0.0-next.7305494",
|
|
34
34
|
"chalk": "^5.2.0",
|
|
35
35
|
"fs-extra": "^10.0.1",
|
|
36
36
|
"latest-version": "^7.0.0",
|
|
@@ -42,24 +42,18 @@
|
|
|
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": "^
|
|
45
|
+
"@types/node": "^20.8.5",
|
|
46
46
|
"@types/react": "^18.0.26",
|
|
47
|
-
"ink": "^
|
|
47
|
+
"ink": "^4.4.1",
|
|
48
48
|
"ink-testing-library": "^3.0.0",
|
|
49
49
|
"react": "^18.2.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"react": "17.x || 18.x"
|
|
52
|
+
"ink": "4.x",
|
|
53
|
+
"react": "18.x"
|
|
55
54
|
},
|
|
56
|
-
"
|
|
57
|
-
"@types/react": {
|
|
58
|
-
"optional": true
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"packageManager": "npm@8.19.4",
|
|
55
|
+
"packageManager": "npm@10.1.0",
|
|
62
56
|
"engines": {
|
|
63
|
-
"node": "
|
|
57
|
+
"node": "^20.8.0"
|
|
64
58
|
}
|
|
65
59
|
}
|