@voxgig/sdkgen 3.7.2 → 4.0.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 (126) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/action/action.js +12 -12
  3. package/dist/action/action.js.map +1 -1
  4. package/dist/action/check.js +2 -2
  5. package/dist/action/check.js.map +1 -1
  6. package/dist/action/doctor.js +4 -4
  7. package/dist/action/doctor.js.map +1 -1
  8. package/dist/action/feature.js +1 -1
  9. package/dist/action/feature.js.map +1 -1
  10. package/dist/action/kind.js +5 -5
  11. package/dist/action/kind.js.map +1 -1
  12. package/dist/action/package.js +1 -1
  13. package/dist/action/package.js.map +1 -1
  14. package/dist/action/resolve.js +2 -2
  15. package/dist/action/resolve.js.map +1 -1
  16. package/dist/action/target.js +2 -2
  17. package/dist/action/target.js.map +1 -1
  18. package/dist/cmp/AgentGuide.js +2 -2
  19. package/dist/cmp/AgentGuideContent.js +9 -9
  20. package/dist/cmp/AgentGuideFeature.js +3 -3
  21. package/dist/cmp/AgentGuideFeature.js.map +1 -1
  22. package/dist/cmp/AgentGuideTop.js +1 -1
  23. package/dist/cmp/Deploy.js +3 -3
  24. package/dist/cmp/Deploy.js.map +1 -1
  25. package/dist/helpers/definition.js +7 -7
  26. package/dist/helpers/definition.js.map +1 -1
  27. package/dist/helpers/featureSource.js +2 -2
  28. package/dist/helpers/featureSource.js.map +1 -1
  29. package/dist/helpers/manifest.js +3 -3
  30. package/dist/helpers/manifest.js.map +1 -1
  31. package/dist/helpers/modelcheck.js +1 -1
  32. package/dist/helpers/modelcheck.js.map +1 -1
  33. package/dist/helpers/opShape.d.ts +2 -1
  34. package/dist/helpers/opShape.js +1 -0
  35. package/dist/helpers/opShape.js.map +1 -1
  36. package/dist/helpers/packageMeta.js +1 -1
  37. package/dist/helpers/packageMeta.js.map +1 -1
  38. package/dist/helpers/shipped.js +2 -2
  39. package/dist/helpers/shipped.js.map +1 -1
  40. package/dist/sdkgen.d.ts +2 -2
  41. package/dist/sdkgen.js +5 -4
  42. package/dist/sdkgen.js.map +1 -1
  43. package/dist/testkit.js +7 -7
  44. package/dist/testkit.js.map +1 -1
  45. package/dist/tsconfig.tsbuildinfo +1 -1
  46. package/dist/utility.js +1 -1
  47. package/dist/utility.js.map +1 -1
  48. package/model/{sdkgen.aontu → sdkgen.aon} +14 -0
  49. package/package.json +3 -3
  50. package/project/.sdk/model/feature/feature-index.aon +24 -0
  51. package/project/.sdk/src/cmp/seneca-provider/Extras_seneca-provider.ts +54 -21
  52. package/project/.sdk/src/cmp/seneca-provider/Main_seneca-provider.ts +24 -11
  53. package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +96 -0
  54. package/project/.sdk/tm/csharp/Makefile +1 -1
  55. package/project/.sdk/tm/rb/utility/struct/voxgig_struct.rb +31 -11
  56. package/project/.sdk/tm/swift/Makefile +1 -1
  57. package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +47 -1
  58. package/project/sdkgen-package.json +1 -1
  59. package/src/action/action.ts +12 -12
  60. package/src/action/check.ts +2 -2
  61. package/src/action/doctor.ts +5 -5
  62. package/src/action/feature.ts +1 -1
  63. package/src/action/kind.ts +5 -5
  64. package/src/action/package.ts +1 -1
  65. package/src/action/resolve.ts +2 -2
  66. package/src/action/target.ts +2 -2
  67. package/src/cmp/AgentGuide.ts +2 -2
  68. package/src/cmp/AgentGuideContent.ts +9 -9
  69. package/src/cmp/AgentGuideFeature.ts +3 -3
  70. package/src/cmp/AgentGuideTop.ts +1 -1
  71. package/src/cmp/Deploy.ts +3 -3
  72. package/src/helpers/definition.ts +7 -7
  73. package/src/helpers/featureSource.ts +2 -2
  74. package/src/helpers/manifest.ts +3 -3
  75. package/src/helpers/modelcheck.ts +1 -1
  76. package/src/helpers/opShape.ts +1 -0
  77. package/src/helpers/packageMeta.ts +1 -1
  78. package/src/helpers/shipped.ts +2 -2
  79. package/src/sdkgen.ts +4 -3
  80. package/src/testkit.ts +9 -9
  81. package/src/utility.ts +1 -1
  82. package/testkit.js +1 -1
  83. package/project/.sdk/model/feature/feature-index.aontu +0 -24
  84. /package/project/.sdk/model/feature/{audit.aontu → audit.aon} +0 -0
  85. /package/project/.sdk/model/feature/{cache.aontu → cache.aon} +0 -0
  86. /package/project/.sdk/model/feature/{clienttrack.aontu → clienttrack.aon} +0 -0
  87. /package/project/.sdk/model/feature/{debug.aontu → debug.aon} +0 -0
  88. /package/project/.sdk/model/feature/{idempotency.aontu → idempotency.aon} +0 -0
  89. /package/project/.sdk/model/feature/{log.aontu → log.aon} +0 -0
  90. /package/project/.sdk/model/feature/{metrics.aontu → metrics.aon} +0 -0
  91. /package/project/.sdk/model/feature/{netsim.aontu → netsim.aon} +0 -0
  92. /package/project/.sdk/model/feature/{paging.aontu → paging.aon} +0 -0
  93. /package/project/.sdk/model/feature/{proxy.aontu → proxy.aon} +0 -0
  94. /package/project/.sdk/model/feature/{ratelimit.aontu → ratelimit.aon} +0 -0
  95. /package/project/.sdk/model/feature/{rbac.aontu → rbac.aon} +0 -0
  96. /package/project/.sdk/model/feature/{retry.aontu → retry.aon} +0 -0
  97. /package/project/.sdk/model/feature/{streaming.aontu → streaming.aon} +0 -0
  98. /package/project/.sdk/model/feature/{telemetry.aontu → telemetry.aon} +0 -0
  99. /package/project/.sdk/model/feature/{test.aontu → test.aon} +0 -0
  100. /package/project/.sdk/model/feature/{timeout.aontu → timeout.aon} +0 -0
  101. /package/project/.sdk/model/target/{c.aontu → c.aon} +0 -0
  102. /package/project/.sdk/model/target/{clojure.aontu → clojure.aon} +0 -0
  103. /package/project/.sdk/model/target/{cpp.aontu → cpp.aon} +0 -0
  104. /package/project/.sdk/model/target/{csharp.aontu → csharp.aon} +0 -0
  105. /package/project/.sdk/model/target/{dart.aontu → dart.aon} +0 -0
  106. /package/project/.sdk/model/target/{elixir.aontu → elixir.aon} +0 -0
  107. /package/project/.sdk/model/target/{go-cli.aontu → go-cli.aon} +0 -0
  108. /package/project/.sdk/model/target/{go-mcp.aontu → go-mcp.aon} +0 -0
  109. /package/project/.sdk/model/target/{go.aontu → go.aon} +0 -0
  110. /package/project/.sdk/model/target/{java.aontu → java.aon} +0 -0
  111. /package/project/.sdk/model/target/{js.aontu → js.aon} +0 -0
  112. /package/project/.sdk/model/target/{kotlin.aontu → kotlin.aon} +0 -0
  113. /package/project/.sdk/model/target/{lean.aontu → lean.aon} +0 -0
  114. /package/project/.sdk/model/target/{lua.aontu → lua.aon} +0 -0
  115. /package/project/.sdk/model/target/{ocaml.aontu → ocaml.aon} +0 -0
  116. /package/project/.sdk/model/target/{perl.aontu → perl.aon} +0 -0
  117. /package/project/.sdk/model/target/{php.aontu → php.aon} +0 -0
  118. /package/project/.sdk/model/target/{py-data.aontu → py-data.aon} +0 -0
  119. /package/project/.sdk/model/target/{py.aontu → py.aon} +0 -0
  120. /package/project/.sdk/model/target/{rb.aontu → rb.aon} +0 -0
  121. /package/project/.sdk/model/target/{rust.aontu → rust.aon} +0 -0
  122. /package/project/.sdk/model/target/{scala.aontu → scala.aon} +0 -0
  123. /package/project/.sdk/model/target/{seneca-provider.aontu → seneca-provider.aon} +0 -0
  124. /package/project/.sdk/model/target/{swift.aontu → swift.aon} +0 -0
  125. /package/project/.sdk/model/target/{ts.aontu → ts.aon} +0 -0
  126. /package/project/.sdk/model/target/{zig.aontu → zig.aon} +0 -0
@@ -109,7 +109,7 @@ const ROOT_COMPONENTS: [string, string][] = [
109
109
  // What the check found, by category. Categories 1-3 are drift; `additive` is
110
110
  // the project's own work and is reported separately, never as a problem.
111
111
  type DoctorReport = {
112
- // `.sdk/src/cmp/**`, or a target's own `.sdk/model/target/<t>.aontu`, that
112
+ // `.sdk/src/cmp/**`, or a target's own `.sdk/model/target/<t>.aon`, that
113
113
  // differs from the scaffold. `target add` will silently revert every one of
114
114
  // these.
115
115
  forked: string[]
@@ -198,8 +198,8 @@ async function doctor(
198
198
 
199
199
  // EVERY KIND, not just targets.
200
200
  //
201
- // `add` writes a copied model file for each kind — `model/target/<t>.aontu`
202
- // and `model/feature/<f>.aontu` alike — and overwrites it on every resync.
201
+ // `add` writes a copied model file for each kind — `model/target/<t>.aon`
202
+ // and `model/feature/<f>.aon` alike — and overwrites it on every resync.
203
203
  // Only the target one was ever compared, so a hand-edit to an installed
204
204
  // FEATURE definition read as perfectly in sync and was silently reverted by
205
205
  // the next `target add` (which re-runs `feature add` for every active
@@ -777,7 +777,7 @@ function checkFeatureSource(
777
777
  }
778
778
 
779
779
 
780
- // The copied MODEL FILE — `model/<kind>/<name>.aontu`, written by add with
780
+ // The copied MODEL FILE — `model/<kind>/<name>.aon`, written by add with
781
781
  // the `'BASE'` replacement, and overwritten on every resync exactly as
782
782
  // `src/cmp` and `tm` are.
783
783
  //
@@ -830,7 +830,7 @@ function checkItemModel(
830
830
  const aliased = kindDef(kind).alias && name !== origname
831
831
 
832
832
  const project = definitionPath(actx.folder, kind, name)
833
- const label = 'model/' + kind + '/' + name + '.aontu'
833
+ const label = 'model/' + kind + '/' + name + '.aon'
834
834
 
835
835
  if (!fs.existsSync(project)) {
836
836
  report.missing.push(label)
@@ -141,7 +141,7 @@ const FeatureRoot = cmp(function FeatureRoot(props: any) {
141
141
  Project({}, () => {
142
142
  // The names as INSTALLED, which is what the index must list. A ref is
143
143
  // not a name: `feature add @acme/sdkgen-iot/circuitbreaker` installs
144
- // `circuitbreaker`, and writing the raw ref into feature-index.aontu
144
+ // `circuitbreaker`, and writing the raw ref into feature-index.aon
145
145
  // would produce an include of a file that does not exist.
146
146
  const fnames: string[] = []
147
147
 
@@ -11,9 +11,9 @@
11
11
  // - the ref grammar and resolution, including the fallback to what the
12
12
  // model already records for a bare name;
13
13
  // - whether the kind may be installed under a different name (`~alias`);
14
- // - the definition file: `model/<kind>/<name>.aontu`, stamped with
14
+ // - the definition file: `model/<kind>/<name>.aon`, stamped with
15
15
  // provenance and landing under the INSTALLED name;
16
- // - the include list: `model/<kind>/<kind>-index.aontu`.
16
+ // - the include list: `model/<kind>/<kind>-index.aon`.
17
17
  //
18
18
  // What a kind adds on top — a target's component and template trees, a
19
19
  // feature's per-target source fan-out — stays in that kind's own action. Those
@@ -293,7 +293,7 @@ function kindModel(props: {
293
293
 
294
294
  if (owned) {
295
295
  const dest = Path.join(
296
- ctx$.folder ?? '.', 'model', kind, source.name + '.aontu')
296
+ ctx$.folder ?? '.', 'model', kind, source.name + '.aon')
297
297
 
298
298
  if (fs.existsSync(dest)) {
299
299
  log.info({
@@ -308,14 +308,14 @@ function kindModel(props: {
308
308
  const text = null == def.rename ? src :
309
309
  def.rename(src, source.origname, source.name)
310
310
 
311
- File({ name: source.name + '.aontu', exclude: owned }, () =>
311
+ File({ name: source.name + '.aon', exclude: owned }, () =>
312
312
  Content(template(text, ctx$.model, { replace })))
313
313
  }
314
314
  else {
315
315
  Copy({ from: source.model, replace })
316
316
  }
317
317
 
318
- File({ name: def.name + '-index.aontu' }, () => UpdateIndex({
318
+ File({ name: def.name + '-index.aon' }, () => UpdateIndex({
319
319
  content,
320
320
  names,
321
321
  }))
@@ -1029,7 +1029,7 @@ async function reAdd(
1029
1029
  skipped.map((i: Installed) => i.origname).join(', ') +
1030
1030
  ' must be ported by hand: ' +
1031
1031
  skipped.map((i: Installed) =>
1032
- 'model/' + i.kind + '/' + i.name + '.aontu').join(', ')
1032
+ 'model/' + i.kind + '/' + i.name + '.aon').join(', ')
1033
1033
  })
1034
1034
  }
1035
1035
 
@@ -86,7 +86,7 @@ function resolveSource(ref: string, kind: string, ctx$: any): Source {
86
86
  if (1 < aliasing.length) {
87
87
  name = aliasing.slice(1).join('~')
88
88
 
89
- // The alias becomes a DESTINATION: `model/<kind>/<name>.aontu`,
89
+ // The alias becomes a DESTINATION: `model/<kind>/<name>.aon`,
90
90
  // `src/cmp/<name>/`, `tm/<name>/` — all written, and `target add`
91
91
  // overwrites what it writes. `go~..` therefore redirects the copy out of
92
92
  // the target-specific directory and over unrelated scaffold. Checked
@@ -253,7 +253,7 @@ function warnManifest(ctx$: any, file: string, err: string) {
253
253
  // Teach the IN-MEMORY model about items that have just been installed.
254
254
  //
255
255
  // An action reads `actx.model`, compiled from `model/sdk.aontu` before the
256
- // run. Writing `model/target/iotgo.aontu` does not change it and nothing
256
+ // run. Writing `model/target/iotgo.aon` does not change it and nothing
257
257
  // recompiles mid-process, so anything later in the SAME command behaves as if
258
258
  // the item is not installed.
259
259
  //
@@ -431,7 +431,7 @@ function aliasCmpTree(
431
431
  // refreshed after upstream moved the fh* harness helpers out of it.
432
432
  //
433
433
  // tm/ is toolchain-owned — the scaffold rewrites it on every add-target, and
434
- // model/guide/guide.aontu is the one file a user owns (merged separately by
434
+ // model/guide/guide.aon is the one file a user owns (merged separately by
435
435
  // create-sdkgen) — so removing what the toolchain says should not be there is
436
436
  // consistent with how the rest of that tree is already treated.
437
437
  function pruneStaleTemplates(
@@ -656,7 +656,7 @@ function readTargetFeature(
656
656
  const { log } = ctx$
657
657
  const fs = ctx$.fs()
658
658
 
659
- const path = tfolder + '/model/target/' + torigname + '.aontu'
659
+ const path = tfolder + '/model/target/' + torigname + '.aon'
660
660
 
661
661
  try {
662
662
  const errs: any[] = []
@@ -63,7 +63,7 @@ ${langCommandsBlock(lang)}
63
63
 
64
64
  | Source | Path | Edit when… |
65
65
  | --- | --- | --- |
66
- | Target definition | \`.sdk/model/target/${lang}.aontu\` | deps, module, extension, phases change |
66
+ | Target definition | \`.sdk/model/target/${lang}.aon\` | deps, module, extension, phases change |
67
67
  | Templates | \`.sdk/tm/${lang}/\` | the file is the **same for every API** (runtime, transport, base classes) — copied verbatim with placeholder substitution |
68
68
  | Components | \`.sdk/src/cmp/${lang}/\` | the file's shape **depends on the API** (entities, constructor, README, tests) — TypeScript that walks the model |
69
69
 
@@ -93,7 +93,7 @@ Each feature's runtime and its own guide live in \`src/feature/<name>/\`.
93
93
  // go/py/php/rb/lua: flat files in the shared \`feature/\` package — no
94
94
  // per-feature directory, so features are documented inline here.
95
95
  Content(`Each feature is a flat file in the \`feature/\` package. Its hooks and
96
- default activation come from \`.sdk/model/feature/<name>.aontu\`; customise
96
+ default activation come from \`.sdk/model/feature/<name>.aon\`; customise
97
97
  the runtime under \`.sdk/tm/${lang}/feature/\` and regenerate.
98
98
 
99
99
  | Feature | Runtime file | Active hooks |
@@ -180,11 +180,11 @@ npm run build && npm run generate
180
180
 
181
181
  To author a **new** feature:
182
182
 
183
- 1. Define its model at \`.sdk/model/feature/<name>.aontu\` — \`name: key()\`,
183
+ 1. Define its model at \`.sdk/model/feature/<name>.aon\` — \`name: key()\`,
184
184
  \`title\`, \`version\`, \`active\`, \`config.options.active\`, a \`hook\`
185
185
  map (\`<Stage>: active: true\`), and per-language \`deps\`.
186
- 2. Register it in \`.sdk/model/feature/feature-index.aontu\` with
187
- \`@"<name>.aontu"\`.
186
+ 2. Register it in \`.sdk/model/feature/feature-index.aon\` with
187
+ \`@"<name>.aon"\`.
188
188
  3. Provide the per-language runtime under that target's feature template dir
189
189
  (\`.sdk/tm/<lang>/src/feature/<name>/\` for ts/js, \`.sdk/tm/<lang>/feature/\`
190
190
  otherwise) — the \`FEATURE_Name\` / \`FEATURE_VERSION\` placeholders are
@@ -210,24 +210,24 @@ Each language target is generated from **two layers**:
210
210
 
211
211
  Placeholders substituted on copy: \`ProjectName\` (Pascal-case SDK name),
212
212
  \`GOMODULE\` (Go module path), \`FEATURE_Name\` / \`FEATURE_VERSION\`, and the
213
- \`$$path$$\` interpolation of a model value (such as the name) in \`.aontu\`.
213
+ \`$$path$$\` interpolation of a model value (such as the name) in \`.aon\`.
214
214
 
215
215
  Propagate a change: edit the template/component → \`npm run build\` (only
216
216
  needed if you touched a component) → \`npm run generate\`. Target shape and
217
- deps live in \`.sdk/model/target/<lang>.aontu\`; features in
218
- \`.sdk/model/feature/<name>.aontu\`.
217
+ deps live in \`.sdk/model/target/<lang>.aon\`; features in
218
+ \`.sdk/model/feature/<name>.aon\`.
219
219
  `
220
220
  }
221
221
 
222
222
 
223
223
  // (d) how the aontu model language works.
224
224
  function aontuSection(): string {
225
- return `## The model language (aontu, \`.aontu\` files)
225
+ return `## The model language (aontu, \`.aon\` files)
226
226
 
227
227
  The model is one structured object assembled by **aontu** (a unification
228
228
  engine) from three sources: the API model (entities/operations, from the
229
229
  OpenAPI spec via \`@voxgig/apidef\`), the base schema, and the target/feature
230
- definitions in \`.sdk/model/\`. An \`.aontu\` file is a relaxed JSON (jsonic
230
+ definitions in \`.sdk/model/\`. An \`.aon\` file is a relaxed JSON (jsonic
231
231
  syntax) with unification semantics:
232
232
 
233
233
  | Syntax | Meaning |
@@ -237,7 +237,7 @@ syntax) with unification semantics:
237
237
  | \`*default \\| type\` | A default value unified against a type (e.g. \`*true \\| boolean\`). |
238
238
  | \`name: key()\` | Bind a field to its map key (so \`feature: log: {}\` gets \`name: 'log'\`). |
239
239
  | \`$$path$$\` | Interpolate a model value into a string — e.g. the SDK \`name\`. |
240
- | \`@"file.aontu"\` | Include another fragment (how the index files work). |
240
+ | \`@"file.aon"\` | Include another fragment (how the index files work). |
241
241
  | \`x: .y\` | Reference another path's value (e.g. \`deps: ts: .js\`). |
242
242
 
243
243
  For example, the schema for every feature entry:
@@ -65,8 +65,8 @@ later feature can override an earlier one.
65
65
 
66
66
  | Part | Path |
67
67
  | --- | --- |
68
- | Model definition | \`.sdk/model/feature/${name}.aontu\` (name, title, version, \`config.options.active\`, the \`hook\` map, per-language \`deps\`) |
69
- | Registered in | \`.sdk/model/feature/feature-index.aontu\` (\`@"${name}.aontu"\`) |
68
+ | Model definition | \`.sdk/model/feature/${name}.aon\` (name, title, version, \`config.options.active\`, the \`hook\` map, per-language \`deps\`) |
69
+ | Registered in | \`.sdk/model/feature/feature-index.aon\` (\`@"${name}.aon"\`) |
70
70
  | Runtime template | \`.sdk/tm/${lang}/src/feature/${name}/\` (copied here on \`generate\`; \`FEATURE_Name\`/\`FEATURE_VERSION\` substituted) |
71
71
 
72
72
  (Paths are relative to the **project root** — four levels up from here.)
@@ -74,7 +74,7 @@ later feature can override an earlier one.
74
74
  ## Customising this feature
75
75
 
76
76
  - **Turn hooks on/off**: edit the \`hook\` map in
77
- \`.sdk/model/feature/${name}.aontu\` (\`<Stage>: active: true|false\`).
77
+ \`.sdk/model/feature/${name}.aon\` (\`<Stage>: active: true|false\`).
78
78
  - **Change default activation**: set \`config.options.active\` in the same file.
79
79
  - **Dependencies**: edit \`deps.<lang>\` in the same file.
80
80
  - **Behaviour**: edit the runtime template under
@@ -110,7 +110,7 @@ target's feature container) for the generated adapter.
110
110
 
111
111
  \`\`\`
112
112
  .sdk/
113
- model/ the model: target/, feature/, and index .aontu files
113
+ model/ the model: target/, feature/, and index .aon files
114
114
  src/cmp/<lang>/ components — TypeScript that generates API-specific source
115
115
  tm/<lang>/ templates — verbatim source copied with placeholders
116
116
  dist/ compiled components (npm run build)
package/src/cmp/Deploy.ts CHANGED
@@ -7,7 +7,7 @@ import {
7
7
 
8
8
 
9
9
  // Generate the SDK root deployment Makefile from the model's per-target
10
- // `publish` sections (see model/sdkgen.aontu):
10
+ // `publish` sections (see model/sdkgen.aon):
11
11
  //
12
12
  // publish.tag — git release tag `<prefix>/vX.Y.Z`; every port has
13
13
  // one, pushed with a token from the boru key vault
@@ -179,7 +179,7 @@ deploy-dry-${t.name}:
179
179
 
180
180
  return `# ${model.Name} SDK deployment. GENERATED by @voxgig/sdkgen — regenerated
181
181
  # on every \`npm run generate\` in .sdk/; publication details live in the
182
- # model (.sdk/model/target/<target>.aontu, \`publish\` section).
182
+ # model (.sdk/model/target/<target>.aon, \`publish\` section).
183
183
  #
184
184
  # Every port gets a git release tag <target>/vX.Y.Z. Ports with an ACTIVE
185
185
  # registry also publish a package there. Credentials are injected at exec
@@ -218,7 +218,7 @@ TARGETS := ${targets.map((t: any) => t.name).join(' ')}
218
218
  deploy:
219
219
  \t@echo "Deployment is per-target — pick one (each upload is irreversible):"
220
220
  \t@echo " make deploy-<target> targets: $(TARGETS)"
221
- \t@echo "Registry state is set in the model (.sdk/model/target/<t>.aontu):"
221
+ \t@echo "Registry state is set in the model (.sdk/model/target/<t>.aon):"
222
222
  ${targets.map((t: any) => {
223
223
  const reg = registryOf(t)
224
224
  const state = reg ? `${reg.name} ${regIsActive(reg) ? 'ACTIVE' : 'publish pending (deploy = git tag only)'}` : 'tag-only'
@@ -1,6 +1,6 @@
1
1
  // WHERE A KIND'S DEFINITION FILES LIVE.
2
2
  //
3
- // `model/<kind>/<name>.aontu`, with `model/<kind>/<kind>-index.aontu` as the
3
+ // `model/<kind>/<name>.aon`, with `model/<kind>/<kind>-index.aon` as the
4
4
  // include list beside them. One line of path-building — and it was written out
5
5
  // longhand in three places (the resolver, the feature catalogue, doctor), each
6
6
  // with its own idea of which files in that directory count.
@@ -21,7 +21,7 @@ import { isJunk } from './junk'
21
21
 
22
22
  // The definition file for one item.
23
23
  function definitionPath(sdkfolder: string, kind: string, name: string): string {
24
- return Path.join(sdkfolder, 'model', kind, name + '.aontu')
24
+ return Path.join(sdkfolder, 'model', kind, name + '.aon')
25
25
  }
26
26
 
27
27
 
@@ -33,7 +33,7 @@ function definitionFolder(sdkfolder: string, kind: string): string {
33
33
 
34
34
  // The include list beside them.
35
35
  function indexName(kind: string): string {
36
- return kind + '-index.aontu'
36
+ return kind + '-index.aon'
37
37
  }
38
38
 
39
39
 
@@ -63,13 +63,13 @@ function definitionNames(fs: any, sdkfolder: string, kind: string): string[] {
63
63
  return []
64
64
  }
65
65
 
66
- // The `.aontu` suffix is not enough on its own: an emacs lock link is named
67
- // `.#target.aontu` and a merge leaves `target.aontu.orig`, so an editor open
66
+ // The `.aon` suffix is not enough on its own: an emacs lock link is named
67
+ // `.#target.aon` and a merge leaves `target.aon.orig`, so an editor open
68
68
  // in the wrong window invents an item called `.#target`, which then fails to
69
69
  // resolve everywhere it is named. See helpers/junk.
70
70
  return entries
71
- .filter((n: string) => n.endsWith('.aontu') && index !== n && !isJunk(n))
72
- .map((n: string) => n.replace(/\.aontu$/, ''))
71
+ .filter((n: string) => n.endsWith('.aon') && index !== n && !isJunk(n))
72
+ .map((n: string) => n.replace(/\.aon$/, ''))
73
73
  .sort()
74
74
  }
75
75
 
@@ -27,7 +27,7 @@
27
27
  //
28
28
  // The mapping is deliberately conservative. An entry only counts as feature
29
29
  // source when its derived name is one the generator can actually supply
30
- // (`availableFeatures`, read from `model/feature/*.aontu`). Everything else
30
+ // (`availableFeatures`, read from `model/feature/*.aon`). Everything else
31
31
  // inside a feature directory — `feature_options.go`, `FeatureOptions.cs`,
32
32
  // `mod.rs`, `support.rs`, `options.hpp`, `__init__.py`, `README.md`, and the
33
33
  // `harness.ts` under `test/feature/` — derives a name no feature has, so it
@@ -103,7 +103,7 @@ function featureOf(entry: string, folder: boolean): string {
103
103
 
104
104
 
105
105
  // Feature names this generator can supply, read from the scaffold's
106
- // `model/feature/*.aontu`. This is the authoritative catalogue: a name not in
106
+ // `model/feature/*.aon`. This is the authoritative catalogue: a name not in
107
107
  // it is not a feature, so nothing outside it is ever excluded.
108
108
  //
109
109
  // LOWERCASED, unlike `definitionNames`, because these are matched against
@@ -305,7 +305,7 @@ function validateManifest(
305
305
  // the directory listing; if this loop asked the filesystem instead
306
306
  // (`existsSync`/`statSync`), the two would disagree on a case-insensitive
307
307
  // filesystem — APFS and NTFS by default, which is most package authors'
308
- // machines. A manifest claiming `IoTGo` beside a `model/target/iotgo.aontu`
308
+ // machines. A manifest claiming `IoTGo` beside a `model/target/iotgo.aon`
309
309
  // then validated CLEAN for the author and failed for every Linux consumer,
310
310
  // which is precisely the "validated package that cannot install" this
311
311
  // function exists to prevent. It also makes the duplicate check above
@@ -337,7 +337,7 @@ function validateManifest(
337
337
  found.push({
338
338
  level: 'warn', point: 'manifest-item-unclaimed', file, kind, name,
339
339
  note: file + ': model/' + kind + '/' + name +
340
- '.aontu is in the package but not listed in `provides.' + kind +
340
+ '.aon is in the package but not listed in `provides.' + kind +
341
341
  '` — nothing will install it'
342
342
  })
343
343
  }
@@ -377,7 +377,7 @@ function missingPaths(
377
377
  // The definition, by EXACT NAME from the directory listing — see the note
378
378
  // at the call site about the two directions needing one oracle.
379
379
  if (!defined.has(name)) {
380
- missing.push('model/' + kind + '/' + name + '.aontu')
380
+ missing.push('model/' + kind + '/' + name + '.aon')
381
381
  }
382
382
 
383
383
  for (const tree of (def.trees ?? []).filter((t) => t.required)) {
@@ -1,4 +1,4 @@
1
- // THE MODEL RULES A PACKAGE'S `.aontu` FILES MUST SATISFY.
1
+ // THE MODEL RULES A PACKAGE'S `.aon` FILES MUST SATISFY.
2
2
  //
3
3
  // See docs/design/sdkgen-packages.md §10 (the rules) and §14 (the battery).
4
4
  //
@@ -680,6 +680,7 @@ export {
680
680
  entityCollection,
681
681
  opTypeName,
682
682
  opParams,
683
+ ownPoint,
683
684
  opActions,
684
685
  entityActions,
685
686
  entityPath,
@@ -176,7 +176,7 @@ function goVersion(model: any, target: string, fallback?: string): string {
176
176
  //
177
177
  // This was the last of the four things the slug derives that had no override,
178
178
  // and the only one that came out wrong — see the identity note at the top of
179
- // model/sdkgen.aontu.
179
+ // model/sdkgen.aon.
180
180
  function goPackageIdent(model: any, target: string): string {
181
181
  const declared = model?.main?.[KIT]?.target?.[target]?.module?.package
182
182
  if (null != declared && '' !== declared) {
@@ -21,9 +21,9 @@ function packageRoot(): string {
21
21
  }
22
22
 
23
23
 
24
- // The base model schema — `@voxgig/sdkgen/model/sdkgen.aontu`.
24
+ // The base model schema — `@voxgig/sdkgen/model/sdkgen.aon`.
25
25
  function schemaFile(): string {
26
- return Path.join(packageRoot(), 'model', 'sdkgen.aontu')
26
+ return Path.join(packageRoot(), 'model', 'sdkgen.aon')
27
27
  }
28
28
 
29
29
 
package/src/sdkgen.ts CHANGED
@@ -58,7 +58,7 @@ import { getMatchEntries } from './helpers/getMatchEntries'
58
58
  import { collectDeps } from './helpers/collectDeps'
59
59
  import type { DepEntry } from './helpers/collectDeps'
60
60
  import { canonToType, canonToDtype, canonKey } from './helpers/canonType'
61
- import { OP_SUFFIX, opTypeName, opParams, opActions, entityActions, entityPath, opRequestShape, entityIdField, entityDataIdField, entityOps, entityPrimaryOp, pickExampleEntity, entityClassName, entityTypeCollisions, warnEntityTypeCollisions, deriveEntityNames, entityCollection } from './helpers/opShape'
61
+ import { OP_SUFFIX, opTypeName, opParams, ownPoint, opActions, entityActions, entityPath, opRequestShape, entityIdField, entityDataIdField, entityOps, entityPrimaryOp, pickExampleEntity, entityClassName, entityTypeCollisions, warnEntityTypeCollisions, deriveEntityNames, entityCollection } from './helpers/opShape'
62
62
  import { isReservedName, safeVarName, exampleVarName, phpEntityAccessor, entityCacheField, isRbCoreConstant, isRbSdkConstant, rbSafeTypeName, isSwiftSdkType, swiftSafeTypeName, isPhpReservedType, phpSafeTypeName, isTsReservedType, tsSafeTypeName, jsProp, jsOptProp, jsKey } from './helpers/naming'
63
63
  import { serverVariables, hasServerVariables } from './helpers/serverVars'
64
64
  import { primaryOpCall, idLiteral, matchArg, dataArg, litFor } from './helpers/opExample'
@@ -488,7 +488,7 @@ function SdkGen(opts: SdkGenOptions) {
488
488
 
489
489
 
490
490
  function resolveModel(wanted: boolean) {
491
- const path = './model/sdk.aontu'
491
+ const path = './model/sdk.aon'
492
492
  const errs: any[] = []
493
493
 
494
494
  // A verb that does not act on a project (see `needsModel`) is run where
@@ -642,7 +642,7 @@ SdkGen.makeBuild = async function(opts: SdkGenOptions) {
642
642
  root: opts.root,
643
643
  def: opts.def || 'no-def',
644
644
  kind: 'openapi-3',
645
- model: opts.model ? (opts.model.folder + '/api.aontu') : 'no-model',
645
+ model: opts.model ? (opts.model.folder + '/api.aon') : 'no-model',
646
646
  meta: opts.meta || {},
647
647
  }
648
648
 
@@ -1063,6 +1063,7 @@ export {
1063
1063
  OP_SUFFIX,
1064
1064
  opTypeName,
1065
1065
  opParams,
1066
+ ownPoint,
1066
1067
  opActions,
1067
1068
  entityActions,
1068
1069
  entityPath,
package/src/testkit.ts CHANGED
@@ -87,7 +87,7 @@ type StageOptions = {
87
87
  // The project's API name, which every derived name comes from.
88
88
  name?: string
89
89
 
90
- // The project's OWN model text, appended to `model/sdk.aontu`.
90
+ // The project's OWN model text, appended to `model/sdk.aon`.
91
91
  //
92
92
  // THIS WRITES A FILE. It does NOT reach the action context — see
93
93
  // `setModel` on the consumer, and use that if an add needs to SEE what is
@@ -125,7 +125,7 @@ type Consumer = {
125
125
  // Install a compiled model as the one the ADD ACTIONS see.
126
126
  //
127
127
  // Needed because an action reads `actx.model`, which is compiled from
128
- // `model/sdk.aontu` BEFORE the run — nothing recompiles mid-process. The
128
+ // `model/sdk.aon` BEFORE the run — nothing recompiles mid-process. The
129
129
  // CLI does that compile per invocation; a kit staging several adds in one
130
130
  // process does not, so a feature declared in the project's model is
131
131
  // invisible to a later `target add` unless it is installed here. That
@@ -201,9 +201,9 @@ function stageConsumer(opts: StageOptions = {}): Consumer {
201
201
  Fs.mkdirSync(Path.join(sdk, 'model', 'target'), { recursive: true })
202
202
  Fs.mkdirSync(Path.join(sdk, 'model', 'feature'), { recursive: true })
203
203
 
204
- Fs.writeFileSync(Path.join(sdk, 'model', 'target', 'target-index.aontu'),
204
+ Fs.writeFileSync(Path.join(sdk, 'model', 'target', 'target-index.aon'),
205
205
  '# Targets\n')
206
- Fs.writeFileSync(Path.join(sdk, 'model', 'feature', 'feature-index.aontu'),
206
+ Fs.writeFileSync(Path.join(sdk, 'model', 'feature', 'feature-index.aon'),
207
207
  '# Features\n')
208
208
 
209
209
  const name = opts.name ?? 'demo'
@@ -212,10 +212,10 @@ function stageConsumer(opts: StageOptions = {}): Consumer {
212
212
  // includes the indexes of the kinds that existed THEN — which is why a
213
213
  // consumer staged here can show what an existing project does when a new
214
214
  // kind arrives, rather than assuming every index is already wired.
215
- Fs.writeFileSync(Path.join(sdk, 'model', 'sdk.aontu'),
215
+ Fs.writeFileSync(Path.join(sdk, 'model', 'sdk.aon'),
216
216
  "name: '" + name + "'\n" +
217
- '@"target/target-index.aontu"\n' +
218
- '@"feature/feature-index.aontu"\n' +
217
+ '@"target/target-index.aon"\n' +
218
+ '@"feature/feature-index.aon"\n' +
219
219
  (opts.extra ? opts.extra + '\n' : ''))
220
220
 
221
221
  // `@voxgig/sdkgen` has to be resolvable FROM THE CONSUMER, because the
@@ -242,7 +242,7 @@ function stageConsumer(opts: StageOptions = {}): Consumer {
242
242
  const links = [linkModule(modules, '@voxgig/sdkgen', SDKGEN_ROOT)]
243
243
 
244
244
  // ...and sdkgen's PEERS, because the base model schema a consumer compiles
245
- // against pulls in `@voxgig/apidef/model/apidef.aontu` by package name. A
245
+ // against pulls in `@voxgig/apidef/model/apidef.aon` by package name. A
246
246
  // consumer that really installed sdkgen has these; a staged one has to be
247
247
  // given them, or every model compile here fails on an include that resolves
248
248
  // fine everywhere else.
@@ -266,7 +266,7 @@ function stageConsumer(opts: StageOptions = {}): Consumer {
266
266
  [KIT]: { feature: {}, entity: {}, target: {} },
267
267
  },
268
268
  },
269
- url: Path.join(sdk, 'model', 'sdk.aontu'),
269
+ url: Path.join(sdk, 'model', 'sdk.aon'),
270
270
  jostraca: Jostraca({ existing: { txt: { write: true, merge: false } } }),
271
271
  opts: { dryrun: false },
272
272
  }
package/src/utility.ts CHANGED
@@ -27,7 +27,7 @@ function resolvePath(ctx$: any, path: string): any {
27
27
  // True unless the model declares auth off. Templates use this to gate
28
28
  // apikey-related code, docs, and examples for public APIs that need no
29
29
  // authentication. Two opt-outs, in priority order:
30
- // 1. main.kit.info.auth: false (user-facing, set in api-info.aontu)
30
+ // 1. main.kit.info.auth: false (user-facing, set in api-info.aon)
31
31
  // 2. main.kit.config.auth.active: false
32
32
  function isAuthActive(model: any): boolean {
33
33
  const info = getModelPath(model, `main.${KIT}.info`,
package/testkit.js CHANGED
@@ -5,7 +5,7 @@
5
5
  // A stub rather than an `exports` map entry, on purpose. A map would name
6
6
  // this subpath and, in doing so, replace the deep-import freedom this package
7
7
  // has without one — and consumers depend on that freedom invisibly (generated
8
- // model files include `@voxgig/sdkgen/model/sdkgen.aontu`; the scaffold is
8
+ // model files include `@voxgig/sdkgen/model/sdkgen.aon`; the scaffold is
9
9
  // reached as `@voxgig/sdkgen/project/<lang>`). See the `_no_exports_comment`
10
10
  // in package.json for what was measured.
11
11
 
@@ -1,24 +0,0 @@
1
- # Features
2
-
3
- # Core
4
- @"test.aontu"
5
- @"log.aontu"
6
-
7
- # Enterprise capabilities
8
- @"retry.aontu"
9
- @"timeout.aontu"
10
- @"ratelimit.aontu"
11
- @"cache.aontu"
12
- @"idempotency.aontu"
13
- @"paging.aontu"
14
- @"streaming.aontu"
15
- @"proxy.aontu"
16
- @"telemetry.aontu"
17
- @"metrics.aontu"
18
- @"debug.aontu"
19
- @"audit.aontu"
20
- @"clienttrack.aontu"
21
- @"rbac.aontu"
22
-
23
- # Test support: network behaviour simulation
24
- @"netsim.aontu"
File without changes
File without changes
File without changes