@voxgig/sdkgen 3.4.7 → 3.5.0

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 (194) hide show
  1. package/bin/voxgig-sdkgen +78 -10
  2. package/dist/action/action.d.ts +5 -2
  3. package/dist/action/action.js +113 -6
  4. package/dist/action/action.js.map +1 -1
  5. package/dist/action/check.d.ts +15 -0
  6. package/dist/action/check.js +347 -0
  7. package/dist/action/check.js.map +1 -0
  8. package/dist/action/dispatch.d.ts +8 -0
  9. package/dist/action/dispatch.js +74 -0
  10. package/dist/action/dispatch.js.map +1 -0
  11. package/dist/action/docs.d.ts +4 -0
  12. package/dist/action/docs.js +236 -0
  13. package/dist/action/docs.js.map +1 -0
  14. package/dist/action/doctor.d.ts +5 -2
  15. package/dist/action/doctor.js +526 -74
  16. package/dist/action/doctor.js.map +1 -1
  17. package/dist/action/feature.js +96 -17
  18. package/dist/action/feature.js.map +1 -1
  19. package/dist/action/kind.d.ts +30 -0
  20. package/dist/action/kind.js +258 -0
  21. package/dist/action/kind.js.map +1 -0
  22. package/dist/action/package.d.ts +25 -0
  23. package/dist/action/package.js +852 -0
  24. package/dist/action/package.js.map +1 -0
  25. package/dist/action/resolve.d.ts +18 -0
  26. package/dist/action/resolve.js +280 -0
  27. package/dist/action/resolve.js.map +1 -0
  28. package/dist/action/target.d.ts +7 -1
  29. package/dist/action/target.js +240 -97
  30. package/dist/action/target.js.map +1 -1
  31. package/dist/cmp/Docs.d.ts +4 -0
  32. package/dist/cmp/Docs.js +98 -0
  33. package/dist/cmp/Docs.js.map +1 -0
  34. package/dist/cmp/ExternalDocs.d.ts +2 -0
  35. package/dist/cmp/ExternalDocs.js +43 -0
  36. package/dist/cmp/ExternalDocs.js.map +1 -0
  37. package/dist/helpers/definition.d.ts +5 -0
  38. package/dist/helpers/definition.js +72 -0
  39. package/dist/helpers/definition.js.map +1 -0
  40. package/dist/helpers/featureSource.d.ts +8 -2
  41. package/dist/helpers/featureSource.js +61 -12
  42. package/dist/helpers/featureSource.js.map +1 -1
  43. package/dist/helpers/junk.d.ts +11 -0
  44. package/dist/helpers/junk.js +149 -0
  45. package/dist/helpers/junk.js.map +1 -0
  46. package/dist/helpers/manifest.d.ts +50 -0
  47. package/dist/helpers/manifest.js +328 -0
  48. package/dist/helpers/manifest.js.map +1 -0
  49. package/dist/helpers/modelcheck.d.ts +22 -0
  50. package/dist/helpers/modelcheck.js +203 -0
  51. package/dist/helpers/modelcheck.js.map +1 -0
  52. package/dist/helpers/semver.d.ts +4 -0
  53. package/dist/helpers/semver.js +174 -0
  54. package/dist/helpers/semver.js.map +1 -0
  55. package/dist/helpers/shipped.d.ts +4 -0
  56. package/dist/helpers/shipped.js +36 -0
  57. package/dist/helpers/shipped.js.map +1 -0
  58. package/dist/helpers/stdrep.d.ts +9 -1
  59. package/dist/helpers/stdrep.js +22 -0
  60. package/dist/helpers/stdrep.js.map +1 -1
  61. package/dist/sdkgen.d.ts +15 -3
  62. package/dist/sdkgen.js +233 -67
  63. package/dist/sdkgen.js.map +1 -1
  64. package/dist/tsconfig.tsbuildinfo +1 -1
  65. package/dist/types.d.ts +10 -2
  66. package/dist/utility.js +17 -0
  67. package/dist/utility.js.map +1 -1
  68. package/model/sdkgen.aontu +69 -0
  69. package/package.json +3 -2
  70. package/project/.sdk/model/feature/audit.aontu +1 -0
  71. package/project/.sdk/model/feature/cache.aontu +1 -0
  72. package/project/.sdk/model/feature/clienttrack.aontu +1 -0
  73. package/project/.sdk/model/feature/debug.aontu +1 -0
  74. package/project/.sdk/model/feature/idempotency.aontu +1 -0
  75. package/project/.sdk/model/feature/log.aontu +1 -0
  76. package/project/.sdk/model/feature/metrics.aontu +1 -0
  77. package/project/.sdk/model/feature/netsim.aontu +1 -0
  78. package/project/.sdk/model/feature/paging.aontu +1 -0
  79. package/project/.sdk/model/feature/proxy.aontu +1 -0
  80. package/project/.sdk/model/feature/ratelimit.aontu +1 -0
  81. package/project/.sdk/model/feature/rbac.aontu +1 -0
  82. package/project/.sdk/model/feature/retry.aontu +1 -0
  83. package/project/.sdk/model/feature/streaming.aontu +1 -0
  84. package/project/.sdk/model/feature/telemetry.aontu +1 -0
  85. package/project/.sdk/model/feature/test.aontu +1 -0
  86. package/project/.sdk/model/feature/timeout.aontu +1 -0
  87. package/project/.sdk/model/target/c.aontu +1 -0
  88. package/project/.sdk/model/target/clojure.aontu +1 -0
  89. package/project/.sdk/model/target/cpp.aontu +1 -0
  90. package/project/.sdk/model/target/dart.aontu +1 -0
  91. package/project/.sdk/model/target/elixir.aontu +1 -0
  92. package/project/.sdk/model/target/go-cli.aontu +1 -0
  93. package/project/.sdk/model/target/go-mcp.aontu +1 -0
  94. package/project/.sdk/model/target/go.aontu +1 -0
  95. package/project/.sdk/model/target/haskell.aontu +1 -0
  96. package/project/.sdk/model/target/java.aontu +1 -0
  97. package/project/.sdk/model/target/js.aontu +1 -0
  98. package/project/.sdk/model/target/kotlin.aontu +1 -0
  99. package/project/.sdk/model/target/lean.aontu +1 -0
  100. package/project/.sdk/model/target/lua.aontu +1 -0
  101. package/project/.sdk/model/target/ocaml.aontu +1 -0
  102. package/project/.sdk/model/target/perl.aontu +1 -0
  103. package/project/.sdk/model/target/php.aontu +1 -0
  104. package/project/.sdk/model/target/py-data.aontu +1 -0
  105. package/project/.sdk/model/target/py.aontu +1 -0
  106. package/project/.sdk/model/target/rb.aontu +1 -0
  107. package/project/.sdk/model/target/rust.aontu +1 -0
  108. package/project/.sdk/model/target/scala.aontu +1 -0
  109. package/project/.sdk/model/target/seneca-provider.aontu +1 -0
  110. package/project/.sdk/model/target/zig.aontu +1 -0
  111. package/project/.sdk/src/cmp/c/Config_c.ts +44 -0
  112. package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +3 -1
  113. package/project/.sdk/src/cmp/clojure/Config_clojure.ts +37 -42
  114. package/project/.sdk/src/cmp/clojure/utility_clojure.ts +42 -0
  115. package/project/.sdk/src/cmp/cpp/Config_cpp.ts +18 -0
  116. package/project/.sdk/src/cmp/csharp/Config_csharp.ts +125 -52
  117. package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +3 -1
  118. package/project/.sdk/src/cmp/csharp/utility_csharp.ts +94 -6
  119. package/project/.sdk/src/cmp/dart/Config_dart.ts +43 -5
  120. package/project/.sdk/src/cmp/dart/fragment/Config.data.fragment.dart +74 -0
  121. package/project/.sdk/src/cmp/dart/fragment/Config.fragment.dart +6 -9
  122. package/project/.sdk/src/cmp/dart/fragment/Main.fragment.dart +16 -5
  123. package/project/.sdk/src/cmp/dart/utility_dart.ts +18 -0
  124. package/project/.sdk/src/cmp/elixir/Config_elixir.ts +128 -13
  125. package/project/.sdk/src/cmp/elixir/fragment/Main.fragment.ex +3 -1
  126. package/project/.sdk/src/cmp/elixir/utility_elixir.ts +6 -0
  127. package/project/.sdk/src/cmp/haskell/Config_haskell.ts +35 -52
  128. package/project/.sdk/src/cmp/haskell/Package_haskell.ts +1 -0
  129. package/project/.sdk/src/cmp/haskell/Test_haskell.ts +1 -1
  130. package/project/.sdk/src/cmp/haskell/utility_haskell.ts +15 -5
  131. package/project/.sdk/src/cmp/java/Config_java.ts +21 -0
  132. package/project/.sdk/src/cmp/kotlin/Config_kotlin.ts +15 -0
  133. package/project/.sdk/src/cmp/ocaml/Config_ocaml.ts +42 -39
  134. package/project/.sdk/src/cmp/perl/Config_perl.ts +15 -0
  135. package/project/.sdk/src/cmp/perl/fragment/Main.fragment.pm +3 -1
  136. package/project/.sdk/src/cmp/rust/Config_rust.ts +44 -0
  137. package/project/.sdk/src/cmp/rust/fragment/Main.fragment.rs +4 -2
  138. package/project/.sdk/src/cmp/scala/Config_scala.ts +15 -0
  139. package/project/.sdk/src/cmp/swift/Config_swift.ts +17 -0
  140. package/project/.sdk/src/cmp/swift/fragment/Main.fragment.swift +3 -1
  141. package/project/.sdk/src/cmp/zig/Config_zig.ts +44 -0
  142. package/project/.sdk/src/cmp/zig/TestEntity_zig.ts +9 -2
  143. package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +3 -1
  144. package/project/.sdk/tm/c/core/sdk.h +1 -0
  145. package/project/.sdk/tm/c/utility/make_options.c +5 -1
  146. package/project/.sdk/tm/clojure/src/sdk/core.clj +51 -3
  147. package/project/.sdk/tm/cpp/core/types.hpp +4 -1
  148. package/project/.sdk/tm/cpp/utility/pipeline.hpp +5 -1
  149. package/project/.sdk/tm/csharp/test/PipelineTest.cs +15 -0
  150. package/project/.sdk/tm/csharp/utility/MakeOptions.cs +67 -1
  151. package/project/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +43 -0
  152. package/project/.sdk/tm/elixir/lib/projectname/utility.ex +58 -2
  153. package/project/.sdk/tm/haskell/{test/TestJson.hs → src/SdkJson.hs} +8 -4
  154. package/project/.sdk/tm/haskell/src/SdkRuntime.hs +55 -2
  155. package/project/.sdk/tm/haskell/test/Runner.hs +1 -1
  156. package/project/.sdk/tm/haskell/test/StructCorpus.hs +1 -1
  157. package/project/.sdk/tm/java/core/SdkClient.java +3 -1
  158. package/project/.sdk/tm/java/utility/MakeOptions.java +5 -1
  159. package/project/.sdk/tm/kotlin/core/SdkClient.kt +3 -1
  160. package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +5 -1
  161. package/project/.sdk/tm/ocaml/Makefile +3 -2
  162. package/project/.sdk/tm/ocaml/sdk_json.ml +106 -0
  163. package/project/.sdk/tm/ocaml/sdk_runtime.ml +56 -0
  164. package/project/.sdk/tm/ocaml/test/struct_corpus.ml +4 -86
  165. package/project/.sdk/tm/perl/utility/make_options.pm +5 -1
  166. package/project/.sdk/tm/rust/utility/make_options.rs +79 -1
  167. package/project/.sdk/tm/scala/core/SdkClient.scala +3 -1
  168. package/project/.sdk/tm/scala/utility/Make.scala +5 -1
  169. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +5 -1
  170. package/project/.sdk/tm/zig/core/utility.zig +85 -1
  171. package/project/sdkgen-package.json +57 -0
  172. package/src/action/action.ts +136 -6
  173. package/src/action/check.ts +495 -0
  174. package/src/action/dispatch.ts +105 -0
  175. package/src/action/docs.ts +310 -0
  176. package/src/action/doctor.ts +692 -81
  177. package/src/action/feature.ts +109 -17
  178. package/src/action/kind.ts +375 -0
  179. package/src/action/package.ts +1173 -0
  180. package/src/action/resolve.ts +362 -0
  181. package/src/action/target.ts +290 -108
  182. package/src/cmp/Docs.ts +125 -0
  183. package/src/cmp/ExternalDocs.ts +54 -0
  184. package/src/helpers/definition.ts +82 -0
  185. package/src/helpers/featureSource.ts +83 -13
  186. package/src/helpers/junk.ts +168 -0
  187. package/src/helpers/manifest.ts +474 -0
  188. package/src/helpers/modelcheck.ts +262 -0
  189. package/src/helpers/semver.ts +211 -0
  190. package/src/helpers/shipped.ts +41 -0
  191. package/src/helpers/stdrep.ts +70 -0
  192. package/src/sdkgen.ts +294 -66
  193. package/src/types.ts +33 -3
  194. package/src/utility.ts +17 -0
@@ -0,0 +1,236 @@
1
+ "use strict";
2
+ // `docs add <ref>` — the third kind. See docs/design/sdkgen-packages.md §20.
3
+ //
4
+ // WHAT A DOCS ITEM IS
5
+ //
6
+ // A generation target whose destination is a DOCUMENTATION SYSTEM rather than
7
+ // a language: a static site, a developer-portal catalogue, a hosted service's
8
+ // config. sdkgen ships the kind and no items; the items live in packages
9
+ // (`@voxgig/docgen` first), which is what makes the destinations someone
10
+ // else's business rather than a list this repo has to guess at.
11
+ //
12
+ // WHY IT IS NOT A TARGET
13
+ //
14
+ // Three reasons, argued in §20.2 and worth restating where the code is:
15
+ //
16
+ // - a docs item's INPUT is the target collection — a page per SDK, the
17
+ // package table, per-language tabs — so a docs item inside
18
+ // `main.kit.target` would enumerate itself;
19
+ // - `action/feature.ts` fans out with `each(target, …)` and warns
20
+ // `feature-source-missing` per target with no source, so a docs item in
21
+ // that collection would collect one warning per feature, forever
22
+ // (`srcfeature: false` does not help — that flag is read at generate time
23
+ // and never by the add-time fan-out);
24
+ // - `ext`, `comment: line` and `module: name` are required, non-defaulted
25
+ // strings in the target spread, and a site emitting `.md`, `.yml`, `.css`
26
+ // and `.svg` at once has no honest value for `comment.line`.
27
+ //
28
+ // WHAT THIS ACTION DOES, AND WHAT IT DELIBERATELY DOES NOT
29
+ //
30
+ // It installs the definition — through the shared spine, so provenance,
31
+ // aliasing and the index come along unchanged — and the kind's trees, whose
32
+ // paths come from the registry rather than being spelled here.
33
+ //
34
+ // It does NOT fan out over targets, trim, or prune. A docs item reads the
35
+ // target collection at GENERATE time, not at add time: the opposite direction
36
+ // and the opposite moment from a feature's fan-out, so sharing that machinery
37
+ // would have been a false economy.
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.action_docs = action_docs;
40
+ exports.docs_add = docs_add;
41
+ const jostraca_1 = require("jostraca");
42
+ const utility_1 = require("../utility");
43
+ const stdrep_1 = require("../helpers/stdrep");
44
+ const junk_1 = require("../helpers/junk");
45
+ const kind_1 = require("./kind");
46
+ const resolve_1 = require("./resolve");
47
+ const target_1 = require("./target");
48
+ const action_1 = require("./action");
49
+ // The PREFIX of a docs item's component tree (`src/cmp/docs/`), for the
50
+ // alias rewrite. Derived from the registry's declaration rather than written
51
+ // out a second time, so the two cannot disagree about where docs components
52
+ // live.
53
+ const NAME_MARK = '\u0001name\u0001';
54
+ function cmpBase() {
55
+ const cmp = (0, kind_1.kindTrees)('docs', NAME_MARK)
56
+ .find((t) => 'none' === t.replace);
57
+ return null == cmp ? 'src/cmp/docs/' : cmp.path.split(NAME_MARK)[0];
58
+ }
59
+ const CMD_MAP = Object.assign(Object.create(null), {
60
+ add: cmd_docs_add,
61
+ });
62
+ async function action_docs(args, actx) {
63
+ const cmdname = args[1];
64
+ const cmd = CMD_MAP[cmdname];
65
+ if (null == cmd) {
66
+ throw new utility_1.SdkGenError('Unknown docs cmd: ' + cmdname + ' (expected: ' +
67
+ Object.keys(CMD_MAP).sort().join(', ') + ')');
68
+ }
69
+ return await cmd(args, actx);
70
+ }
71
+ async function cmd_docs_add(args, actx) {
72
+ return docs_add((0, action_1.parseAddNames)(args), actx);
73
+ }
74
+ // Code API.
75
+ async function docs_add(docs, actx) {
76
+ const jostraca = actx.jostraca;
77
+ const opts = {
78
+ fs: actx.fs,
79
+ folder: actx.folder,
80
+ log: actx.log.child({ cmp: 'jostraca' }),
81
+ meta: {
82
+ url: actx.url,
83
+ // Seeded: no project scaffolded before the docs kind existed has a
84
+ // docs index, and every project alive today is in that position.
85
+ content: (0, action_1.loadContent)(actx, 'docs', { docs: '# Docs\n' }),
86
+ },
87
+ model: actx.model,
88
+ // Per-call, never left to the Jostraca instance: `generate` runs its own
89
+ // options through OptionsShape first, which fills `control.dryrun: false`
90
+ // and would override the instance flag. The same trap target_add
91
+ // documents.
92
+ control: {
93
+ dryrun: !!actx.opts.dryrun
94
+ },
95
+ // Per-call for the same reason, and covering the same accident: see
96
+ // helpers/junk.
97
+ cmp: (0, junk_1.copyOpts)(),
98
+ };
99
+ opts.log.info({
100
+ point: 'docs-start',
101
+ note: (actx.opts.dryrun ? '** DRY RUN **' : '')
102
+ });
103
+ // PREFLIGHT, before a single file is written.
104
+ //
105
+ // The write pass emits the definition and its index entry before it copies
106
+ // the trees, so a ref whose definition exists but whose required components
107
+ // do not left the command failed AND the project carrying a docs item with
108
+ // no implementation — which the next model compile then reads as real.
109
+ // `package add` already validates a whole package up front for exactly this
110
+ // reason; a direct `docs add` needs the same guarantee.
111
+ preflight(docs, actx);
112
+ // The project's own model must INCLUDE the docs index, or everything below
113
+ // is invisible: no project scaffolded before this kind existed includes it,
114
+ // and `main.kit.docs` would simply be absent from the next compile.
115
+ (0, action_1.ensureModelInclude)(actx, 'docs');
116
+ // Into the IN-MEMORY model before anything reads it. Nothing recompiles
117
+ // `model/sdk.aontu` mid-process, so without this a second docs item in the
118
+ // same command — and anything else later in it — behaves as if the first
119
+ // was never installed. One definition of what gets recorded, shared with
120
+ // `target add` and `package add`.
121
+ (0, resolve_1.registerInstalled)('docs', docs, actx);
122
+ const jres = await jostraca.generate(opts, () => DocsRoot({ docs, actx }));
123
+ return { jres };
124
+ }
125
+ // Resolve every ref and check every REQUIRED tree, throwing before anything
126
+ // is written. Resolution itself is the other half: a ref that names no
127
+ // definition fails here rather than partway through the pass.
128
+ function preflight(docs, actx) {
129
+ const fs = actx.fs();
130
+ for (const ref of docs) {
131
+ const source = (0, kind_1.resolveKind)(ref, 'docs', actx);
132
+ for (const tree of (0, kind_1.kindTrees)('docs', source.origname)) {
133
+ if (!tree.required) {
134
+ continue;
135
+ }
136
+ const from = source.folder + '/' + tree.path;
137
+ if (!fs.existsSync(from)) {
138
+ throw new utility_1.SdkGenError('Docs ' + source.name + ': required tree not found: ' + from +
139
+ '\n a docs item needs its components (' + tree.path +
140
+ '); nothing has been written');
141
+ }
142
+ }
143
+ }
144
+ }
145
+ const DocsRoot = (0, jostraca_1.cmp)(function DocsRoot(props) {
146
+ const { ctx$, docs } = props;
147
+ const { log } = ctx$;
148
+ (0, jostraca_1.Project)({}, () => {
149
+ // Every installed name seen so far in this run: the index File is
150
+ // re-rendered per item and the last render wins, so each render has to
151
+ // carry all of them.
152
+ const dnames = [];
153
+ (0, jostraca_1.each)(docs, (n) => {
154
+ const dref = n.val$;
155
+ log.info({ point: 'docs-build', docs: dref, note: dref });
156
+ // The shared spine: a BARE name resolves against what the model
157
+ // RECORDS, so a docs item installed from a package resolves back to
158
+ // that package on its next add rather than to the bundled scaffold.
159
+ const source = (0, kind_1.resolveKind)(dref, 'docs', ctx$);
160
+ dnames.push(source.name);
161
+ log.info({
162
+ point: 'docs-name', docs: source.name, folder: source.folder, ref: dref,
163
+ note: source.name +
164
+ (source.name !== source.origname ?
165
+ ' (from ' + source.origname + ')' : '') +
166
+ ' from:' + source.folder
167
+ });
168
+ (0, jostraca_1.Folder)({ name: 'model/docs' }, () => (0, kind_1.kindModel)({
169
+ ctx$, kind: 'docs', source, names: dnames,
170
+ content: ctx$.meta.content.docs_index,
171
+ }));
172
+ // Both ends of every tree come from the registry's ONE declaration,
173
+ // resolved twice: the source carries the ORIGIN name, the destination
174
+ // the installed one. Deriving the source path by substituting inside
175
+ // the destination path would corrupt any item whose name also appears
176
+ // in the fixed part of the path.
177
+ const dest = (0, kind_1.kindTrees)('docs', source.name);
178
+ const from = (0, kind_1.kindTrees)('docs', source.origname);
179
+ dest.forEach((tree, i) => {
180
+ // Copy only ADDS and overwrites. A newer version of the package that
181
+ // RETIRED a template would leave the old one behind, generating from
182
+ // it forever — the failure `pruneStaleTemplates` exists for, and the
183
+ // reason 30 repos once carried a superseded harness file.
184
+ //
185
+ // Templates only, exactly as `target add` prunes only `tm`: extra
186
+ // files under a component tree are the project's own (doctor calls
187
+ // them `additive`, and adding a component is the supported way to
188
+ // extend an item), so pruning there would delete supported work.
189
+ if ('template' === tree.replace) {
190
+ (0, target_1.pruneStaleTemplates)(ctx$, source.folder + '/' + from[i].path, tree.path, [], !!props.actx?.opts?.dryrun);
191
+ }
192
+ copyTree(ctx$, source, tree, from[i].path);
193
+ });
194
+ log.info({ point: 'docs-done', docs: source.name, note: source.name });
195
+ });
196
+ });
197
+ });
198
+ // One tree, copied from the origin path to the installed one.
199
+ //
200
+ // An optional tree the source does not ship is simply not copied — that is
201
+ // what `required: false` means, and a docs item whose every byte is generated
202
+ // legitimately has no template tree.
203
+ function copyTree(ctx$, source, tree, frompath) {
204
+ const fs = ctx$.fs();
205
+ const from = source.folder + '/' + frompath;
206
+ if (!fs.existsSync(from)) {
207
+ if (tree.required) {
208
+ throw new utility_1.SdkGenError('Docs ' + source.name + ': required tree not found: ' + from);
209
+ }
210
+ ctx$.log.info({
211
+ point: 'docs-tree-absent', docs: source.name, tree: tree.path, from,
212
+ note: source.name + ': the source ships no ' + frompath +
213
+ ', nothing to copy'
214
+ });
215
+ return;
216
+ }
217
+ // An ALIASED component tree cannot be copied verbatim: components are
218
+ // dispatched by the convention `cmp/docs/<n>/Main_<n>`, so files keeping
219
+ // the origin suffix resolve nothing — `Main_apidocs.ts` is invisible to a
220
+ // lookup for `Main_portal`. Same rule as a target's, so the same function
221
+ // does it; jostraca's tree Copy has no per-entry rename hook, which is why
222
+ // an aliased tree is emitted file by file.
223
+ if (source.name !== source.origname && 'none' === tree.replace) {
224
+ (0, target_1.aliasCmpTree)(ctx$, from, tree.path, source.origname, source.name, cmpBase());
225
+ return;
226
+ }
227
+ (0, jostraca_1.Folder)({ name: tree.path }, () => {
228
+ (0, jostraca_1.Copy)({
229
+ from,
230
+ // Shared with doctor, which re-applies them before comparing.
231
+ ...('template' === tree.replace ?
232
+ { replace: (0, stdrep_1.templateReplacements)(ctx$.model, source.name) } : {}),
233
+ });
234
+ });
235
+ }
236
+ //# sourceMappingURL=docs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/action/docs.ts"],"names":[],"mappings":";AAAA,6EAA6E;AAC7E,EAAE;AACF,sBAAsB;AACtB,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,yEAAyE;AACzE,yEAAyE;AACzE,gEAAgE;AAChE,EAAE;AACF,yBAAyB;AACzB,EAAE;AACF,wEAAwE;AACxE,EAAE;AACF,yEAAyE;AACzE,+DAA+D;AAC/D,gDAAgD;AAChD,oEAAoE;AACpE,4EAA4E;AAC5E,qEAAqE;AACrE,8EAA8E;AAC9E,0CAA0C;AAC1C,4EAA4E;AAC5E,8EAA8E;AAC9E,iEAAiE;AACjE,EAAE;AACF,2DAA2D;AAC3D,EAAE;AACF,wEAAwE;AACxE,4EAA4E;AAC5E,+DAA+D;AAC/D,EAAE;AACF,0EAA0E;AAC1E,8EAA8E;AAC9E,8EAA8E;AAC9E,mCAAmC;;QAgRjC,WAAW;QACX,QAAQ;AA/QV,uCAA2D;AAO3D,wCAAwC;AAExC,8CAAwD;AAExD,0CAA0C;AAE1C,iCAA0D;AAG1D,uCAA6C;AAE7C,qCAA4D;AAE5D,qCAAyE;AAGzE,wEAAwE;AACxE,6EAA6E;AAC7E,4EAA4E;AAC5E,QAAQ;AACR,MAAM,SAAS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C,CAAC,CAAA;AACJ,CAAC"}
@@ -6,9 +6,12 @@ type DoctorReport = {
6
6
  missing: string[];
7
7
  additive: string[];
8
8
  unwired: string[];
9
+ resyncPending: string[];
10
+ aliasedDiff: string[];
9
11
  ok: boolean;
10
12
  };
11
13
  declare function action_doctor(args: string[], actx: ActionContext): Promise<ActionResult>;
12
- declare function doctor(actx: ActionContext): Promise<ActionResult>;
13
- export type { DoctorReport, };
14
+ type DoctorScope = (kind: string, name: string) => boolean;
15
+ declare function doctor(actx: ActionContext, scope?: DoctorScope): Promise<ActionResult>;
16
+ export type { DoctorReport, DoctorScope, };
14
17
  export { action_doctor, doctor, };