Skip to content

Commit 06d3f01

Browse files
committed
upgrade deps && docs [skip ci]
1 parent d66fea6 commit 06d3f01

24 files changed

+537
-253
lines changed

PLUGIN_GUIDE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ const plugin: StrategyPlugin = {
2929
strategies: {
3030
"my-strategy": myStrategy,
3131
},
32-
init: async (config) => {
32+
init: async config => {
3333
// Optional initialization
34-
}
34+
},
3535
};
3636

3737
export default plugin;
@@ -56,8 +56,8 @@ await resolveConflicts({
5656
"my-strategy": myStrategy,
5757
},
5858
rules: {
59-
version: ["my-strategy"]
60-
}
59+
version: ["my-strategy"],
60+
},
6161
});
6262
```
6363

@@ -86,11 +86,11 @@ import type { Config } from "git-json-resolver";
8686
const config: Config = {
8787
plugins: ["my-plugin"],
8888
pluginConfig: {
89-
"my-plugin": { customOption: "value" }
89+
"my-plugin": { customOption: "value" },
9090
},
9191
rules: {
92-
version: ["my-strategy"] // TypeScript will know about this strategy
93-
}
92+
version: ["my-strategy"], // TypeScript will know about this strategy
93+
},
9494
};
9595

9696
export default config;
@@ -110,4 +110,4 @@ export default config;
110110
- `timestamp-latest`: Choose most recent timestamp
111111
- `array-union`: Merge arrays with unique values
112112
- `file-size-larger`: Choose larger file content
113-
- `priority-field`: Use priority-based resolution
113+
- `priority-field`: Use priority-based resolution

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ module.exports = {
180180
```
181181

182182
**⚠️ JSON Config Limitations:**
183+
183184
- No TypeScript intellisense for plugin strategies
184185
- Limited validation for custom strategy names
185186
- No compile-time type checking
@@ -268,8 +269,8 @@ await resolveConflicts({
268269
// or "semantic-version": semanticVersion,
269270
},
270271
rules: {
271-
version: ["semantic-version", "theirs"]
272-
}
272+
version: ["semantic-version", "theirs"],
273+
},
273274
});
274275
```
275276

@@ -280,11 +281,11 @@ await resolveConflicts({
280281
const config = {
281282
plugins: ["my-plugin"],
282283
pluginConfig: {
283-
"my-plugin": { option: "value" }
284+
"my-plugin": { option: "value" },
284285
},
285286
rules: {
286-
version: ["semantic-version", "theirs"]
287-
}
287+
version: ["semantic-version", "theirs"],
288+
},
288289
};
289290
```
290291

@@ -338,7 +339,7 @@ export const timestampLatest: StrategyFn = ({ ours, theirs }) => {
338339
const theirsTime = new Date(theirs as string).getTime();
339340
return {
340341
status: StrategyStatus.OK,
341-
value: oursTime > theirsTime ? ours : theirs
342+
value: oursTime > theirsTime ? ours : theirs,
342343
};
343344
};
344345

@@ -351,9 +352,9 @@ export const strategies = {
351352
// Plugin interface for dynamic loading
352353
const plugin: StrategyPlugin = {
353354
strategies,
354-
init: async (config) => {
355-
console.log('Plugin initialized with:', config);
356-
}
355+
init: async config => {
356+
console.log("Plugin initialized with:", config);
357+
},
357358
};
358359

359360
export default plugin;

docs/cli.md

Lines changed: 6 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:17](https://github.com/react18-tools/git-json-resolver/blob/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/cli.ts#L17)
15+
Defined in: [cli.ts:17](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/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:47](https://github.com/react18-tools/git-json-resolver/blob/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/cli.ts#L47)
29+
Defined in: [cli.ts:47](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/cli.ts#L47)
3030

3131
Write a starter config file
3232

@@ -44,23 +44,23 @@ Write a starter config file
4444

4545
### loadConfigFile()
4646

47-
> **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`\>\>\>
47+
> **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)\<[`AllStrategies`](types/README.md#allstrategies), `unknown`\>\>\>
4848
49-
Defined in: [cli.ts:28](https://github.com/react18-tools/git-json-resolver/blob/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/cli.ts#L28)
49+
Defined in: [cli.ts:28](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/cli.ts#L28)
5050

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

5353
#### Returns
5454

55-
[`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`\>\>\>
55+
[`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)\<[`AllStrategies`](types/README.md#allstrategies), `unknown`\>\>\>
5656

5757
---
5858

5959
### parseArgs()
6060

6161
> **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:68](https://github.com/react18-tools/git-json-resolver/blob/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/cli.ts#L68)
63+
Defined in: [cli.ts:68](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/cli.ts#L68)
6464

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

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/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/conflict-helper.ts#L31)
15+
Defined in: [conflict-helper.ts:31](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/conflict-helper.ts#L31)
1616

1717
Build conflict markers into serialized string
1818

docs/file-parser.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ nav_order: 6
1010

1111
### ParseConflictOptions
1212

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

1515
Options for parsing conflicted content.
1616

@@ -24,7 +24,7 @@ Options for parsing conflicted content.
2424

2525
> `optional` **filename**: `string`
2626
27-
Defined in: [file-parser.ts:29](https://github.com/react18-tools/git-json-resolver/blob/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/file-parser.ts#L29)
27+
Defined in: [file-parser.ts:29](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/file-parser.ts#L29)
2828

2929
Optional filename hint to prioritize parser choice.
3030
Example:
@@ -38,7 +38,7 @@ If extension is unknown, falls back to `parsers` or `"json"`.
3838

3939
> `optional` **parsers**: [`SupportedParsers`](types/README.md#supportedparsers) \| `"auto"` \| [`SupportedParsers`](types/README.md#supportedparsers)[]
4040
41-
Defined in: [types.ts:191](https://github.com/react18-tools/git-json-resolver/blob/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/types.ts#L191)
41+
Defined in: [types.ts:231](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/types.ts#L231)
4242

4343
Parsers to attempt, in order:
4444

@@ -55,7 +55,7 @@ Defaults to `"json"`.
5555

5656
### ParsedConflict\<T\>
5757

58-
Defined in: [file-parser.ts:8](https://github.com/react18-tools/git-json-resolver/blob/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/file-parser.ts#L8)
58+
Defined in: [file-parser.ts:8](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/file-parser.ts#L8)
5959

6060
Represents a parsed conflict from a file with `ours` and `theirs` versions.
6161

@@ -73,23 +73,23 @@ The type of the parsed content.
7373

7474
> **format**: `string`
7575
76-
Defined in: [file-parser.ts:14](https://github.com/react18-tools/git-json-resolver/blob/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/file-parser.ts#L14)
76+
Defined in: [file-parser.ts:14](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/file-parser.ts#L14)
7777

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

8080
##### ours
8181

8282
> **ours**: `T`
8383
84-
Defined in: [file-parser.ts:10](https://github.com/react18-tools/git-json-resolver/blob/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/file-parser.ts#L10)
84+
Defined in: [file-parser.ts:10](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/file-parser.ts#L10)
8585

8686
Parsed content from the "ours" side of the conflict.
8787

8888
##### theirs
8989

9090
> **theirs**: `T`
9191
92-
Defined in: [file-parser.ts:12](https://github.com/react18-tools/git-json-resolver/blob/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/file-parser.ts#L12)
92+
Defined in: [file-parser.ts:12](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/file-parser.ts#L12)
9393

9494
Parsed content from the "theirs" side of the conflict.
9595

@@ -99,7 +99,7 @@ Parsed content from the "theirs" side of the conflict.
9999

100100
> **normalizeParsers**(`options`: [`ParseConflictOptions`](#parseconflictoptions)): [`SupportedParsers`](types/README.md#supportedparsers)[]
101101
102-
Defined in: [file-parser.ts:120](https://github.com/react18-tools/git-json-resolver/blob/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/file-parser.ts#L120)
102+
Defined in: [file-parser.ts:120](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/file-parser.ts#L120)
103103

104104
Normalize parsers based on filename + options.
105105

@@ -119,7 +119,7 @@ Normalize parsers based on filename + options.
119119

120120
> **parseConflictContent**\<`T`\>(`content`: `string`, `options`: [`ParseConflictOptions`](#parseconflictoptions)): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ParsedConflict`](#parsedconflict)\<`T`\>\>
121121
122-
Defined in: [file-parser.ts:49](https://github.com/react18-tools/git-json-resolver/blob/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/file-parser.ts#L49)
122+
Defined in: [file-parser.ts:49](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/file-parser.ts#L49)
123123

124124
Parses a conflicted file's content into separate `ours` and `theirs` objects.
125125

@@ -169,7 +169,7 @@ If parsing fails or conflict markers are invalid.
169169

170170
> **parseFormat**(`parser`: `"json"` \| `"json5"` \| `"yaml"` \| `"toml"` \| `"xml"`, `raw`: `string`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`unknown`\>
171171
172-
Defined in: [file-parser.ts:159](https://github.com/react18-tools/git-json-resolver/blob/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/file-parser.ts#L159)
172+
Defined in: [file-parser.ts:159](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/file-parser.ts#L159)
173173

174174
Internal parser dispatcher for supported formats.
175175

@@ -193,7 +193,7 @@ Internal parser dispatcher for supported formats.
193193

194194
> **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)\]\>
195195
196-
Defined in: [file-parser.ts:141](https://github.com/react18-tools/git-json-resolver/blob/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/file-parser.ts#L141)
196+
Defined in: [file-parser.ts:141](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/file-parser.ts#L141)
197197

198198
Internal helper to try parsers in order.
199199

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/f4a78307ca1912fa18ae0a9600625f9d3b3c8372/lib/src/file-serializer.ts#L1)
15+
Defined in: [file-serializer.ts:1](https://github.com/react18-tools/git-json-resolver/blob/d66fea6d97a1504766ed9007635bb4e3c057eb5c/lib/src/file-serializer.ts#L1)
1616

1717
#### Parameters
1818

0 commit comments

Comments
 (0)