@voxgig/sdkgen 3.4.6 → 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 (198) 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/cmp/ReadmeTop.js +5 -1
  38. package/dist/cmp/ReadmeTop.js.map +1 -1
  39. package/dist/helpers/definition.d.ts +5 -0
  40. package/dist/helpers/definition.js +72 -0
  41. package/dist/helpers/definition.js.map +1 -0
  42. package/dist/helpers/featureSource.d.ts +8 -2
  43. package/dist/helpers/featureSource.js +61 -12
  44. package/dist/helpers/featureSource.js.map +1 -1
  45. package/dist/helpers/junk.d.ts +11 -0
  46. package/dist/helpers/junk.js +149 -0
  47. package/dist/helpers/junk.js.map +1 -0
  48. package/dist/helpers/manifest.d.ts +50 -0
  49. package/dist/helpers/manifest.js +328 -0
  50. package/dist/helpers/manifest.js.map +1 -0
  51. package/dist/helpers/modelcheck.d.ts +22 -0
  52. package/dist/helpers/modelcheck.js +203 -0
  53. package/dist/helpers/modelcheck.js.map +1 -0
  54. package/dist/helpers/semver.d.ts +4 -0
  55. package/dist/helpers/semver.js +174 -0
  56. package/dist/helpers/semver.js.map +1 -0
  57. package/dist/helpers/shipped.d.ts +4 -0
  58. package/dist/helpers/shipped.js +36 -0
  59. package/dist/helpers/shipped.js.map +1 -0
  60. package/dist/helpers/stdrep.d.ts +9 -1
  61. package/dist/helpers/stdrep.js +22 -0
  62. package/dist/helpers/stdrep.js.map +1 -1
  63. package/dist/sdkgen.d.ts +15 -3
  64. package/dist/sdkgen.js +233 -67
  65. package/dist/sdkgen.js.map +1 -1
  66. package/dist/tsconfig.tsbuildinfo +1 -1
  67. package/dist/types.d.ts +10 -2
  68. package/dist/utility.js +17 -0
  69. package/dist/utility.js.map +1 -1
  70. package/model/sdkgen.aontu +69 -0
  71. package/package.json +3 -2
  72. package/project/.sdk/model/feature/audit.aontu +1 -0
  73. package/project/.sdk/model/feature/cache.aontu +1 -0
  74. package/project/.sdk/model/feature/clienttrack.aontu +1 -0
  75. package/project/.sdk/model/feature/debug.aontu +1 -0
  76. package/project/.sdk/model/feature/idempotency.aontu +1 -0
  77. package/project/.sdk/model/feature/log.aontu +1 -0
  78. package/project/.sdk/model/feature/metrics.aontu +1 -0
  79. package/project/.sdk/model/feature/netsim.aontu +1 -0
  80. package/project/.sdk/model/feature/paging.aontu +1 -0
  81. package/project/.sdk/model/feature/proxy.aontu +1 -0
  82. package/project/.sdk/model/feature/ratelimit.aontu +1 -0
  83. package/project/.sdk/model/feature/rbac.aontu +1 -0
  84. package/project/.sdk/model/feature/retry.aontu +1 -0
  85. package/project/.sdk/model/feature/streaming.aontu +1 -0
  86. package/project/.sdk/model/feature/telemetry.aontu +1 -0
  87. package/project/.sdk/model/feature/test.aontu +1 -0
  88. package/project/.sdk/model/feature/timeout.aontu +1 -0
  89. package/project/.sdk/model/target/c.aontu +1 -0
  90. package/project/.sdk/model/target/clojure.aontu +1 -0
  91. package/project/.sdk/model/target/cpp.aontu +1 -0
  92. package/project/.sdk/model/target/dart.aontu +1 -0
  93. package/project/.sdk/model/target/elixir.aontu +1 -0
  94. package/project/.sdk/model/target/go-cli.aontu +1 -0
  95. package/project/.sdk/model/target/go-mcp.aontu +1 -0
  96. package/project/.sdk/model/target/go.aontu +1 -0
  97. package/project/.sdk/model/target/haskell.aontu +1 -0
  98. package/project/.sdk/model/target/java.aontu +1 -0
  99. package/project/.sdk/model/target/js.aontu +1 -0
  100. package/project/.sdk/model/target/kotlin.aontu +1 -0
  101. package/project/.sdk/model/target/lean.aontu +1 -0
  102. package/project/.sdk/model/target/lua.aontu +1 -0
  103. package/project/.sdk/model/target/ocaml.aontu +1 -0
  104. package/project/.sdk/model/target/perl.aontu +1 -0
  105. package/project/.sdk/model/target/php.aontu +1 -0
  106. package/project/.sdk/model/target/py-data.aontu +1 -0
  107. package/project/.sdk/model/target/py.aontu +1 -0
  108. package/project/.sdk/model/target/rb.aontu +1 -0
  109. package/project/.sdk/model/target/rust.aontu +1 -0
  110. package/project/.sdk/model/target/scala.aontu +1 -0
  111. package/project/.sdk/model/target/seneca-provider.aontu +1 -0
  112. package/project/.sdk/model/target/zig.aontu +1 -0
  113. package/project/.sdk/src/cmp/c/Config_c.ts +44 -0
  114. package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +3 -1
  115. package/project/.sdk/src/cmp/clojure/Config_clojure.ts +37 -42
  116. package/project/.sdk/src/cmp/clojure/utility_clojure.ts +42 -0
  117. package/project/.sdk/src/cmp/cpp/Config_cpp.ts +18 -0
  118. package/project/.sdk/src/cmp/csharp/Config_csharp.ts +125 -52
  119. package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +3 -1
  120. package/project/.sdk/src/cmp/csharp/utility_csharp.ts +94 -6
  121. package/project/.sdk/src/cmp/dart/Config_dart.ts +56 -3
  122. package/project/.sdk/src/cmp/dart/fragment/Config.data.fragment.dart +74 -0
  123. package/project/.sdk/src/cmp/dart/fragment/Config.fragment.dart +6 -9
  124. package/project/.sdk/src/cmp/dart/fragment/Main.fragment.dart +16 -5
  125. package/project/.sdk/src/cmp/dart/utility_dart.ts +18 -0
  126. package/project/.sdk/src/cmp/elixir/Config_elixir.ts +128 -13
  127. package/project/.sdk/src/cmp/elixir/fragment/Main.fragment.ex +3 -1
  128. package/project/.sdk/src/cmp/elixir/utility_elixir.ts +6 -0
  129. package/project/.sdk/src/cmp/haskell/Config_haskell.ts +35 -52
  130. package/project/.sdk/src/cmp/haskell/Package_haskell.ts +1 -0
  131. package/project/.sdk/src/cmp/haskell/Test_haskell.ts +1 -1
  132. package/project/.sdk/src/cmp/haskell/utility_haskell.ts +15 -5
  133. package/project/.sdk/src/cmp/java/Config_java.ts +21 -0
  134. package/project/.sdk/src/cmp/kotlin/Config_kotlin.ts +15 -0
  135. package/project/.sdk/src/cmp/ocaml/Config_ocaml.ts +42 -39
  136. package/project/.sdk/src/cmp/perl/Config_perl.ts +15 -0
  137. package/project/.sdk/src/cmp/perl/fragment/Main.fragment.pm +3 -1
  138. package/project/.sdk/src/cmp/rust/Config_rust.ts +44 -0
  139. package/project/.sdk/src/cmp/rust/fragment/Main.fragment.rs +4 -2
  140. package/project/.sdk/src/cmp/scala/Config_scala.ts +15 -0
  141. package/project/.sdk/src/cmp/swift/Config_swift.ts +17 -0
  142. package/project/.sdk/src/cmp/swift/fragment/Main.fragment.swift +3 -1
  143. package/project/.sdk/src/cmp/zig/Config_zig.ts +44 -0
  144. package/project/.sdk/src/cmp/zig/TestEntity_zig.ts +9 -2
  145. package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +31 -18
  146. package/project/.sdk/tm/c/core/sdk.h +1 -0
  147. package/project/.sdk/tm/c/utility/make_options.c +5 -1
  148. package/project/.sdk/tm/clojure/src/sdk/core.clj +51 -3
  149. package/project/.sdk/tm/cpp/core/types.hpp +4 -1
  150. package/project/.sdk/tm/cpp/utility/pipeline.hpp +5 -1
  151. package/project/.sdk/tm/csharp/test/PipelineTest.cs +15 -0
  152. package/project/.sdk/tm/csharp/utility/MakeOptions.cs +67 -1
  153. package/project/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +43 -0
  154. package/project/.sdk/tm/elixir/lib/projectname/utility.ex +58 -2
  155. package/project/.sdk/tm/haskell/{test/TestJson.hs → src/SdkJson.hs} +8 -4
  156. package/project/.sdk/tm/haskell/src/SdkRuntime.hs +55 -2
  157. package/project/.sdk/tm/haskell/test/Runner.hs +1 -1
  158. package/project/.sdk/tm/haskell/test/StructCorpus.hs +1 -1
  159. package/project/.sdk/tm/java/core/SdkClient.java +3 -1
  160. package/project/.sdk/tm/java/utility/MakeOptions.java +5 -1
  161. package/project/.sdk/tm/kotlin/core/SdkClient.kt +3 -1
  162. package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +5 -1
  163. package/project/.sdk/tm/ocaml/Makefile +3 -2
  164. package/project/.sdk/tm/ocaml/sdk_json.ml +106 -0
  165. package/project/.sdk/tm/ocaml/sdk_runtime.ml +56 -0
  166. package/project/.sdk/tm/ocaml/test/struct_corpus.ml +4 -86
  167. package/project/.sdk/tm/perl/utility/make_options.pm +5 -1
  168. package/project/.sdk/tm/rust/utility/make_options.rs +79 -1
  169. package/project/.sdk/tm/scala/core/SdkClient.scala +3 -1
  170. package/project/.sdk/tm/scala/utility/Make.scala +5 -1
  171. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +5 -1
  172. package/project/.sdk/tm/zig/core/utility.zig +85 -1
  173. package/project/.sdk/tm/zig/test/gotcha_test.zig +8 -8
  174. package/project/sdkgen-package.json +57 -0
  175. package/src/action/action.ts +136 -6
  176. package/src/action/check.ts +495 -0
  177. package/src/action/dispatch.ts +105 -0
  178. package/src/action/docs.ts +310 -0
  179. package/src/action/doctor.ts +692 -81
  180. package/src/action/feature.ts +109 -17
  181. package/src/action/kind.ts +375 -0
  182. package/src/action/package.ts +1173 -0
  183. package/src/action/resolve.ts +362 -0
  184. package/src/action/target.ts +290 -108
  185. package/src/cmp/Docs.ts +125 -0
  186. package/src/cmp/ExternalDocs.ts +54 -0
  187. package/src/cmp/ReadmeTop.ts +6 -1
  188. package/src/helpers/definition.ts +82 -0
  189. package/src/helpers/featureSource.ts +83 -13
  190. package/src/helpers/junk.ts +168 -0
  191. package/src/helpers/manifest.ts +474 -0
  192. package/src/helpers/modelcheck.ts +262 -0
  193. package/src/helpers/semver.ts +211 -0
  194. package/src/helpers/shipped.ts +41 -0
  195. package/src/helpers/stdrep.ts +70 -0
  196. package/src/sdkgen.ts +294 -66
  197. package/src/types.ts +33 -3
  198. package/src/utility.ts +17 -0
@@ -0,0 +1,328 @@
1
+ "use strict";
2
+ // THE PACKAGE MANIFEST: `sdkgen-package.json`, beside the package's `.sdk`.
3
+ //
4
+ // See docs/design/sdkgen-packages.md §2.
5
+ //
6
+ // <package-root>/
7
+ // ├── sdkgen-package.json <- this
8
+ // └── .sdk/ <- shaped exactly like ts/project/.sdk
9
+ //
10
+ // WHY JSON RATHER THAN AONTU
11
+ //
12
+ // Consumer models compile under `@voxgig/model`'s strictly-configured parser,
13
+ // which accepts `#` comments only — a `//` line is a parse error, and seven
14
+ // shipped targets once broke on exactly that (ts/test/model-compile.test.ts
15
+ // exists because of it). The manifest is read by the CLI and never unified
16
+ // into the model, so JSON keeps it outside that trap entirely.
17
+ //
18
+ // WHAT IT IS FOR
19
+ //
20
+ // A package's CLAIM about what it provides, so that:
21
+ //
22
+ // - `package add <pkg>` knows what to install without guessing from
23
+ // directory listings;
24
+ // - a typo'd ref fails naming what the package actually provides, rather
25
+ // than resolving to a folder that exists and failing later on a missing
26
+ // file;
27
+ // - an item records WHICH PACKAGE supplied it (`package:` provenance), so a
28
+ // project can be resynced against a newer version of that package.
29
+ //
30
+ // A claim is worth nothing unless it is checked, so `validateManifest`
31
+ // compares it against the trees actually on disk, in both directions: a
32
+ // manifest that lies is an error, on-disk extras are a warning.
33
+ //
34
+ // THE MANIFEST IS OPTIONAL FOR A DIRECT REF. `target add ../pkg/iot-go`
35
+ // against a bare `.sdk`-shaped folder keeps working exactly as it does today
36
+ // — that is what every existing consumer fixture is — and simply records no
37
+ // `package` provenance. Requiring one is `package add`'s business.
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.ITEM_NAME_RE = exports.SCHEMA = exports.MANIFEST = void 0;
43
+ exports.manifestPath = manifestPath;
44
+ exports.probePackage = probePackage;
45
+ exports.readManifest = readManifest;
46
+ exports.validateManifest = validateManifest;
47
+ exports.checkShape = checkShape;
48
+ const node_path_1 = __importDefault(require("node:path"));
49
+ const definition_1 = require("./definition");
50
+ const MANIFEST = 'sdkgen-package.json';
51
+ exports.MANIFEST = MANIFEST;
52
+ // The manifest schema version this generator understands. Bumped only for a
53
+ // BREAKING change to the manifest's own shape; new optional fields do not
54
+ // need it. Read from `sdkgen.package` so the gate is the very first thing in
55
+ // the file, before anything version-specific is interpreted.
56
+ const SCHEMA = 1;
57
+ exports.SCHEMA = SCHEMA;
58
+ // The manifest path for a `.sdk` folder: its SIBLING, not its child.
59
+ //
60
+ // The package root is the parent of `.sdk` — which is what `resolveSource`
61
+ // already assumes when it probes `<ref-dir>/.sdk`, so the manifest sits where
62
+ // the ref already pointed.
63
+ function manifestPath(sdkfolder) {
64
+ return node_path_1.default.join(sdkfolder, '..', MANIFEST);
65
+ }
66
+ function readManifest(fs, sdkfolder) {
67
+ const file = manifestPath(sdkfolder);
68
+ if (!fs.existsSync(file)) {
69
+ return { file };
70
+ }
71
+ let manifest;
72
+ try {
73
+ manifest = JSON.parse(String(fs.readFileSync(file, 'utf8')));
74
+ }
75
+ catch (err) {
76
+ return { file, err: err.message };
77
+ }
78
+ // A JSON scalar or array parses fine and then fails much later, on a
79
+ // property access that reads `undefined`. Reject it here, where the file
80
+ // that caused it is still in hand.
81
+ if (null == manifest || 'object' !== typeof manifest ||
82
+ Array.isArray(manifest)) {
83
+ return { file, err: 'not a JSON object' };
84
+ }
85
+ return { file, manifest };
86
+ }
87
+ // Is the manifest itself well-formed? Checked before anything reads its
88
+ // contents, so a malformed file produces one clear finding rather than a
89
+ // cascade of consequences.
90
+ function checkShape(manifest, file) {
91
+ const found = [];
92
+ const version = manifest?.sdkgen?.package;
93
+ if (null == version) {
94
+ found.push({
95
+ level: 'error', point: 'manifest-unversioned', file,
96
+ note: file + ': no `sdkgen.package` schema version — this is the gate ' +
97
+ 'that says the file is an sdkgen package manifest at all'
98
+ });
99
+ }
100
+ else if (!Number.isInteger(version) || version < 1) {
101
+ // A NON-NUMBER passes `version > SCHEMA` silently — `'banana' > 1` and
102
+ // `({}) > 1` are both false — so the gate that decides whether this
103
+ // generator may interpret the rest of the file would have been skipped by
104
+ // anything that is not a number at all. The version is the one field that
105
+ // must be checked before anything version-specific is read.
106
+ found.push({
107
+ level: 'error', point: 'manifest-schema-invalid', file,
108
+ note: file + ': `sdkgen.package` must be a positive integer schema ' +
109
+ 'version, not ' + JSON.stringify(version)
110
+ });
111
+ }
112
+ else if (version > SCHEMA) {
113
+ // FORWARD, not backward: a manifest written for a later schema may use
114
+ // fields this generator would misread. Say both numbers — "too new" is
115
+ // actionable (upgrade sdkgen), "invalid" is not.
116
+ found.push({
117
+ level: 'error', point: 'manifest-schema-too-new', file,
118
+ note: file + ': manifest schema version ' + version +
119
+ ' is newer than this generator understands (' + SCHEMA +
120
+ ') — upgrade @voxgig/sdkgen'
121
+ });
122
+ }
123
+ if ('string' !== typeof manifest?.name || '' === manifest.name) {
124
+ found.push({
125
+ level: 'error', point: 'manifest-unnamed', file,
126
+ note: file + ': no `name` — the name is what an item records as its ' +
127
+ '`package` provenance and what `package update` is given'
128
+ });
129
+ }
130
+ const provides = manifest?.provides;
131
+ if (null == provides || 'object' !== typeof provides ||
132
+ Array.isArray(provides)) {
133
+ found.push({
134
+ level: 'error', point: 'manifest-provides-missing', file,
135
+ note: file + ': no `provides` map — a package that provides nothing ' +
136
+ 'has nothing to add (use `{}` to say so deliberately)'
137
+ });
138
+ }
139
+ else {
140
+ for (const [kind, names] of Object.entries(provides)) {
141
+ if (!Array.isArray(names) ||
142
+ names.some((n) => 'string' !== typeof n || '' === n)) {
143
+ found.push({
144
+ level: 'error', point: 'manifest-provides-malformed', file, kind,
145
+ note: file + ': `provides.' + kind +
146
+ '` is not a list of names'
147
+ });
148
+ continue;
149
+ }
150
+ // A NAME, not a path. `missingPaths` joins these onto the package root,
151
+ // so `../../outside` would send every existence check out of the
152
+ // package entirely and let a manifest validate clean against unrelated
153
+ // files. `~` is excluded for a different reason: it is the alias
154
+ // separator, so a name containing one could never be resolved back to
155
+ // this item.
156
+ for (const name of names) {
157
+ if (!ITEM_NAME_RE.test(name)) {
158
+ found.push({
159
+ level: 'error', point: 'manifest-item-name-invalid', file, kind,
160
+ name,
161
+ note: file + ': `provides.' + kind + '` lists ' +
162
+ JSON.stringify(name) + ' — an item name must match ' +
163
+ ITEM_NAME_RE.source + ' (a name, not a path)'
164
+ });
165
+ }
166
+ }
167
+ const seen = new Set();
168
+ for (const name of names) {
169
+ if (seen.has(name)) {
170
+ found.push({
171
+ level: 'error', point: 'manifest-item-duplicated', file, kind,
172
+ name,
173
+ note: file + ': `provides.' + kind + '` lists ' +
174
+ JSON.stringify(name) + ' more than once'
175
+ });
176
+ }
177
+ seen.add(name);
178
+ }
179
+ }
180
+ }
181
+ return found;
182
+ }
183
+ // What may name a target, feature, or any other item.
184
+ //
185
+ // Deliberately narrow: these become directory names, aontu model keys,
186
+ // generated config keys (`options.feature.<name>`) and component filename
187
+ // suffixes, so the intersection of what all of those accept is the real
188
+ // constraint. The shipped names — `go-cli`, `py-data`, `seneca-provider`,
189
+ // `clienttrack` — all fit.
190
+ const ITEM_NAME_RE = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
191
+ exports.ITEM_NAME_RE = ITEM_NAME_RE;
192
+ // Does the package's disk match its claim?
193
+ //
194
+ // BOTH DIRECTIONS, because they fail differently and neither implies the
195
+ // other:
196
+ //
197
+ // claim without disk -> ERROR. `package add` would try to install it and
198
+ // break partway through, having already written the
199
+ // items listed before it.
200
+ // disk without claim -> WARN. Everything works; the author has shipped
201
+ // something nobody can discover, which is nearly
202
+ // always a forgotten manifest edit.
203
+ //
204
+ // `kindRequires` is supplied by the caller rather than imported, because the
205
+ // kind registry lives in `action/` and this is a helper — the dependency has
206
+ // to point that way, not this way.
207
+ function validateManifest(fs, sdkfolder, manifest, kinds) {
208
+ const file = manifestPath(sdkfolder);
209
+ const shape = checkShape(manifest, file);
210
+ // A malformed manifest cannot be compared against anything — the checks
211
+ // below would read `undefined` and invent findings about it.
212
+ if (0 < shape.length) {
213
+ return shape;
214
+ }
215
+ const found = [];
216
+ const provides = manifest.provides;
217
+ for (const [kind, names] of Object.entries(provides)) {
218
+ const def = kinds[kind];
219
+ if (null == def) {
220
+ found.push({
221
+ level: 'error', point: 'manifest-unknown-kind', file, kind,
222
+ note: file + ': `provides.' + kind + '` — unknown kind; this ' +
223
+ 'generator knows: ' + Object.keys(kinds).sort().join(', ')
224
+ });
225
+ continue;
226
+ }
227
+ // ONE ORACLE FOR BOTH DIRECTIONS. The unclaimed-extras loop below reads
228
+ // the directory listing; if this loop asked the filesystem instead
229
+ // (`existsSync`/`statSync`), the two would disagree on a case-insensitive
230
+ // filesystem — APFS and NTFS by default, which is most package authors'
231
+ // machines. A manifest claiming `IoTGo` beside a `model/target/iotgo.aontu`
232
+ // then validated CLEAN for the author and failed for every Linux consumer,
233
+ // which is precisely the "validated package that cannot install" this
234
+ // function exists to prevent. It also makes the duplicate check above
235
+ // meaningful: `['retry','Retry']` are two names to a Set and one file to
236
+ // the filesystem.
237
+ const defined = new Set((0, definition_1.definitionNames)(fs, sdkfolder, kind));
238
+ for (const name of names) {
239
+ for (const missing of missingPaths(fs, sdkfolder, kind, name, def, defined)) {
240
+ found.push({
241
+ level: 'error', point: 'manifest-item-missing', file, kind, name,
242
+ note: file + ': claims ' + kind + ' `' + name +
243
+ '` but ' + missing + ' is not in the package'
244
+ });
245
+ }
246
+ }
247
+ }
248
+ // The other direction. Only for kinds the manifest MENTIONS plus the ones
249
+ // this generator knows — a directory named after a kind nobody registered
250
+ // is already reported above if claimed, and is not this check's business if
251
+ // not.
252
+ for (const kind of Object.keys(kinds)) {
253
+ const claimed = new Set(provides[kind] ?? []);
254
+ for (const name of (0, definition_1.definitionNames)(fs, sdkfolder, kind)) {
255
+ if (!claimed.has(name)) {
256
+ found.push({
257
+ level: 'warn', point: 'manifest-item-unclaimed', file, kind, name,
258
+ note: file + ': model/' + kind + '/' + name +
259
+ '.aontu is in the package but not listed in `provides.' + kind +
260
+ '` — nothing will install it'
261
+ });
262
+ }
263
+ }
264
+ }
265
+ return found;
266
+ }
267
+ // Every path an item of this kind needs, that is not there AS THE RIGHT KIND
268
+ // OF THING.
269
+ //
270
+ // The definition file is implied for every kind; the kind's REQUIRED trees
271
+ // add whatever else it needs (a target's component and template trees, a docs
272
+ // item's components). An optional tree — a docs item's templates — is not
273
+ // checked here, because a package that legitimately ships none must validate.
274
+ //
275
+ // FILE vs DIRECTORY is checked, not merely existence. A regular file at
276
+ // `src/cmp/<t>` satisfies `existsSync` and satisfies nothing else: `target
277
+ // add` walks both of those paths as trees, so a package validated on
278
+ // existence alone could still be incapable of installing a usable target —
279
+ // which is the one thing validation is supposed to rule out.
280
+ //
281
+ // Returned as package-relative strings, because that is what an error message
282
+ // should say: the absolute path is this machine's business, not the author's.
283
+ function missingPaths(fs, sdkfolder, kind, name, def, defined) {
284
+ const missing = [];
285
+ // The definition, by EXACT NAME from the directory listing — see the note
286
+ // at the call site about the two directions needing one oracle.
287
+ if (!defined.has(name)) {
288
+ missing.push('model/' + kind + '/' + name + '.aontu');
289
+ }
290
+ for (const tree of (def.trees ?? []).filter((t) => t.required)) {
291
+ const rel = tree.path.split('{name}').join(name);
292
+ const got = entryKind(fs, node_path_1.default.join(sdkfolder, ...rel.split('/')));
293
+ if ('dir' !== got) {
294
+ missing.push(rel +
295
+ ('none' === got ? '' : ' (a file where a directory is required)'));
296
+ }
297
+ }
298
+ return missing;
299
+ }
300
+ // What is at a path: a file, a directory, or nothing. `statSync` FOLLOWS
301
+ // symlinks, deliberately — a package may legitimately symlink a shared tree,
302
+ // and what matters is what `target add` will find when it walks it.
303
+ function entryKind(fs, path) {
304
+ try {
305
+ const stat = fs.statSync(path);
306
+ return stat.isDirectory() ? 'dir' : 'file';
307
+ }
308
+ catch (err) {
309
+ return 'none';
310
+ }
311
+ }
312
+ function probePackage(fs, project, ref) {
313
+ const search = [];
314
+ const candidates = node_path_1.default.isAbsolute(ref) ? [ref] : [
315
+ node_path_1.default.join(project, 'node_modules', ref),
316
+ node_path_1.default.join(project, ref),
317
+ ];
318
+ for (const root of candidates) {
319
+ const sdk = node_path_1.default.normalize(node_path_1.default.join(root, '.sdk'));
320
+ search.push(sdk);
321
+ if (!fs.existsSync(sdk)) {
322
+ continue;
323
+ }
324
+ return { found: { ref, root, sdk, read: readManifest(fs, sdk) }, search };
325
+ }
326
+ return { search };
327
+ }
328
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/helpers/manifest.ts"],"names":[],"mappings":";AAAA,4EAA4E;AAC5E,EAAE;AACF,yCAAyC;AACzC,EAAE;AACF,oBAAoB;AACpB,yCAAyC;AACzC,wEAAwE;AACxE,EAAE;AAC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E,CAAC;YACxB,SAAQ;QACV,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,CAAA;IAC3E,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,CAAA;AACnB,CAAC"}
@@ -0,0 +1,22 @@
1
+ declare const ANCHOR = "base: 'BASE'";
2
+ declare const ANCHOR_RE: RegExp;
3
+ declare function aontuKey(name: string): string;
4
+ declare function unquoted(line: string): string;
5
+ declare function slashComments(text: string): {
6
+ line: number;
7
+ text: string;
8
+ }[];
9
+ declare function strictAontu(): any;
10
+ declare function includeLine(file: string): string;
11
+ type CompileResult = {
12
+ model?: any;
13
+ errors: string[];
14
+ };
15
+ declare function compileModel(src: string, path: string, opts?: {
16
+ strict?: boolean;
17
+ schema?: boolean;
18
+ }): CompileResult;
19
+ declare const PUBLISH_OVERRIDES: [string, string, string][];
20
+ declare function publishOverrideProbe(src: string, path: string, tname: string): CompileResult;
21
+ export type { CompileResult, };
22
+ export { ANCHOR, ANCHOR_RE, PUBLISH_OVERRIDES, aontuKey, compileModel, includeLine, publishOverrideProbe, slashComments, strictAontu, unquoted, };
@@ -0,0 +1,203 @@
1
+ "use strict";
2
+ // THE MODEL RULES A PACKAGE'S `.aontu` FILES MUST SATISFY.
3
+ //
4
+ // See docs/design/sdkgen-packages.md §10 (the rules) and §14 (the battery).
5
+ //
6
+ // WHY THIS IS A MODULE AND NOT A TEST
7
+ //
8
+ // Every rule below was already enforced — on the BUNDLED scaffold only, and
9
+ // from inside `ts/test/model-compile.test.ts`, where nothing else can call
10
+ // it. `package check` has to apply the same rules to a package this
11
+ // generator has never seen, and a rule written twice diverges: this
12
+ // workstream has produced that exact defect five times (path refs, replace
13
+ // maps, provenance reconstruction, the tilde parse, the installed-registry
14
+ // call). So the rules move here and BOTH callers read them — the guard suite
15
+ // over `ts/project`, which is itself an sdkgen package, and the verb.
16
+ //
17
+ // WHAT MAKES A MODEL FILE WRONG
18
+ //
19
+ // Three failure modes, and they surface at three different times, which is
20
+ // why all three are checked:
21
+ //
22
+ // 1. It does not PARSE under the parser a consumer actually uses. Aontu
23
+ // takes `#` comments; the npm engine's jsonic enables `//` and `/* */`
24
+ // by default and `@voxgig/model` switches them back off, so a `//` line
25
+ // compiles here and fails in the consumer's build. Seven shipped
26
+ // targets went out broken that way.
27
+ // 2. It parses but does not UNIFY with the base schema — a missing
28
+ // non-defaulted key (`ext`, `comment.line`, `module.name`, a feature's
29
+ // `title`). The file alone is fine, so nothing at add time notices; the
30
+ // consumer's whole model compile is what fails.
31
+ // 3. It unifies but PINS a key the project owns (`publish.version`,
32
+ // `publish.registry.package`). Concrete-vs-concrete is a conflict in
33
+ // aontu, so the project cannot override it — and the failure names the
34
+ // project's own file, not the package's.
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.PUBLISH_OVERRIDES = exports.ANCHOR_RE = exports.ANCHOR = void 0;
37
+ exports.aontuKey = aontuKey;
38
+ exports.compileModel = compileModel;
39
+ exports.includeLine = includeLine;
40
+ exports.publishOverrideProbe = publishOverrideProbe;
41
+ exports.slashComments = slashComments;
42
+ exports.strictAontu = strictAontu;
43
+ exports.unquoted = unquoted;
44
+ const aontu_1 = require("aontu");
45
+ const shipped_1 = require("./shipped");
46
+ // The provenance anchor. The literal line a shipped definition carries so the
47
+ // stamp has somewhere to hang (helpers/stdrep), and therefore the one thing
48
+ // a package's definition must not lose.
49
+ const ANCHOR = "base: 'BASE'";
50
+ exports.ANCHOR = ANCHOR;
51
+ // Matched as a WHOLE LINE, never as a substring — the same rule doctor
52
+ // learned the hard way (see AGENTS.md, "Provenance is matched by EXACT LINE").
53
+ //
54
+ // `database: 'BASE'` contains the anchor text, and so does a comment
55
+ // mentioning it. Either would satisfy a substring test while leaving the
56
+ // definition with no anchor of its own: the stamp then rewrites that
57
+ // unrelated occurrence, the item records no usable `base`, and `doctor` and
58
+ // `package update` can never locate its source — with `package check` having
59
+ // reported the file as fine.
60
+ const ANCHOR_RE = /^[ \t]*base: 'BASE'[ \t]*$/m;
61
+ exports.ANCHOR_RE = ANCHOR_RE;
62
+ // An aontu map key that is safe unquoted. Everything else — a hyphen
63
+ // (`go-cli`), a dot (`go.v2`), a leading digit (`2go`) — has to be quoted or
64
+ // the file does not parse, and the ITEM name grammar admits all three.
65
+ const BARE_KEY_RE = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
66
+ // The key as it must be WRITTEN in a model file.
67
+ function aontuKey(name) {
68
+ return BARE_KEY_RE.test(name) ? name : "'" + name + "'";
69
+ }
70
+ // Blank out quoted spans before looking for comment markers, so a `//` inside
71
+ // a string — a url, or the `comment: line: '//'` every C-family target model
72
+ // legitimately declares — is not mistaken for a comment.
73
+ function unquoted(line) {
74
+ return line.replace(/'[^']*'|"[^"]*"|`[^`]*`/g, '');
75
+ }
76
+ // What the PARSER sees on this line: quoted spans blanked, then everything
77
+ // from the first `#` dropped.
78
+ //
79
+ // Both steps, in that order. Without the second, a perfectly valid comment
80
+ // that happens to mention the token — `# some languages use // comments` —
81
+ // is reported as a parse error and the CLI exits non-zero on a correct
82
+ // package. Without the first, a `#` inside a string would truncate the line
83
+ // early and hide a real `//` after it.
84
+ function code(line) {
85
+ return unquoted(line).split('#')[0];
86
+ }
87
+ // Every line carrying a slash comment, 1-based, as a consumer's parser would
88
+ // see it.
89
+ function slashComments(text) {
90
+ const found = [];
91
+ String(text).split('\n').forEach((line, i) => {
92
+ if (/(^|\s)(\/\/|\/\*)/.test(code(line))) {
93
+ found.push({ line: i + 1, text: line.trim() });
94
+ }
95
+ });
96
+ return found;
97
+ }
98
+ // An Aontu configured the way `@voxgig/model` configures it — which is what
99
+ // actually compiles a consumer's models. A plain `new Aontu()` accepts `//`
100
+ // and `/* */`; the Go engine has no such extension, so the npm build switches
101
+ // them off to match, and this must too or the check is checking a parser
102
+ // nobody runs.
103
+ //
104
+ // A FRESH INSTANCE each time: the option call mutates the instance's jsonic,
105
+ // so a cached one would leak its configuration into the bare compile that is
106
+ // deliberately paired with it.
107
+ function strictAontu() {
108
+ const aontu = new aontu_1.Aontu();
109
+ aontu.lang.jsonic.options({ comment: { def: { slash: null, multi: null } } });
110
+ return aontu;
111
+ }
112
+ // An `@` include line for a path, quoted so a path containing a quote or a
113
+ // backslash — a Windows path, or the pathological ones the provenance tests
114
+ // exercise — cannot end the string early.
115
+ function includeLine(file) {
116
+ return "@'" + String(file).replace(/\\/g, '\\\\').replace(/'/g, "\\'") + "'";
117
+ }
118
+ // aontu reports a resolution problem through the `errs` collector and THROWS
119
+ // a parse problem, so both routes have to be handled or the interesting
120
+ // failure escapes as an opaque AontuError. Its message carries a source
121
+ // excerpt with ANSI colouring and line numbers that refer to the text
122
+ // COMPILED, which is not the file on disk once a schema include is prepended
123
+ // — so the excerpt is cut and only the diagnosis is kept.
124
+ function tidy(msg) {
125
+ const lines = String(msg)
126
+ .replace(new RegExp(String.fromCharCode(27) + "\\[[0-9;]*m", 'g'), '')
127
+ .split('\n');
128
+ const cut = lines.findIndex((l) => /^\s*-->/.test(l));
129
+ return (cut < 0 ? lines : lines.slice(0, cut))
130
+ .map((l) => l.trim())
131
+ .filter((l) => '' !== l)
132
+ .join(' ');
133
+ }
134
+ // Compile one model file's TEXT.
135
+ //
136
+ // strict: under the parser @voxgig/model configures (the consumer's
137
+ // reality) rather than a bare Aontu().
138
+ // schema: unified with the base schema, which is what makes a missing
139
+ // non-defaulted key a failure instead of an absent key nobody
140
+ // notices until the consumer compiles.
141
+ //
142
+ // `path` must be the file's real path even when the text is synthesised:
143
+ // aontu resolves includes relative to it, and stats it.
144
+ function compileModel(src, path, opts) {
145
+ // `errs`, NOT `err`. They are different options with opposite behaviour:
146
+ //
147
+ // errs — aontu THROWS on the first problem it cannot resolve.
148
+ // err — aontu COLLECTS problems and returns no model, which sounds
149
+ // better and is not: a PARSE problem is then swallowed entirely.
150
+ // `// nope` under the strict parser yields a model and an EMPTY
151
+ // collector, and a slash comment is the single most common thing
152
+ // this check exists to catch.
153
+ //
154
+ // So the throw is the signal, and it is caught below. The collector is
155
+ // still passed and still read: it costs nothing, and an aontu that one day
156
+ // collects instead of throwing must not report "no errors" here.
157
+ const errs = [];
158
+ const text = true === opts?.schema ?
159
+ includeLine((0, shipped_1.schemaFile)()) + '\n' + src : src;
160
+ try {
161
+ const aontu = false === opts?.strict ? new aontu_1.Aontu() : strictAontu();
162
+ const model = aontu.generate(text, { path, errs });
163
+ return {
164
+ model,
165
+ errors: errs.map((e) => tidy((null == e.why ? '' : '[' + e.why + '] ') + (e.msg ?? String(e)))),
166
+ };
167
+ }
168
+ catch (err) {
169
+ return { errors: [tidy(err.message ?? String(err))] };
170
+ }
171
+ }
172
+ // Every key the schema DEFAULTS and a project therefore expects to set, with
173
+ // TWO values to try setting it to. A target model that declares any of them
174
+ // makes the project's own declaration a concrete-vs-concrete conflict — which
175
+ // fails the consumer's entire model compile, naming the consumer's file.
176
+ //
177
+ // Two values because aontu unifies two EQUAL concrete scalars happily: a
178
+ // target pinning `publish: tag: active: false` — which is one of only two
179
+ // values that key can take — passed a single-sentinel probe while still
180
+ // making `true` impossible for the consumer. One alternative value per key is
181
+ // enough: a pin can equal one sentinel or the other, never both.
182
+ const PUBLISH_OVERRIDES = [
183
+ ['publish: version', "'9.9.9'", "'8.8.8'"],
184
+ ['publish: tag: active', 'false', 'true'],
185
+ ['publish: registry: state', "'active'", "'inactive'"],
186
+ ['publish: registry: active', 'true', 'false'],
187
+ ['publish: registry: package', "'@acme/pinned'", "'@acme/other'"],
188
+ ];
189
+ exports.PUBLISH_OVERRIDES = PUBLISH_OVERRIDES;
190
+ // The probe: unify the target model with a project that sets each of them,
191
+ // once per sentinel set. EITHER conflicting means the key is pinned.
192
+ function publishOverrideProbe(src, path, tname) {
193
+ const key = aontuKey(tname);
194
+ const run = (pick) => compileModel([src, ...PUBLISH_OVERRIDES.map((o) => 'main: kit: target: ' + key + ': ' + o[0] + ': ' + pick(o))]
195
+ .join('\n'), path);
196
+ const first = run((o) => o[1]);
197
+ const second = run((o) => o[2]);
198
+ return {
199
+ model: first.model ?? second.model,
200
+ errors: [...first.errors, ...second.errors],
201
+ };
202
+ }
203
+ //# sourceMappingURL=modelcheck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modelcheck.js","sourceRoot":"","sources":["../../src/helpers/modelcheck.ts"],"names":[],"mappings":";AAAA,2DAA2D;AAC3D,EAAE;AACF,4EAA4E;AAC5E,EAAE;AACF,sCAAsC;AACtC,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,oEAAoE;AACpE,oEAAoE;AACpE,2EAA2E;AAC3E,2EAA2E;AAC3E,6EAA6E;AAC7E,sEAAsE;AACtE,EAAE;AACF,gCAAgC;AAChC,EAAE;AACF,2EAA2E;AAC3E,6BAA6B;AAC7B,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,sEAAsE;AACtE,yCAAyC;AACzC,qEAAqE;AACrE,4EAA4E;AAC5E,6EAA6E;AAC7E,qDAAqD;AACrD,sEAAsE;AACtE,0EAA0E;AAC1E,4EAA4E;AAC5E,8CAA8C;;;QA8N5C,QAAQ;QACR,YAAY;QACZ,WAAW;QACX,oBAAoB;QACpB,aAAa;QACb,WAAW;QACX,QAAQ;AAlOV,iCAA6B;AAE7B,uCAAsC;AAGtC,8EAA8E;AAC9E,4EAA4E;AAC5E,wCAAwC;AACxC,MAAM,MAAM,GAAG,cAAc,CAAA;QAiN3B,MAAM;AA9MR,uEAAuE;AACvE,+EAA+E;AAC/E,EAAE;AACF,qEAAqE;AACrE,yEAAyE;AACzE,qEAAqE;AACrE,4EAA4E;AAC5E,6EAA6E;AAC7E,6BAA6B;AAC7B,MAAM,SAAS,GAAG,6BAA6B,CAAA;QAsM7C,SAAS;AAnMX,qEAAqE;AACrE,6EAA6E;AAC7E,uEAAuE;AACvE,MAAM,WAAW,GAAG,4BAA4B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CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAE/B,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK;QAClC,MAAM,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC;KAC5C,CAAA;AACH,CAAC"}
@@ -0,0 +1,4 @@
1
+ type Parts = [number, number, number];
2
+ declare function parseVersion(v: string): Parts | undefined;
3
+ declare function satisfies(version: string, range: string): boolean | undefined;
4
+ export { satisfies, parseVersion, };