ddd-ts-kit 0.113.0 → 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 (136) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/help/work-notes.d.ts.map +1 -1
  3. package/dist/help/work-notes.js +7 -2
  4. package/dist/help/work-notes.js.map +1 -1
  5. package/dist/init/manifest/versions.js +25 -25
  6. package/dist/markers/merge-imports.d.ts.map +1 -1
  7. package/dist/markers/merge-imports.js +2 -22
  8. package/dist/markers/merge-imports.js.map +1 -1
  9. package/dist/markers/one-line-imports.d.ts +3 -0
  10. package/dist/markers/one-line-imports.d.ts.map +1 -0
  11. package/dist/markers/one-line-imports.js +22 -0
  12. package/dist/markers/one-line-imports.js.map +1 -0
  13. package/dist/merge/declarations/binds-the-name.d.ts +8 -0
  14. package/dist/merge/declarations/binds-the-name.d.ts.map +1 -0
  15. package/dist/merge/declarations/binds-the-name.js +40 -0
  16. package/dist/merge/declarations/binds-the-name.js.map +1 -0
  17. package/dist/merge/declarations/brackets-left-open.d.ts +7 -0
  18. package/dist/merge/declarations/brackets-left-open.d.ts.map +1 -0
  19. package/dist/merge/declarations/brackets-left-open.js +21 -0
  20. package/dist/merge/declarations/brackets-left-open.js.map +1 -0
  21. package/dist/merge/declarations/close-of.d.ts +3 -0
  22. package/dist/merge/declarations/close-of.d.ts.map +1 -0
  23. package/dist/merge/declarations/close-of.js +15 -0
  24. package/dist/merge/declarations/close-of.js.map +1 -0
  25. package/dist/merge/declarations/declaration.d.ts +15 -0
  26. package/dist/merge/declarations/declaration.d.ts.map +1 -0
  27. package/dist/merge/declarations/declaration.js +2 -0
  28. package/dist/merge/declarations/declaration.js.map +1 -0
  29. package/dist/merge/declarations/declarations-of.d.ts +13 -0
  30. package/dist/merge/declarations/declarations-of.d.ts.map +1 -0
  31. package/dist/merge/declarations/declarations-of.js +130 -0
  32. package/dist/merge/declarations/declarations-of.js.map +1 -0
  33. package/dist/merge/declarations/declared-lines.d.ts +14 -0
  34. package/dist/merge/declarations/declared-lines.d.ts.map +1 -0
  35. package/dist/merge/declarations/declared-lines.js +42 -0
  36. package/dist/merge/declarations/declared-lines.js.map +1 -0
  37. package/dist/merge/declarations/declared-side.d.ts +8 -0
  38. package/dist/merge/declarations/declared-side.d.ts.map +1 -0
  39. package/dist/merge/declarations/declared-side.js +2 -0
  40. package/dist/merge/declarations/declared-side.js.map +1 -0
  41. package/dist/merge/declarations/declares-a-member.d.ts +7 -0
  42. package/dist/merge/declarations/declares-a-member.d.ts.map +1 -0
  43. package/dist/merge/declarations/declares-a-member.js +29 -0
  44. package/dist/merge/declarations/declares-a-member.js.map +1 -0
  45. package/dist/merge/declarations/enclosing-group.d.ts +8 -0
  46. package/dist/merge/declarations/enclosing-group.d.ts.map +1 -0
  47. package/dist/merge/declarations/enclosing-group.js +16 -0
  48. package/dist/merge/declarations/enclosing-group.js.map +1 -0
  49. package/dist/merge/declarations/holds-every-line.d.ts +3 -0
  50. package/dist/merge/declarations/holds-every-line.d.ts.map +1 -0
  51. package/dist/merge/declarations/holds-every-line.js +10 -0
  52. package/dist/merge/declarations/holds-every-line.js.map +1 -0
  53. package/dist/merge/declarations/imports-read-as-merged.d.ts +9 -0
  54. package/dist/merge/declarations/imports-read-as-merged.d.ts.map +1 -0
  55. package/dist/merge/declarations/imports-read-as-merged.js +23 -0
  56. package/dist/merge/declarations/imports-read-as-merged.js.map +1 -0
  57. package/dist/merge/declarations/inverts-a-reference.d.ts +12 -0
  58. package/dist/merge/declarations/inverts-a-reference.d.ts.map +1 -0
  59. package/dist/merge/declarations/inverts-a-reference.js +25 -0
  60. package/dist/merge/declarations/inverts-a-reference.js.map +1 -0
  61. package/dist/merge/declarations/lead-of.d.ts +15 -0
  62. package/dist/merge/declarations/lead-of.d.ts.map +1 -0
  63. package/dist/merge/declarations/lead-of.js +19 -0
  64. package/dist/merge/declarations/lead-of.js.map +1 -0
  65. package/dist/merge/declarations/lines-of-both-sides.d.ts +10 -0
  66. package/dist/merge/declarations/lines-of-both-sides.d.ts.map +1 -0
  67. package/dist/merge/declarations/lines-of-both-sides.js +22 -0
  68. package/dist/merge/declarations/lines-of-both-sides.js.map +1 -0
  69. package/dist/merge/declarations/merge-declarations.d.ts +44 -0
  70. package/dist/merge/declarations/merge-declarations.d.ts.map +1 -0
  71. package/dist/merge/declarations/merge-declarations.js +87 -0
  72. package/dist/merge/declarations/merge-declarations.js.map +1 -0
  73. package/dist/merge/declarations/merged-file.d.ts +15 -0
  74. package/dist/merge/declarations/merged-file.d.ts.map +1 -0
  75. package/dist/merge/declarations/merged-file.js +55 -0
  76. package/dist/merge/declarations/merged-file.js.map +1 -0
  77. package/dist/merge/declarations/merged-imports.d.ts +9 -0
  78. package/dist/merge/declarations/merged-imports.d.ts.map +1 -0
  79. package/dist/merge/declarations/merged-imports.js +25 -0
  80. package/dist/merge/declarations/merged-imports.js.map +1 -0
  81. package/dist/merge/declarations/merged-lines.d.ts +10 -0
  82. package/dist/merge/declarations/merged-lines.d.ts.map +1 -0
  83. package/dist/merge/declarations/merged-lines.js +10 -0
  84. package/dist/merge/declarations/merged-lines.js.map +1 -0
  85. package/dist/merge/declarations/merged-region.d.ts +33 -0
  86. package/dist/merge/declarations/merged-region.d.ts.map +1 -0
  87. package/dist/merge/declarations/merged-region.js +122 -0
  88. package/dist/merge/declarations/merged-region.js.map +1 -0
  89. package/dist/merge/declarations/reads-a-removed.d.ts +8 -0
  90. package/dist/merge/declarations/reads-a-removed.d.ts.map +1 -0
  91. package/dist/merge/declarations/reads-a-removed.js +27 -0
  92. package/dist/merge/declarations/reads-a-removed.js.map +1 -0
  93. package/dist/merge/declarations/reads-as-merged.d.ts +9 -0
  94. package/dist/merge/declarations/reads-as-merged.d.ts.map +1 -0
  95. package/dist/merge/declarations/reads-as-merged.js +19 -0
  96. package/dist/merge/declarations/reads-as-merged.js.map +1 -0
  97. package/dist/merge/declarations/reads-the-name.d.ts +10 -0
  98. package/dist/merge/declarations/reads-the-name.d.ts.map +1 -0
  99. package/dist/merge/declarations/reads-the-name.js +23 -0
  100. package/dist/merge/declarations/reads-the-name.js.map +1 -0
  101. package/dist/merge/declarations/settle-declarations.d.ts +25 -0
  102. package/dist/merge/declarations/settle-declarations.d.ts.map +1 -0
  103. package/dist/merge/declarations/settle-declarations.js +114 -0
  104. package/dist/merge/declarations/settle-declarations.js.map +1 -0
  105. package/dist/merge/declarations/shares-half-a-pair.d.ts +11 -0
  106. package/dist/merge/declarations/shares-half-a-pair.d.ts.map +1 -0
  107. package/dist/merge/declarations/shares-half-a-pair.js +41 -0
  108. package/dist/merge/declarations/shares-half-a-pair.js.map +1 -0
  109. package/dist/merge/declarations/shown-of.d.ts +5 -0
  110. package/dist/merge/declarations/shown-of.d.ts.map +1 -0
  111. package/dist/merge/declarations/shown-of.js +5 -0
  112. package/dist/merge/declarations/shown-of.js.map +1 -0
  113. package/dist/merge/declarations/sides-of-region.d.ts +5 -0
  114. package/dist/merge/declarations/sides-of-region.d.ts.map +1 -0
  115. package/dist/merge/declarations/sides-of-region.js +19 -0
  116. package/dist/merge/declarations/sides-of-region.js.map +1 -0
  117. package/dist/merge/declarations/union-in-doubt.d.ts +17 -0
  118. package/dist/merge/declarations/union-in-doubt.d.ts.map +1 -0
  119. package/dist/merge/declarations/union-in-doubt.js +84 -0
  120. package/dist/merge/declarations/union-in-doubt.js.map +1 -0
  121. package/dist/merge/declarations/union-reads-as-merged.d.ts +23 -0
  122. package/dist/merge/declarations/union-reads-as-merged.d.ts.map +1 -0
  123. package/dist/merge/declarations/union-reads-as-merged.js +155 -0
  124. package/dist/merge/declarations/union-reads-as-merged.js.map +1 -0
  125. package/dist/merge/for-you-entry.js +4 -1
  126. package/dist/merge/for-you-entry.js.map +1 -1
  127. package/dist/merge/resolution.d.ts +2 -0
  128. package/dist/merge/resolution.d.ts.map +1 -1
  129. package/dist/merge/resolve-conflict.d.ts +5 -2
  130. package/dist/merge/resolve-conflict.d.ts.map +1 -1
  131. package/dist/merge/resolve-conflict.js +62 -15
  132. package/dist/merge/resolve-conflict.js.map +1 -1
  133. package/dist/version.d.ts +1 -1
  134. package/dist/version.js +1 -1
  135. package/package.json +6 -6
  136. package/templates/pipeline/package-scripts.json +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,53 @@ 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
+
46
+ ## 0.113.1
47
+
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.
49
+
50
+ The lines of both sides are still what a conflict inside a generated region keeps: the report says `generated registry: the lines of both sides kept` and the region is written as it was before this change, in every case but two. The first: the region those lines give does not pair its brackets, the case above. The second: in one conflict, two different statements that each hold a bracket open across several lines open on the same line or close on the same line (two `platform.commands.register(` written on several lines), a line the union keeps once; a chain written on several lines with no bracket across them is not seen; a statement both sides added alike does not count, it is kept once as before. In these two cases the region of a TypeScript, JavaScript or Prisma file is merged declaration by declaration instead, from the three sides of the file. The declaration each side added is kept whole; one both added alike is kept once; one a side changed or removed while the other left it as the base holds it follows that side; one both changed takes the merge of its lines, as git merges a file, when they merge without a conflict: a line one side removed stays removed. The declarations both sides hold stand in the order of the side that changed their order, ours when neither did, and what a side alone adds stands after the declaration it follows on that side, or first when it opened the region there. The report then says `generated registry: the declarations of both sides kept, each one whole`, in a dry run too, and `generated registry: the declarations of both sides kept, each one whole, and the lines of both sides kept` when another region of the file kept the lines of both sides.
51
+
52
+ What the kit does not merge this way is left to you. A declaration both sides wrote differently (two tables of one name with different columns, one of them with one more column included, a table both changed whose lines do not merge, a table one side changed and the other removed) is one hunk that holds each version whole, the rest of the region being merged, and the report names it when both sides hold it: ``the two sides do not agree on `invoices` in the region `tables`: for each, write the one declaration that keeps the intent of both, whole, or remove it.`` In the cases that follow nothing is written in the region, the hunks git wrote stay, those of a region written inside it too, and the report says why and what to write, each declaration of both sides whole, once, in most cases, where it said `both sides only add lines: keep both`: a bracket that does not pair, a regular expression, a region written inside it, two declarations of one name on one side, a side that does not hold the region once; a statement that declares no name (a call written on several lines) which a side changed or removed; lines that end no statement (entries of a list, or statements written without `;`) on which the two sides differ; two statements with no declared name that open alike, one holding every line of the other, which nothing tells from one statement written twice; declarations both sides set in two different orders; a default export on each side, written `export default` or `export { name as default }` on one line, a file having one (another spelling, `export { default } from`, a list on several lines, is not seen, and a line of that shape in a comment or a template literal counts); merged lines that would not read back as the declarations merged.
53
+
7
54
  ## 0.113.0
8
55
 
9
56
  **`ddd-ts-kit check` reports a read model store that the list of the read model tables does not answer for (`persistence/read-model-listed`).** The application checks the tables of its read models when it starts, and `npm run db:read-models` before a deployment, by the stores `src/platform/database/read-model-tables.ts` lists and no other: a store written by hand and never listed was checked by nothing, in silence. The new rule, an error, reads the stores of the tree and reports each one the list neither holds under its context (itself, a class that extends it, or the name a file gives it when it re-exports it, `export { A as B } from` or `export * from`, one level), nor names in `NOT_LISTED`, nor leaves out by a comment between the markers of the file that holds `<context>: <Store>`. Its fix gives the import and the entry to add, the entry alone when the list still imports the class, and for a store the list cannot build, what stands in the way. A store is a class of a context, tests aside, that is not abstract and extends `DrizzleReadModelStore`, `KnexReadModelStore`, `PrismaReadModelStore` or `TypeOrmReadModelStore`, directly or through classes of the project, wherever they are declared. It also reports an entry of the list whose class the file neither imports nor declares, whose import leads to no file, or whose class another context declares; a line of `NOT_LISTED` whose class is gone or whose store `LISTED` answers for; a `LISTED` whose entries it cannot read (spread, or built by a call); and, once, a project on one of the four ORM that holds stores and no list. It does not judge: an abstract class; a store in memory or in a search engine, and a class directly over `TableReadModelStore` of the kernel; a store of the tests; a class declared in a function or in a `namespace` block, and a class expression that has no name of its own (one that has is read under that name); a base that is not the name of the store of the kit or of a class of the project: a namespace (`kit.KnexReadModelStore`), an import alias, a call (`mixin(KnexReadModelStore)`); of two classes of one name in one context, which one an entry names; whether a class that extends a store reads the same table; the reason a comment gives; what a package exports (`ddd-ts-kit explain persistence/read-model-listed`, [docs/concepts/cqrs.md](docs/concepts/cqrs.md#every-table-checked-at-the-start-and-before-a-deployment)).
@@ -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,EA6MrC,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,8 +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
- 'slices.md row by row (the furthest status), the stored-events lock by key, 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',
193
198
  '(trunk side, installed again when the branch changed package.json); the rest is left in a',
194
199
  'merge in progress git understands, with what each side did (exit 1). Then, or on',
195
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,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,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,UAAU;QACnB,KAAK,EAAE;YACL,2FAA2F;YAC3F,yFAAyF;YACzF,sFAAsF;YACtF,wFAAwF;YACxF,wFAAwF;YACxF,gFAAgF;YAChF,yFAAyF;YACzF,uFAAuF;YACvF,sBAAsB;SACvB;KACF;IACD;QACE,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE;YACL,sEAAsE;YACtE,wFAAwF;YACxF,2FAA2F;YAC3F,uFAAuF;YACvF,kFAAkF;YAClF,wFAAwF;YACxF,4CAA4C;YAC5C,qFAAqF;YACrF,uCAAuC;SACxC;KACF;IACD;QACE,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE;YACL,qFAAqF;YACrF,0FAA0F;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nF,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,wFAAwF;YACxF,yFAAyF;YACzF,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,u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AA4D;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.0',
4
- '@ddd-ts-kit/validation': '^0.113.0',
5
- '@ddd-ts-kit/http': '^0.113.0',
6
- '@ddd-ts-kit/tracing': '^0.113.0',
7
- '@ddd-ts-kit/di': '^0.113.0',
8
- '@ddd-ts-kit/events': '^0.113.0',
9
- '@ddd-ts-kit/testing': '^0.113.0',
10
- '@ddd-ts-kit/drizzle': '^0.113.0',
11
- '@ddd-ts-kit/knex': '^0.113.0',
12
- '@ddd-ts-kit/prisma': '^0.113.0',
13
- '@ddd-ts-kit/typeorm': '^0.113.0',
14
- '@ddd-ts-kit/auth': '^0.113.0',
15
- '@ddd-ts-kit/rabbitmq': '^0.113.0',
16
- '@ddd-ts-kit/aspects': '^0.113.0',
17
- '@ddd-ts-kit/audit': '^0.113.0',
18
- '@ddd-ts-kit/redis': '^0.113.0',
19
- '@ddd-ts-kit/kafka': '^0.113.0',
20
- '@ddd-ts-kit/nats': '^0.113.0',
21
- '@ddd-ts-kit/scheduling': '^0.113.0',
22
- '@ddd-ts-kit/sentry': '^0.113.0',
23
- '@ddd-ts-kit/s3': '^0.113.0',
24
- '@ddd-ts-kit/opensearch': '^0.113.0',
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.0',
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.0',
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.0',
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',
@@ -1 +1 @@
1
- {"version":3,"file":"merge-imports.d.ts","sourceRoot":"","sources":["../../src/markers/merge-imports.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAqB5F"}
1
+ {"version":3,"file":"merge-imports.d.ts","sourceRoot":"","sources":["../../src/markers/merge-imports.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAqB5F"}
@@ -1,11 +1,12 @@
1
1
  import { LINE_WIDTH } from '../layout/index.js';
2
+ import { oneLineImports } from './one-line-imports.js';
2
3
  const NAMED_IMPORT = /^import (type )?\{ ([^}]+) \} from '([^']+)';$/;
3
4
  /**
4
5
  * Adds import lines to those already there; names imported from one module end up in one
5
6
  * statement, written one name per line once it no longer fits the line width.
6
7
  */
7
8
  export function mergeImports(present, wanted) {
8
- const merged = joined(present);
9
+ const merged = oneLineImports(present);
9
10
  for (const line of wanted.map((candidate) => candidate.trim())) {
10
11
  const added = NAMED_IMPORT.exec(line);
11
12
  const twin = added === null ? -1 : merged.findIndex((existing) => sameSource(NAMED_IMPORT.exec(existing), added));
@@ -20,27 +21,6 @@ export function mergeImports(present, wanted) {
20
21
  }
21
22
  return merged.flatMap(fitted);
22
23
  }
23
- /** Each import statement on one line, whatever the number of lines it was written on. */
24
- function joined(present) {
25
- const statements = [];
26
- let open;
27
- for (const line of present.map((candidate) => candidate.trim())) {
28
- if (open === undefined && /^import (?:type )?\{$/.test(line)) {
29
- open = [line];
30
- }
31
- else if (open === undefined) {
32
- statements.push(line);
33
- }
34
- else if (line.startsWith('}')) {
35
- statements.push(`${open[0] ?? ''} ${open.slice(1).join(' ').replace(/,$/, '')} ${line}`);
36
- open = undefined;
37
- }
38
- else {
39
- open.push(line);
40
- }
41
- }
42
- return [...statements, ...(open ?? [])];
43
- }
44
24
  function fitted(line) {
45
25
  const named = NAMED_IMPORT.exec(line);
46
26
  // One name alone stays on its line, whatever its length.
@@ -1 +1 @@
1
- {"version":3,"file":"merge-imports.js","sourceRoot":"","sources":["../../src/markers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AAK,CAAC,EAAE,CAAC;QAC9E,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED,OAAO,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,GAAG,CAAC,EAAE,WAAW,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACpH,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,IAA4B,EAAE,KAA6B,EAAW,EAAE,CAC1F,IAAI,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;AAElF,MAAM,OAAO,GAAG,CAAC,IAAY,EAAY,EAAE,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Each import statement on one line, whatever the number of lines it was written on. */
2
+ export declare function oneLineImports(present: readonly string[]): string[];
3
+ //# sourceMappingURL=one-line-imports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"one-line-imports.d.ts","sourceRoot":"","sources":["../../src/markers/one-line-imports.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAkBnE"}
@@ -0,0 +1,22 @@
1
+ /** Each import statement on one line, whatever the number of lines it was written on. */
2
+ export function oneLineImports(present) {
3
+ const statements = [];
4
+ let open;
5
+ for (const line of present.map((candidate) => candidate.trim())) {
6
+ if (open === undefined && /^import (?:type )?\{$/.test(line)) {
7
+ open = [line];
8
+ }
9
+ else if (open === undefined) {
10
+ statements.push(line);
11
+ }
12
+ else if (line.startsWith('}')) {
13
+ statements.push(`${open[0] ?? ''} ${open.slice(1).join(' ').replace(/,$/, '')} ${line}`);
14
+ open = undefined;
15
+ }
16
+ else {
17
+ open.push(line);
18
+ }
19
+ }
20
+ return [...statements, ...(open ?? [])];
21
+ }
22
+ //# sourceMappingURL=one-line-imports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"one-line-imports.js","sourceRoot":"","sources":["../../src/markers/one-line-imports.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,UAAU,cAAc,CAAC,OAA0B;IACvD,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,IAAI,IAA0B,CAAC;IAE/B,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;QAChE,IAAI,IAAI,KAAK,SAAS,IAAI,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7D,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC;aAAM,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YAC9B,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;aAAM,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAChC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;YACzF,IAAI,GAAG,SAAS,CAAC;QACnB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,UAAU,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;AAC1C,CAAC"}
@@ -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,+B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AK,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC;AAC5F,CAAC;AAED,uIAAuI;AACvI,SAAS,SAAS,CAAC,IAAY,EAAE,EAAE,IAAI,EAAE,EAAE,EAAQ,EAAE,MAAc;IACjE,MAAM,MAAM,GACV,IAAI;SACD,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC;SACd,OAAO,EAAE;SACT,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;SACtB,OAAO,EAAE;SACT,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAElB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;IACzC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,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,7 @@
1
+ /**
2
+ * The brackets left open after `code`, read after those `open` holds, each by its kind; undefined
3
+ * when a bracket closes one that was not opened, or one of another kind. Comments and strings
4
+ * are blanked in `code`.
5
+ */
6
+ export declare function bracketsLeftOpen(code: string, open?: readonly number[]): number[] | undefined;
7
+ //# sourceMappingURL=brackets-left-open.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brackets-left-open.d.ts","sourceRoot":"","sources":["../../../src/merge/declarations/brackets-left-open.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,SAAS,MAAM,EAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAejG"}
@@ -0,0 +1,21 @@
1
+ import { BRACKETS } from '../../check/text/brackets.js';
2
+ /**
3
+ * The brackets left open after `code`, read after those `open` holds, each by its kind; undefined
4
+ * when a bracket closes one that was not opened, or one of another kind. Comments and strings
5
+ * are blanked in `code`.
6
+ */
7
+ export function bracketsLeftOpen(code, open = []) {
8
+ const waiting = [...open];
9
+ for (const char of code) {
10
+ const opener = BRACKETS.openers.indexOf(char);
11
+ const closer = BRACKETS.closers.indexOf(char);
12
+ if (opener !== -1) {
13
+ waiting.push(opener);
14
+ }
15
+ else if (closer !== -1 && waiting.pop() !== closer) {
16
+ return undefined;
17
+ }
18
+ }
19
+ return waiting;
20
+ }
21
+ //# sourceMappingURL=brackets-left-open.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brackets-left-open.js","sourceRoot":"","sources":["../../../src/merge/declarations/brackets-left-open.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,IAAI,GAAsB,EAAE;IACzE,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAE1B,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC9C,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE9C,IAAI,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;aAAM,IAAI,MAAM,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,KAAK,MAAM,EAAE,CAAC;YACrD,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,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"}
@@ -0,0 +1,15 @@
1
+ /** One declaration of a generated region: a table, a model, a function, with the comments written above it. */
2
+ export interface Declaration {
3
+ /** What makes it the same declaration on two sides: the name it declares, else its text. */
4
+ readonly key: string;
5
+ /** The name it declares, when it declares one. */
6
+ readonly name?: string;
7
+ readonly lines: readonly string[];
8
+ /** Whether a line that ends a statement closes it: an entry of a list, ended by a comma, is closed by a blank line or the end of the region. */
9
+ readonly ended: boolean;
10
+ /** The blank lines written above it. */
11
+ readonly gap: number;
12
+ /** Whether it opens the region on its side: nothing above it says how it is set apart. */
13
+ readonly first: boolean;
14
+ }
15
+ //# sourceMappingURL=declaration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../../src/merge/declarations/declaration.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,MAAM,WAAW,WAAW;IAC1B,4FAA4F;IAC5F,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,gJAAgJ;IAChJ,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,wCAAwC;IACxC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,0FAA0F;IAC1F,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=declaration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declaration.js","sourceRoot":"","sources":["../../../src/merge/declarations/declaration.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
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;
4
+ /**
5
+ * The lines of a region read as declarations, each whole: a statement runs until its brackets are
6
+ * closed and its line ends it (a closing brace does not when the next line goes on with an
7
+ * operator), until a blank line outside any bracket, or until a line that declares another name
8
+ * outside any bracket; the comments above it are its own. Undefined when the region cannot be read with certainty: a bracket that does not
9
+ * pair, a text the lexer may have taken for code, a region written inside it, or two declarations
10
+ * of one name.
11
+ */
12
+ export declare function declarationsOf(lines: readonly string[]): DeclaredSide | undefined;
13
+ //# sourceMappingURL=declarations-of.d.ts.map
@@ -0,0 +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;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"}
@@ -0,0 +1,130 @@
1
+ import { scan } from '../../check/scan/scan.js';
2
+ import { REGION_MARKER } from '../../markers/index.js';
3
+ import { bracketsLeftOpen } from './brackets-left-open.js';
4
+ /** A line that declares a name outside any bracket: a constant, a function, a class, a type, an enum, a model of Prisma. */
5
+ const NAMED = /^\s*(?:export\s+)?(?:default\s+)?(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:const\s+enum|const|let|var|function\s*\*?|class|interface|type|enum|namespace|module|model|view)\s+([A-Za-z_$][\w$]*)/;
6
+ /** A default export written as a declaration or an expression. */
7
+ const DEFAULT = /^\s*export\s+default\b/;
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
+ const ENDS = /[;}]$/;
10
+ /** How a line starts that goes on with the statement above it, whatever that one ends with but a semicolon. */
11
+ export const GOES_ON = /^(?:[|&?:.+\-*/=]|satisfies\b|as\b)/;
12
+ /**
13
+ * The lines of a region read as declarations, each whole: a statement runs until its brackets are
14
+ * closed and its line ends it (a closing brace does not when the next line goes on with an
15
+ * operator), until a blank line outside any bracket, or until a line that declares another name
16
+ * outside any bracket; the comments above it are its own. Undefined when the region cannot be read with certainty: a bracket that does not
17
+ * pair, a text the lexer may have taken for code, a region written inside it, or two declarations
18
+ * of one name.
19
+ */
20
+ export function declarationsOf(lines) {
21
+ const scanned = scan(lines.join('\n'));
22
+ if (scanned.uncertain || lines.some((line) => REGION_MARKER.test(line))) {
23
+ return undefined;
24
+ }
25
+ const read = readings(lines, scanned.code.split('\n'));
26
+ if (read === undefined) {
27
+ return undefined;
28
+ }
29
+ const left = read.last.lines.length > 0;
30
+ const declarations = [...read.closed, ...(left ? [read.last] : [])].map(declared);
31
+ const keys = new Set(declarations.map(({ key }) => key));
32
+ return keys.size === declarations.length ? { declarations, trailing: left ? 0 : read.last.gap } : undefined;
33
+ }
34
+ /** Each declaration a line closed, and the one the last line left; undefined when a bracket does not pair. */
35
+ function readings(lines, code) {
36
+ const closed = [];
37
+ let reading = blank(0);
38
+ for (const [at, line] of lines.entries()) {
39
+ const next = code.slice(at + 1).find((after) => after.trim() !== '') ?? '';
40
+ const step = followed(reading, { line, code: (code[at] ?? '').trim(), goesOn: GOES_ON.test(next.trim()) });
41
+ if (step === undefined) {
42
+ return undefined;
43
+ }
44
+ closed.push(...step.closed);
45
+ reading = step.reading;
46
+ }
47
+ return reading.open.length > 0 ? undefined : { closed, last: reading };
48
+ }
49
+ function blank(gap) {
50
+ return { lines: [], open: [], name: undefined, code: false, tail: 0, margin: 0, gap, ended: false };
51
+ }
52
+ /** The reading after one more line; undefined when the line closes a bracket that is not open. */
53
+ function followed(reading, { line, code, goesOn }) {
54
+ const apart = line.trim() === '' && reading.open.length === 0 ? setApart(reading, goesOn) : undefined;
55
+ if (apart !== undefined) {
56
+ return apart;
57
+ }
58
+ const second = startsAnother(reading, line, code);
59
+ const grown = withLine(second ? afterNamed(reading) : reading, line, code);
60
+ const before = second ? [beforeNamed(reading)] : [];
61
+ if (grown === undefined) {
62
+ return undefined;
63
+ }
64
+ return grown.code && grown.open.length === 0 && ends(code, goesOn)
65
+ ? { reading: blank(0), closed: [...before, { ...grown, ended: true }] }
66
+ : { reading: grown, closed: before };
67
+ }
68
+ /** Whether a line ends its statement once its brackets are closed: a semicolon does, a closing brace unless the next line goes on. */
69
+ function ends(code, goesOn) {
70
+ return code.endsWith(';') || (ENDS.test(code) && !goesOn);
71
+ }
72
+ /**
73
+ * What a blank line outside any bracket makes of a reading: one more above a declaration to come,
74
+ * the end of one that holds code unless the code after it goes on with it.
75
+ */
76
+ function setApart(reading, goesOn) {
77
+ if (reading.lines.length === 0) {
78
+ return { reading: { ...reading, gap: reading.gap + 1 }, closed: [] };
79
+ }
80
+ return reading.code && !goesOn ? { reading: blank(1), closed: [reading] } : undefined;
81
+ }
82
+ /** Whether a line declares another name where the declaration read so far declared its own: outside any bracket, no deeper in the margin. */
83
+ function startsAnother(reading, line, code) {
84
+ return (reading.open.length === 0 &&
85
+ reading.name !== undefined &&
86
+ nameOf(code) !== undefined &&
87
+ marginOf(line) <= reading.margin);
88
+ }
89
+ function marginOf(line) {
90
+ return line.length - line.trimStart().length;
91
+ }
92
+ /** A declaration without the comments written under its last line of code: they stand above the one that follows. */
93
+ function beforeNamed(reading) {
94
+ return { ...reading, lines: reading.lines.slice(0, reading.lines.length - reading.tail), tail: 0 };
95
+ }
96
+ /** The reading a second name starts: the comments the declaration before it ended with. */
97
+ function afterNamed(reading) {
98
+ return { ...blank(0), lines: reading.lines.slice(reading.lines.length - reading.tail) };
99
+ }
100
+ /** A reading with one more line: the brackets it leaves open, the name it declares when it is written outside any. */
101
+ function withLine(reading, line, code) {
102
+ const open = bracketsLeftOpen(code, reading.open);
103
+ const named = reading.open.length === 0 ? nameOf(code) : undefined;
104
+ return open === undefined
105
+ ? undefined
106
+ : {
107
+ ...reading,
108
+ lines: [...reading.lines, line],
109
+ open,
110
+ name: reading.name ?? named,
111
+ margin: reading.name === undefined && named !== undefined ? marginOf(line) : reading.margin,
112
+ code: reading.code || code !== '',
113
+ tail: code === '' ? reading.tail + 1 : 0,
114
+ };
115
+ }
116
+ /** The name a line declares; a default export that declares none is `default`. */
117
+ function nameOf(code) {
118
+ return NAMED.exec(code)?.[1] ?? (DEFAULT.test(code) ? 'default' : undefined);
119
+ }
120
+ function declared({ lines, name, gap, ended }, at) {
121
+ return {
122
+ ended,
123
+ key: name === undefined ? `text ${lines.join('\n')}` : `name ${name}`,
124
+ ...(name === undefined ? {} : { name }),
125
+ lines,
126
+ gap,
127
+ first: at === 0,
128
+ };
129
+ }
130
+ //# sourceMappingURL=declarations-of.js.map
@@ -0,0 +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,CAAC,MAAM,OAAO,GAAG,qCAAqC,CAAC;AAwB7D;;;;;;;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,E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