@gunshi/shared 0.37.1 → 0.37.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.
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/args-tokens@0.28.1/node_modules/args-tokens/lib/parser-DT7Ztcch.d.ts
1
+ //#region ../../node_modules/.pnpm/args-tokens@0.29.0/node_modules/args-tokens/lib/parser-DT7Ztcch.d.ts
2
2
  //#region src/parser.d.ts
3
3
  /**
4
4
  * Entry point of argument parser.
@@ -55,7 +55,7 @@ interface ArgToken {
55
55
  * Parser Options.
56
56
  */
57
57
  //#endregion
58
- //#region ../../node_modules/.pnpm/args-tokens@0.28.1/node_modules/args-tokens/lib/resolver.d.ts
58
+ //#region ../../node_modules/.pnpm/args-tokens@0.29.0/node_modules/args-tokens/lib/resolver.d.ts
59
59
  //#region src/resolver.d.ts
60
60
  /**
61
61
  * An argument schema definition for command-line argument parsing.
@@ -508,13 +508,6 @@ interface ArgSchema {
508
508
  */
509
509
  parse?: (value: string) => any;
510
510
  }
511
- /**
512
- * Machine-readable error codes for {@link ArgsValidationError}.
513
- *
514
- * Each code identifies a validation failure category and is also suitable as an
515
- * i18n resource key for localized rendering.
516
- */
517
-
518
511
  /**
519
512
  * An object that contains {@link ArgSchema | argument schema}.
520
513
  *
@@ -548,7 +541,7 @@ type ResolveOptionValue<A extends ArgSchema, T> = A['multiple'] extends true ? T
548
541
  *
549
542
  * @internal
550
543
  */
551
- type ResolveArgValues<A extends Args, V extends Record<keyof A, unknown>> = { -readonly [Arg in keyof A]?: V[Arg] } & FilterArgs<A, V, 'default'> & FilterArgs<A, V, 'required'> & FilterPositionalArgs<A, V> extends infer P ? { [K in keyof P]: P[K] } : never;
544
+ type ResolveArgValues<A extends Args, V extends Record<keyof A, unknown>> = { -readonly [Arg in keyof A]?: V[Arg] } & FilterArgs<A, V, 'default'> & FilterArgs<A, V, 'required'> & FilterPositionalArgs<A, V> extends (infer P) ? { [K in keyof P]: P[K] } : never;
552
545
  /**
553
546
  * Filters the arguments based on their default values.
554
547
  *
@@ -582,38 +575,6 @@ type IsRequiredPositionalArg<A extends ArgSchema> = A['type'] extends 'positiona
582
575
  * @typeParam A - {@link Args | Arguments}, which is an object that defines the command line arguments.
583
576
  */
584
577
  type ArgExplicitlyProvided<A extends Args> = { [K in keyof A]: boolean };
585
- /**
586
- * Resolve command line arguments.
587
- *
588
- * @typeParam A - {@link Args | Arguments}, which is an object that defines the command line arguments.
589
- *
590
- * @param args - An arguments that contains {@link ArgSchema | arguments schema}.
591
- * @param tokens - An array of {@link ArgToken | tokens}.
592
- * @param resolveArgs - An arguments that contains {@link ResolveArgs | resolve arguments}.
593
- * @returns An object that contains the values of the arguments, positional arguments, rest arguments, {@link AggregateError | validation errors}, and explicit provision status.
594
- *
595
- * @example
596
- * ```typescript
597
- * // passed tokens: --port 3000
598
- *
599
- * const { values, explicit } = resolveArgs({
600
- * port: {
601
- * type: 'number',
602
- * default: 8080
603
- * },
604
- * host: {
605
- * type: 'string',
606
- * default: 'localhost'
607
- * }
608
- * }, parsedTokens)
609
- *
610
- * values.port // 3000
611
- * values.host // 'localhost'
612
- *
613
- * explicit.port // true (explicitly provided)
614
- * explicit.host // false (not provided, fallback to default)
615
- * ```
616
- */
617
578
  //#endregion
618
579
  //#region ../gunshi/src/types.d.ts
619
580
  /**
@@ -1126,7 +1087,7 @@ type CommandExamplesFetcher<G extends GunshiParamsConstraint = DefaultGunshiPara
1126
1087
  */
1127
1088
  type CommandRunner<G extends GunshiParamsConstraint = DefaultGunshiParams> = (ctx: Readonly<CommandContext<G>>) => Awaitable<string | void>;
1128
1089
  //#endregion
1129
- //#region ../../node_modules/.pnpm/args-tokens@0.28.1/node_modules/args-tokens/lib/utils.d.ts
1090
+ //#region ../../node_modules/.pnpm/args-tokens@0.29.0/node_modules/args-tokens/lib/utils.d.ts
1130
1091
  //#region src/utils.d.ts
1131
1092
  /**
1132
1093
  * Entry point of utils.
@@ -1146,12 +1107,6 @@ type CommandRunner<G extends GunshiParamsConstraint = DefaultGunshiParams> = (ct
1146
1107
  * @returns Converted string into kebab-case.
1147
1108
  */
1148
1109
  declare function kebabnize(str: string): string;
1149
- /**
1150
- * Format allowed argument choices for validation error values and fallback messages.
1151
- *
1152
- * @param choices - Choice values to format
1153
- * @returns JSON-quoted choices joined with `, `.
1154
- */
1155
1110
  //#endregion
1156
1111
  //#region ../gunshi/src/utils.d.ts
1157
1112
  /**
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/args-tokens@0.28.1/node_modules/args-tokens/lib/utils.js
1
+ //#region ../../node_modules/.pnpm/args-tokens@0.29.0/node_modules/args-tokens/lib/utils.js
2
2
  /**
3
3
  * Entry point of utils.
4
4
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gunshi/shared",
3
3
  "description": "shared utils for gunshi",
4
- "version": "0.37.1",
4
+ "version": "0.37.3",
5
5
  "author": {
6
6
  "name": "kazuya kawaguchi",
7
7
  "email": "kawakazu80@gmail.com"
@@ -55,8 +55,8 @@
55
55
  "jsr-exports-lint": "^0.4.2",
56
56
  "publint": "^0.3.20",
57
57
  "tsdown": "0.21.0",
58
- "@gunshi/resources": "0.37.1",
59
- "gunshi": "0.37.1"
58
+ "gunshi": "0.37.3",
59
+ "@gunshi/resources": "0.37.3"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "tsdown",