Skip to content

Commit c0f2c82

Browse files
committed
upgrade deps && docs [skip ci]
1 parent 1c52250 commit c0f2c82

27 files changed

+868
-417
lines changed

docs/cli.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ nav_order: 2
1212

1313
> **findGitRoot**(): `string`
1414
15-
Defined in: [cli.ts:15](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/cli.ts#L15)
15+
Defined in: [cli.ts:17](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/cli.ts#L17)
1616

1717
Find Git root directory
1818

@@ -26,7 +26,7 @@ Find Git root directory
2626

2727
> **initConfig**(`targetDir`: `string`): `void`
2828
29-
Defined in: [cli.ts:45](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/cli.ts#L45)
29+
Defined in: [cli.ts:47](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/cli.ts#L47)
3030

3131
Write a starter config file
3232

@@ -46,7 +46,7 @@ Write a starter config file
4646

4747
> **loadConfigFile**(): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Partial`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype)\<[`Config`](types/README.md#config)\<[`InbuiltMergeStrategies`](types/README.md#inbuiltmergestrategies), `unknown`\>\>\>
4848
49-
Defined in: [cli.ts:26](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/cli.ts#L26)
49+
Defined in: [cli.ts:28](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/cli.ts#L28)
5050

5151
Load configuration file (js/ts) from current dir or Git root.
5252

@@ -58,9 +58,9 @@ Load configuration file (js/ts) from current dir or Git root.
5858

5959
### parseArgs()
6060

61-
> **parseArgs**(`argv`: `string`[]): \{ `init?`: `boolean`; `overrides`: [`Partial`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype)\<[`Config`](types/README.md#config)\>; \}
61+
> **parseArgs**(`argv`: `string`[]): \{ `gitMergeFiles?`: \[`string`, `string`, `string`\]; `init?`: `boolean`; `overrides`: [`Partial`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype)\<[`Config`](types/README.md#config)\>; `restore?`: `string`; \}
6262
63-
Defined in: [cli.ts:66](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/cli.ts#L66)
63+
Defined in: [cli.ts:68](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/cli.ts#L68)
6464

6565
CLI argument parser (minimal, no external deps).
6666

@@ -72,7 +72,11 @@ CLI argument parser (minimal, no external deps).
7272

7373
#### Returns
7474

75-
\{ `init?`: `boolean`; `overrides`: [`Partial`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype)\<[`Config`](types/README.md#config)\>; \}
75+
\{ `gitMergeFiles?`: \[`string`, `string`, `string`\]; `init?`: `boolean`; `overrides`: [`Partial`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype)\<[`Config`](types/README.md#config)\>; `restore?`: `string`; \}
76+
77+
##### gitMergeFiles?
78+
79+
> `optional` **gitMergeFiles**: \[`string`, `string`, `string`\]
7680
7781
##### init?
7882

@@ -81,3 +85,7 @@ CLI argument parser (minimal, no external deps).
8185
##### overrides
8286

8387
> **overrides**: [`Partial`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype)\<[`Config`](types/README.md#config)\>
88+
89+
##### restore?
90+
91+
> `optional` **restore**: `string`

docs/conflict-helper.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ nav_order: 4
1212

1313
> **reconstructConflict**(`merged`: `any`, `ours`: `any`, `theirs`: `any`, `format`: `string`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\>
1414
15-
Defined in: [conflict-helper.ts:31](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/conflict-helper.ts#L31)
15+
Defined in: [conflict-helper.ts:31](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/conflict-helper.ts#L31)
1616

1717
Build conflict markers into serialized string
1818

docs/file-parser.md

Lines changed: 75 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@ nav_order: 6
1010

1111
### ParseConflictOptions
1212

13-
Defined in: [file-parser.ts:24](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/file-parser.ts#L24)
13+
Defined in: [file-parser.ts:20](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/file-parser.ts#L20)
1414

1515
Options for parsing conflicted content.
1616

17+
#### Extends
18+
19+
- [`Pick`](https://www.typescriptlang.org/docs/handbook/utility-types.html#picktype-keys)\<[`Config`](types/README.md#config), `"parsers"`\>
20+
1721
#### Properties
1822

1923
##### filename?
2024

2125
> `optional` **filename**: `string`
2226
23-
Defined in: [file-parser.ts:42](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/file-parser.ts#L42)
27+
Defined in: [file-parser.ts:29](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/file-parser.ts#L29)
2428

2529
Optional filename hint to prioritize parser choice.
2630
Example:
@@ -32,9 +36,9 @@ If extension is unknown, falls back to `parsers` or `"json"`.
3236

3337
##### parsers?
3438

35-
> `optional` **parsers**: [`SupportedParsers`](#supportedparsers) \| `"auto"` \| [`SupportedParsers`](#supportedparsers)[]
39+
> `optional` **parsers**: [`SupportedParsers`](types/README.md#supportedparsers) \| `"auto"` \| [`SupportedParsers`](types/README.md#supportedparsers)[]
3640
37-
Defined in: [file-parser.ts:32](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/file-parser.ts#L32)
41+
Defined in: [types.ts:191](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/types.ts#L191)
3842

3943
Parsers to attempt, in order:
4044

@@ -43,11 +47,15 @@ Parsers to attempt, in order:
4347

4448
Defaults to `"json"`.
4549

50+
###### Inherited from
51+
52+
`Pick.parsers`
53+
4654
---
4755

4856
### ParsedConflict\<T\>
4957

50-
Defined in: [file-parser.ts:6](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/file-parser.ts#L6)
58+
Defined in: [file-parser.ts:8](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/file-parser.ts#L8)
5159

5260
Represents a parsed conflict from a file with `ours` and `theirs` versions.
5361

@@ -65,77 +73,53 @@ The type of the parsed content.
6573

6674
> **format**: `string`
6775
68-
Defined in: [file-parser.ts:12](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/file-parser.ts#L12)
76+
Defined in: [file-parser.ts:14](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/file-parser.ts#L14)
6977

7078
Format used to parse the content (`json`, `yaml`, `toml`, `xml`, or `custom`).
7179

7280
##### ours
7381

7482
> **ours**: `T`
7583
76-
Defined in: [file-parser.ts:8](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/file-parser.ts#L8)
84+
Defined in: [file-parser.ts:10](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/file-parser.ts#L10)
7785

7886
Parsed content from the "ours" side of the conflict.
7987

8088
##### theirs
8189

8290
> **theirs**: `T`
8391
84-
Defined in: [file-parser.ts:10](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/file-parser.ts#L10)
92+
Defined in: [file-parser.ts:12](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/file-parser.ts#L12)
8593

8694
Parsed content from the "theirs" side of the conflict.
8795

88-
## Type Aliases
89-
90-
### Parser
91-
92-
> **Parser** = \{ `name`: `string`; `parser`: (`input`: `string`) => `unknown`; \}
93-
94-
Defined in: [file-parser.ts:16](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/file-parser.ts#L16)
95-
96-
A parser function that takes a raw string and returns parsed content.
97-
98-
#### Properties
99-
100-
##### name
101-
102-
> **name**: `string`
96+
## Functions
10397

104-
Defined in: [file-parser.ts:16](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/file-parser.ts#L16)
98+
### normalizeParsers()
10599

106-
##### parser()
100+
> **normalizeParsers**(`options`: [`ParseConflictOptions`](#parseconflictoptions)): [`SupportedParsers`](types/README.md#supportedparsers)[]
107101
108-
> **parser**: (`input`: `string`) => `unknown`
102+
Defined in: [file-parser.ts:120](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/file-parser.ts#L120)
109103

110-
Defined in: [file-parser.ts:16](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/file-parser.ts#L16)
104+
Normalize parsers based on filename + options.
111105

112-
###### Parameters
106+
#### Parameters
113107

114-
###### input
108+
##### options
115109

116-
`string`
110+
[`ParseConflictOptions`](#parseconflictoptions)
117111

118-
###### Returns
112+
#### Returns
119113

120-
`unknown`
114+
[`SupportedParsers`](types/README.md#supportedparsers)[]
121115

122116
---
123117

124-
### SupportedParsers
125-
126-
> **SupportedParsers** = `"json"` \| `"json5"` \| `"yaml"` \| `"toml"` \| `"xml"` \| [`Parser`](#parser)
127-
128-
Defined in: [file-parser.ts:19](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/file-parser.ts#L19)
129-
130-
Built-in parser identifiers or a custom parser function.
131-
132-
## Functions
133-
134118
### parseConflictContent()
135119

136120
> **parseConflictContent**\<`T`\>(`content`: `string`, `options`: [`ParseConflictOptions`](#parseconflictoptions)): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ParsedConflict`](#parsedconflict)\<`T`\>\>
137121
138-
Defined in: [file-parser.ts:62](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/file-parser.ts#L62)
122+
Defined in: [file-parser.ts:49](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/file-parser.ts#L49)
139123

140124
Parses a conflicted file's content into separate `ours` and `theirs` objects.
141125

@@ -178,3 +162,51 @@ Parsed conflict with both sides and detected format.
178162
#### Throws
179163

180164
If parsing fails or conflict markers are invalid.
165+
166+
---
167+
168+
### parseFormat()
169+
170+
> **parseFormat**(`parser`: `"json"` \| `"json5"` \| `"yaml"` \| `"toml"` \| `"xml"`, `raw`: `string`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`unknown`\>
171+
172+
Defined in: [file-parser.ts:159](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/file-parser.ts#L159)
173+
174+
Internal parser dispatcher for supported formats.
175+
176+
#### Parameters
177+
178+
##### parser
179+
180+
`"json"` | `"json5"` | `"yaml"` | `"toml"` | `"xml"`
181+
182+
##### raw
183+
184+
`string`
185+
186+
#### Returns
187+
188+
[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`unknown`\>
189+
190+
---
191+
192+
### runParser()
193+
194+
> **runParser**(`raw`: `string`, `parsers`: [`SupportedParsers`](types/README.md#supportedparsers)[]): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<\[`unknown`, [`SupportedParsers`](types/README.md#supportedparsers)\]\>
195+
196+
Defined in: [file-parser.ts:141](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/file-parser.ts#L141)
197+
198+
Internal helper to try parsers in order.
199+
200+
#### Parameters
201+
202+
##### raw
203+
204+
`string`
205+
206+
##### parsers
207+
208+
[`SupportedParsers`](types/README.md#supportedparsers)[]
209+
210+
#### Returns
211+
212+
[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<\[`unknown`, [`SupportedParsers`](types/README.md#supportedparsers)\]\>

docs/file-serializer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ nav_order: 8
1212

1313
> **serialize**(`format`: `string`, `value`: `unknown`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\>
1414
15-
Defined in: [file-serializer.ts:1](https://github.com/react18-tools/git-json-resolver/blob/b38c33aa182eca9ca6d5408ecc380f54f3e1d39d/lib/src/file-serializer.ts#L1)
15+
Defined in: [file-serializer.ts:1](https://github.com/react18-tools/git-json-resolver/blob/1c522503a4da2b0c40b914a11887e11d24ab51da/lib/src/file-serializer.ts#L1)
1616

1717
#### Parameters
1818

0 commit comments

Comments
 (0)