Skip to content

Commit 45313a4

Browse files
committed
upgrade deps && docs [skip ci]
1 parent 9b3eafd commit 45313a4

16 files changed

+156
-141
lines changed

docs/cli.md

Lines changed: 4 additions & 4 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/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/cli.ts#L17)
15+
Defined in: [cli.ts:17](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/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/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/cli.ts#L47)
29+
Defined in: [cli.ts:47](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/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)\<[`AllStrategies`](types/README.md#allstrategies), `unknown`\>\>\>
4848
49-
Defined in: [cli.ts:28](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/cli.ts#L28)
49+
Defined in: [cli.ts:28](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/cli.ts#L28)
5050

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

@@ -60,7 +60,7 @@ Load configuration file (js/ts) from current dir or Git root.
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/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/cli.ts#L68)
63+
Defined in: [cli.ts:68](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/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: 3
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/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/conflict-helper.ts#L31)
15+
Defined in: [conflict-helper.ts:31](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/conflict-helper.ts#L31)
1616

1717
Build conflict markers into serialized string
1818

docs/file-parser.md

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

1111
### ParseConflictOptions
1212

13-
Defined in: [file-parser.ts:26](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/file-parser.ts#L26)
13+
Defined in: [file-parser.ts:26](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/file-parser.ts#L26)
1414

1515
Options for parsing conflicted content.
1616

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

2525
> **filename**: `string`
2626
27-
Defined in: [file-parser.ts:35](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/file-parser.ts#L35)
27+
Defined in: [file-parser.ts:35](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/file-parser.ts#L35)
2828

2929
filename hint to prioritize parser choice as well as get base and ours from git.
3030
Example:
@@ -38,7 +38,7 @@ If extension is unknown, falls back to `parsers` or `"json"`.
3838

3939
> `optional` **parsers**: `"auto"` \| [`SupportedParsers`](types/README.md#supportedparsers) \| [`SupportedParsers`](types/README.md#supportedparsers)[]
4040
41-
Defined in: [types.ts:245](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/types.ts#L245)
41+
Defined in: [types.ts:245](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/types.ts#L245)
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:12](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/file-parser.ts#L12)
58+
Defined in: [file-parser.ts:12](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/file-parser.ts#L12)
5959

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

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

7474
> `optional` **base**: `T`
7575
76-
Defined in: [file-parser.ts:18](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/file-parser.ts#L18)
76+
Defined in: [file-parser.ts:18](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/file-parser.ts#L18)
7777

7878
Parsed content from the "base" side of the conflict (optional).
7979

8080
##### format
8181

8282
> **format**: `string`
8383
84-
Defined in: [file-parser.ts:20](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/file-parser.ts#L20)
84+
Defined in: [file-parser.ts:20](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/file-parser.ts#L20)
8585

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

8888
##### ours
8989

9090
> **ours**: `T`
9191
92-
Defined in: [file-parser.ts:14](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/file-parser.ts#L14)
92+
Defined in: [file-parser.ts:14](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/file-parser.ts#L14)
9393

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

9696
##### theirs
9797

9898
> **theirs**: `T`
9999
100-
Defined in: [file-parser.ts:16](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/file-parser.ts#L16)
100+
Defined in: [file-parser.ts:16](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/file-parser.ts#L16)
101101

102102
Parsed content from the "theirs" side of the conflict.
103103

@@ -107,7 +107,7 @@ Parsed content from the "theirs" side of the conflict.
107107

108108
> **normalizeParsers**(`options`: [`ParseConflictOptions`](#parseconflictoptions)): [`SupportedParsers`](types/README.md#supportedparsers)[]
109109
110-
Defined in: [file-parser.ts:144](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/file-parser.ts#L144)
110+
Defined in: [file-parser.ts:144](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/file-parser.ts#L144)
111111

112112
Normalize parsers based on filename + options.
113113

@@ -127,7 +127,7 @@ Normalize parsers based on filename + options.
127127

128128
> **parseConflictContent**\<`T`\>(`content`: `string`, `options`: [`ParseConflictOptions`](#parseconflictoptions)): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ParsedConflict`](#parsedconflict)\<`T`\>\>
129129
130-
Defined in: [file-parser.ts:55](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/file-parser.ts#L55)
130+
Defined in: [file-parser.ts:55](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/file-parser.ts#L55)
131131

132132
Parses a conflicted file's content into separate `ours` and `theirs` objects.
133133

@@ -177,7 +177,7 @@ If parsing fails or conflict markers are invalid.
177177

178178
> **parseFormat**(`parser`: `"json"` \| `"json5"` \| `"yaml"` \| `"toml"` \| `"xml"`, `raw`: `string`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`unknown`\>
179179
180-
Defined in: [file-parser.ts:183](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/file-parser.ts#L183)
180+
Defined in: [file-parser.ts:183](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/file-parser.ts#L183)
181181

182182
Internal parser dispatcher for supported formats.
183183

@@ -201,7 +201,7 @@ Internal parser dispatcher for supported formats.
201201

202202
> **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)\]\>
203203
204-
Defined in: [file-parser.ts:165](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/file-parser.ts#L165)
204+
Defined in: [file-parser.ts:165](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/file-parser.ts#L165)
205205

206206
Internal helper to try parsers in order.
207207

docs/file-serializer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ nav_order: 5
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/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/file-serializer.ts#L1)
15+
Defined in: [file-serializer.ts:1](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/file-serializer.ts#L1)
1616

1717
#### Parameters
1818

docs/index.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ nav_order: 1
66

77
# Git Json Resolver <img src="https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png" style="height: 40px"/>
88

9+
![Git JSON Resolver Banner](./banner.jpg)
10+
911
[![test](https://github.com/react18-tools/git-json-resolver/actions/workflows/test.yml/badge.svg)](https://github.com/react18-tools/git-json-resolver/actions/workflows/test.yml)
1012
[![Maintainability](https://qlty.sh/gh/react18-tools/projects/git-json-resolver/maintainability.svg)](https://qlty.sh/gh/react18-tools/projects/git-json-resolver)
1113
[![codecov](https://codecov.io/gh/react18-tools/git-json-resolver/graph/badge.svg)](https://codecov.io/gh/react18-tools/git-json-resolver)
@@ -355,7 +357,7 @@ export const strategies = {
355357
"timestamp-latest": timestampLatest,
356358
};
357359

358-
// Plugin interface for dynamic loading
360+
// Plugin interface for dynamic loading (object-based)
359361
const plugin: StrategyPlugin = {
360362
strategies,
361363
init: async config => {
@@ -364,6 +366,19 @@ const plugin: StrategyPlugin = {
364366
};
365367

366368
export default plugin;
369+
370+
// Alternative: Function-based plugin (NEW)
371+
export default async function createPlugin(config?: any): Promise<StrategyPlugin> {
372+
// Initialize with config if needed
373+
console.log("Plugin initialized with:", config);
374+
375+
return {
376+
strategies,
377+
init: async initConfig => {
378+
// Additional initialization if needed
379+
},
380+
};
381+
}
367382
```
368383

369384
### Custom Strategies (Inline)

docs/logger.md

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

1313
> **createLogger**(`config`: [`LoggerConfig`](types/README.md#loggerconfig-1), `debug?`: `boolean`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<\{ `debug`: (`fileId`: `string`, `msg`: `string`) => `void`; `error`: (`fileId`: `string`, `msg`: `string`) => `void`; `flush`: () => [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\>; `info`: (`fileId`: `string`, `msg`: `string`) => `void`; `warn`: (`fileId`: `string`, `msg`: `string`) => `void`; \}\>
1414
15-
Defined in: [logger.ts:12](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/logger.ts#L12)
15+
Defined in: [logger.ts:12](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/logger.ts#L12)
1616

1717
#### Parameters
1818

docs/matcher.md

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

1111
### Matcher
1212

13-
Defined in: [matcher.ts:17](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/matcher.ts#L17)
13+
Defined in: [matcher.ts:17](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/matcher.ts#L17)
1414

1515
Matcher abstraction + adapters for micromatch/picomatch (optional).
1616

@@ -29,7 +29,7 @@ Micromatch/Picomatch can be loaded at runtime as optional peers.
2929

3030
> **isMatch**: (`str`: `string`, `patterns`: `string`[]) => `boolean`
3131
32-
Defined in: [matcher.ts:21](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/matcher.ts#L21)
32+
Defined in: [matcher.ts:21](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/matcher.ts#L21)
3333

3434
Returns true if `str` matches at least one of the provided glob `patterns`.
3535

@@ -53,7 +53,7 @@ Returns true if `str` matches at least one of the provided glob `patterns`.
5353

5454
> `const` **basicMatcher**: [`Matcher`](#matcher)
5555
56-
Defined in: [matcher.ts:32](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/matcher.ts#L32)
56+
Defined in: [matcher.ts:32](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/matcher.ts#L32)
5757

5858
Minimal homegrown matcher (default).
5959
Supports:
@@ -69,7 +69,7 @@ Supports:
6969

7070
> `const` **ESCAPED_DOT**: "\u0000" = `"\u0000"`
7171
72-
Defined in: [matcher.ts:2](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/matcher.ts#L2)
72+
Defined in: [matcher.ts:2](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/matcher.ts#L2)
7373

7474
Escape sequence for literal dots in field names
7575

@@ -79,7 +79,7 @@ Escape sequence for literal dots in field names
7979

8080
> `const` **ESCAPED_SLASH**: "\u0001" = `"\u0001"`
8181
82-
Defined in: [matcher.ts:4](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/matcher.ts#L4)
82+
Defined in: [matcher.ts:4](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/matcher.ts#L4)
8383

8484
Escape sequence for literal slashes in field names
8585

@@ -89,7 +89,7 @@ Escape sequence for literal slashes in field names
8989

9090
> **loadMatcher**(`name`: `"micromatch"` \| `"picomatch"`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Matcher`](#matcher)\>
9191
92-
Defined in: [matcher.ts:45](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/matcher.ts#L45)
92+
Defined in: [matcher.ts:45](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/matcher.ts#L45)
9393

9494
Attempts to load a named matcher adapter.
9595

docs/merge-processor.md

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

1313
> **processMerge**\<`T`\>(`__namedParameters`: \{ `autoStage?`: `boolean`; `base?`: `unknown`; `config`: [`Config`](types/README.md#config)\<`T`\>; `filePath`: `string`; `format`: `string`; `logger`: \{ `debug`: (`fileId`: `string`, `msg`: `string`) => `void`; `error`: (`fileId`: `string`, `msg`: `string`) => `void`; `flush`: () => [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\>; `info`: (`fileId`: `string`, `msg`: `string`) => `void`; `warn`: (`fileId`: `string`, `msg`: `string`) => `void`; \}; `normalizedConfig`: [`NormalizedConfig`](normalizer.md#normalizedconfig); `ours`: `unknown`; `theirs`: `unknown`; \}): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<\{ `conflicts`: [`Conflict`](merger/README.md#conflict)[]; `success`: `boolean`; \}\>
1414
15-
Defined in: [merge-processor.ts:17](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/merge-processor.ts#L17)
15+
Defined in: [merge-processor.ts:17](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/merge-processor.ts#L17)
1616

1717
Common merge logic for processing a single file with ours/theirs/base data
1818

@@ -92,7 +92,7 @@ Common merge logic for processing a single file with ours/theirs/base data
9292

9393
> **resolveGitMergeFiles**\<`T`\>(`oursPath`: `string`, `basePath`: `string`, `theirsPath`: `string`, `config`: [`Config`](types/README.md#config)\<`T`\>): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`never`\>
9494
95-
Defined in: [merge-processor.ts:92](https://github.com/react18-tools/git-json-resolver/blob/d61d9369fb47648a20fc0be0040b2aaa41b03a8c/lib/src/merge-processor.ts#L92)
95+
Defined in: [merge-processor.ts:92](https://github.com/react18-tools/git-json-resolver/blob/9b3eafde93c5cdd7078466539ccff7dff2a4fc0c/lib/src/merge-processor.ts#L92)
9696

9797
Resolves Git merge conflicts for a single file using the three-way merge approach.
9898
This function is designed to work as a Git merge driver.

0 commit comments

Comments
 (0)