ddd-ts-kit 0.113.1 → 0.113.2

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.
Files changed (88) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/help/work-notes.d.ts.map +1 -1
  3. package/dist/help/work-notes.js +7 -5
  4. package/dist/help/work-notes.js.map +1 -1
  5. package/dist/init/manifest/versions.js +25 -25
  6. package/dist/merge/declarations/binds-the-name.d.ts +8 -0
  7. package/dist/merge/declarations/binds-the-name.d.ts.map +1 -0
  8. package/dist/merge/declarations/binds-the-name.js +40 -0
  9. package/dist/merge/declarations/binds-the-name.js.map +1 -0
  10. package/dist/merge/declarations/close-of.d.ts +3 -0
  11. package/dist/merge/declarations/close-of.d.ts.map +1 -0
  12. package/dist/merge/declarations/close-of.js +15 -0
  13. package/dist/merge/declarations/close-of.js.map +1 -0
  14. package/dist/merge/declarations/declarations-of.d.ts +2 -0
  15. package/dist/merge/declarations/declarations-of.d.ts.map +1 -1
  16. package/dist/merge/declarations/declarations-of.js +1 -1
  17. package/dist/merge/declarations/declarations-of.js.map +1 -1
  18. package/dist/merge/declarations/declares-a-member.d.ts +7 -0
  19. package/dist/merge/declarations/declares-a-member.d.ts.map +1 -0
  20. package/dist/merge/declarations/declares-a-member.js +29 -0
  21. package/dist/merge/declarations/declares-a-member.js.map +1 -0
  22. package/dist/merge/declarations/enclosing-group.d.ts +8 -0
  23. package/dist/merge/declarations/enclosing-group.d.ts.map +1 -0
  24. package/dist/merge/declarations/enclosing-group.js +16 -0
  25. package/dist/merge/declarations/enclosing-group.js.map +1 -0
  26. package/dist/merge/declarations/imports-read-as-merged.d.ts +9 -0
  27. package/dist/merge/declarations/imports-read-as-merged.d.ts.map +1 -0
  28. package/dist/merge/declarations/imports-read-as-merged.js +23 -0
  29. package/dist/merge/declarations/imports-read-as-merged.js.map +1 -0
  30. package/dist/merge/declarations/inverts-a-reference.d.ts +12 -0
  31. package/dist/merge/declarations/inverts-a-reference.d.ts.map +1 -0
  32. package/dist/merge/declarations/inverts-a-reference.js +25 -0
  33. package/dist/merge/declarations/inverts-a-reference.js.map +1 -0
  34. package/dist/merge/declarations/lead-of.d.ts +15 -0
  35. package/dist/merge/declarations/lead-of.d.ts.map +1 -0
  36. package/dist/merge/declarations/lead-of.js +19 -0
  37. package/dist/merge/declarations/lead-of.js.map +1 -0
  38. package/dist/merge/declarations/lines-of-both-sides.d.ts +10 -0
  39. package/dist/merge/declarations/lines-of-both-sides.d.ts.map +1 -0
  40. package/dist/merge/declarations/lines-of-both-sides.js +22 -0
  41. package/dist/merge/declarations/lines-of-both-sides.js.map +1 -0
  42. package/dist/merge/declarations/merge-declarations.d.ts.map +1 -1
  43. package/dist/merge/declarations/merge-declarations.js +1 -15
  44. package/dist/merge/declarations/merge-declarations.js.map +1 -1
  45. package/dist/merge/declarations/merged-file.d.ts +15 -0
  46. package/dist/merge/declarations/merged-file.d.ts.map +1 -0
  47. package/dist/merge/declarations/merged-file.js +55 -0
  48. package/dist/merge/declarations/merged-file.js.map +1 -0
  49. package/dist/merge/declarations/merged-lines.d.ts +5 -11
  50. package/dist/merge/declarations/merged-lines.d.ts.map +1 -1
  51. package/dist/merge/declarations/merged-lines.js +6 -39
  52. package/dist/merge/declarations/merged-lines.js.map +1 -1
  53. package/dist/merge/declarations/merged-region.d.ts +2 -1
  54. package/dist/merge/declarations/merged-region.d.ts.map +1 -1
  55. package/dist/merge/declarations/merged-region.js +60 -22
  56. package/dist/merge/declarations/merged-region.js.map +1 -1
  57. package/dist/merge/declarations/reads-a-removed.d.ts +8 -0
  58. package/dist/merge/declarations/reads-a-removed.d.ts.map +1 -0
  59. package/dist/merge/declarations/reads-a-removed.js +27 -0
  60. package/dist/merge/declarations/reads-a-removed.js.map +1 -0
  61. package/dist/merge/declarations/reads-the-name.d.ts +10 -0
  62. package/dist/merge/declarations/reads-the-name.d.ts.map +1 -0
  63. package/dist/merge/declarations/reads-the-name.js +23 -0
  64. package/dist/merge/declarations/reads-the-name.js.map +1 -0
  65. package/dist/merge/declarations/settle-declarations.d.ts +9 -5
  66. package/dist/merge/declarations/settle-declarations.d.ts.map +1 -1
  67. package/dist/merge/declarations/settle-declarations.js +39 -13
  68. package/dist/merge/declarations/settle-declarations.js.map +1 -1
  69. package/dist/merge/declarations/sides-of-region.d.ts +5 -0
  70. package/dist/merge/declarations/sides-of-region.d.ts.map +1 -0
  71. package/dist/merge/declarations/sides-of-region.js +19 -0
  72. package/dist/merge/declarations/sides-of-region.js.map +1 -0
  73. package/dist/merge/declarations/union-in-doubt.d.ts +17 -0
  74. package/dist/merge/declarations/union-in-doubt.d.ts.map +1 -0
  75. package/dist/merge/declarations/union-in-doubt.js +84 -0
  76. package/dist/merge/declarations/union-in-doubt.js.map +1 -0
  77. package/dist/merge/declarations/union-reads-as-merged.d.ts +23 -0
  78. package/dist/merge/declarations/union-reads-as-merged.d.ts.map +1 -0
  79. package/dist/merge/declarations/union-reads-as-merged.js +155 -0
  80. package/dist/merge/declarations/union-reads-as-merged.js.map +1 -0
  81. package/dist/merge/resolve-conflict.d.ts +2 -1
  82. package/dist/merge/resolve-conflict.d.ts.map +1 -1
  83. package/dist/merge/resolve-conflict.js +5 -3
  84. package/dist/merge/resolve-conflict.js.map +1 -1
  85. package/dist/version.d.ts +1 -1
  86. package/dist/version.js +1 -1
  87. package/package.json +6 -6
  88. package/templates/pipeline/package-scripts.json +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,45 @@ What each version changes for someone who uses the kit. The packages of `package
4
4
  together, under one version; the notes of each [GitHub release](https://github.com/gbourgeat/ddd-ts-kit/releases)
5
5
  list the pull requests behind it.
6
6
 
7
+ ## 0.113.2
8
+
9
+ **`ddd-ts-kit merge-trunk` reads back the lines of both sides it keeps in a generated region, and merges the region declaration by declaration when those lines would mix the two sides.**
10
+
11
+ What you see. Your branch and the trunk conflict inside a generated region of a TypeScript, JavaScript or Prisma file (the tables of a context, the handlers of a module). `merge-trunk` keeps the lines of both sides of each conflict, and until now it committed the region whenever its brackets paired, exit 0, `generated registry: the lines of both sides kept`. After a hand edit inside the region that could be wrong: your branch adds a column above `version` in the table of the orders and stores an aggregate below it, the trunk adds a column at the same place, and the column of the trunk was written in the new table (on Knex the project still type-checked). From this version:
12
+
13
+ - a column, an argument or a statement of one side is no longer written inside a table, a function or a call of the other;
14
+ - a table one side removed and the other only moved does not come back, and a table is not written twice;
15
+ - a comment stays above the declaration it was written above, and a constant a side added under a table stays below that table when the other side moved it;
16
+ - a chain or a call written on several lines keeps its lines when the other side added one that shares some of them.
17
+
18
+ Three things can happen where the two sides conflict in such a region.
19
+
20
+ 1. Nothing changes: the same file and the same report line as before, whenever the lines of both sides hold each declaration of the two sides whole and once, none above one it reads; the order of the lines of both sides is otherwise kept. Everything the generators write alone is in this case.
21
+ 2. The region is merged declaration by declaration, and the report says `generated registry: the declarations of both sides kept, each one whole`: the table one side added is kept whole, the one a side changed or removed while the other left it alone follows that side, the declarations stand in the order of the side that alone changed it, and what a side alone added stands after the declaration it follows on that side.
22
+ 3. The merge stops, exit 1, on one hunk per declaration the two sides do not agree on, the rest of the region being merged. The hunk holds each version of the declaration whole: ``the two sides do not agree on `orders` in the region `tables`: for each, write the one declaration that keeps the intent of both, whole, or remove it.`` Write the declaration once with what both sides meant, `git add` the file, then `npx ddd-ts-kit merge-trunk --continue`. This is what the example above now gives: one hunk on the table of the orders, with the version of each side, and the new table whole below it. The same holds for a table one side removed and the other changed. When a region has to be merged this way and each side set its declarations in an order of its own, nothing is written in the region and the hunks git wrote stay, as since 0.113.1.
23
+
24
+ When. Each conflicted region whose three sides the kit reads with certainty is read back, declaration by declaration, a comment belonging to the declaration it stands above. The lines of both sides are kept when the region they give holds, for each declaration, what the three sides merge into: the one a side added, changed or removed while the other left it as the base holds it, the one both wrote alike, and for one both changed the lines the kit keeps of that declaration merged alone (what git merges of its three versions and the lines of both sides of each conflict left). The order of the lines of both sides is kept, with one rule: a declaration that reads another one stands below it, as on the side that wrote it. The lines are not kept when a declaration names, in its code, one that stands below it in the region they give while every side that holds the two sets it above; a function a side wrote above the one it calls is as that side wrote it. A comment both sides wrote, word for word, above the declaration each added is kept once, above the first, as before. Blank lines are not compared: the lines of both sides keep one of each run, so a comment a side set apart from its declaration by a blank line stands right above it. In the `imports` region the lines are kept when they bring the same names from the same modules as the statements of both sides.
25
+
26
+ Three stops are new.
27
+
28
+ - A rename against a change, where the lines of both sides were right: one side gives a table another name by hand and the other side adds a column to it by hand (you rename `payments` to `invoices`, the trunk adds `paidAt` to `payments`). The kit cannot tell a declaration given another name from one replaced by another, so it leaves the table the trunk changed as one hunk, the rest of the region merged, and says so: `If a declaration of the side that removed it is this one under another name, write the change there and remove the hunk.`
29
+ - A declaration one side removed and the other started to read: one side removed a declaration the other left alone, and that other side wrote or changed a declaration that now reads it. Nothing is written in the region and the hunks git wrote stay: ``the region `tables` holds a declaration one side removed and that a declaration the other side wrote reads``; keep the one removed, or write the other without it.
30
+ - A declaration that would stand above one it reads: when the region merged declaration by declaration would set it there while the sides set it below, nothing is written in the region and the hunks git wrote stay: ``the region `tables` holds a declaration that would stand above one it reads once the two sides are merged``; write the region in the order that holds for both.
31
+
32
+ Limits.
33
+
34
+ - A merge git settles with no conflict is never read back: where git itself sets a column in the wrong table, nothing reports it.
35
+ - A region the kit does not read with certainty is merged by lines, as before, whatever its conflicts look like: one that holds a regular expression, a constant and a type or an interface of one name, the signatures of one function, one statement written twice, a region written inside it, or that a side does not hold once. So is a region in which a side holds lines that end no statement (entries of a list, statements written without `;`), whether the two sides differ on them or not.
36
+ - Two edits of one line are both kept, as before: each side adds an argument to a call written on one line, and the call stands twice.
37
+ - Statements that declare no name (a call, a registration) have no name to be paired by: one a side removed and the other changed is kept as changed, and a comment a side wrote above one may stay above its neighbour.
38
+ - Inside one declaration both sides changed, the lines of both sides are kept unless a conflict there breaks a statement written on several lines. The kit sees such a statement when it holds a bracket open from one line to the next; when a line starts with `|`, `&`, `?`, `:`, `.`, `+`, `-`, `*`, `/`, `=`, `satisfies` or `as` (three dots start an entry of their own); when a line ends with `=`, `+`, `-`, `*`, `|`, `&`, `?`, `:`, `.` or `=>`; when it is a block comment; or when a line starts with `@`, does not end with `;` and has a line under it. In a schema of Prisma, only the bracket and the block comment. Another way of writing a statement on several lines is not seen.
39
+ - Inside one declaration both sides changed, the lines of a conflict stand ours first, then the trunk's, as before: a line one side added under a line the other changed can stand above it, and a line one side removed and the other changed is kept as changed.
40
+ - A declaration both sides changed, one of them by setting a comment above it apart by a blank line, can be left as one hunk where the lines of both sides were right: git aligns the conflicts of the file otherwise than those of the declaration merged alone, and the kit then does not read the two as the same (4 in 12000 conflicts measured).
41
+ - Two import statements that name one module, one wrapped on several lines and the other not, are both kept, and a name can then be imported twice, as before.
42
+ - What a declaration reads is found by name, in its code, comments and strings left out, and no scope is read. A read is the name as a whole word: in an expression, in a type (`typeof orders`), spread (`...orders`), as a shorthand property (`{ orders }`). A member of another value is not a read (`other.orders`, `other?.orders`), nor a member the code declares under that name: a key (`orders: 1`), a member of an interface or of a type, a method or an accessor, a field of a class, a member of an enum. A declaration that binds the name itself is taken to read no outer declaration of that name at all: a parameter, with or without a type or a default, the parameter of an arrow (`orders =>`), a local `const`, `let`, `var`, `function` or `class`, a destructured binding, a catch clause, a label, an alias of an import or an export. A real read written beside such a binding is therefore not seen, and the region is merged as before this change.
43
+
44
+ To move: nothing.
45
+
7
46
  ## 0.113.1
8
47
 
9
48
  **`ddd-ts-kit merge-trunk` keeps each table whole when both sides added one to the same context.** Two branches that each stored an aggregate in one context each add a table to its tables file, at the same place. git sets the two side by side and keeps the lines they share once, their last ones, and the merge then kept "the lines of both sides" of the conflict: the tables file it committed, exit 0, held two tables with the closing lines of one (`TS1005 '}' expected`), on the four ORM: the tables file of the context on Drizzle and on TypeORM, `create-<context>-tables.schema.ts` on Knex, `prisma/schema/<context>.prisma` on Prisma, the context flat or laid out in modules. The schema index was right, and still is.
@@ -1 +1 @@
1
- {"version":3,"file":"work-notes.d.ts","sourceRoot":"","sources":["../../src/help/work-notes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,yFAAyF;AACzF,eAAO,MAAM,UAAU,EAAE,SAAS,IAAI,EAgNrC,CAAC"}
1
+ {"version":3,"file":"work-notes.d.ts","sourceRoot":"","sources":["../../src/help/work-notes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,yFAAyF;AACzF,eAAO,MAAM,UAAU,EAAE,SAAS,IAAI,EAkNrC,CAAC"}
@@ -188,11 +188,13 @@ export const WORK_NOTES = [
188
188
  'lines are on the trunk; else git merge-base). Settles derived files and drizzle-kit meta',
189
189
  '(trunk side), the package.json of a client (trunk side, at the higher of both versions;',
190
190
  'left to you when one is not a semantic version), generated regions of CONTEXT.md and the',
191
- 'context map (trunk side), conflicts inside generated registries (lines of both sides;',
192
- 'where those lines would leave a declaration open, two tables added at one place, the',
193
- 'region merged declaration by declaration, what is not read with certainty left to you as',
194
- 'git wrote it), slices.md row by row (the furthest status), the stored-events lock by key,',
195
- 'the lockfile',
191
+ 'context map (trunk side), conflicts inside generated registries (lines of both sides,',
192
+ 'read back: where they would leave a declaration open or do not give the declarations of',
193
+ 'the two sides merged one by one, the region merged declaration by declaration, one the',
194
+ 'two sides do not agree on left to you as one hunk; a region not read with certainty is',
195
+ 'merged by lines as before, one the kit merges neither way is left as git wrote it),',
196
+ 'slices.md row by row (the furthest',
197
+ 'status), the stored-events lock by key, the lockfile',
196
198
  '(trunk side, installed again when the branch changed package.json); the rest is left in a',
197
199
  'merge in progress git understands, with what each side did (exit 1). Then, or on',
198
200
  '--continue: the drizzle migrations of both sides replayed, on --to-land the working',
@@ -1 +1 @@
1
- {"version":3,"file":"work-notes.js","sourceRoot":"","sources":["../../src/help/work-notes.ts"],"names":[],"mappings":"AAEA,yFAAyF;AACzF,MAAM,CAAC,MAAM,UAAU,G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AwF;YACxF,yEAAyE;SAC1E;KACF;IACD;QACE,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,aAAa;QACtB,KAAK,EAAE;YACL,8FAA8F;YAC9F,4EAA4E;YAC5E,2FAA2F;YAC3F,kFAAkF;YAClF,4FAA4F;YAC5F,2FAA2F;YAC3F,0FAA0F;YAC1F,yFAAyF;YACzF,0FAA0F;YAC1F,uFAAuF;YACvF,sFAAsF;YACtF,0FAA0F;YAC1F,2FAA2F;YAC3F,cAAc;YACd,2FAA2F;YAC3F,kFAAkF;YAClF,qFAAqF;YACrF,6FAA6F;YAC7F,yFAAyF;YACzF,4FAA4F;YAC5F,sFAAsF;YACtF,0FAA0F;YAC1F,oEAAoE;YACpE,4FAA4F;YAC5F,6FAA6F;YAC7F,4DAA4D;SAC7D;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"work-notes.js","sourceRoot":"","sources":["../../src/help/work-notes.ts"],"names":[],"mappings":"AAEA,yFAAyF;AACzF,MAAM,CAAC,MAAM,UAAU,GAAoB;IACzC;QACE,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,cAAc;QACvB,KAAK,EAAE;YACL,+FAA+F;YAC/F,8FAA8F;YAC9F,0FAA0F;YAC1F,0FAA0F;YAC1F,0FAA0F;YAC1F,6FAA6F;YAC7F,yFAAyF;YACzF,sFAAsF;YACtF,qEAAqE;SACtE;KACF;IACD;QACE,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,cAAc;QACvB,KAAK,EAAE;YACL,2FAA2F;YAC3F,kFAAkF;YAClF,uFAAuF;SACxF;KACF;IACD;QACE,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,aAAa;QACtB,KAAK,EAAE;YACL,4FAA4F;YAC5F,qFAAqF;YACrF,0FAA0F;YAC1F,0FAA0F;YAC1F,wFAAwF;YACxF,wFAAwF;YACxF,uFAAuF;YACvF,qFAAqF;YACrF,wFAAwF;YACxF,sFAAsF;YACtF,WAAW;SACZ;KACF;IACD;QACE,IA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,+DAA+D;YAC/D,iDAAiD;SAClD;KACF;IACD;QACE,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE;YACL,yFAAyF;YACzF,sFAAsF;YACtF,uFAAuF;YACvF,sFAAsF;YACtF,wFAAwF;YACxF,qFAAqF;YACrF,uFAAuF;YACvF,uFAAuF;YACvF,6DAA6D;SAC9D;KACF;IACD;QACE,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,cAAc;QACvB,KAAK,EAAE;YACL,wFAAwF;YACxF,0FAA0F;YAC1F,wFAAwF;YACxF,uFAAuF;YACvF,uFAAuF;YACvF,mFAAmF;YACnF,yFAAyF;YACzF,mFAAmF;YACnF,qFAAqF;YACrF,uFAAuF;YACvF,yFAAyF;YACzF,uFAAuF;YACvF,mFAAmF;YACnF,wFAAwF;YACxF,2FAA2F;YAC3F,uFAAuF;YACvF,4DAA4D;YAC5D,iFAAiF;YACjF,wFAAwF;YACxF,0FAA0F;YAC1F,2FAA2F;YAC3F,wFAAwF;YACxF,yEAAyE;SAC1E;KACF;IACD;QACE,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,aAAa;QACtB,KAAK,EAAE;YACL,8FAA8F;YAC9F,4EAA4E;YAC5E,2FAA2F;YAC3F,kFAAkF;YAClF,4FAA4F;YAC5F,2FAA2F;YAC3F,0FAA0F;YAC1F,yFAAyF;YACzF,0FAA0F;YAC1F,uFAAuF;YACvF,yFAAyF;YACzF,wFAAwF;YACxF,wFAAwF;YACxF,qFAAqF;YACrF,oCAAoC;YACpC,sDAAsD;YACtD,2FAA2F;YAC3F,kFAAkF;YAClF,qFAAqF;YACrF,6FAA6F;YAC7F,yFAAyF;YACzF,4FAA4F;YAC5F,sFAAsF;YACtF,0FAA0F;YAC1F,oEAAoE;YACpE,4FAA4F;YAC5F,6FAA6F;YAC7F,4DAA4D;SAC7D;KACF;CACF,CAAC"}
@@ -1,36 +1,36 @@
1
1
  /** Ranges written to the generated package.json; bumped together with the kit. */
2
2
  export const VERSIONS = {
3
- '@ddd-ts-kit/kernel': '^0.113.1',
4
- '@ddd-ts-kit/validation': '^0.113.1',
5
- '@ddd-ts-kit/http': '^0.113.1',
6
- '@ddd-ts-kit/tracing': '^0.113.1',
7
- '@ddd-ts-kit/di': '^0.113.1',
8
- '@ddd-ts-kit/events': '^0.113.1',
9
- '@ddd-ts-kit/testing': '^0.113.1',
10
- '@ddd-ts-kit/drizzle': '^0.113.1',
11
- '@ddd-ts-kit/knex': '^0.113.1',
12
- '@ddd-ts-kit/prisma': '^0.113.1',
13
- '@ddd-ts-kit/typeorm': '^0.113.1',
14
- '@ddd-ts-kit/auth': '^0.113.1',
15
- '@ddd-ts-kit/rabbitmq': '^0.113.1',
16
- '@ddd-ts-kit/aspects': '^0.113.1',
17
- '@ddd-ts-kit/audit': '^0.113.1',
18
- '@ddd-ts-kit/redis': '^0.113.1',
19
- '@ddd-ts-kit/kafka': '^0.113.1',
20
- '@ddd-ts-kit/nats': '^0.113.1',
21
- '@ddd-ts-kit/scheduling': '^0.113.1',
22
- '@ddd-ts-kit/sentry': '^0.113.1',
23
- '@ddd-ts-kit/s3': '^0.113.1',
24
- '@ddd-ts-kit/opensearch': '^0.113.1',
3
+ '@ddd-ts-kit/kernel': '^0.113.2',
4
+ '@ddd-ts-kit/validation': '^0.113.2',
5
+ '@ddd-ts-kit/http': '^0.113.2',
6
+ '@ddd-ts-kit/tracing': '^0.113.2',
7
+ '@ddd-ts-kit/di': '^0.113.2',
8
+ '@ddd-ts-kit/events': '^0.113.2',
9
+ '@ddd-ts-kit/testing': '^0.113.2',
10
+ '@ddd-ts-kit/drizzle': '^0.113.2',
11
+ '@ddd-ts-kit/knex': '^0.113.2',
12
+ '@ddd-ts-kit/prisma': '^0.113.2',
13
+ '@ddd-ts-kit/typeorm': '^0.113.2',
14
+ '@ddd-ts-kit/auth': '^0.113.2',
15
+ '@ddd-ts-kit/rabbitmq': '^0.113.2',
16
+ '@ddd-ts-kit/aspects': '^0.113.2',
17
+ '@ddd-ts-kit/audit': '^0.113.2',
18
+ '@ddd-ts-kit/redis': '^0.113.2',
19
+ '@ddd-ts-kit/kafka': '^0.113.2',
20
+ '@ddd-ts-kit/nats': '^0.113.2',
21
+ '@ddd-ts-kit/scheduling': '^0.113.2',
22
+ '@ddd-ts-kit/sentry': '^0.113.2',
23
+ '@ddd-ts-kit/s3': '^0.113.2',
24
+ '@ddd-ts-kit/opensearch': '^0.113.2',
25
25
  '@aws-sdk/client-s3': '^3.1150.0',
26
26
  '@aws-sdk/lib-storage': '^3.1150.0',
27
27
  '@aws-sdk/s3-request-presigner': '^3.1150.0',
28
28
  busboy: '^1.6.0',
29
29
  '@sentry/node': '^11.6.0',
30
- '@ddd-ts-kit/pino': '^0.113.1',
30
+ '@ddd-ts-kit/pino': '^0.113.2',
31
31
  pino: '^10.4.0',
32
32
  'pino-pretty': '^13.2.0',
33
- '@ddd-ts-kit/winston': '^0.113.1',
33
+ '@ddd-ts-kit/winston': '^0.113.2',
34
34
  winston: '^3.19.0',
35
35
  '@confluentinc/kafka-javascript': '^1.11.0',
36
36
  '@nats-io/jetstream': '^3.4.0',
@@ -41,7 +41,7 @@ export const VERSIONS = {
41
41
  'passport-jwt': '^4.0.1',
42
42
  '@types/passport-jwt': '^4.0.1',
43
43
  amqplib: '^2.2.0',
44
- 'ddd-ts-kit': '^0.113.1',
44
+ 'ddd-ts-kit': '^0.113.2',
45
45
  tsx: '^4.23.15',
46
46
  vitest: '^5.0.3',
47
47
  'fast-check': '^4.10.2',
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Whether some code binds a name itself: a local `const`, `let`, `var`, `function` or `class` of
3
+ * that name, an arrow `name =>`, a parameter with or without a type or a default, a destructured
4
+ * binding, a catch clause, an import alias, a label. No scope is read: code that binds a name is not taken
5
+ * to read the outer declaration of that name anywhere. In doubt the code binds it.
6
+ */
7
+ export declare function bindsTheName(code: string, name: string): boolean;
8
+ //# sourceMappingURL=binds-the-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binds-the-name.d.ts","sourceRoot":"","sources":["../../../src/merge/declarations/binds-the-name.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAUhE"}
@@ -0,0 +1,40 @@
1
+ import { enclosingGroup } from './enclosing-group.js';
2
+ /** What opens a group of parentheses that holds a condition, not parameters. */
3
+ const CONTROL = /\b(?:if|while|for|switch|with)\s*$/;
4
+ /**
5
+ * Whether some code binds a name itself: a local `const`, `let`, `var`, `function` or `class` of
6
+ * that name, an arrow `name =>`, a parameter with or without a type or a default, a destructured
7
+ * binding, a catch clause, an import alias, a label. No scope is read: code that binds a name is not taken
8
+ * to read the outer declaration of that name anywhere. In doubt the code binds it.
9
+ */
10
+ export function bindsTheName(code, name) {
11
+ const word = name.replaceAll('$', '\\$');
12
+ const declared = new RegExp(`\\b(?:const|let|var|function\\s*\\*?|class)\\s+${word}(?![\\w$])|(?<![\\w$.])${word}\\s*=>|\\b(?:import|export)\\b[^;]*\\bas\\s+${word}(?![\\w$])|(?:^|[\\n{;])\\s*${word}\\s*:\\s*(?:for|while|do|switch|\\{)`);
13
+ const places = [...code.matchAll(new RegExp(`(?<![\\w$])${word}(?![\\w$])`, 'g'))];
14
+ return declared.test(code) || places.some(({ index }) => bound(code, { from: index, to: index + name.length }));
15
+ }
16
+ /** Whether a place is an element of a list of parameters or of a destructuring pattern. */
17
+ function bound(code, span) {
18
+ const group = enclosingGroup(code, span.from);
19
+ if (group === undefined || !isElement(code, span, code.charAt(group.open))) {
20
+ return false;
21
+ }
22
+ const after = code.slice(group.close + 1).trimStart();
23
+ if (code.charAt(group.open) === '(') {
24
+ return /^(?:=>|\{|:)/.test(after) && !CONTROL.test(code.slice(0, group.open));
25
+ }
26
+ return /^=(?![=>])/.test(after) || bound(code, { from: group.open, to: group.close + 1 });
27
+ }
28
+ /** Whether a place stands alone between the separators of a list: a name with its type or its default, not a part of an expression. */
29
+ function isElement(code, { from, to }, opener) {
30
+ const before = code
31
+ .slice(0, from)
32
+ .trimEnd()
33
+ .replace(/\.\.\.$/, '')
34
+ .trimEnd()
35
+ .at(-1) ?? '';
36
+ const after = code.slice(to).trimStart();
37
+ const starts = '(,{['.includes(before) || (before === ':' && opener === '{');
38
+ return starts && before !== '' && /^(?:[,)}\]]|\??:|=(?![=>]))/.test(after);
39
+ }
40
+ //# sourceMappingURL=binds-the-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binds-the-name.js","sourceRoot":"","sources":["../../../src/merge/declarations/binds-the-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAQnD,gFAAgF;AAChF,MAAM,OAAO,GAAG,oCAAoC,CAAC;AAErD;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,IAAY;IACrD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAEzC,MAAM,QAAQ,GAAG,IAAI,MAAM,CACzB,kDAAkD,IAAI,0BAA0B,IAAI,+CAA+C,IAAI,+BAA+B,IAAI,sCAAsC,CACjN,CAAC;IAEF,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,cAAc,IAAI,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAEnF,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAClH,CAAC;AAED,2FAA2F;AAC3F,SAAS,KAAK,CAAC,IAAY,EAAE,IAAU;I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AAC,MAAM,CAAC,IAAI,CAAC,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,CAAC,CAAC;IAE7E,OAAO,MAAM,IAAI,MAAM,KAAK,EAAE,IAAI,6BAA6B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Where the group that holds a place closes. */
2
+ export declare function closeOf(code: string, from: number): number;
3
+ //# sourceMappingURL=close-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"close-of.d.ts","sourceRoot":"","sources":["../../../src/merge/declarations/close-of.ts"],"names":[],"mappings":"AAGA,iDAAiD;AACjD,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAc1D"}
@@ -0,0 +1,15 @@
1
+ const OPENERS = '([{';
2
+ const CLOSERS = ')]}';
3
+ /** Where the group that holds a place closes. */
4
+ export function closeOf(code, from) {
5
+ let depth = 0;
6
+ for (let close = from; close < code.length; close += 1) {
7
+ const character = code.charAt(close);
8
+ if (CLOSERS.includes(character) && depth === 0) {
9
+ return close;
10
+ }
11
+ depth += OPENERS.includes(character) ? 1 : CLOSERS.includes(character) ? -1 : 0;
12
+ }
13
+ return code.length;
14
+ }
15
+ //# sourceMappingURL=close-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"close-of.js","sourceRoot":"","sources":["../../../src/merge/declarations/close-of.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,KAAK,CAAC;AACtB,MAAM,OAAO,GAAG,KAAK,CAAC;AAEtB,iDAAiD;AACjD,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,IAAY;IAChD,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,KAAK,IAAI,KAAK,GAAG,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACvD,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAErC,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAC/C,OAAO,KAAK,CAAC;QACf,CAAC;QAED,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB,CAAC"}
@@ -1,4 +1,6 @@
1
1
  import type { DeclaredSide } from './declared-side.js';
2
+ /** How a line starts that goes on with the statement above it, whatever that one ends with but a semicolon. */
3
+ export declare const GOES_ON: RegExp;
2
4
  /**
3
5
  * The lines of a region read as declarations, each whole: a statement runs until its brackets are
4
6
  * closed and its line ends it (a closing brace does not when the next line goes on with an
@@ -1 +1 @@
1
- {"version":3,"file":"declarations-of.d.ts","sourceRoot":"","sources":["../../../src/merge/declarations/declarations-of.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAqCpD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,YAAY,GAAG,SAAS,CAkBjF"}
1
+ {"version":3,"file":"declarations-of.d.ts","sourceRoot":"","sources":["../../../src/merge/declarations/declarations-of.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAYpD,+GAA+G;AAC/G,eAAO,MAAM,OAAO,QAAwC,CAAC;AAwB7D;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,YAAY,GAAG,SAAS,CAkBjF"}
@@ -8,7 +8,7 @@ const DEFAULT = /^\s*export\s+default\b/;
8
8
  /** How the last line of a statement ends once its brackets are closed: a comma goes on with a second name or a type argument. */
9
9
  const ENDS = /[;}]$/;
10
10
  /** How a line starts that goes on with the statement above it, whatever that one ends with but a semicolon. */
11
- const GOES_ON = /^(?:[|&?:.+\-*/=]|satisfies\b|as\b)/;
11
+ export const GOES_ON = /^(?:[|&?:.+\-*/=]|satisfies\b|as\b)/;
12
12
  /**
13
13
  * The lines of a region read as declarations, each whole: a statement runs until its brackets are
14
14
  * closed and its line ends it (a closing brace does not when the next line goes on with an
@@ -1 +1 @@
1
- {"version":3,"file":"declarations-of.js","sourceRoot":"","sources":["../../../src/merge/declarations/declarations-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAIxD,4HAA4H;AAC5H,MAAM,KAAK,GACT,uMAAuM,CAAC;AAE1M,kEAAkE;AAClE,MAAM,OAAO,GAAG,wBAAwB,CAAC;AAEzC,iIAAiI;AACjI,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB,+GAA+G;AAC/G,MAAM,OAAO,GAAG,qCAAqC,CAAC;AAwBtD;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,KAAwB;IACrD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAEvC,IAAI,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACxE,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAE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AAK;YAC3B,MAAM,EAAE,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM;YAC3F,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,IAAI,KAAK,EAAE;YACjC,IAAI,EAAE,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SACzC,CAAC;AACR,CAAC;AAED,kFAAkF;AAClF,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAC/E,CAAC;AAED,SAAS,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAW,EAAE,EAAU;IAChE,OAAO;QACL,KAAK;QACL,GAAG,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE;QACrE,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;QACvC,KAAK;QACL,GAAG;QACH,KAAK,EAAE,EAAE,KAAK,CAAC;KAChB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Whether a name, at a place of some code, declares a member and reads nothing: a key, a member
3
+ * of an interface or of a type, a label, a typed parameter (`orders: 1`, `orders?: Table`), a
4
+ * method or an accessor (`orders() {`), a member of an enum, a field of a class.
5
+ */
6
+ export declare function declaresAMember(code: string, from: number, name: string): boolean;
7
+ //# sourceMappingURL=declares-a-member.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declares-a-member.d.ts","sourceRoot":"","sources":["../../../src/merge/declarations/declares-a-member.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAQjF"}
@@ -0,0 +1,29 @@
1
+ import { closeOf } from './close-of.js';
2
+ import { enclosingGroup } from './enclosing-group.js';
3
+ /** Where a member is declared: at the start of a line or after `{`, `,`, `;` or `(`, behind its modifiers. */
4
+ const MEMBER_PLACE = /(?:^|[\n{,;(])\s*(?:(?:public|private|protected|static|readonly|async|get|set|declare|override|abstract)\s+)*$/;
5
+ /** What opens the body a member is declared in. */
6
+ const BODY = /\b(class|enum|interface)\b[^;{}]*$/;
7
+ /**
8
+ * Whether a name, at a place of some code, declares a member and reads nothing: a key, a member
9
+ * of an interface or of a type, a label, a typed parameter (`orders: 1`, `orders?: Table`), a
10
+ * method or an accessor (`orders() {`), a member of an enum, a field of a class.
11
+ */
12
+ export function declaresAMember(code, from, name) {
13
+ const after = code.slice(from + name.length).trimStart();
14
+ if (!MEMBER_PLACE.test(code.slice(0, from))) {
15
+ return false;
16
+ }
17
+ return /^[?!]?:/.test(after) || isMethod(after) || inABody(code, from, after);
18
+ }
19
+ /** Whether what follows a name is the parameters and the body of a method. */
20
+ function isMethod(after) {
21
+ return after.startsWith('(') && /^(?::[^{;=]*)?\{/.test(after.slice(closeOf(after, 1) + 1).trimStart());
22
+ }
23
+ /** Whether a name is a member of an enum, or a field of a class with or without a value. */
24
+ function inABody(code, from, after) {
25
+ const group = enclosingGroup(code, from);
26
+ const body = group === undefined || code.charAt(group.open) !== '{' ? undefined : BODY.exec(code.slice(0, group.open));
27
+ return body?.[1] === 'enum' || (body !== undefined && body !== null && /^(?:=(?![=>])|;|$)/.test(after));
28
+ }
29
+ //# sourceMappingURL=declares-a-member.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declares-a-member.js","sourceRoot":"","sources":["../../../src/merge/declarations/declares-a-member.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,8GAA8G;AAC9G,MAAM,YAAY,GAChB,gHAAgH,CAAC;AAEnH,mDAAmD;AACnD,MAAM,IAAI,GAAG,oCAAoC,CAAC;AAElD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,IAAY,EAAE,IAAY;IACtE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;IAEzD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;QAC5C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAChF,CAAC;AAED,8EAA8E;AAC9E,SAAS,QAAQ,CAAC,KAAa;IAC7B,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;AAC1G,CAAC;AAED,4FAA4F;AAC5F,SAAS,OAAO,CAAC,IAAY,EAAE,IAAY,EAAE,KAAa;IACxD,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAEzC,MAAM,IAAI,GACR,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAE5G,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,IAAI,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3G,CAAC"}
@@ -0,0 +1,8 @@
1
+ /** A bracket group of some code: where it opens and where it closes, the end of the code when nothing closes it. */
2
+ export interface Group {
3
+ readonly open: number;
4
+ readonly close: number;
5
+ }
6
+ /** The innermost bracket group that holds a place of some code, comments and strings left out; undefined outside any. */
7
+ export declare function enclosingGroup(code: string, at: number): Group | undefined;
8
+ //# sourceMappingURL=enclosing-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enclosing-group.d.ts","sourceRoot":"","sources":["../../../src/merge/declarations/enclosing-group.ts"],"names":[],"mappings":"AAEA,oHAAoH;AACpH,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAKD,yHAAyH;AACzH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAc1E"}
@@ -0,0 +1,16 @@
1
+ import { closeOf } from './close-of.js';
2
+ const OPENERS = '([{';
3
+ const CLOSERS = ')]}';
4
+ /** The innermost bracket group that holds a place of some code, comments and strings left out; undefined outside any. */
5
+ export function enclosingGroup(code, at) {
6
+ let depth = 0;
7
+ for (let open = at - 1; open >= 0; open -= 1) {
8
+ const character = code.charAt(open);
9
+ if (OPENERS.includes(character) && depth === 0) {
10
+ return { open, close: closeOf(code, at) };
11
+ }
12
+ depth += CLOSERS.includes(character) ? 1 : OPENERS.includes(character) ? -1 : 0;
13
+ }
14
+ return undefined;
15
+ }
16
+ //# sourceMappingURL=enclosing-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enclosing-group.js","sourceRoot":"","sources":["../../../src/merge/declarations/enclosing-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAQrC,MAAM,OAAO,GAAG,KAAK,CAAC;AACtB,MAAM,OAAO,GAAG,KAAK,CAAC;AAEtB,yHAAyH;AACzH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,EAAU;IACrD,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,KAAK,IAAI,IAAI,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC;QAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEpC,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAC/C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;QAC5C,CAAC;QAED,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { DeclaredSides } from './merge-declarations.js';
2
+ /**
3
+ * Whether the `imports` region the union of lines gives brings what the three sides merged
4
+ * statement by statement bring: the same names from the same modules, whatever the statements
5
+ * they are written in and their order. False when a statement of a side is no import the kit
6
+ * merges by statement: the region is then read as any other declarations.
7
+ */
8
+ export declare function importsReadAsMerged(union: readonly string[], sides: DeclaredSides): boolean;
9
+ //# sourceMappingURL=imports-read-as-merged.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imports-read-as-merged.d.ts","sourceRoot":"","sources":["../../../src/merge/declarations/imports-read-as-merged.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAM1D;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAK3F"}
@@ -0,0 +1,23 @@
1
+ import { oneLineImports } from '../../markers/one-line-imports.js';
2
+ import { mergedImports } from './merged-imports.js';
3
+ /** The names an import statement written on one line brings from a module. */
4
+ const NAMED = /^import (type )?\{ ([^}]+) \} from '([^']+)';$/;
5
+ /**
6
+ * Whether the `imports` region the union of lines gives brings what the three sides merged
7
+ * statement by statement bring: the same names from the same modules, whatever the statements
8
+ * they are written in and their order. False when a statement of a side is no import the kit
9
+ * merges by statement: the region is then read as any other declarations.
10
+ */
11
+ export function importsReadAsMerged(union, sides) {
12
+ const merged = mergedImports(sides);
13
+ const brought = broughtBy(union.filter((line) => line.trim() !== ''));
14
+ return merged !== undefined && [...broughtBy(merged)].sort().join('\n') === [...brought].sort().join('\n');
15
+ }
16
+ /** What import statements bring: each name with its module, or the statement when it names none that way. */
17
+ function broughtBy(lines) {
18
+ return new Set(oneLineImports(lines).flatMap((statement) => {
19
+ const [, type = '', names, source = ''] = NAMED.exec(statement) ?? [];
20
+ return names === undefined ? [statement] : names.split(',').map((name) => `${type}${source} ${name.trim()}`);
21
+ }));
22
+ }
23
+ //# sourceMappingURL=imports-read-as-merged.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imports-read-as-merged.js","sourceRoot":"","sources":["../../../src/merge/declarations/imports-read-as-merged.ts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CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { DeclaredSide } from './declared-side.js';
2
+ import type { DeclaredSides } from './merge-declarations.js';
3
+ /**
4
+ * Whether a region sets a declaration above one it reads, against the sides. A declaration reads
5
+ * another when its code, comments and strings left out, holds the name the other declares, as a
6
+ * whole word. The reference is inverted when the one it reads stands below it in the region,
7
+ * while every side that holds the two sets it above: a side that wrote the reader first, a
8
+ * function that calls one written below it, says the order is meant. Nothing else of the order of
9
+ * a region is read.
10
+ */
11
+ export declare function invertsAReference(read: DeclaredSide, { ours, theirs }: DeclaredSides): boolean;
12
+ //# sourceMappingURL=inverts-a-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inverts-a-reference.d.ts","sourceRoot":"","sources":["../../../src/merge/declarations/inverts-a-reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,aAAa,GAAG,OAAO,CAe9F"}
@@ -0,0 +1,25 @@
1
+ import { readsTheName } from './reads-the-name.js';
2
+ /**
3
+ * Whether a region sets a declaration above one it reads, against the sides. A declaration reads
4
+ * another when its code, comments and strings left out, holds the name the other declares, as a
5
+ * whole word. The reference is inverted when the one it reads stands below it in the region,
6
+ * while every side that holds the two sets it above: a side that wrote the reader first, a
7
+ * function that calls one written below it, says the order is meant. Nothing else of the order of
8
+ * a region is read.
9
+ */
10
+ export function invertsAReference(read, { ours, theirs }) {
11
+ const sides = [ours, theirs].map(placesOf);
12
+ return read.declarations.some((reader, at) => read.declarations.slice(at + 1).some((below) => {
13
+ const orders = sides.flatMap((places) => {
14
+ const first = places.get(reader.key);
15
+ const second = places.get(below.key);
16
+ return first === undefined || second === undefined ? [] : [second < first];
17
+ });
18
+ return orders.length > 0 && orders.every((above) => above) && readsTheName(reader, below.name);
19
+ }));
20
+ }
21
+ /** Where each declaration of a side stands, by its key. */
22
+ function placesOf(side) {
23
+ return new Map(side.declarations.map(({ key }, at) => [key, at]));
24
+ }
25
+ //# sourceMappingURL=inverts-a-reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inverts-a-reference.js","sourceRoot":"","sources":["../../../src/merge/declarations/inverts-a-reference.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAkB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAiB;IACnF,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE3C,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAC3C,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;QAC7C,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YACtC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACrC,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAErC,OAAO,KAAK,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACjG,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAED,2DAA2D;AAC3D,SAAS,QAAQ,CAAC,IAAkB;IAClC,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { DeclaredSide } from './declared-side.js';
2
+ /** The two sides of a region and its base, each read as declarations. */
3
+ interface Sides {
4
+ readonly ours: DeclaredSide;
5
+ readonly base: DeclaredSide;
6
+ readonly theirs: DeclaredSide;
7
+ }
8
+ /**
9
+ * The side whose order the merged region follows: ours, unless the trunk alone changed the order
10
+ * of the declarations both sides hold. Undefined when the two sides order them differently and
11
+ * the base does not say that one of them left that order alone.
12
+ */
13
+ export declare function leadOf({ ours, base, theirs }: Sides): DeclaredSide | undefined;
14
+ export {};
15
+ //# sourceMappingURL=lead-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lead-of.d.ts","sourceRoot":"","sources":["../../../src/merge/declarations/lead-of.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,yEAAyE;AACzE,UAAU,KAAK;IACb,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,GAAG,YAAY,GAAG,SAAS,CAc9E"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The side whose order the merged region follows: ours, unless the trunk alone changed the order
3
+ * of the declarations both sides hold. Undefined when the two sides order them differently and
4
+ * the base does not say that one of them left that order alone.
5
+ */
6
+ export function leadOf({ ours, base, theirs }) {
7
+ const shared = new Set(ours.declarations.map(({ key }) => key).filter((key) => byKey(theirs).has(key)));
8
+ const orderOf = (side, among = shared) => side.declarations.flatMap(({ key }) => (among.has(key) ? [key] : [])).join('\0');
9
+ if (orderOf(ours) === orderOf(theirs)) {
10
+ return ours;
11
+ }
12
+ const kept = new Set(base.declarations.map(({ key }) => key).filter((key) => shared.has(key)));
13
+ const moved = [ours, theirs].filter((side) => orderOf(side, kept) !== orderOf(base, kept));
14
+ return moved.length === 1 ? moved[0] : undefined;
15
+ }
16
+ function byKey(side) {
17
+ return new Map(side.declarations.map((declaration) => [declaration.key, declaration]));
18
+ }
19
+ //# sourceMappingURL=lead-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lead-of.js","sourceRoot":"","sources":["../../../src/merge/declarations/lead-of.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAS;IAClD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAExG,MAAM,OAAO,GAAG,CAAC,IAAkB,EAAE,KAAK,GAAwB,MAAM,EAAU,EAAE,CAClF,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEnF,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC/F,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IAE3F,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACnD,CAAC;AAED,SAAS,KAAK,CAAC,IAAkB;IAC/B,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;AACzF,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type Versions } from './merged-file.js';
2
+ import { type ReadAs } from './union-in-doubt.js';
3
+ /**
4
+ * The lines the kit keeps of one declaration both sides changed, merged alone as it merges a
5
+ * region: what git merges, and for each conflict left the lines of both sides. Undefined when one
6
+ * of those conflicts is in doubt, a side of it not holding whole statements or its union breaking
7
+ * one, or when git cannot merge the versions.
8
+ */
9
+ export declare function linesOfBothSides(top: string, versions: Versions, readAs: ReadAs): string[] | undefined;
10
+ //# sourceMappingURL=lines-of-both-sides.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lines-of-both-sides.d.ts","sourceRoot":"","sources":["../../../src/merge/declarations/lines-of-both-sides.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,kBAAkB,CAAC;AAE7D;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAatG"}
@@ -0,0 +1,22 @@
1
+ import { conflictBlocks } from '../conflict-blocks.js';
2
+ import { registryUnion } from '../registry-union.js';
3
+ import { mergedFile } from './merged-file.js';
4
+ import { sharesHalfAPair } from './shares-half-a-pair.js';
5
+ import { unionInDoubt } from './union-in-doubt.js';
6
+ /**
7
+ * The lines the kit keeps of one declaration both sides changed, merged alone as it merges a
8
+ * region: what git merges, and for each conflict left the lines of both sides. Undefined when one
9
+ * of those conflicts is in doubt, a side of it not holding whole statements or its union breaking
10
+ * one, or when git cannot merge the versions.
11
+ */
12
+ export function linesOfBothSides(top, versions, readAs) {
13
+ const segments = conflictBlocks((mergedFile(top, versions, true) ?? [UNMERGED]).join('\n'));
14
+ const [first] = segments;
15
+ const inDoubt = segments.some((segment) => segment.kind === 'conflict' && (sharesHalfAPair(segment) || unionInDoubt(segment, readAs)));
16
+ return inDoubt || (first?.kind === 'settled' && first.lines[0] === UNMERGED)
17
+ ? undefined
18
+ : segments.flatMap((segment) => segment.kind === 'settled' ? segment.lines : registryUnion(segment, readAs.region));
19
+ }
20
+ /** What stands for a merge git did not compute: a line no declaration starts with. */
21
+ const UNMERGED = '>>>>>>> not merged';
22
+ //# sourceMappingURL=lines-of-both-sides.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lines-of-both-sides.js","sourceRoot":"","sources":["../../../src/merge/declarations/lines-of-both-sides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