sf-git-merge-driver 1.0.0-dev-3.13724775513-1 → 1.0.0-dev-3.13730130635-1

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/README.md CHANGED
@@ -19,6 +19,7 @@ sf plugins install sf-git-merge-driver
19
19
 
20
20
  <!-- commands -->
21
21
  * [`sf git merge driver install`](#sf-git-merge-driver-install)
22
+ * [`sf git merge driver run`](#sf-git-merge-driver-run)
22
23
  * [`sf git merge driver uninstall`](#sf-git-merge-driver-uninstall)
23
24
 
24
25
  ## `sf git merge driver install`
@@ -46,7 +47,45 @@ EXAMPLES
46
47
  $ sf git merge driver install
47
48
  ```
48
49
 
49
- _See code: [src/commands/git/merge/driver/install.ts](https://github.com/scolladon/sf-git-merge-driver/blob/v1.0.0-dev-3.13724775513-1/src/commands/git/merge/driver/install.ts)_
50
+ _See code: [src/commands/git/merge/driver/install.ts](https://github.com/scolladon/sf-git-merge-driver/blob/v1.0.0-dev-3.13730130635-1/src/commands/git/merge/driver/install.ts)_
51
+
52
+ ## `sf git merge driver run`
53
+
54
+ Runs the merge driver for the specified files.
55
+
56
+ ```
57
+ USAGE
58
+ $ sf git merge driver run -a <value> -o <value> -t <value> -p <value> [--json] [--flags-dir <value>]
59
+
60
+ FLAGS
61
+ -a, --ancestor-file=<value> (required) path to the common ancestor version of the file
62
+ -o, --our-file=<value> (required) path to our version of the file
63
+ -p, --output-file=<value> (required) path to the file where the merged content will be written
64
+ -t, --theirs-file=<value> (required) path to their version of the file
65
+
66
+ GLOBAL FLAGS
67
+ --flags-dir=<value> Import flag values from a directory.
68
+ --json Format output as json.
69
+
70
+ DESCRIPTION
71
+ Runs the merge driver for the specified files.
72
+
73
+ Runs the merge driver for the specified files, handling the merge conflict resolution using Salesforce-specific merge
74
+ strategies. This command is typically called automatically by Git when a merge conflict is detected.
75
+
76
+ EXAMPLES
77
+ Run the merge driver for conflicting files:
78
+
79
+ $ sf git merge driver run --ancestor-file=<value> --our-file=<value> --theirs-file=<value> --output-file=<value>
80
+
81
+ Where:
82
+ - ancestor-file is the path to the common ancestor version of the file
83
+ - our-file is the path to our version of the file
84
+ - their-file is the path to their version of the file
85
+ - output-file is the path to the file where the merged content will be written
86
+ ```
87
+
88
+ _See code: [src/commands/git/merge/driver/run.ts](https://github.com/scolladon/sf-git-merge-driver/blob/v1.0.0-dev-3.13730130635-1/src/commands/git/merge/driver/run.ts)_
50
89
 
51
90
  ## `sf git merge driver uninstall`
52
91
 
@@ -73,7 +112,7 @@ EXAMPLES
73
112
  $ sf git merge driver uninstall
74
113
  ```
75
114
 
76
- _See code: [src/commands/git/merge/driver/uninstall.ts](https://github.com/scolladon/sf-git-merge-driver/blob/v1.0.0-dev-3.13724775513-1/src/commands/git/merge/driver/uninstall.ts)_
115
+ _See code: [src/commands/git/merge/driver/uninstall.ts](https://github.com/scolladon/sf-git-merge-driver/blob/v1.0.0-dev-3.13730130635-1/src/commands/git/merge/driver/uninstall.ts)_
77
116
  <!-- commandsstop -->
78
117
 
79
118
 
@@ -0,0 +1,13 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ export default class Run extends SfCommand<void> {
3
+ static readonly summary: string;
4
+ static readonly description: string;
5
+ static readonly examples: string[];
6
+ static readonly flags: {
7
+ 'ancestor-file': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ 'our-file': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ 'theirs-file': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'output-file': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,42 @@
1
+ import { Messages } from '@salesforce/core';
2
+ import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
3
+ import { MergeDriver } from '../../../../driver/MergeDriver.js';
4
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
5
+ const messages = Messages.loadMessages('sf-git-merge-driver', 'run');
6
+ export default class Run extends SfCommand {
7
+ static summary = messages.getMessage('summary');
8
+ static description = messages.getMessage('description');
9
+ static examples = messages.getMessages('examples');
10
+ static flags = {
11
+ 'ancestor-file': Flags.string({
12
+ char: 'a',
13
+ summary: messages.getMessage('flags.ancestor-file.summary'),
14
+ required: true,
15
+ exists: true,
16
+ }),
17
+ 'our-file': Flags.string({
18
+ char: 'o',
19
+ summary: messages.getMessage('flags.our-file.summary'),
20
+ required: true,
21
+ exists: true,
22
+ }),
23
+ 'theirs-file': Flags.string({
24
+ char: 't',
25
+ summary: messages.getMessage('flags.theirs-file.summary'),
26
+ required: true,
27
+ exists: true,
28
+ }),
29
+ 'output-file': Flags.string({
30
+ char: 'p',
31
+ summary: messages.getMessage('flags.output-file.summary'),
32
+ required: true,
33
+ exists: true,
34
+ }),
35
+ };
36
+ async run() {
37
+ const { flags } = await this.parse(Run);
38
+ const mergeDriver = new MergeDriver();
39
+ await mergeDriver.mergeFiles(flags['ancestor-file'], flags['our-file'], flags['theirs-file'], flags['output-file']);
40
+ }
41
+ }
42
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../../../../../src/commands/git/merge/driver/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAE/D,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC5D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAA;AAEpE,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,SAAe;IACvC,MAAM,CAAmB,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;IACjE,MAAM,CAAmB,WAAW,GACzC,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;IAC7B,MAAM,CAAmB,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;IAEpE,MAAM,CAAmB,KAAK,GAAG;QACtC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC;YAC5B,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,6BAA6B,CAAC;YAC3D,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,IAAI;SACb,CAAC;QACF,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC;YACvB,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;YACtD,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,IAAI;SACb,CAAC;QACF,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC;YAC1B,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,2BAA2B,CAAC;YACzD,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,IAAI;SACb,CAAC;QACF,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC;YAC1B,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,2BAA2B,CAAC;YACzD,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,IAAI;SACb,CAAC;KACH,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACvC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAA;QACrC,MAAM,WAAW,CAAC,UAAU,CAC1B,KAAK,CAAC,eAAe,CAAC,EACtB,KAAK,CAAC,UAAU,CAAC,EACjB,KAAK,CAAC,aAAa,CAAC,EACpB,KAAK,CAAC,aAAa,CAAC,CACrB,CAAA;IACH,CAAC"}
@@ -1 +1,2 @@
1
1
  export declare const DRIVER_NAME = "salesforce-source";
2
+ export declare const RUN_PLUGIN_COMMAND = "sf git merge driver run";
@@ -1,2 +1,3 @@
1
1
  export const DRIVER_NAME = 'salesforce-source';
2
+ export const RUN_PLUGIN_COMMAND = 'sf git merge driver run';
2
3
  //# sourceMappingURL=driverConstant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"driverConstant.js","sourceRoot":"","sources":["../../src/constant/driverConstant.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,mBAAmB,CAAA"}
1
+ {"version":3,"file":"driverConstant.js","sourceRoot":"","sources":["../../src/constant/driverConstant.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,mBAAmB,CAAA;AAC9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,yBAAyB,CAAA"}
@@ -1,20 +1,11 @@
1
- import { appendFile, chmod, copyFile, mkdir } from 'node:fs/promises';
2
- import { join } from 'node:path';
3
- import { fileURLToPath } from 'node:url';
1
+ import { appendFile } from 'node:fs/promises';
4
2
  import { simpleGit } from 'simple-git';
5
- import { DRIVER_NAME } from '../constant/driverConstant.js';
6
- const currentDir = fileURLToPath(new URL('.', import.meta.url));
7
- const libIndexPath = join(currentDir, '../../lib/index.js');
8
- const binaryPath = 'node_modules/.bin';
9
- const localBinPath = `${binaryPath}/sf-git-merge-driver`;
3
+ import { DRIVER_NAME, RUN_PLUGIN_COMMAND } from '../constant/driverConstant.js';
10
4
  export class InstallService {
11
5
  async installMergeDriver() {
12
- await mkdir(binaryPath, { recursive: true });
13
- await copyFile(libIndexPath, localBinPath);
14
- await chmod(localBinPath, 0o755);
15
6
  const git = simpleGit();
16
7
  await git.addConfig(`merge.${DRIVER_NAME}.name`, 'Salesforce source merge driver');
17
- await git.addConfig(`merge.${DRIVER_NAME}.driver`, `${localBinPath} %O %A %B %P`);
8
+ await git.addConfig(`merge.${DRIVER_NAME}.driver`, `${RUN_PLUGIN_COMMAND} --ancestor-file %O --our-file %A --theirs-file %B --output-file %P`);
18
9
  await git.addConfig(`merge.${DRIVER_NAME}.recursive`, 'true');
19
10
  const content = ['*.xml'].map(pattern => `${pattern} merge=${DRIVER_NAME}`).join('\n') +
20
11
  '\n';
@@ -1 +1 @@
1
- {"version":3,"file":"installService.js","sourceRoot":"","sources":["../../src/service/installService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAE3D,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AAC/D,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAA;AAC3D,MAAM,UAAU,GAAG,mBAAmB,CAAA;AACtC,MAAM,YAAY,GAAG,GAAG,UAAU,sBAAsB,CAAA;AAExD,MAAM,OAAO,cAAc;IAClB,KAAK,CAAC,kBAAkB;QAC7B,MAAM,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QAC5C,MAAM,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA;QAC1C,MAAM,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAA;QAEhC,MAAM,GAAG,GAAG,SAAS,EAAE,CAAA;QACvB,MAAM,GAAG,CAAC,SAAS,CACjB,SAAS,WAAW,OAAO,EAC3B,gCAAgC,CACjC,CAAA;QACD,MAAM,GAAG,CAAC,SAAS,CACjB,SAAS,WAAW,SAAS,EAC7B,GAAG,YAAY,cAAc,CAC9B,CAAA;QACD,MAAM,GAAG,CAAC,SAAS,CAAC,SAAS,WAAW,YAAY,EAAE,MAAM,CAAC,CAAA;QAE7D,MAAM,OAAO,GACX,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,UAAU,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YACtE,IAAI,CAAA;QAEN,MAAM,UAAU,CAAC,gBAAgB,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAA;IAC5D,CAAC;CACF"}
1
+ {"version":3,"file":"installService.js","sourceRoot":"","sources":["../../src/service/installService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAE/E,MAAM,OAAO,cAAc;IAClB,KAAK,CAAC,kBAAkB;QAC7B,MAAM,GAAG,GAAG,SAAS,EAAE,CAAA;QACvB,MAAM,GAAG,CAAC,SAAS,CACjB,SAAS,WAAW,OAAO,EAC3B,gCAAgC,CACjC,CAAA;QACD,MAAM,GAAG,CAAC,SAAS,CACjB,SAAS,WAAW,SAAS,EAC7B,GAAG,kBAAkB,qEAAqE,CAC3F,CAAA;QACD,MAAM,GAAG,CAAC,SAAS,CAAC,SAAS,WAAW,YAAY,EAAE,MAAM,CAAC,CAAA;QAE7D,MAAM,OAAO,GACX,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,UAAU,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YACtE,IAAI,CAAA;QAEN,MAAM,UAAU,CAAC,gBAAgB,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAA;IAC5D,CAAC;CACF"}
@@ -1,16 +1,9 @@
1
- import { readFile, unlink, writeFile } from 'node:fs/promises';
2
- import { join } from 'node:path';
1
+ import { readFile, writeFile } from 'node:fs/promises';
3
2
  import { simpleGit } from 'simple-git';
4
3
  import { DRIVER_NAME } from '../constant/driverConstant.js';
5
4
  const MERGE_DRIVER_CONFIG = new RegExp(`.* merge\\s*=\\s*${DRIVER_NAME}$`);
6
- const localBinPath = join(process.cwd(), 'node_modules/.bin/sf-git-merge-driver');
7
5
  export class UninstallService {
8
6
  async uninstallMergeDriver() {
9
- try {
10
- await unlink(localBinPath);
11
- // biome-ignore lint/suspicious/noEmptyBlockStatements: <explanation>
12
- }
13
- catch { }
14
7
  const git = simpleGit();
15
8
  try {
16
9
  await git.raw(['config', '--remove-section', `merge.${DRIVER_NAME}`]);
@@ -1 +1 @@
1
- {"version":3,"file":"uninstallService.js","sourceRoot":"","sources":["../../src/service/uninstallService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAE3D,MAAM,mBAAmB,GAAG,IAAI,MAAM,CAAC,oBAAoB,WAAW,GAAG,CAAC,CAAA;AAC1E,MAAM,YAAY,GAAG,IAAI,CACvB,OAAO,CAAC,GAAG,EAAE,EACb,uCAAuC,CACxC,CAAA;AAED,MAAM,OAAO,gBAAgB;IACpB,KAAK,CAAC,oBAAoB;QAC/B,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,YAAY,CAAC,CAAA;YAC1B,qEAAqE;QACvE,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;QAEV,MAAM,GAAG,GAAG,SAAS,EAAE,CAAA;QACvB,IAAI,CAAC;YACH,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,kBAAkB,EAAE,SAAS,WAAW,EAAE,CAAC,CAAC,CAAA;YACrE,qEAAqE;QACvE,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;QAEV,MAAM,aAAa,GAAG,MAAM,QAAQ,CAAC,gBAAgB,EAAE;YACrD,QAAQ,EAAE,MAAM;SACjB,CAAC,CAAA;QACF,MAAM,kBAAkB,GAAG,aAAa;aACrC,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;QAClD,MAAM,SAAS,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAClE,CAAC;CACF"}
1
+ {"version":3,"file":"uninstallService.js","sourceRoot":"","sources":["../../src/service/uninstallService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAE3D,MAAM,mBAAmB,GAAG,IAAI,MAAM,CAAC,oBAAoB,WAAW,GAAG,CAAC,CAAA;AAE1E,MAAM,OAAO,gBAAgB;IACpB,KAAK,CAAC,oBAAoB;QAC/B,MAAM,GAAG,GAAG,SAAS,EAAE,CAAA;QACvB,IAAI,CAAC;YACH,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,kBAAkB,EAAE,SAAS,WAAW,EAAE,CAAC,CAAC,CAAA;YACrE,qEAAqE;QACvE,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;QAEV,MAAM,aAAa,GAAG,MAAM,QAAQ,CAAC,gBAAgB,EAAE;YACrD,QAAQ,EAAE,MAAM;SACjB,CAAC,CAAA;QACF,MAAM,kBAAkB,GAAG,aAAa;aACrC,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;QAClD,MAAM,SAAS,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAClE,CAAC;CACF"}
@@ -0,0 +1,36 @@
1
+ # summary
2
+
3
+ Runs the merge driver for the specified files.
4
+
5
+ # description
6
+
7
+ Runs the merge driver for the specified files, handling the merge conflict resolution using Salesforce-specific merge strategies. This command is typically called automatically by Git when a merge conflict is detected.
8
+
9
+ # examples
10
+
11
+ - Run the merge driver for conflicting files:
12
+
13
+ <%= config.bin %> <%= command.id %> --ancestor-file=<value> --our-file=<value> --theirs-file=<value> --output-file=<value>
14
+
15
+ - Where:
16
+ - ancestor-file is the path to the common ancestor version of the file
17
+ - our-file is the path to our version of the file
18
+ - their-file is the path to their version of the file
19
+ - output-file is the path to the file where the merged content will be written
20
+
21
+ # flags.ancestor-file.summary
22
+
23
+ path to the common ancestor version of the file
24
+
25
+ # flags.our-file.summary
26
+
27
+ path to our version of the file
28
+
29
+ # flags.theirs-file.summary
30
+
31
+ path to their version of the file
32
+
33
+ # flags.output-file.summary
34
+
35
+ path to the file where the merged content will be written
36
+
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "sf-git-merge-driver",
3
- "version": "1.0.0-dev-3.13724775513-1",
3
+ "version": "1.0.0-dev-3.13730130635-1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "sf-git-merge-driver",
9
- "version": "1.0.0-dev-3.13724775513-1",
9
+ "version": "1.0.0-dev-3.13730130635-1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@oclif/core": "^4.2.8",
@@ -15,17 +15,10 @@
15
15
  "fast-xml-parser": "^5.0.8",
16
16
  "simple-git": "^3.27.0"
17
17
  },
18
- "bin": {
19
- "sf-git-merge-driver": "lib/index.js"
20
- },
21
18
  "devDependencies": {
22
19
  "@biomejs/biome": "1.9.4",
23
20
  "@commitlint/config-conventional": "^19.8.0",
24
21
  "@oclif/plugin-help": "^6.2.26",
25
- "@rollup/plugin-commonjs": "^28.0.3",
26
- "@rollup/plugin-node-resolve": "^16.0.0",
27
- "@rollup/plugin-terser": "^0.4.4",
28
- "@rollup/plugin-typescript": "^12.1.2",
29
22
  "@salesforce/cli-plugins-testkit": "^5.3.39",
30
23
  "@salesforce/dev-config": "^4.3.1",
31
24
  "@types/chai": "^5.2.0",
@@ -37,11 +30,8 @@
37
30
  "mocha": "^11.1.0",
38
31
  "nyc": "^17.1.0",
39
32
  "oclif": "^4.17.34",
40
- "rollup": "^4.34.9",
41
- "rollup-plugin-preserve-shebangs": "^0.2.0",
42
33
  "shx": "^0.3.4",
43
34
  "ts-jest": "^29.2.6",
44
- "ts-jest-mock-import-meta": "^1.2.1",
45
35
  "ts-node": "^10.9.2",
46
36
  "tslib": "^2.8.1",
47
37
  "typescript": "^5.8.2",
@@ -3819,17 +3809,6 @@
3819
3809
  "node": ">=6.0.0"
3820
3810
  }
3821
3811
  },
3822
- "node_modules/@jridgewell/source-map": {
3823
- "version": "0.3.6",
3824
- "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz",
3825
- "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==",
3826
- "dev": true,
3827
- "license": "MIT",
3828
- "dependencies": {
3829
- "@jridgewell/gen-mapping": "^0.3.5",
3830
- "@jridgewell/trace-mapping": "^0.3.25"
3831
- }
3832
- },
3833
3812
  "node_modules/@jridgewell/sourcemap-codec": {
3834
3813
  "version": "1.5.0",
3835
3814
  "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
@@ -4193,475 +4172,6 @@
4193
4172
  "node": ">=12"
4194
4173
  }
4195
4174
  },
4196
- "node_modules/@rollup/plugin-commonjs": {
4197
- "version": "28.0.3",
4198
- "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.3.tgz",
4199
- "integrity": "sha512-pyltgilam1QPdn+Zd9gaCfOLcnjMEJ9gV+bTw6/r73INdvzf1ah9zLIJBm+kW7R6IUFIQ1YO+VqZtYxZNWFPEQ==",
4200
- "dev": true,
4201
- "license": "MIT",
4202
- "dependencies": {
4203
- "@rollup/pluginutils": "^5.0.1",
4204
- "commondir": "^1.0.1",
4205
- "estree-walker": "^2.0.2",
4206
- "fdir": "^6.2.0",
4207
- "is-reference": "1.2.1",
4208
- "magic-string": "^0.30.3",
4209
- "picomatch": "^4.0.2"
4210
- },
4211
- "engines": {
4212
- "node": ">=16.0.0 || 14 >= 14.17"
4213
- },
4214
- "peerDependencies": {
4215
- "rollup": "^2.68.0||^3.0.0||^4.0.0"
4216
- },
4217
- "peerDependenciesMeta": {
4218
- "rollup": {
4219
- "optional": true
4220
- }
4221
- }
4222
- },
4223
- "node_modules/@rollup/plugin-commonjs/node_modules/fdir": {
4224
- "version": "6.4.3",
4225
- "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz",
4226
- "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==",
4227
- "dev": true,
4228
- "license": "MIT",
4229
- "peerDependencies": {
4230
- "picomatch": "^3 || ^4"
4231
- },
4232
- "peerDependenciesMeta": {
4233
- "picomatch": {
4234
- "optional": true
4235
- }
4236
- }
4237
- },
4238
- "node_modules/@rollup/plugin-commonjs/node_modules/picomatch": {
4239
- "version": "4.0.2",
4240
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz",
4241
- "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
4242
- "dev": true,
4243
- "license": "MIT",
4244
- "engines": {
4245
- "node": ">=12"
4246
- },
4247
- "funding": {
4248
- "url": "https://github.com/sponsors/jonschlinkert"
4249
- }
4250
- },
4251
- "node_modules/@rollup/plugin-node-resolve": {
4252
- "version": "16.0.0",
4253
- "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.0.tgz",
4254
- "integrity": "sha512-0FPvAeVUT/zdWoO0jnb/V5BlBsUSNfkIOtFHzMO4H9MOklrmQFY6FduVHKucNb/aTFxvnGhj4MNj/T1oNdDfNg==",
4255
- "dev": true,
4256
- "license": "MIT",
4257
- "dependencies": {
4258
- "@rollup/pluginutils": "^5.0.1",
4259
- "@types/resolve": "1.20.2",
4260
- "deepmerge": "^4.2.2",
4261
- "is-module": "^1.0.0",
4262
- "resolve": "^1.22.1"
4263
- },
4264
- "engines": {
4265
- "node": ">=14.0.0"
4266
- },
4267
- "peerDependencies": {
4268
- "rollup": "^2.78.0||^3.0.0||^4.0.0"
4269
- },
4270
- "peerDependenciesMeta": {
4271
- "rollup": {
4272
- "optional": true
4273
- }
4274
- }
4275
- },
4276
- "node_modules/@rollup/plugin-terser": {
4277
- "version": "0.4.4",
4278
- "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz",
4279
- "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==",
4280
- "dev": true,
4281
- "license": "MIT",
4282
- "dependencies": {
4283
- "serialize-javascript": "^6.0.1",
4284
- "smob": "^1.0.0",
4285
- "terser": "^5.17.4"
4286
- },
4287
- "engines": {
4288
- "node": ">=14.0.0"
4289
- },
4290
- "peerDependencies": {
4291
- "rollup": "^2.0.0||^3.0.0||^4.0.0"
4292
- },
4293
- "peerDependenciesMeta": {
4294
- "rollup": {
4295
- "optional": true
4296
- }
4297
- }
4298
- },
4299
- "node_modules/@rollup/plugin-terser/node_modules/commander": {
4300
- "version": "2.20.3",
4301
- "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
4302
- "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
4303
- "dev": true,
4304
- "license": "MIT"
4305
- },
4306
- "node_modules/@rollup/plugin-terser/node_modules/source-map-support": {
4307
- "version": "0.5.21",
4308
- "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
4309
- "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
4310
- "dev": true,
4311
- "license": "MIT",
4312
- "dependencies": {
4313
- "buffer-from": "^1.0.0",
4314
- "source-map": "^0.6.0"
4315
- }
4316
- },
4317
- "node_modules/@rollup/plugin-terser/node_modules/terser": {
4318
- "version": "5.39.0",
4319
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.0.tgz",
4320
- "integrity": "sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw==",
4321
- "dev": true,
4322
- "license": "BSD-2-Clause",
4323
- "dependencies": {
4324
- "@jridgewell/source-map": "^0.3.3",
4325
- "acorn": "^8.8.2",
4326
- "commander": "^2.20.0",
4327
- "source-map-support": "~0.5.20"
4328
- },
4329
- "bin": {
4330
- "terser": "bin/terser"
4331
- },
4332
- "engines": {
4333
- "node": ">=10"
4334
- }
4335
- },
4336
- "node_modules/@rollup/plugin-typescript": {
4337
- "version": "12.1.2",
4338
- "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.2.tgz",
4339
- "integrity": "sha512-cdtSp154H5sv637uMr1a8OTWB0L1SWDSm1rDGiyfcGcvQ6cuTs4MDk2BVEBGysUWago4OJN4EQZqOTl/QY3Jgg==",
4340
- "dev": true,
4341
- "license": "MIT",
4342
- "dependencies": {
4343
- "@rollup/pluginutils": "^5.1.0",
4344
- "resolve": "^1.22.1"
4345
- },
4346
- "engines": {
4347
- "node": ">=14.0.0"
4348
- },
4349
- "peerDependencies": {
4350
- "rollup": "^2.14.0||^3.0.0||^4.0.0",
4351
- "tslib": "*",
4352
- "typescript": ">=3.7.0"
4353
- },
4354
- "peerDependenciesMeta": {
4355
- "rollup": {
4356
- "optional": true
4357
- },
4358
- "tslib": {
4359
- "optional": true
4360
- }
4361
- }
4362
- },
4363
- "node_modules/@rollup/pluginutils": {
4364
- "version": "5.1.4",
4365
- "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz",
4366
- "integrity": "sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==",
4367
- "dev": true,
4368
- "license": "MIT",
4369
- "dependencies": {
4370
- "@types/estree": "^1.0.0",
4371
- "estree-walker": "^2.0.2",
4372
- "picomatch": "^4.0.2"
4373
- },
4374
- "engines": {
4375
- "node": ">=14.0.0"
4376
- },
4377
- "peerDependencies": {
4378
- "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
4379
- },
4380
- "peerDependenciesMeta": {
4381
- "rollup": {
4382
- "optional": true
4383
- }
4384
- }
4385
- },
4386
- "node_modules/@rollup/pluginutils/node_modules/picomatch": {
4387
- "version": "4.0.2",
4388
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz",
4389
- "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
4390
- "dev": true,
4391
- "license": "MIT",
4392
- "engines": {
4393
- "node": ">=12"
4394
- },
4395
- "funding": {
4396
- "url": "https://github.com/sponsors/jonschlinkert"
4397
- }
4398
- },
4399
- "node_modules/@rollup/rollup-android-arm-eabi": {
4400
- "version": "4.34.9",
4401
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.9.tgz",
4402
- "integrity": "sha512-qZdlImWXur0CFakn2BJ2znJOdqYZKiedEPEVNTBrpfPjc/YuTGcaYZcdmNFTkUj3DU0ZM/AElcM8Ybww3xVLzA==",
4403
- "cpu": [
4404
- "arm"
4405
- ],
4406
- "dev": true,
4407
- "license": "MIT",
4408
- "optional": true,
4409
- "os": [
4410
- "android"
4411
- ]
4412
- },
4413
- "node_modules/@rollup/rollup-android-arm64": {
4414
- "version": "4.34.9",
4415
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.9.tgz",
4416
- "integrity": "sha512-4KW7P53h6HtJf5Y608T1ISKvNIYLWRKMvfnG0c44M6In4DQVU58HZFEVhWINDZKp7FZps98G3gxwC1sb0wXUUg==",
4417
- "cpu": [
4418
- "arm64"
4419
- ],
4420
- "dev": true,
4421
- "license": "MIT",
4422
- "optional": true,
4423
- "os": [
4424
- "android"
4425
- ]
4426
- },
4427
- "node_modules/@rollup/rollup-darwin-arm64": {
4428
- "version": "4.34.9",
4429
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.9.tgz",
4430
- "integrity": "sha512-0CY3/K54slrzLDjOA7TOjN1NuLKERBgk9nY5V34mhmuu673YNb+7ghaDUs6N0ujXR7fz5XaS5Aa6d2TNxZd0OQ==",
4431
- "cpu": [
4432
- "arm64"
4433
- ],
4434
- "dev": true,
4435
- "license": "MIT",
4436
- "optional": true,
4437
- "os": [
4438
- "darwin"
4439
- ]
4440
- },
4441
- "node_modules/@rollup/rollup-darwin-x64": {
4442
- "version": "4.34.9",
4443
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.9.tgz",
4444
- "integrity": "sha512-eOojSEAi/acnsJVYRxnMkPFqcxSMFfrw7r2iD9Q32SGkb/Q9FpUY1UlAu1DH9T7j++gZ0lHjnm4OyH2vCI7l7Q==",
4445
- "cpu": [
4446
- "x64"
4447
- ],
4448
- "dev": true,
4449
- "license": "MIT",
4450
- "optional": true,
4451
- "os": [
4452
- "darwin"
4453
- ]
4454
- },
4455
- "node_modules/@rollup/rollup-freebsd-arm64": {
4456
- "version": "4.34.9",
4457
- "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.9.tgz",
4458
- "integrity": "sha512-2lzjQPJbN5UnHm7bHIUKFMulGTQwdvOkouJDpPysJS+QFBGDJqcfh+CxxtG23Ik/9tEvnebQiylYoazFMAgrYw==",
4459
- "cpu": [
4460
- "arm64"
4461
- ],
4462
- "dev": true,
4463
- "license": "MIT",
4464
- "optional": true,
4465
- "os": [
4466
- "freebsd"
4467
- ]
4468
- },
4469
- "node_modules/@rollup/rollup-freebsd-x64": {
4470
- "version": "4.34.9",
4471
- "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.9.tgz",
4472
- "integrity": "sha512-SLl0hi2Ah2H7xQYd6Qaiu01kFPzQ+hqvdYSoOtHYg/zCIFs6t8sV95kaoqjzjFwuYQLtOI0RZre/Ke0nPaQV+g==",
4473
- "cpu": [
4474
- "x64"
4475
- ],
4476
- "dev": true,
4477
- "license": "MIT",
4478
- "optional": true,
4479
- "os": [
4480
- "freebsd"
4481
- ]
4482
- },
4483
- "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
4484
- "version": "4.34.9",
4485
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.9.tgz",
4486
- "integrity": "sha512-88I+D3TeKItrw+Y/2ud4Tw0+3CxQ2kLgu3QvrogZ0OfkmX/DEppehus7L3TS2Q4lpB+hYyxhkQiYPJ6Mf5/dPg==",
4487
- "cpu": [
4488
- "arm"
4489
- ],
4490
- "dev": true,
4491
- "license": "MIT",
4492
- "optional": true,
4493
- "os": [
4494
- "linux"
4495
- ]
4496
- },
4497
- "node_modules/@rollup/rollup-linux-arm-musleabihf": {
4498
- "version": "4.34.9",
4499
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.9.tgz",
4500
- "integrity": "sha512-3qyfWljSFHi9zH0KgtEPG4cBXHDFhwD8kwg6xLfHQ0IWuH9crp005GfoUUh/6w9/FWGBwEHg3lxK1iHRN1MFlA==",
4501
- "cpu": [
4502
- "arm"
4503
- ],
4504
- "dev": true,
4505
- "license": "MIT",
4506
- "optional": true,
4507
- "os": [
4508
- "linux"
4509
- ]
4510
- },
4511
- "node_modules/@rollup/rollup-linux-arm64-gnu": {
4512
- "version": "4.34.9",
4513
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.9.tgz",
4514
- "integrity": "sha512-6TZjPHjKZUQKmVKMUowF3ewHxctrRR09eYyvT5eFv8w/fXarEra83A2mHTVJLA5xU91aCNOUnM+DWFMSbQ0Nxw==",
4515
- "cpu": [
4516
- "arm64"
4517
- ],
4518
- "dev": true,
4519
- "license": "MIT",
4520
- "optional": true,
4521
- "os": [
4522
- "linux"
4523
- ]
4524
- },
4525
- "node_modules/@rollup/rollup-linux-arm64-musl": {
4526
- "version": "4.34.9",
4527
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.9.tgz",
4528
- "integrity": "sha512-LD2fytxZJZ6xzOKnMbIpgzFOuIKlxVOpiMAXawsAZ2mHBPEYOnLRK5TTEsID6z4eM23DuO88X0Tq1mErHMVq0A==",
4529
- "cpu": [
4530
- "arm64"
4531
- ],
4532
- "dev": true,
4533
- "license": "MIT",
4534
- "optional": true,
4535
- "os": [
4536
- "linux"
4537
- ]
4538
- },
4539
- "node_modules/@rollup/rollup-linux-loongarch64-gnu": {
4540
- "version": "4.34.9",
4541
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.9.tgz",
4542
- "integrity": "sha512-dRAgTfDsn0TE0HI6cmo13hemKpVHOEyeciGtvlBTkpx/F65kTvShtY/EVyZEIfxFkV5JJTuQ9tP5HGBS0hfxIg==",
4543
- "cpu": [
4544
- "loong64"
4545
- ],
4546
- "dev": true,
4547
- "license": "MIT",
4548
- "optional": true,
4549
- "os": [
4550
- "linux"
4551
- ]
4552
- },
4553
- "node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
4554
- "version": "4.34.9",
4555
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.9.tgz",
4556
- "integrity": "sha512-PHcNOAEhkoMSQtMf+rJofwisZqaU8iQ8EaSps58f5HYll9EAY5BSErCZ8qBDMVbq88h4UxaNPlbrKqfWP8RfJA==",
4557
- "cpu": [
4558
- "ppc64"
4559
- ],
4560
- "dev": true,
4561
- "license": "MIT",
4562
- "optional": true,
4563
- "os": [
4564
- "linux"
4565
- ]
4566
- },
4567
- "node_modules/@rollup/rollup-linux-riscv64-gnu": {
4568
- "version": "4.34.9",
4569
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.9.tgz",
4570
- "integrity": "sha512-Z2i0Uy5G96KBYKjeQFKbbsB54xFOL5/y1P5wNBsbXB8yE+At3oh0DVMjQVzCJRJSfReiB2tX8T6HUFZ2k8iaKg==",
4571
- "cpu": [
4572
- "riscv64"
4573
- ],
4574
- "dev": true,
4575
- "license": "MIT",
4576
- "optional": true,
4577
- "os": [
4578
- "linux"
4579
- ]
4580
- },
4581
- "node_modules/@rollup/rollup-linux-s390x-gnu": {
4582
- "version": "4.34.9",
4583
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.9.tgz",
4584
- "integrity": "sha512-U+5SwTMoeYXoDzJX5dhDTxRltSrIax8KWwfaaYcynuJw8mT33W7oOgz0a+AaXtGuvhzTr2tVKh5UO8GVANTxyQ==",
4585
- "cpu": [
4586
- "s390x"
4587
- ],
4588
- "dev": true,
4589
- "license": "MIT",
4590
- "optional": true,
4591
- "os": [
4592
- "linux"
4593
- ]
4594
- },
4595
- "node_modules/@rollup/rollup-linux-x64-gnu": {
4596
- "version": "4.34.9",
4597
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.9.tgz",
4598
- "integrity": "sha512-FwBHNSOjUTQLP4MG7y6rR6qbGw4MFeQnIBrMe161QGaQoBQLqSUEKlHIiVgF3g/mb3lxlxzJOpIBhaP+C+KP2A==",
4599
- "cpu": [
4600
- "x64"
4601
- ],
4602
- "dev": true,
4603
- "license": "MIT",
4604
- "optional": true,
4605
- "os": [
4606
- "linux"
4607
- ]
4608
- },
4609
- "node_modules/@rollup/rollup-linux-x64-musl": {
4610
- "version": "4.34.9",
4611
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.9.tgz",
4612
- "integrity": "sha512-cYRpV4650z2I3/s6+5/LONkjIz8MBeqrk+vPXV10ORBnshpn8S32bPqQ2Utv39jCiDcO2eJTuSlPXpnvmaIgRA==",
4613
- "cpu": [
4614
- "x64"
4615
- ],
4616
- "dev": true,
4617
- "license": "MIT",
4618
- "optional": true,
4619
- "os": [
4620
- "linux"
4621
- ]
4622
- },
4623
- "node_modules/@rollup/rollup-win32-arm64-msvc": {
4624
- "version": "4.34.9",
4625
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.9.tgz",
4626
- "integrity": "sha512-z4mQK9dAN6byRA/vsSgQiPeuO63wdiDxZ9yg9iyX2QTzKuQM7T4xlBoeUP/J8uiFkqxkcWndWi+W7bXdPbt27Q==",
4627
- "cpu": [
4628
- "arm64"
4629
- ],
4630
- "dev": true,
4631
- "license": "MIT",
4632
- "optional": true,
4633
- "os": [
4634
- "win32"
4635
- ]
4636
- },
4637
- "node_modules/@rollup/rollup-win32-ia32-msvc": {
4638
- "version": "4.34.9",
4639
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.9.tgz",
4640
- "integrity": "sha512-KB48mPtaoHy1AwDNkAJfHXvHp24H0ryZog28spEs0V48l3H1fr4i37tiyHsgKZJnCmvxsbATdZGBpbmxTE3a9w==",
4641
- "cpu": [
4642
- "ia32"
4643
- ],
4644
- "dev": true,
4645
- "license": "MIT",
4646
- "optional": true,
4647
- "os": [
4648
- "win32"
4649
- ]
4650
- },
4651
- "node_modules/@rollup/rollup-win32-x64-msvc": {
4652
- "version": "4.34.9",
4653
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.9.tgz",
4654
- "integrity": "sha512-AyleYRPU7+rgkMWbEh71fQlrzRfeP6SyMnRf9XX4fCdDPAJumdSBqYEcWPMzVQ4ScAl7E4oFfK0GUVn77xSwbw==",
4655
- "cpu": [
4656
- "x64"
4657
- ],
4658
- "dev": true,
4659
- "license": "MIT",
4660
- "optional": true,
4661
- "os": [
4662
- "win32"
4663
- ]
4664
- },
4665
4175
  "node_modules/@salesforce/cli-plugins-testkit": {
4666
4176
  "version": "5.3.39",
4667
4177
  "resolved": "https://registry.npmjs.org/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-5.3.39.tgz",
@@ -5760,13 +5270,6 @@
5760
5270
  "dev": true,
5761
5271
  "license": "MIT"
5762
5272
  },
5763
- "node_modules/@types/estree": {
5764
- "version": "1.0.6",
5765
- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz",
5766
- "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==",
5767
- "dev": true,
5768
- "license": "MIT"
5769
- },
5770
5273
  "node_modules/@types/glob": {
5771
5274
  "version": "7.2.0",
5772
5275
  "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz",
@@ -5874,13 +5377,6 @@
5874
5377
  "csstype": "^3.0.2"
5875
5378
  }
5876
5379
  },
5877
- "node_modules/@types/resolve": {
5878
- "version": "1.20.2",
5879
- "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz",
5880
- "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==",
5881
- "dev": true,
5882
- "license": "MIT"
5883
- },
5884
5380
  "node_modules/@types/shelljs": {
5885
5381
  "version": "0.8.15",
5886
5382
  "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.15.tgz",
@@ -7696,13 +7192,6 @@
7696
7192
  "node": ">=4"
7697
7193
  }
7698
7194
  },
7699
- "node_modules/estree-walker": {
7700
- "version": "2.0.2",
7701
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
7702
- "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
7703
- "dev": true,
7704
- "license": "MIT"
7705
- },
7706
7195
  "node_modules/event-target-shim": {
7707
7196
  "version": "5.0.1",
7708
7197
  "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
@@ -9100,13 +8589,6 @@
9100
8589
  "url": "https://github.com/sponsors/sindresorhus"
9101
8590
  }
9102
8591
  },
9103
- "node_modules/is-module": {
9104
- "version": "1.0.0",
9105
- "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
9106
- "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==",
9107
- "dev": true,
9108
- "license": "MIT"
9109
- },
9110
8592
  "node_modules/is-number": {
9111
8593
  "version": "7.0.0",
9112
8594
  "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
@@ -9139,16 +8621,6 @@
9139
8621
  "url": "https://github.com/sponsors/sindresorhus"
9140
8622
  }
9141
8623
  },
9142
- "node_modules/is-reference": {
9143
- "version": "1.2.1",
9144
- "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz",
9145
- "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==",
9146
- "dev": true,
9147
- "license": "MIT",
9148
- "dependencies": {
9149
- "@types/estree": "*"
9150
- }
9151
- },
9152
8624
  "node_modules/is-retry-allowed": {
9153
8625
  "version": "1.2.0",
9154
8626
  "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz",
@@ -11213,16 +10685,6 @@
11213
10685
  "yallist": "^3.0.2"
11214
10686
  }
11215
10687
  },
11216
- "node_modules/magic-string": {
11217
- "version": "0.30.17",
11218
- "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz",
11219
- "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==",
11220
- "dev": true,
11221
- "license": "MIT",
11222
- "dependencies": {
11223
- "@jridgewell/sourcemap-codec": "^1.5.0"
11224
- }
11225
- },
11226
10688
  "node_modules/make-dir": {
11227
10689
  "version": "4.0.0",
11228
10690
  "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz",
@@ -12901,68 +12363,6 @@
12901
12363
  "url": "https://github.com/sponsors/isaacs"
12902
12364
  }
12903
12365
  },
12904
- "node_modules/rollup": {
12905
- "version": "4.34.9",
12906
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.9.tgz",
12907
- "integrity": "sha512-nF5XYqWWp9hx/LrpC8sZvvvmq0TeTjQgaZHYmAgwysT9nh8sWnZhBnM8ZyVbbJFIQBLwHDNoMqsBZBbUo4U8sQ==",
12908
- "dev": true,
12909
- "license": "MIT",
12910
- "dependencies": {
12911
- "@types/estree": "1.0.6"
12912
- },
12913
- "bin": {
12914
- "rollup": "dist/bin/rollup"
12915
- },
12916
- "engines": {
12917
- "node": ">=18.0.0",
12918
- "npm": ">=8.0.0"
12919
- },
12920
- "optionalDependencies": {
12921
- "@rollup/rollup-android-arm-eabi": "4.34.9",
12922
- "@rollup/rollup-android-arm64": "4.34.9",
12923
- "@rollup/rollup-darwin-arm64": "4.34.9",
12924
- "@rollup/rollup-darwin-x64": "4.34.9",
12925
- "@rollup/rollup-freebsd-arm64": "4.34.9",
12926
- "@rollup/rollup-freebsd-x64": "4.34.9",
12927
- "@rollup/rollup-linux-arm-gnueabihf": "4.34.9",
12928
- "@rollup/rollup-linux-arm-musleabihf": "4.34.9",
12929
- "@rollup/rollup-linux-arm64-gnu": "4.34.9",
12930
- "@rollup/rollup-linux-arm64-musl": "4.34.9",
12931
- "@rollup/rollup-linux-loongarch64-gnu": "4.34.9",
12932
- "@rollup/rollup-linux-powerpc64le-gnu": "4.34.9",
12933
- "@rollup/rollup-linux-riscv64-gnu": "4.34.9",
12934
- "@rollup/rollup-linux-s390x-gnu": "4.34.9",
12935
- "@rollup/rollup-linux-x64-gnu": "4.34.9",
12936
- "@rollup/rollup-linux-x64-musl": "4.34.9",
12937
- "@rollup/rollup-win32-arm64-msvc": "4.34.9",
12938
- "@rollup/rollup-win32-ia32-msvc": "4.34.9",
12939
- "@rollup/rollup-win32-x64-msvc": "4.34.9",
12940
- "fsevents": "~2.3.2"
12941
- }
12942
- },
12943
- "node_modules/rollup-plugin-preserve-shebangs": {
12944
- "version": "0.2.0",
12945
- "resolved": "https://registry.npmjs.org/rollup-plugin-preserve-shebangs/-/rollup-plugin-preserve-shebangs-0.2.0.tgz",
12946
- "integrity": "sha512-OEyTIfZwUJ7yUAVAbegac/bNvp1WJzgZcQNCFprWX42wwwOqlJwrev9lUmzZdYVgCWct+03xUPvZg4RfgkM9oQ==",
12947
- "dev": true,
12948
- "license": "MIT",
12949
- "dependencies": {
12950
- "magic-string": "^0.25.7"
12951
- },
12952
- "peerDependencies": {
12953
- "rollup": "*"
12954
- }
12955
- },
12956
- "node_modules/rollup-plugin-preserve-shebangs/node_modules/magic-string": {
12957
- "version": "0.25.9",
12958
- "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz",
12959
- "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==",
12960
- "dev": true,
12961
- "license": "MIT",
12962
- "dependencies": {
12963
- "sourcemap-codec": "^1.4.8"
12964
- }
12965
- },
12966
12366
  "node_modules/run-parallel": {
12967
12367
  "version": "1.2.0",
12968
12368
  "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
@@ -13276,13 +12676,6 @@
13276
12676
  "url": "https://github.com/sponsors/sindresorhus"
13277
12677
  }
13278
12678
  },
13279
- "node_modules/smob": {
13280
- "version": "1.5.0",
13281
- "resolved": "https://registry.npmjs.org/smob/-/smob-1.5.0.tgz",
13282
- "integrity": "sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==",
13283
- "dev": true,
13284
- "license": "MIT"
13285
- },
13286
12679
  "node_modules/smol-toml": {
13287
12680
  "version": "1.3.1",
13288
12681
  "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.3.1.tgz",
@@ -13376,14 +12769,6 @@
13376
12769
  "source-map": "^0.6.0"
13377
12770
  }
13378
12771
  },
13379
- "node_modules/sourcemap-codec": {
13380
- "version": "1.4.8",
13381
- "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
13382
- "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
13383
- "deprecated": "Please use @jridgewell/sourcemap-codec instead",
13384
- "dev": true,
13385
- "license": "MIT"
13386
- },
13387
12772
  "node_modules/spawn-wrap": {
13388
12773
  "version": "2.0.0",
13389
12774
  "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz",
@@ -13975,16 +13360,6 @@
13975
13360
  }
13976
13361
  }
13977
13362
  },
13978
- "node_modules/ts-jest-mock-import-meta": {
13979
- "version": "1.2.1",
13980
- "resolved": "https://registry.npmjs.org/ts-jest-mock-import-meta/-/ts-jest-mock-import-meta-1.2.1.tgz",
13981
- "integrity": "sha512-+qh8ZijpFnh7nMNdw1yYrvmnhe3Rctau5a3AFtgBAtps46RSiC8SHr3Z0S9sNqCU3cNOGumCAVO7Ac65fstxRA==",
13982
- "dev": true,
13983
- "license": "MIT",
13984
- "peerDependencies": {
13985
- "ts-jest": ">=20.0.0"
13986
- }
13987
- },
13988
13363
  "node_modules/ts-node": {
13989
13364
  "version": "10.9.2",
13990
13365
  "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
@@ -70,6 +70,113 @@
70
70
  "install:driver:merge:git"
71
71
  ]
72
72
  },
73
+ "git:merge:driver:run": {
74
+ "aliases": [],
75
+ "args": {},
76
+ "description": "Runs the merge driver for the specified files, handling the merge conflict resolution using Salesforce-specific merge strategies. This command is typically called automatically by Git when a merge conflict is detected.",
77
+ "examples": [
78
+ "Run the merge driver for conflicting files:\n<%= config.bin %> <%= command.id %> --ancestor-file=<value> --our-file=<value> --theirs-file=<value> --output-file=<value>",
79
+ "Where:\n- ancestor-file is the path to the common ancestor version of the file\n- our-file is the path to our version of the file\n- their-file is the path to their version of the file\n- output-file is the path to the file where the merged content will be written"
80
+ ],
81
+ "flags": {
82
+ "json": {
83
+ "description": "Format output as json.",
84
+ "helpGroup": "GLOBAL",
85
+ "name": "json",
86
+ "allowNo": false,
87
+ "type": "boolean"
88
+ },
89
+ "flags-dir": {
90
+ "helpGroup": "GLOBAL",
91
+ "name": "flags-dir",
92
+ "summary": "Import flag values from a directory.",
93
+ "hasDynamicHelp": false,
94
+ "multiple": false,
95
+ "type": "option"
96
+ },
97
+ "ancestor-file": {
98
+ "char": "a",
99
+ "name": "ancestor-file",
100
+ "required": true,
101
+ "summary": "path to the common ancestor version of the file",
102
+ "hasDynamicHelp": false,
103
+ "multiple": false,
104
+ "type": "option"
105
+ },
106
+ "our-file": {
107
+ "char": "o",
108
+ "name": "our-file",
109
+ "required": true,
110
+ "summary": "path to our version of the file",
111
+ "hasDynamicHelp": false,
112
+ "multiple": false,
113
+ "type": "option"
114
+ },
115
+ "theirs-file": {
116
+ "char": "t",
117
+ "name": "theirs-file",
118
+ "required": true,
119
+ "summary": "path to their version of the file",
120
+ "hasDynamicHelp": false,
121
+ "multiple": false,
122
+ "type": "option"
123
+ },
124
+ "output-file": {
125
+ "char": "p",
126
+ "name": "output-file",
127
+ "required": true,
128
+ "summary": "path to the file where the merged content will be written",
129
+ "hasDynamicHelp": false,
130
+ "multiple": false,
131
+ "type": "option"
132
+ }
133
+ },
134
+ "hasDynamicHelp": false,
135
+ "hiddenAliases": [],
136
+ "id": "git:merge:driver:run",
137
+ "pluginAlias": "sf-git-merge-driver",
138
+ "pluginName": "sf-git-merge-driver",
139
+ "pluginType": "core",
140
+ "strict": true,
141
+ "summary": "Runs the merge driver for the specified files.",
142
+ "enableJsonFlag": true,
143
+ "isESM": true,
144
+ "relativePath": [
145
+ "lib",
146
+ "commands",
147
+ "git",
148
+ "merge",
149
+ "driver",
150
+ "run.js"
151
+ ],
152
+ "aliasPermutations": [],
153
+ "permutations": [
154
+ "git:merge:driver:run",
155
+ "merge:git:driver:run",
156
+ "merge:driver:git:run",
157
+ "merge:driver:run:git",
158
+ "git:driver:merge:run",
159
+ "driver:git:merge:run",
160
+ "driver:merge:git:run",
161
+ "driver:merge:run:git",
162
+ "git:driver:run:merge",
163
+ "driver:git:run:merge",
164
+ "driver:run:git:merge",
165
+ "driver:run:merge:git",
166
+ "git:merge:run:driver",
167
+ "merge:git:run:driver",
168
+ "merge:run:git:driver",
169
+ "merge:run:driver:git",
170
+ "git:run:merge:driver",
171
+ "run:git:merge:driver",
172
+ "run:merge:git:driver",
173
+ "run:merge:driver:git",
174
+ "git:run:driver:merge",
175
+ "run:git:driver:merge",
176
+ "run:driver:git:merge",
177
+ "run:driver:merge:git"
178
+ ]
179
+ },
73
180
  "git:merge:driver:uninstall": {
74
181
  "aliases": [],
75
182
  "args": {},
@@ -141,5 +248,5 @@
141
248
  ]
142
249
  }
143
250
  },
144
- "version": "1.0.0-dev-3.13724775513-1"
251
+ "version": "1.0.0-dev-3.13730130635-1"
145
252
  }
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "sf-git-merge-driver",
3
3
  "description": "git remote add origin git@github.com:scolladon/sf-git-merge-driver.git",
4
- "version": "1.0.0-dev-3.13724775513-1",
4
+ "version": "1.0.0-dev-3.13730130635-1",
5
5
  "exports": "./lib/driver/MergeDriver.js",
6
- "bin": {
7
- "sf-git-merge-driver": "./lib/index.js"
8
- },
9
6
  "type": "module",
10
7
  "author": "Sébastien Colladon (colladonsebastien@gmail.com)",
11
8
  "repository": {
@@ -23,10 +20,6 @@
23
20
  "@biomejs/biome": "1.9.4",
24
21
  "@commitlint/config-conventional": "^19.8.0",
25
22
  "@oclif/plugin-help": "^6.2.26",
26
- "@rollup/plugin-commonjs": "^28.0.3",
27
- "@rollup/plugin-node-resolve": "^16.0.0",
28
- "@rollup/plugin-terser": "^0.4.4",
29
- "@rollup/plugin-typescript": "^12.1.2",
30
23
  "@salesforce/cli-plugins-testkit": "^5.3.39",
31
24
  "@salesforce/dev-config": "^4.3.1",
32
25
  "@types/chai": "^5.2.0",
@@ -38,11 +31,8 @@
38
31
  "mocha": "^11.1.0",
39
32
  "nyc": "^17.1.0",
40
33
  "oclif": "^4.17.34",
41
- "rollup": "^4.34.9",
42
- "rollup-plugin-preserve-shebangs": "^0.2.0",
43
34
  "shx": "^0.3.4",
44
35
  "ts-jest": "^29.2.6",
45
- "ts-jest-mock-import-meta": "^1.2.1",
46
36
  "ts-node": "^10.9.2",
47
37
  "tslib": "^2.8.1",
48
38
  "typescript": "^5.8.2",
@@ -79,7 +69,6 @@
79
69
  },
80
70
  "scripts": {
81
71
  "build": "wireit",
82
- "bundle": "wireit",
83
72
  "clean:package-manager": "wireit",
84
73
  "clean": "wireit",
85
74
  "compile": "wireit",
@@ -103,23 +92,10 @@
103
92
  "wireit": {
104
93
  "build": {
105
94
  "dependencies": [
106
- "bundle",
95
+ "compile",
107
96
  "lint"
108
97
  ]
109
98
  },
110
- "bundle": {
111
- "command": "rollup -c",
112
- "files": [
113
- "src/**/*.ts",
114
- "rollup.config.js"
115
- ],
116
- "output": [
117
- "lib/index.js"
118
- ],
119
- "dependencies": [
120
- "compile"
121
- ]
122
- },
123
99
  "clean": {
124
100
  "command": "shx rm -rf 'reports/*' .nyc_output oclif.manifest.json package.tgz 'sfdx-git-delta-*.tgz' 'stderr*.txt' 'stdout*.txt' '.stryker-tmp/*' perf-result.txt",
125
101
  "files": [
package/lib/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/lib/index.js DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{readFile as t,writeFile as e}from"node:fs/promises";const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=new RegExp("^"+("["+n+"]["+(n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*")+"$");function s(t,e){const n=[];let i=e.exec(t);for(;i;){const s=[];s.startIndex=e.lastIndex-i[0].length;const r=i.length;for(let t=0;t<r;t++)s.push(i[t]);n.push(s),i=e.exec(t)}return n}const r=function(t){const e=i.exec(t);return!(null==e)};const o={allowBooleanAttributes:!1,unpairedTags:[]};function a(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function l(t,e){const n=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const i=t.substr(n,e-n);if(e>5&&"xml"===i)return m("InvalidXml","XML declaration allowed only at the start of the document.",b(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function u(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}const h='"',c="'";function f(t,e){let n="",i="",s=!1;for(;e<t.length;e++){if(t[e]===h||t[e]===c)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){s=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:s}}const p=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function d(t,e){const n=s(t,p),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return m("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",N(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return m("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",N(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return m("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",N(n[t]));const s=n[t][2];if(!x(s))return m("InvalidAttr","Attribute '"+s+"' is an invalid name.",N(n[t]));if(i.hasOwnProperty(s))return m("InvalidAttr","Attribute '"+s+"' is repeated.",N(n[t]));i[s]=1}return!0}function g(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function m(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function x(t){return r(t)}function b(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function N(t){return t.startIndex+t[1].length}const E={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t}};class v{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function y(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,s=!1,r=!1,o="";for(;e<t.length;e++)if("<"!==t[e]||r)if(">"===t[e]){if(r?"-"===t[e-1]&&"-"===t[e-2]&&(r=!1,i--):i--,0===i)break}else"["===t[e]?s=!0:o+=t[e];else{if(s&&A(t,e)){let i,s;e+=7,[i,s,e]=T(t,e+1),-1===s.indexOf("&")&&(n[C(i)]={regx:RegExp(`&${i};`,"g"),val:s})}else if(s&&O(t,e))e+=8;else if(s&&P(t,e))e+=8;else if(s&&I(t,e))e+=9;else{if(!w)throw new Error("Invalid DOCTYPE");r=!0}i++,o=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}function T(t,e){let n="";for(;e<t.length&&"'"!==t[e]&&'"'!==t[e];e++)n+=t[e];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const i=t[e++];let s="";for(;e<t.length&&t[e]!==i;e++)s+=t[e];return[n,s,e]}function w(t,e){return"!"===t[e+1]&&"-"===t[e+2]&&"-"===t[e+3]}function A(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7]}function O(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8]}function P(t,e){return"!"===t[e+1]&&"A"===t[e+2]&&"T"===t[e+3]&&"T"===t[e+4]&&"L"===t[e+5]&&"I"===t[e+6]&&"S"===t[e+7]&&"T"===t[e+8]}function I(t,e){return"!"===t[e+1]&&"N"===t[e+2]&&"O"===t[e+3]&&"T"===t[e+4]&&"A"===t[e+5]&&"T"===t[e+6]&&"I"===t[e+7]&&"O"===t[e+8]&&"N"===t[e+9]}function C(t){if(r(t))return t;throw new Error(`Invalid entity name ${t}`)}const S=/^[-+]?0x[a-fA-F0-9]+$/,j=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,F={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function V(t,e={}){if(e=Object.assign({},F,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if("0"===t)return 0;if(e.hex&&S.test(n))return function(t,e){if(parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(n,16);if(-1!==n.search(/[eE]/)){const i=n.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(i){if(e.leadingZeros)n=(i[1]||"")+i[3];else if("0"!==i[2]||"."!==i[3][0])return t;return e.eNotation?Number(n):t}return t}{const i=j.exec(n);if(i){const s=i[1],r=i[2];let o=function(t){if(t&&-1!==t.indexOf("."))return"."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t;return t}(i[3]);if(!e.leadingZeros&&r.length>0&&s&&"."!==n[2])return t;if(!e.leadingZeros&&r.length>0&&!s&&"."!==n[1])return t;if(e.leadingZeros&&r===t)return 0;{const i=Number(n),a=""+i;return-1!==a.search(/[eE]/)?e.eNotation?i:t:-1!==n.indexOf(".")?"0"===a&&""===o||a===o||s&&a==="-"+o?i:t:r?o===a||s+o===a?i:t:n===a||n===s+a?i:t}}return t}}function $(t){return"function"==typeof t?t:Array.isArray(t)?e=>{for(const n of t){if("string"==typeof n&&e===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}}:()=>!1}class k{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,16))}},this.addExternalEntities=_,this.parseXml=G,this.parseTextData=D,this.resolveNameSpace=B,this.buildAttributesMap=M,this.isItStopNode=Z,this.replaceEntitiesValue=X,this.readStopNodeData=W,this.saveTextToParentTag=U,this.addChild=R,this.ignoreAttributesFn=$(this.options.ignoreAttributes)}}function _(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function D(t,e,n,i,s,r,o){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,s,r);if(null==i)return t;if(typeof i!=typeof t||i!==t)return i;if(this.options.trimValues)return z(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?z(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function B(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const L=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function M(t,e,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const n=s(t,L),i=n.length,r={};for(let t=0;t<i;t++){const i=this.resolveNameSpace(n[t][1]);if(this.ignoreAttributesFn(i,e))continue;let s=n[t][4],o=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s);const t=this.options.attributeValueProcessor(i,s,e);r[o]=null==t?s:typeof t!=typeof s||t!==s?t:z(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[o]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=r,t}return r}}const G=function(t){t=t.replace(/\r\n?/g,"\n");const e=new v("!xml");let n=e,i="",s="";for(let r=0;r<t.length;r++){if("<"===t[r])if("/"===t[r+1]){const e=Y(t,">",r,"Closing Tag is not closed.");let o=t.substring(r+2,e).trim();if(this.options.removeNSPrefix){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(i=this.saveTextToParentTag(i,n,s));const a=s.substring(s.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),n=this.tagsNodeStack.pop(),i="",r=e}else if("?"===t[r+1]){let e=q(t,r,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new v(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s,e.tagName)),this.addChild(n,t,s)}r=e.closeIndex+1}else if("!--"===t.substr(r+1,3)){const e=Y(t,"--\x3e",r+4,"Comment is not closed.");if(this.options.commentPropName){const o=t.substring(r+4,e-2);i=this.saveTextToParentTag(i,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}r=e}else if("!D"===t.substr(r+1,2)){const e=y(t,r);this.docTypeEntities=e.entities,r=e.i}else if("!["===t.substr(r+1,2)){const e=Y(t,"]]>",r,"CDATA is not closed.")-2,o=t.substring(r+9,e);i=this.saveTextToParentTag(i,n,s);let a=this.parseTextData(o,n.tagname,s,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):n.add(this.options.textNodeName,a),r=e+2}else{let o=q(t,r,this.options.removeNSPrefix),a=o.tagName;const l=o.rawTagName;let u=o.tagExp,h=o.attrExpPresent,c=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,s,!1));const f=n;if(f&&-1!==this.options.unpairedTags.indexOf(f.tagname)&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==e.tagname&&(s+=s?"."+a:a),this.isItStopNode(this.options.stopNodes,s,a)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),r=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))r=o.closeIndex;else{const n=this.readStopNodeData(t,l,c+1);if(!n)throw new Error(`Unexpected end of ${l}`);r=n.i,e=n.tagContent}const i=new v(a);a!==u&&h&&(i[":@"]=this.buildAttributesMap(u,s,a)),e&&(e=this.parseTextData(e,a,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,s)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const t=new v(a);a!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s,a)),this.addChild(n,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new v(a);this.tagsNodeStack.push(n),a!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s,a)),this.addChild(n,t,s),n=t}i="",r=c}}else i+=t[r]}return e.child};function R(t,e,n){const i=this.options.updateTag(e.tagname,n,e[":@"]);!1===i||("string"==typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e))}const X=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function U(t,e,n,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function Z(t,e,n){const i="*."+n;for(const n in t){const s=t[n];if(i===s||e===s)return!0}return!1}function Y(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s+e.length-1}function q(t,e,n,i=">"){const s=function(t,e,n=">"){let i,s="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:s,index:r};if(t[r+1]===n[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,i);if(!s)return;let r=s.data;const o=s.index,a=r.search(/\s/);let l=r,u=!0;-1!==a&&(l=r.substring(0,a),r=r.substring(a+1).trimStart());const h=l;if(n){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),u=l!==s.data.substr(t+1))}return{tagName:l,tagExp:r,closeIndex:o,attrExpPresent:u,rawTagName:h}}function W(t,e,n){const i=n;let s=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const r=Y(t,">",n,`${e} is not closed`);if(t.substring(n+2,r).trim()===e&&(s--,0===s))return{tagContent:t.substring(i,n),i:r};n=r}else if("?"===t[n+1]){n=Y(t,"?>",n+1,"StopNode is not closed.")}else if("!--"===t.substr(n+1,3)){n=Y(t,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===t.substr(n+1,2)){n=Y(t,"]]>",n,"StopNode is not closed.")-2}else{const i=q(t,n,">");if(i){(i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&s++,n=i.closeIndex}}}function z(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&V(t,n)}return void 0!==t?t:""}function J(t,e){return H(t,e)}function H(t,e,n){let i;const s={};for(let r=0;r<t.length;r++){const o=t[r],a=K(o);let l="";if(l=void 0===n?a:n+"."+a,a===e.textNodeName)void 0===i?i=o[a]:i+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=H(o[a],e,l);const n=tt(t,e);o[":@"]?Q(t,o[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==s[a]&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(t)):e.isArray(a,l,n)?s[a]=[t]:s[a]=t}}}return"string"==typeof i?i.length>0&&(s[e.textNodeName]=i):void 0!==i&&(s[e.textNodeName]=i),s}function K(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function Q(t,e,n,i){if(e){const s=Object.keys(e),r=s.length;for(let o=0;o<r;o++){const r=s[o];i.isArray(r,n+"."+r,!0,!0)?t[r]=[e[r]]:t[r]=e[r]}}}function tt(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n])}class et{constructor(t){this.externalEntities={},this.options=function(t){return Object.assign({},E,t)}(t)}parse(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const n=function(t,e){e=Object.assign({},o,e);const n=[];let i=!1,s=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if(o+=2,o=l(t,o),o.err)return o}else{if("<"!==t[o]){if(a(t[o]))continue;return m("InvalidChar","char '"+t[o]+"' is not expected.",b(t,o))}{let h=o;if(o++,"!"===t[o]){o=u(t,o);continue}{let c=!1;"/"===t[o]&&(c=!0,o++);let p="";for(;o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)p+=t[o];if(p=p.trim(),"/"===p[p.length-1]&&(p=p.substring(0,p.length-1),o--),!r(p)){let e;return e=0===p.trim().length?"Invalid space after '<'.":"Tag '"+p+"' is an invalid name.",m("InvalidTag",e,b(t,o))}const x=f(t,o);if(!1===x)return m("InvalidAttr","Attributes for '"+p+"' have open quote.",b(t,o));let N=x.value;if(o=x.index,"/"===N[N.length-1]){const n=o-N.length;N=N.substring(0,N.length-1);const s=d(N,e);if(!0!==s)return m(s.err.code,s.err.msg,b(t,n+s.err.line));i=!0}else if(c){if(!x.tagClosed)return m("InvalidTag","Closing tag '"+p+"' doesn't have proper closing.",b(t,o));if(N.trim().length>0)return m("InvalidTag","Closing tag '"+p+"' can't have attributes or invalid starting.",b(t,h));if(0===n.length)return m("InvalidTag","Closing tag '"+p+"' has not been opened.",b(t,h));{const e=n.pop();if(p!==e.tagName){let n=b(t,e.tagStartPos);return m("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+p+"'.",b(t,h))}0==n.length&&(s=!0)}}else{const r=d(N,e);if(!0!==r)return m(r.err.code,r.err.msg,b(t,o-N.length+r.err.line));if(!0===s)return m("InvalidXml","Multiple possible root nodes found.",b(t,o));-1!==e.unpairedTags.indexOf(p)||n.push({tagName:p,tagStartPos:h}),i=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o++,o=u(t,o);continue}if("?"!==t[o+1])break;if(o=l(t,++o),o.err)return o}else if("&"===t[o]){const e=g(t,o);if(-1==e)return m("InvalidChar","char '&' is not expected.",b(t,o));o=e}else if(!0===s&&!a(t[o]))return m("InvalidXml","Extra text at the end",b(t,o));"<"===t[o]&&o--}}}return i?1==n.length?m("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",b(t,n[0].tagStartPos)):!(n.length>0)||m("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):m("InvalidXml","Start tag expected.",1)}(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new k(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:J(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}}function nt(t,e){let n="";return e.format&&e.indentBy.length>0&&(n="\n"),it(t,e,"",n)}function it(t,e,n,i){let s="",r=!1;for(let o=0;o<t.length;o++){const a=t[o],l=st(a);if(void 0===l)continue;let u="";if(u=0===n.length?l:`${n}.${l}`,l===e.textNodeName){let t=a[l];ot(u,e)||(t=e.tagValueProcessor(l,t),t=at(t,e)),r&&(s+=i),s+=t,r=!1;continue}if(l===e.cdataPropName){r&&(s+=i),s+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,r=!1;continue}if(l===e.commentPropName){s+=i+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,r=!0;continue}if("?"===l[0]){const t=rt(a[":@"],e),n="?xml"===l?"":i;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",s+=n+`<${l}${o}${t}?>`,r=!0;continue}let h=i;""!==h&&(h+=e.indentBy);const c=i+`<${l}${rt(a[":@"],e)}`,f=it(a[l],e,u,h);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?s+=c+">":s+=c+"/>":f&&0!==f.length||!e.suppressEmptyNode?f&&f.endsWith(">")?s+=c+`>${f}${i}</${l}>`:(s+=c+">",f&&""!==i&&(f.includes("/>")||f.includes("</"))?s+=i+e.indentBy+f+i:s+=f,s+=`</${l}>`):s+=c+"/>",r=!0}return s}function st(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];if(t.hasOwnProperty(i)&&":@"!==i)return i}}function rt(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){if(!t.hasOwnProperty(i))continue;let s=e.attributeValueProcessor(i,t[i]);s=at(s,e),!0===s&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}="${s}"`}return n}function ot(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function at(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}const lt={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ut(t){this.options=Object.assign({},lt,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=$(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ft),this.processTextOrObjNode=ht,this.options.format?(this.indentate=ct,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function ht(t,e,n,i){const s=this.j2x(t,n+1,i.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,s.attrStr,n):this.buildObjectNode(s.val,e,s.attrStr,n)}function ct(t){return this.options.indentBy.repeat(t)}function ft(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}ut.prototype.build=function(t){return this.options.preserveOrder?nt(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)},ut.prototype.j2x=function(t,e,n){let i="",s="";const r=n.join(".");for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(void 0===t[o])this.isAttribute(o)&&(s+="");else if(null===t[o])this.isAttribute(o)||o===this.options.cdataPropName?s+="":"?"===o[0]?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)s+=this.buildTextValNode(t[o],o,"",e);else if("object"!=typeof t[o]){const n=this.isAttribute(o);if(n&&!this.ignoreAttributesFn(n,r))i+=this.buildAttrPairStr(n,""+t[o]);else if(!n)if(o===this.options.textNodeName){let e=this.options.tagValueProcessor(o,""+t[o]);s+=this.replaceEntitiesValue(e)}else s+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){const i=t[o].length;let r="",a="";for(let l=0;l<i;l++){const i=t[o][l];if(void 0===i);else if(null===i)"?"===o[0]?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if("object"==typeof i)if(this.options.oneListGroup){const t=this.j2x(i,e+1,n.concat(o));r+=t.val,this.options.attributesGroupName&&i.hasOwnProperty(this.options.attributesGroupName)&&(a+=t.attrStr)}else r+=this.processTextOrObjNode(i,o,e,n);else if(this.options.oneListGroup){let t=this.options.tagValueProcessor(o,i);t=this.replaceEntitiesValue(t),r+=t}else r+=this.buildTextValNode(i,o,"",e)}this.options.oneListGroup&&(r=this.buildObjectNode(r,o,a,e)),s+=r}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const e=Object.keys(t[o]),n=e.length;for(let s=0;s<n;s++)i+=this.buildAttrPairStr(e[s],""+t[o][e[s]])}else s+=this.processTextOrObjNode(t[o],o,e,n);return{attrStr:i,val:s}},ut.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},ut.prototype.buildObjectNode=function(t,e,n,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let s="</"+e+this.tagEndChar,r="";return"?"===e[0]&&(r="?",s=""),!n&&""!==n||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===r.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+n+r+this.tagEndChar+t+this.indentate(i)+s:this.indentate(i)+"<"+e+n+r+">"+t+s}},ut.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},ut.prototype.buildTextValNode=function(t,e,n,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),""===s?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+s+"</"+e+this.tagEndChar}},ut.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};class pt{idFields=["fullName","name","field","label","id","@_name"];mergeObjects(t,e,n){if(null===e||null===n)return e??n;if(typeof e!=typeof n)return e;if(Array.isArray(e)&&Array.isArray(n))return this.mergeArrays(Array.isArray(t)?t:void 0,e,n);if("object"==typeof e&&"object"==typeof n){const i={...e},s=t??{},r=n,o=new Set([...Object.keys(e),...Object.keys(n)]);for(const t of o)t in r&&(i[t]=t in i?this.mergeObjects(s[t],i[t],r[t]):r[t]);return i}return n!==t&&e===t?n:e}mergeArrays(t,e,n){const i=this.idFields.find((t=>e.some((e=>this.hasIdField(e,t)))&&n.some((e=>this.hasIdField(e,t)))));if(!i)return e;const s=this.createIdMap(e,i),r=this.createIdMap(n,i),o=t?this.createIdMap(t,i):new Map,a=[...e],l=new Set;for(const[t,e]of s){const n=r.get(t);if(n){const s=a.findIndex((e=>this.hasIdField(e,i)&&e[i]===t));-1!==s&&(a[s]=this.mergeObjects(o.get(t),e,n))}l.add(t)}for(const[t,e]of r)l.has(t)||a.push(e);return a}hasIdField(t,e){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&e in t}createIdMap(t,e){return new Map(t.filter((t=>this.hasIdField(t,e))).map((t=>[String(t[e]),t])))}}const dt={attributeNamePrefix:"@_",commentPropName:"#comment",format:!0,ignoreAttributes:!1,ignoreNameSpace:!1,indentBy:" ",parseAttributeValue:!1,parseNodeValue:!1,parseTagValue:!1,processEntities:!1,suppressEmptyNode:!1,trimValues:!0};class gt{async tripartXmlMerge(t,e,n){const i=new et(dt),s=i.parse(t),r=i.parse(e),o=i.parse(n),a=(new pt).mergeObjects(s,r,o);return new ut(dt).build(a)}}class mt{async mergeFiles(n,i,s,r){const[o,a,l]=await Promise.all([t(n,"utf8"),t(i,"utf8"),t(s,"utf8")]),u=new gt,h=await u.tripartXmlMerge(o,a,l);await e(r,h)}}if(process.argv.length>=6){const[,,t,e,n,i]=process.argv;(new mt).mergeFiles(t,e,n,i).then((()=>process.exit(0)))}else console.error("Usage: sf-git-merge-driver %O %A %B %P"),console.error(" %O: ancestor file"),console.error(" %A: our file"),console.error(" %B: their file"),console.error(" %P: output file path"),process.exit(1);
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;IAC7B,MAAM,CAAC,EAAE,AAAD,EAAG,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAA;IACvE,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAA;IACrC,WAAW;SACR,UAAU,CAAC,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC;SACxD,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAChC,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAA;IACvD,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAA;IACpC,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;IAC/B,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;IACjC,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC"}