@gunshi/combinators 1.0.0-rc.5 → 1.0.0-rc.7
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 +117 -59
- package/lib/index.js +20 -15
- package/package.json +30 -31
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/args-tokens@1.0.2/node_modules/args-tokens/lib/resolver.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* An argument schema definition for command-line argument parsing.
|
|
4
3
|
*
|
|
5
4
|
* This schema is similar to the schema of Node.js `util.parseArgs` but with extended features:
|
|
6
|
-
* - Additional `required`, `description`, and `
|
|
5
|
+
* - Additional `required`, `description`, `hidden`, and `deprecated` properties
|
|
7
6
|
* - Extended `type` support: 'string', 'boolean', 'number', 'enum', 'positional', 'custom'
|
|
8
7
|
* - Simplified `default` property (single type, not union types)
|
|
9
8
|
*
|
|
@@ -133,6 +132,32 @@ interface ArgSchema {
|
|
|
133
132
|
* ```
|
|
134
133
|
*/
|
|
135
134
|
hidden?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Mark the argument as deprecated: `true`, or a text that tells what to use instead, such as
|
|
137
|
+
* `'Use --output.'`.
|
|
138
|
+
*
|
|
139
|
+
* Like {@link ArgSchema.hidden}, this is metadata for the tools that read the schema, such as a CLI
|
|
140
|
+
* framework that warns when a deprecated argument is given and leaves it out of the help. It does
|
|
141
|
+
* not affect parsing, validation, required checks, defaults, conflicts, or resolved values: a
|
|
142
|
+
* deprecated argument still works. `false`, like leaving it out, means that the argument is not
|
|
143
|
+
* deprecated.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* The old name of an option, kept while the scripts that use it move to the new one:
|
|
147
|
+
* ```ts
|
|
148
|
+
* {
|
|
149
|
+
* output: {
|
|
150
|
+
* type: 'string',
|
|
151
|
+
* description: 'Output format'
|
|
152
|
+
* },
|
|
153
|
+
* format: {
|
|
154
|
+
* type: 'string',
|
|
155
|
+
* deprecated: 'Use --output.'
|
|
156
|
+
* }
|
|
157
|
+
* }
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
deprecated?: boolean | string;
|
|
136
161
|
/**
|
|
137
162
|
* Marks the argument as required.
|
|
138
163
|
*
|
|
@@ -556,8 +581,6 @@ interface ArgSchema {
|
|
|
556
581
|
interface Args {
|
|
557
582
|
[option: string]: ArgSchema;
|
|
558
583
|
}
|
|
559
|
-
//#endregion
|
|
560
|
-
//#region ../../node_modules/.pnpm/args-tokens@1.0.2/node_modules/args-tokens/lib/combinators.d.ts
|
|
561
584
|
/**
|
|
562
585
|
* A combinator produced by combinator factory functions.
|
|
563
586
|
*
|
|
@@ -583,9 +606,10 @@ type Combinator<T> = {
|
|
|
583
606
|
type CombinatorSchema<T> = Omit<ArgSchema, 'parse'> & Combinator<T>;
|
|
584
607
|
/**
|
|
585
608
|
* How {@link short}, {@link describe}, {@link withDefault}, {@link required}, {@link multiple},
|
|
586
|
-
* {@link hidden}, {@link unrequired} and {@link positional} read a schema
|
|
587
|
-
* is typed `unknown`, and the `parse` of {@link ArgSchema}, which returns
|
|
588
|
-
* the result still fits any {@link CombinatorSchema}, as the schema typed
|
|
609
|
+
* {@link hidden}, {@link deprecated}, {@link unrequired} and {@link positional} read a schema
|
|
610
|
+
* typed as `any`: its value is typed `unknown`, and the `parse` of {@link ArgSchema}, which returns
|
|
611
|
+
* `any`, is kept, so that the result still fits any {@link CombinatorSchema}, as the schema typed
|
|
612
|
+
* as `any` does.
|
|
589
613
|
*
|
|
590
614
|
* For a schema typed by a type parameter, whether it is `any` is not known, so the result is built
|
|
591
615
|
* from the properties of the type parameter, which TypeScript reads through its constraint.
|
|
@@ -685,7 +709,7 @@ interface StringOptions extends BaseOptions {
|
|
|
685
709
|
* }
|
|
686
710
|
* ```
|
|
687
711
|
*/
|
|
688
|
-
declare function string<const R extends boolean>(opts: StringOptions & {
|
|
712
|
+
export declare function string<const R extends boolean>(opts: StringOptions & {
|
|
689
713
|
required: R;
|
|
690
714
|
}): WithRequiredOption<CombinatorSchema<string>, R>;
|
|
691
715
|
/**
|
|
@@ -705,7 +729,7 @@ declare function string<const R extends boolean>(opts: StringOptions & {
|
|
|
705
729
|
* }
|
|
706
730
|
* ```
|
|
707
731
|
*/
|
|
708
|
-
declare function string<const R extends boolean | undefined = boolean | undefined>(opts?: StringOptions & {
|
|
732
|
+
export declare function string<const R extends boolean | undefined = boolean | undefined>(opts?: StringOptions & {
|
|
709
733
|
required?: R;
|
|
710
734
|
}): WithUnrequiredOption<CombinatorSchema<string>, R>;
|
|
711
735
|
/**
|
|
@@ -721,7 +745,7 @@ declare function string<const R extends boolean | undefined = boolean | undefine
|
|
|
721
745
|
* }
|
|
722
746
|
* ```
|
|
723
747
|
*/
|
|
724
|
-
declare function string(opts?: StringOptions): CombinatorSchema<string>;
|
|
748
|
+
export declare function string(opts?: StringOptions): CombinatorSchema<string>;
|
|
725
749
|
/**
|
|
726
750
|
* Options for the {@link number} combinator.
|
|
727
751
|
*/
|
|
@@ -752,7 +776,7 @@ interface NumberOptions extends BaseOptions {
|
|
|
752
776
|
* }
|
|
753
777
|
* ```
|
|
754
778
|
*/
|
|
755
|
-
declare function number<const R extends boolean>(opts: NumberOptions & {
|
|
779
|
+
export declare function number<const R extends boolean>(opts: NumberOptions & {
|
|
756
780
|
required: R;
|
|
757
781
|
}): WithRequiredOption<CombinatorSchema<number>, R>;
|
|
758
782
|
/**
|
|
@@ -774,7 +798,7 @@ declare function number<const R extends boolean>(opts: NumberOptions & {
|
|
|
774
798
|
* }
|
|
775
799
|
* ```
|
|
776
800
|
*/
|
|
777
|
-
declare function number<const R extends boolean | undefined = boolean | undefined>(opts?: NumberOptions & {
|
|
801
|
+
export declare function number<const R extends boolean | undefined = boolean | undefined>(opts?: NumberOptions & {
|
|
778
802
|
required?: R;
|
|
779
803
|
}): WithUnrequiredOption<CombinatorSchema<number>, R>;
|
|
780
804
|
/**
|
|
@@ -792,7 +816,7 @@ declare function number<const R extends boolean | undefined = boolean | undefine
|
|
|
792
816
|
* }
|
|
793
817
|
* ```
|
|
794
818
|
*/
|
|
795
|
-
declare function number(opts?: NumberOptions): CombinatorSchema<number>;
|
|
819
|
+
export declare function number(opts?: NumberOptions): CombinatorSchema<number>;
|
|
796
820
|
/**
|
|
797
821
|
* Options for the {@link integer} combinator.
|
|
798
822
|
*/
|
|
@@ -823,7 +847,7 @@ interface IntegerOptions extends BaseOptions {
|
|
|
823
847
|
* }
|
|
824
848
|
* ```
|
|
825
849
|
*/
|
|
826
|
-
declare function integer<const R extends boolean>(opts: IntegerOptions & {
|
|
850
|
+
export declare function integer<const R extends boolean>(opts: IntegerOptions & {
|
|
827
851
|
required: R;
|
|
828
852
|
}): WithRequiredOption<CombinatorSchema<number>, R>;
|
|
829
853
|
/**
|
|
@@ -845,7 +869,7 @@ declare function integer<const R extends boolean>(opts: IntegerOptions & {
|
|
|
845
869
|
* }
|
|
846
870
|
* ```
|
|
847
871
|
*/
|
|
848
|
-
declare function integer<const R extends boolean | undefined = boolean | undefined>(opts?: IntegerOptions & {
|
|
872
|
+
export declare function integer<const R extends boolean | undefined = boolean | undefined>(opts?: IntegerOptions & {
|
|
849
873
|
required?: R;
|
|
850
874
|
}): WithUnrequiredOption<CombinatorSchema<number>, R>;
|
|
851
875
|
/**
|
|
@@ -863,7 +887,7 @@ declare function integer<const R extends boolean | undefined = boolean | undefin
|
|
|
863
887
|
* }
|
|
864
888
|
* ```
|
|
865
889
|
*/
|
|
866
|
-
declare function integer(opts?: IntegerOptions): CombinatorSchema<number>;
|
|
890
|
+
export declare function integer(opts?: IntegerOptions): CombinatorSchema<number>;
|
|
867
891
|
/**
|
|
868
892
|
* Options for the {@link float} combinator.
|
|
869
893
|
*/
|
|
@@ -894,7 +918,7 @@ interface FloatOptions extends BaseOptions {
|
|
|
894
918
|
* }
|
|
895
919
|
* ```
|
|
896
920
|
*/
|
|
897
|
-
declare function float<const R extends boolean>(opts: FloatOptions & {
|
|
921
|
+
export declare function float<const R extends boolean>(opts: FloatOptions & {
|
|
898
922
|
required: R;
|
|
899
923
|
}): WithRequiredOption<CombinatorSchema<number>, R>;
|
|
900
924
|
/**
|
|
@@ -916,7 +940,7 @@ declare function float<const R extends boolean>(opts: FloatOptions & {
|
|
|
916
940
|
* }
|
|
917
941
|
* ```
|
|
918
942
|
*/
|
|
919
|
-
declare function float<const R extends boolean | undefined = boolean | undefined>(opts?: FloatOptions & {
|
|
943
|
+
export declare function float<const R extends boolean | undefined = boolean | undefined>(opts?: FloatOptions & {
|
|
920
944
|
required?: R;
|
|
921
945
|
}): WithUnrequiredOption<CombinatorSchema<number>, R>;
|
|
922
946
|
/**
|
|
@@ -934,7 +958,7 @@ declare function float<const R extends boolean | undefined = boolean | undefined
|
|
|
934
958
|
* }
|
|
935
959
|
* ```
|
|
936
960
|
*/
|
|
937
|
-
declare function float(opts?: FloatOptions): CombinatorSchema<number>;
|
|
961
|
+
export declare function float(opts?: FloatOptions): CombinatorSchema<number>;
|
|
938
962
|
/**
|
|
939
963
|
* Options for the {@link boolean} combinator.
|
|
940
964
|
*/
|
|
@@ -964,7 +988,7 @@ interface BooleanOptions extends BaseOptions {
|
|
|
964
988
|
* // Usage: --color (true), --no-color (false)
|
|
965
989
|
* ```
|
|
966
990
|
*/
|
|
967
|
-
declare function boolean<const R extends boolean>(opts: BooleanOptions & {
|
|
991
|
+
export declare function boolean<const R extends boolean>(opts: BooleanOptions & {
|
|
968
992
|
required: R;
|
|
969
993
|
}): WithRequiredOption<CombinatorSchema<boolean>, R>;
|
|
970
994
|
/**
|
|
@@ -989,7 +1013,7 @@ declare function boolean<const R extends boolean>(opts: BooleanOptions & {
|
|
|
989
1013
|
* // Usage: --color (true), --no-color (false)
|
|
990
1014
|
* ```
|
|
991
1015
|
*/
|
|
992
|
-
declare function boolean<const R extends boolean | undefined = boolean | undefined>(opts?: BooleanOptions & {
|
|
1016
|
+
export declare function boolean<const R extends boolean | undefined = boolean | undefined>(opts?: BooleanOptions & {
|
|
993
1017
|
required?: R;
|
|
994
1018
|
}): WithUnrequiredOption<CombinatorSchema<boolean>, R>;
|
|
995
1019
|
/**
|
|
@@ -1010,7 +1034,7 @@ declare function boolean<const R extends boolean | undefined = boolean | undefin
|
|
|
1010
1034
|
* // Usage: --color (true), --no-color (false)
|
|
1011
1035
|
* ```
|
|
1012
1036
|
*/
|
|
1013
|
-
declare function boolean(opts?: BooleanOptions): CombinatorSchema<boolean>;
|
|
1037
|
+
export declare function boolean(opts?: BooleanOptions): CombinatorSchema<boolean>;
|
|
1014
1038
|
/**
|
|
1015
1039
|
* Positional argument schema type.
|
|
1016
1040
|
*/
|
|
@@ -1020,7 +1044,7 @@ type ArgSchemaPositionalType = {
|
|
|
1020
1044
|
/**
|
|
1021
1045
|
* The properties of a parser that {@link positional} keeps.
|
|
1022
1046
|
*/
|
|
1023
|
-
type PositionalParserKey = 'parse' | 'metavar' | 'description' | 'hidden' | 'required' | 'default' | 'multiple';
|
|
1047
|
+
type PositionalParserKey = 'parse' | 'metavar' | 'description' | 'hidden' | 'deprecated' | 'required' | 'default' | 'multiple';
|
|
1024
1048
|
/**
|
|
1025
1049
|
* The positional argument schema that {@link positional} builds from a parser: the properties it
|
|
1026
1050
|
* keeps, with their types, as `type: 'positional'`. A parser of type `any` is read as
|
|
@@ -1054,9 +1078,9 @@ type PositionalOf<S> = S extends unknown ? PositionalWithParser<S> : never;
|
|
|
1054
1078
|
*
|
|
1055
1079
|
* @typeParam T - The parser's resolved type.
|
|
1056
1080
|
* @typeParam S - The type of the parser, inferred from `parser`, whose `required`, `default`,
|
|
1057
|
-
* `multiple`, `description`, `hidden` and `metavar` the positional argument keeps.
|
|
1058
|
-
* arguments are given explicitly without `S`, `S` is `CombinatorSchema<T>`, and the type
|
|
1059
|
-
* result lacks them, although the returned object has them.
|
|
1081
|
+
* `multiple`, `description`, `hidden`, `deprecated` and `metavar` the positional argument keeps.
|
|
1082
|
+
* If type arguments are given explicitly without `S`, `S` is `CombinatorSchema<T>`, and the type
|
|
1083
|
+
* of the result lacks them, although the returned object has them.
|
|
1060
1084
|
*
|
|
1061
1085
|
* @param parser - The parser combinator schema.
|
|
1062
1086
|
* @returns A positional argument schema resolving to the parser's type.
|
|
@@ -1070,7 +1094,7 @@ type PositionalOf<S> = S extends unknown ? PositionalWithParser<S> : never;
|
|
|
1070
1094
|
* }
|
|
1071
1095
|
* ```
|
|
1072
1096
|
*/
|
|
1073
|
-
declare function positional<T, S extends CombinatorSchema<T> = CombinatorSchema<T>>(parser: S & CombinatorSchema<T>): PositionalOf<S>;
|
|
1097
|
+
export declare function positional<T, S extends CombinatorSchema<T> = CombinatorSchema<T>>(parser: S & CombinatorSchema<T>): PositionalOf<S>;
|
|
1074
1098
|
/**
|
|
1075
1099
|
* Create a positional argument schema from a union of combinator schemas of different types, such
|
|
1076
1100
|
* as `strict ? integer() : string()`.
|
|
@@ -1098,7 +1122,7 @@ declare function positional<T, S extends CombinatorSchema<T> = CombinatorSchema<
|
|
|
1098
1122
|
* }
|
|
1099
1123
|
* ```
|
|
1100
1124
|
*/
|
|
1101
|
-
declare function positional<S extends CombinatorSchema<unknown>>(parser: S): PositionalOf<S>;
|
|
1125
|
+
export declare function positional<S extends CombinatorSchema<unknown>>(parser: S): PositionalOf<S>;
|
|
1102
1126
|
/**
|
|
1103
1127
|
* Create a positional argument schema.
|
|
1104
1128
|
*
|
|
@@ -1127,7 +1151,7 @@ declare function positional<S extends CombinatorSchema<unknown>>(parser: S): Pos
|
|
|
1127
1151
|
* }
|
|
1128
1152
|
* ```
|
|
1129
1153
|
*/
|
|
1130
|
-
declare function positional<const R extends boolean>(parser: BaseOptions & {
|
|
1154
|
+
export declare function positional<const R extends boolean>(parser: BaseOptions & {
|
|
1131
1155
|
required: R;
|
|
1132
1156
|
}): WithRequiredOption<Omit<CombinatorSchema<string>, 'type'> & ArgSchemaPositionalType, R>;
|
|
1133
1157
|
/**
|
|
@@ -1160,7 +1184,7 @@ declare function positional<const R extends boolean>(parser: BaseOptions & {
|
|
|
1160
1184
|
* }
|
|
1161
1185
|
* ```
|
|
1162
1186
|
*/
|
|
1163
|
-
declare function positional<const R extends boolean | undefined = boolean | undefined>(parser?: BaseOptions & {
|
|
1187
|
+
export declare function positional<const R extends boolean | undefined = boolean | undefined>(parser?: BaseOptions & {
|
|
1164
1188
|
required?: R;
|
|
1165
1189
|
}): WithUnrequiredOption<Omit<CombinatorSchema<string>, 'type'> & ArgSchemaPositionalType, R>;
|
|
1166
1190
|
/**
|
|
@@ -1186,7 +1210,7 @@ declare function positional<const R extends boolean | undefined = boolean | unde
|
|
|
1186
1210
|
* }
|
|
1187
1211
|
* ```
|
|
1188
1212
|
*/
|
|
1189
|
-
declare function positional(parser?: BaseOptions): Omit<CombinatorSchema<string>, 'type'> & ArgSchemaPositionalType;
|
|
1213
|
+
export declare function positional(parser?: BaseOptions): Omit<CombinatorSchema<string>, 'type'> & ArgSchemaPositionalType;
|
|
1190
1214
|
/**
|
|
1191
1215
|
* Create an enum-like argument schema with literal type inference.
|
|
1192
1216
|
*
|
|
@@ -1207,7 +1231,7 @@ declare function positional(parser?: BaseOptions): Omit<CombinatorSchema<string>
|
|
|
1207
1231
|
* // typeof values.level === 'debug' | 'info' | 'warn' | 'error'
|
|
1208
1232
|
* ```
|
|
1209
1233
|
*/
|
|
1210
|
-
declare function choice<const T extends readonly string[], const R extends boolean>(values: T, opts: BaseOptions & {
|
|
1234
|
+
export declare function choice<const T extends readonly string[], const R extends boolean>(values: T, opts: BaseOptions & {
|
|
1211
1235
|
required: R;
|
|
1212
1236
|
}): WithRequiredOption<CombinatorSchema<T[number]>, R>;
|
|
1213
1237
|
/**
|
|
@@ -1232,7 +1256,7 @@ declare function choice<const T extends readonly string[], const R extends boole
|
|
|
1232
1256
|
* // typeof values.level === 'debug' | 'info' | 'warn' | 'error'
|
|
1233
1257
|
* ```
|
|
1234
1258
|
*/
|
|
1235
|
-
declare function choice<const T extends readonly string[], const R extends boolean | undefined = boolean | undefined>(values: T, opts?: BaseOptions & {
|
|
1259
|
+
export declare function choice<const T extends readonly string[], const R extends boolean | undefined = boolean | undefined>(values: T, opts?: BaseOptions & {
|
|
1236
1260
|
required?: R;
|
|
1237
1261
|
}): WithUnrequiredOption<CombinatorSchema<T[number]>, R>;
|
|
1238
1262
|
/**
|
|
@@ -1254,7 +1278,7 @@ declare function choice<const T extends readonly string[], const R extends boole
|
|
|
1254
1278
|
* // typeof values.level === 'debug' | 'info' | 'warn' | 'error'
|
|
1255
1279
|
* ```
|
|
1256
1280
|
*/
|
|
1257
|
-
declare function choice<const T extends readonly string[]>(values: T, opts?: BaseOptions): CombinatorSchema<T[number]>;
|
|
1281
|
+
export declare function choice<const T extends readonly string[]>(values: T, opts?: BaseOptions): CombinatorSchema<T[number]>;
|
|
1258
1282
|
/**
|
|
1259
1283
|
* Options for the {@link combinator} factory function.
|
|
1260
1284
|
*
|
|
@@ -1307,7 +1331,7 @@ interface CombinatorOptions<T> extends BaseOptions {
|
|
|
1307
1331
|
* })
|
|
1308
1332
|
* ```
|
|
1309
1333
|
*/
|
|
1310
|
-
declare function combinator<T, const R extends boolean>(config: CombinatorOptions<T> & {
|
|
1334
|
+
export declare function combinator<T, const R extends boolean>(config: CombinatorOptions<T> & {
|
|
1311
1335
|
required: R;
|
|
1312
1336
|
}): WithRequiredOption<CombinatorSchema<T>, R>;
|
|
1313
1337
|
/**
|
|
@@ -1341,7 +1365,7 @@ declare function combinator<T, const R extends boolean>(config: CombinatorOption
|
|
|
1341
1365
|
* })
|
|
1342
1366
|
* ```
|
|
1343
1367
|
*/
|
|
1344
|
-
declare function combinator<T, const R extends boolean | undefined = boolean | undefined>(config: CombinatorOptions<T> & {
|
|
1368
|
+
export declare function combinator<T, const R extends boolean | undefined = boolean | undefined>(config: CombinatorOptions<T> & {
|
|
1345
1369
|
required?: R;
|
|
1346
1370
|
}): WithUnrequiredOption<CombinatorSchema<T>, R>;
|
|
1347
1371
|
/**
|
|
@@ -1372,7 +1396,7 @@ declare function combinator<T, const R extends boolean | undefined = boolean | u
|
|
|
1372
1396
|
* })
|
|
1373
1397
|
* ```
|
|
1374
1398
|
*/
|
|
1375
|
-
declare function combinator<T>(config: CombinatorOptions<T>): CombinatorSchema<T>;
|
|
1399
|
+
export declare function combinator<T>(config: CombinatorOptions<T>): CombinatorSchema<T>;
|
|
1376
1400
|
/**
|
|
1377
1401
|
* Transform the output of a combinator schema.
|
|
1378
1402
|
*
|
|
@@ -1408,7 +1432,7 @@ declare function combinator<T>(config: CombinatorOptions<T>): CombinatorSchema<T
|
|
|
1408
1432
|
* }
|
|
1409
1433
|
* ```
|
|
1410
1434
|
*/
|
|
1411
|
-
declare function map<T, U, S extends CombinatorSchema<T> = CombinatorSchema<T>>(schema: S & CombinatorSchema<T>, transform: (value: T) => U): Modified<S, Combinator<U>>;
|
|
1435
|
+
export declare function map<T, U, S extends CombinatorSchema<T> = CombinatorSchema<T>>(schema: S & CombinatorSchema<T>, transform: (value: T) => U): Modified<S, Combinator<U>>;
|
|
1412
1436
|
/**
|
|
1413
1437
|
* Transform the output of a combinator schema, as the first overload does, for a schema that fits
|
|
1414
1438
|
* the first overload but that TypeScript does not match with it at first, such as
|
|
@@ -1439,7 +1463,7 @@ declare function map<T, U, S extends CombinatorSchema<T> = CombinatorSchema<T>>(
|
|
|
1439
1463
|
* }
|
|
1440
1464
|
* ```
|
|
1441
1465
|
*/
|
|
1442
|
-
declare function map<T, U, S extends CombinatorSchema<T> = CombinatorSchema<T>>(schema: S & Combinator<T>, transform: (value: T) => U): Modified<S, Combinator<U>>;
|
|
1466
|
+
export declare function map<T, U, S extends CombinatorSchema<T> = CombinatorSchema<T>>(schema: S & Combinator<T>, transform: (value: T) => U): Modified<S, Combinator<U>>;
|
|
1443
1467
|
/**
|
|
1444
1468
|
* Transform the output of a union of combinator schemas of different types, such as
|
|
1445
1469
|
* `strict ? integer() : string()`.
|
|
@@ -1472,7 +1496,7 @@ declare function map<T, U, S extends CombinatorSchema<T> = CombinatorSchema<T>>(
|
|
|
1472
1496
|
* }
|
|
1473
1497
|
* ```
|
|
1474
1498
|
*/
|
|
1475
|
-
declare function map<S extends CombinatorSchema<unknown>, U>(schema: S, transform: (value: ParsedType<S>) => U): Modified<S, Combinator<U>>;
|
|
1499
|
+
export declare function map<S extends CombinatorSchema<unknown>, U>(schema: S, transform: (value: ParsedType<S>) => U): Modified<S, Combinator<U>>;
|
|
1476
1500
|
/**
|
|
1477
1501
|
* Options for the {@link withDefault} combinator.
|
|
1478
1502
|
*/
|
|
@@ -1514,7 +1538,7 @@ type CombinatorWithDefault<T> = {
|
|
|
1514
1538
|
* }
|
|
1515
1539
|
* ```
|
|
1516
1540
|
*/
|
|
1517
|
-
declare function withDefault<T extends string | boolean | number, D extends T = T, S extends CombinatorSchema<T> = CombinatorSchema<T>>(schema: S & CombinatorSchema<T>, defaultValue: D): Modified<S, CombinatorWithDefault<T>>;
|
|
1541
|
+
export declare function withDefault<T extends string | boolean | number, D extends T = T, S extends CombinatorSchema<T> = CombinatorSchema<T>>(schema: S & CombinatorSchema<T>, defaultValue: D): Modified<S, CombinatorWithDefault<T>>;
|
|
1518
1542
|
/**
|
|
1519
1543
|
* Set a default value on a combinator schema, as the first overload does, for a schema that fits
|
|
1520
1544
|
* the first overload but that TypeScript does not match with it at first, such as
|
|
@@ -1542,7 +1566,7 @@ declare function withDefault<T extends string | boolean | number, D extends T =
|
|
|
1542
1566
|
* }
|
|
1543
1567
|
* ```
|
|
1544
1568
|
*/
|
|
1545
|
-
declare function withDefault<T extends string | boolean | number, D extends T = T, S extends CombinatorSchema<T> = CombinatorSchema<T>>(schema: S & Combinator<T>, defaultValue: D): Modified<S, CombinatorWithDefault<T>>;
|
|
1569
|
+
export declare function withDefault<T extends string | boolean | number, D extends T = T, S extends CombinatorSchema<T> = CombinatorSchema<T>>(schema: S & Combinator<T>, defaultValue: D): Modified<S, CombinatorWithDefault<T>>;
|
|
1546
1570
|
/**
|
|
1547
1571
|
* Set a default value on a union of combinator schemas of different types, such as
|
|
1548
1572
|
* `strict ? integer() : string()`.
|
|
@@ -1575,7 +1599,7 @@ declare function withDefault<T extends string | boolean | number, D extends T =
|
|
|
1575
1599
|
* // typeof values.timeout === number | string
|
|
1576
1600
|
* ```
|
|
1577
1601
|
*/
|
|
1578
|
-
declare function withDefault<S extends CombinatorSchema<string | boolean | number>>(schema: S, defaultValue: unknown extends ParsedType<S> ? never : ParsedType<S>): Modified<S, CombinatorWithDefault<ParsedType<S>> & Combinator<ParsedType<S>>>;
|
|
1602
|
+
export declare function withDefault<S extends CombinatorSchema<string | boolean | number>>(schema: S, defaultValue: unknown extends ParsedType<S> ? never : ParsedType<S>): Modified<S, CombinatorWithDefault<ParsedType<S>> & Combinator<ParsedType<S>>>;
|
|
1579
1603
|
/**
|
|
1580
1604
|
* Overlay the properties of `F` onto a combinator schema without dropping its other properties.
|
|
1581
1605
|
*
|
|
@@ -1611,8 +1635,9 @@ type Modified<S, F> = S extends unknown ? WithFlag<S, F> : never;
|
|
|
1611
1635
|
*
|
|
1612
1636
|
* It maps the properties of `S` itself, so that TypeScript still sees them when `S` is a type
|
|
1613
1637
|
* parameter with other modifiers on it, and it maps each schema of a union on its own.
|
|
1614
|
-
* For a type parameter, TypeScript does not take it for `Omit<S, K>`, so {@link hidden}
|
|
1615
|
-
* {@link unrequired}, whose results were typed `Omit<S, K>` with their flag,
|
|
1638
|
+
* For a type parameter, TypeScript does not take it for `Omit<S, K>`, so {@link hidden},
|
|
1639
|
+
* {@link deprecated} and {@link unrequired}, whose results were typed `Omit<S, K>` with their flag,
|
|
1640
|
+
* return that type too.
|
|
1616
1641
|
*/
|
|
1617
1642
|
type Without<S, K> = { [P in keyof S as P extends K ? never : NamedKey<P>]: S[P]; };
|
|
1618
1643
|
/**
|
|
@@ -1650,7 +1675,7 @@ type CombinatorMultiple = {
|
|
|
1650
1675
|
* // typeof values.tags === string[]
|
|
1651
1676
|
* ```
|
|
1652
1677
|
*/
|
|
1653
|
-
declare function multiple<S extends CombinatorSchema<unknown>>(schema: S): Modified<S, CombinatorMultiple>;
|
|
1678
|
+
export declare function multiple<S extends CombinatorSchema<unknown>>(schema: S): Modified<S, CombinatorMultiple>;
|
|
1654
1679
|
/**
|
|
1655
1680
|
* Options for the {@link required} combinator.
|
|
1656
1681
|
*/
|
|
@@ -1675,7 +1700,7 @@ type CombinatorRequired = {
|
|
|
1675
1700
|
* }
|
|
1676
1701
|
* ```
|
|
1677
1702
|
*/
|
|
1678
|
-
declare function required<S extends CombinatorSchema<unknown>>(schema: S): Modified<S, CombinatorRequired>;
|
|
1703
|
+
export declare function required<S extends CombinatorSchema<unknown>>(schema: S): Modified<S, CombinatorRequired>;
|
|
1679
1704
|
/**
|
|
1680
1705
|
* Options for the {@link short} combinator.
|
|
1681
1706
|
*/
|
|
@@ -1707,7 +1732,7 @@ type CombinatorShort<S extends string> = {
|
|
|
1707
1732
|
* // Usage: -v or --verbose
|
|
1708
1733
|
* ```
|
|
1709
1734
|
*/
|
|
1710
|
-
declare function short<T, A extends string, S extends CombinatorSchema<T> = CombinatorSchema<T>>(schema: S, alias: A): Modified<S, CombinatorShort<A>>;
|
|
1735
|
+
export declare function short<T, A extends string, S extends CombinatorSchema<T> = CombinatorSchema<T>>(schema: S, alias: A): Modified<S, CombinatorShort<A>>;
|
|
1711
1736
|
/**
|
|
1712
1737
|
* Options for the {@link describe} combinator.
|
|
1713
1738
|
*/
|
|
@@ -1738,7 +1763,7 @@ type CombinatorDescribe<D extends string> = {
|
|
|
1738
1763
|
* }
|
|
1739
1764
|
* ```
|
|
1740
1765
|
*/
|
|
1741
|
-
declare function describe<T, D extends string, S extends CombinatorSchema<T> = CombinatorSchema<T>>(schema: S, text: D): Modified<S, CombinatorDescribe<D>>;
|
|
1766
|
+
export declare function describe<T, D extends string, S extends CombinatorSchema<T> = CombinatorSchema<T>>(schema: S, text: D): Modified<S, CombinatorDescribe<D>>;
|
|
1742
1767
|
/**
|
|
1743
1768
|
* Options for the {@link hidden} combinator.
|
|
1744
1769
|
*/
|
|
@@ -1764,7 +1789,41 @@ type CombinatorHidden = {
|
|
|
1764
1789
|
* }
|
|
1765
1790
|
* ```
|
|
1766
1791
|
*/
|
|
1767
|
-
declare function hidden<T extends ArgSchema>(schema: T): T extends unknown ? WithFlag<T, CombinatorHidden> & Omit<T, 'hidden'> : never;
|
|
1792
|
+
export declare function hidden<T extends ArgSchema>(schema: T): T extends unknown ? WithFlag<T, CombinatorHidden> & Omit<T, 'hidden'> : never;
|
|
1793
|
+
/**
|
|
1794
|
+
* Options for the {@link deprecated} combinator: `true`, or the text that tells what to use
|
|
1795
|
+
* instead.
|
|
1796
|
+
*/
|
|
1797
|
+
type CombinatorDeprecated<M extends true | string> = {
|
|
1798
|
+
deprecated: M;
|
|
1799
|
+
};
|
|
1800
|
+
/**
|
|
1801
|
+
* Mark a combinator schema as deprecated: `true`, or the text that tells what to use instead.
|
|
1802
|
+
*
|
|
1803
|
+
* The original schema is not modified. Like {@link hidden}, this only marks metadata for the tools
|
|
1804
|
+
* that read the schema, such as a CLI framework that warns when the argument is given and leaves it
|
|
1805
|
+
* out of the help. It does not change parsing, validation, required checks, defaults, conflicts,
|
|
1806
|
+
* or resolved values. For a union of schemas, such as `strict ? integer() : string()`, each schema
|
|
1807
|
+
* gets `deprecated`.
|
|
1808
|
+
*
|
|
1809
|
+
* @typeParam T - The schema type.
|
|
1810
|
+
* @typeParam M - The type of `message`: `deprecated` is typed `string` with it, and `true` without
|
|
1811
|
+
* it.
|
|
1812
|
+
*
|
|
1813
|
+
* @param schema - The base combinator schema.
|
|
1814
|
+
* @param message - The text that tells what to use instead, such as `'Use --output.'`. Without it,
|
|
1815
|
+
* `deprecated` is `true`.
|
|
1816
|
+
* @returns A new schema with `deprecated` set to `message`, or to `true`.
|
|
1817
|
+
*
|
|
1818
|
+
* @example
|
|
1819
|
+
* ```ts
|
|
1820
|
+
* const args = {
|
|
1821
|
+
* output: string(),
|
|
1822
|
+
* format: deprecated(string(), 'Use --output.')
|
|
1823
|
+
* }
|
|
1824
|
+
* ```
|
|
1825
|
+
*/
|
|
1826
|
+
export declare function deprecated<T extends ArgSchema, M extends string | undefined = undefined>(schema: T, message?: M): T extends unknown ? WithFlag<T, CombinatorDeprecated<M extends string ? string : true>> & Omit<T, 'deprecated'> : never;
|
|
1768
1827
|
/**
|
|
1769
1828
|
* Options for the {@link unrequired} combinator.
|
|
1770
1829
|
*/
|
|
@@ -1793,7 +1852,7 @@ type CombinatorUnrequired = {
|
|
|
1793
1852
|
* }
|
|
1794
1853
|
* ```
|
|
1795
1854
|
*/
|
|
1796
|
-
declare function unrequired<T extends ArgSchema>(schema: T): T extends unknown ? WithFlag<T, CombinatorUnrequired> & Omit<T, 'required'> : never;
|
|
1855
|
+
export declare function unrequired<T extends ArgSchema>(schema: T): T extends unknown ? WithFlag<T, CombinatorUnrequired> & Omit<T, 'required'> : never;
|
|
1797
1856
|
/**
|
|
1798
1857
|
* Recursively merge a tuple of {@link Args} types.
|
|
1799
1858
|
* Later types override earlier ones on key conflicts.
|
|
@@ -1820,7 +1879,7 @@ type MergeArgs<T extends Args[]> = T extends [infer Only extends Args] ? Only :
|
|
|
1820
1879
|
* })
|
|
1821
1880
|
* ```
|
|
1822
1881
|
*/
|
|
1823
|
-
declare function args<T extends Args>(fields: T): T;
|
|
1882
|
+
export declare function args<T extends Args>(fields: T): T;
|
|
1824
1883
|
/**
|
|
1825
1884
|
* Compose multiple {@link Args} schemas into one.
|
|
1826
1885
|
*
|
|
@@ -1840,7 +1899,7 @@ declare function args<T extends Args>(fields: T): T;
|
|
|
1840
1899
|
* const schema = merge(common, network)
|
|
1841
1900
|
* ```
|
|
1842
1901
|
*/
|
|
1843
|
-
declare function merge<A extends Args, B extends Args>(a: A, b: B): Omit<A, keyof B> & B;
|
|
1902
|
+
export declare function merge<A extends Args, B extends Args>(a: A, b: B): Omit<A, keyof B> & B;
|
|
1844
1903
|
/**
|
|
1845
1904
|
* Compose multiple {@link Args} schemas into one.
|
|
1846
1905
|
*
|
|
@@ -1849,7 +1908,7 @@ declare function merge<A extends Args, B extends Args>(a: A, b: B): Omit<A, keyo
|
|
|
1849
1908
|
* @param c - Third schema.
|
|
1850
1909
|
* @returns A merged schema containing all fields.
|
|
1851
1910
|
*/
|
|
1852
|
-
declare function merge<A extends Args, B extends Args, C extends Args>(a: A, b: B, c: C): Omit<Omit<A, keyof B | keyof C> & Omit<B, keyof C>, never> & C;
|
|
1911
|
+
export declare function merge<A extends Args, B extends Args, C extends Args>(a: A, b: B, c: C): Omit<Omit<A, keyof B | keyof C> & Omit<B, keyof C>, never> & C;
|
|
1853
1912
|
/**
|
|
1854
1913
|
* Compose multiple {@link Args} schemas into one.
|
|
1855
1914
|
*
|
|
@@ -1859,14 +1918,14 @@ declare function merge<A extends Args, B extends Args, C extends Args>(a: A, b:
|
|
|
1859
1918
|
* @param d - Fourth schema.
|
|
1860
1919
|
* @returns A merged schema containing all fields.
|
|
1861
1920
|
*/
|
|
1862
|
-
declare function merge<A extends Args, B extends Args, C extends Args, D extends Args>(a: A, b: B, c: C, d: D): MergeArgs<[A, B, C, D]>;
|
|
1921
|
+
export declare function merge<A extends Args, B extends Args, C extends Args, D extends Args>(a: A, b: B, c: C, d: D): MergeArgs<[A, B, C, D]>;
|
|
1863
1922
|
/**
|
|
1864
1923
|
* Compose multiple {@link Args} schemas into one.
|
|
1865
1924
|
*
|
|
1866
1925
|
* @param schemas - The schemas to merge.
|
|
1867
1926
|
* @returns A merged schema containing all fields.
|
|
1868
1927
|
*/
|
|
1869
|
-
declare function merge<T extends Args[]>(...schemas: T): MergeArgs<T>;
|
|
1928
|
+
export declare function merge<T extends Args[]>(...schemas: T): MergeArgs<T>;
|
|
1870
1929
|
/**
|
|
1871
1930
|
* Extend a schema by overriding or adding fields.
|
|
1872
1931
|
*
|
|
@@ -1886,6 +1945,5 @@ declare function merge<T extends Args[]>(...schemas: T): MergeArgs<T>;
|
|
|
1886
1945
|
* const strict = extend(base, { port: required(integer({ min: 1, max: 65535 })) })
|
|
1887
1946
|
* ```
|
|
1888
1947
|
*/
|
|
1889
|
-
declare function extend<T extends Args, U extends Args>(base: T, overrides: U): Omit<T, keyof U> & U;
|
|
1890
|
-
|
|
1891
|
-
export { type BaseOptions, type BooleanOptions, type Combinator, type CombinatorOptions, type CombinatorSchema, type FloatOptions, type IntegerOptions, type NumberOptions, type StringOptions, args, boolean, choice, combinator, describe, extend, float, hidden, integer, map, merge, multiple, number, positional, required, short, string, unrequired, withDefault };
|
|
1948
|
+
export declare function extend<T extends Args, U extends Args>(base: T, overrides: U): Omit<T, keyof U> & U;
|
|
1949
|
+
export type { BaseOptions, BooleanOptions, Combinator, CombinatorOptions, CombinatorSchema, FloatOptions, IntegerOptions, NumberOptions, StringOptions };
|
package/lib/index.js
CHANGED
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
"-".codePointAt(0);
|
|
10
10
|
"=".codePointAt(0);
|
|
11
|
-
|
|
12
|
-
//#region ../../node_modules/.pnpm/args-tokens@1.0.2/node_modules/args-tokens/lib/utils.js
|
|
11
|
+
// ../../node_modules/.pnpm/args-tokens@1.2.0/node_modules/args-tokens/lib/utils.js
|
|
13
12
|
/**
|
|
14
13
|
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
15
14
|
* @license MIT
|
|
@@ -23,8 +22,7 @@
|
|
|
23
22
|
function formatChoices(choices) {
|
|
24
23
|
return choices.map((value) => JSON.stringify(value)).join(", ");
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
//#region ../../node_modules/.pnpm/args-tokens@1.0.2/node_modules/args-tokens/lib/resolver-Cx5Pw6-S.js
|
|
25
|
+
// ../../node_modules/.pnpm/args-tokens@1.2.0/node_modules/args-tokens/lib/resolver-DT0CiD5Y.js
|
|
28
26
|
/**
|
|
29
27
|
* Internal definitions shared by the modules of `args-tokens`.
|
|
30
28
|
*
|
|
@@ -60,9 +58,11 @@ const PURE_PARSE = Symbol.for("args-tokens.pureParse");
|
|
|
60
58
|
* Each code identifies a validation failure category and is also suitable as an
|
|
61
59
|
* i18n resource key for localized rendering.
|
|
62
60
|
*
|
|
63
|
-
* {@link resolveArgs} and `parse()` do not report `unknownOption
|
|
61
|
+
* {@link resolveArgs} and `parse()` do not report `unknownOption` or `unexpectedPositional`: a caller
|
|
62
|
+
* that knows what a command takes, such as a CLI framework, reports them. An option that is not in the
|
|
64
63
|
* schema takes the argument after it as its value, unless that argument is an option, and the value
|
|
65
|
-
* is dropped: with no `foo` in the schema, `--foo bar` gives no positional argument.
|
|
64
|
+
* is dropped: with no `foo` in the schema, `--foo bar` gives no positional argument. A positional
|
|
65
|
+
* argument that the schema does not take stays in `positionals`, as the other positional arguments do.
|
|
66
66
|
*/
|
|
67
67
|
const ArgsValidationErrorKeys = {
|
|
68
68
|
requiredOption: "err:arg:required-option",
|
|
@@ -74,7 +74,8 @@ const ArgsValidationErrorKeys = {
|
|
|
74
74
|
unexpectedValue: "err:arg:unexpected-value",
|
|
75
75
|
missingValue: "err:arg:missing-value",
|
|
76
76
|
conflict: "err:arg:conflict",
|
|
77
|
-
invalidDefault: "err:arg:invalid-default"
|
|
77
|
+
invalidDefault: "err:arg:invalid-default",
|
|
78
|
+
unexpectedPositional: "err:arg:unexpected-positional"
|
|
78
79
|
};
|
|
79
80
|
/**
|
|
80
81
|
* Brand that marks {@link ArgsValidationError} instances.
|
|
@@ -126,8 +127,7 @@ var ArgsValidationError = class extends Error {
|
|
|
126
127
|
});
|
|
127
128
|
}
|
|
128
129
|
};
|
|
129
|
-
|
|
130
|
-
//#region ../../node_modules/.pnpm/args-tokens@1.0.2/node_modules/args-tokens/lib/combinators.js
|
|
130
|
+
// ../../node_modules/.pnpm/args-tokens@1.2.0/node_modules/args-tokens/lib/combinators.js
|
|
131
131
|
/**
|
|
132
132
|
* Parser combinator factory functions for composable argument schema construction.
|
|
133
133
|
*
|
|
@@ -309,6 +309,7 @@ function positional(parser) {
|
|
|
309
309
|
...parser.metavar != null ? { metavar: parser.metavar } : {},
|
|
310
310
|
...parser.description != null ? { description: parser.description } : {},
|
|
311
311
|
...parser.hidden != null ? { hidden: parser.hidden } : {},
|
|
312
|
+
...parser.deprecated != null ? { deprecated: parser.deprecated } : {},
|
|
312
313
|
...parser.required != null ? { required: parser.required } : {},
|
|
313
314
|
...parser.default != null ? { default: parser.default } : {},
|
|
314
315
|
...parser.multiple != null ? { multiple: parser.multiple } : {}
|
|
@@ -406,6 +407,13 @@ function hidden(schema) {
|
|
|
406
407
|
};
|
|
407
408
|
}
|
|
408
409
|
// @__NO_SIDE_EFFECTS__
|
|
410
|
+
function deprecated(schema, message) {
|
|
411
|
+
return {
|
|
412
|
+
...schema,
|
|
413
|
+
deprecated: message ?? true
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
// @__NO_SIDE_EFFECTS__
|
|
409
417
|
function unrequired(schema) {
|
|
410
418
|
return {
|
|
411
419
|
...schema,
|
|
@@ -467,17 +475,14 @@ function extend(base, overrides) {
|
|
|
467
475
|
for (const key of Object.keys(overrides)) result[key] = overrides[key];
|
|
468
476
|
return result;
|
|
469
477
|
}
|
|
470
|
-
|
|
471
|
-
//#region ../gunshi/src/combinators.ts
|
|
478
|
+
// ../gunshi/src/combinators.ts
|
|
472
479
|
/**
|
|
473
480
|
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
474
481
|
* @license MIT
|
|
475
482
|
*/
|
|
476
|
-
|
|
477
|
-
//#region src/index.ts
|
|
483
|
+
// src/index.ts
|
|
478
484
|
/**
|
|
479
485
|
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
480
486
|
* @license MIT
|
|
481
487
|
*/
|
|
482
|
-
|
|
483
|
-
export { args, boolean, choice, combinator, describe, extend, float, hidden, integer, map, merge, multiple, number, positional, required, short, string, unrequired, withDefault };
|
|
488
|
+
export { args, boolean, choice, combinator, deprecated, describe, extend, float, hidden, integer, map, merge, multiple, number, positional, required, short, string, unrequired, withDefault };
|
package/package.json
CHANGED
|
@@ -1,38 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gunshi/combinators",
|
|
3
|
+
"version": "1.0.0-rc.7",
|
|
3
4
|
"description": "parser combinators for gunshi argument schema",
|
|
4
|
-
"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cli",
|
|
7
|
+
"combinators",
|
|
8
|
+
"gunshi",
|
|
9
|
+
"parser"
|
|
10
|
+
],
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/kazupon/gunshi/issues"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
5
15
|
"author": {
|
|
6
16
|
"name": "kazuya kawaguchi",
|
|
7
17
|
"email": "kawakazu80@gmail.com"
|
|
8
18
|
},
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"funding": "https://github.com/sponsors/kazupon",
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/kazupon/gunshi/issues"
|
|
13
|
-
},
|
|
14
19
|
"repository": {
|
|
15
20
|
"type": "git",
|
|
16
21
|
"url": "git+https://github.com/kazupon/gunshi.git",
|
|
17
22
|
"directory": "packages/combinators"
|
|
18
23
|
},
|
|
19
|
-
"
|
|
20
|
-
"gunshi",
|
|
21
|
-
"combinators",
|
|
22
|
-
"parser",
|
|
23
|
-
"cli"
|
|
24
|
-
],
|
|
25
|
-
"publishConfig": {
|
|
26
|
-
"access": "public"
|
|
27
|
-
},
|
|
28
|
-
"engines": {
|
|
29
|
-
"node": ">= 22"
|
|
30
|
-
},
|
|
31
|
-
"type": "module",
|
|
24
|
+
"funding": "https://github.com/sponsors/kazupon",
|
|
32
25
|
"files": [
|
|
33
26
|
"lib"
|
|
34
27
|
],
|
|
28
|
+
"type": "module",
|
|
35
29
|
"module": "lib/index.js",
|
|
30
|
+
"types": "lib/index.d.ts",
|
|
31
|
+
"typesVersions": {
|
|
32
|
+
"*": {
|
|
33
|
+
"*": [
|
|
34
|
+
"./lib/*",
|
|
35
|
+
"./*"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
36
39
|
"exports": {
|
|
37
40
|
".": {
|
|
38
41
|
"types": "./lib/index.d.ts",
|
|
@@ -42,21 +45,17 @@
|
|
|
42
45
|
},
|
|
43
46
|
"./package.json": "./package.json"
|
|
44
47
|
},
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
"*": {
|
|
48
|
-
"*": [
|
|
49
|
-
"./lib/*",
|
|
50
|
-
"./*"
|
|
51
|
-
]
|
|
52
|
-
}
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
53
50
|
},
|
|
54
51
|
"devDependencies": {
|
|
55
|
-
"gunshi": "1.0.0-rc.
|
|
56
|
-
"publint": "^0.3.20"
|
|
57
|
-
|
|
52
|
+
"gunshi": "1.0.0-rc.7",
|
|
53
|
+
"publint": "^0.3.20"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">= 22"
|
|
58
57
|
},
|
|
59
58
|
"scripts": {
|
|
60
|
-
"build": "
|
|
59
|
+
"build": "vp pack"
|
|
61
60
|
}
|
|
62
61
|
}
|