@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.
- package/bin/voxgig-sdkgen +78 -10
- package/dist/action/action.d.ts +5 -2
- package/dist/action/action.js +113 -6
- package/dist/action/action.js.map +1 -1
- package/dist/action/check.d.ts +15 -0
- package/dist/action/check.js +347 -0
- package/dist/action/check.js.map +1 -0
- package/dist/action/dispatch.d.ts +8 -0
- package/dist/action/dispatch.js +74 -0
- package/dist/action/dispatch.js.map +1 -0
- package/dist/action/docs.d.ts +4 -0
- package/dist/action/docs.js +236 -0
- package/dist/action/docs.js.map +1 -0
- package/dist/action/doctor.d.ts +5 -2
- package/dist/action/doctor.js +526 -74
- package/dist/action/doctor.js.map +1 -1
- package/dist/action/feature.js +96 -17
- package/dist/action/feature.js.map +1 -1
- package/dist/action/kind.d.ts +30 -0
- package/dist/action/kind.js +258 -0
- package/dist/action/kind.js.map +1 -0
- package/dist/action/package.d.ts +25 -0
- package/dist/action/package.js +852 -0
- package/dist/action/package.js.map +1 -0
- package/dist/action/resolve.d.ts +18 -0
- package/dist/action/resolve.js +280 -0
- package/dist/action/resolve.js.map +1 -0
- package/dist/action/target.d.ts +7 -1
- package/dist/action/target.js +240 -97
- package/dist/action/target.js.map +1 -1
- package/dist/cmp/Docs.d.ts +4 -0
- package/dist/cmp/Docs.js +98 -0
- package/dist/cmp/Docs.js.map +1 -0
- package/dist/cmp/ExternalDocs.d.ts +2 -0
- package/dist/cmp/ExternalDocs.js +43 -0
- package/dist/cmp/ExternalDocs.js.map +1 -0
- package/dist/helpers/definition.d.ts +5 -0
- package/dist/helpers/definition.js +72 -0
- package/dist/helpers/definition.js.map +1 -0
- package/dist/helpers/featureSource.d.ts +8 -2
- package/dist/helpers/featureSource.js +61 -12
- package/dist/helpers/featureSource.js.map +1 -1
- package/dist/helpers/junk.d.ts +11 -0
- package/dist/helpers/junk.js +149 -0
- package/dist/helpers/junk.js.map +1 -0
- package/dist/helpers/manifest.d.ts +50 -0
- package/dist/helpers/manifest.js +328 -0
- package/dist/helpers/manifest.js.map +1 -0
- package/dist/helpers/modelcheck.d.ts +22 -0
- package/dist/helpers/modelcheck.js +203 -0
- package/dist/helpers/modelcheck.js.map +1 -0
- package/dist/helpers/semver.d.ts +4 -0
- package/dist/helpers/semver.js +174 -0
- package/dist/helpers/semver.js.map +1 -0
- package/dist/helpers/shipped.d.ts +4 -0
- package/dist/helpers/shipped.js +36 -0
- package/dist/helpers/shipped.js.map +1 -0
- package/dist/helpers/stdrep.d.ts +9 -1
- package/dist/helpers/stdrep.js +22 -0
- package/dist/helpers/stdrep.js.map +1 -1
- package/dist/sdkgen.d.ts +15 -3
- package/dist/sdkgen.js +233 -67
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +10 -2
- package/dist/utility.js +17 -0
- package/dist/utility.js.map +1 -1
- package/model/sdkgen.aontu +69 -0
- package/package.json +3 -2
- package/project/.sdk/model/feature/audit.aontu +1 -0
- package/project/.sdk/model/feature/cache.aontu +1 -0
- package/project/.sdk/model/feature/clienttrack.aontu +1 -0
- package/project/.sdk/model/feature/debug.aontu +1 -0
- package/project/.sdk/model/feature/idempotency.aontu +1 -0
- package/project/.sdk/model/feature/log.aontu +1 -0
- package/project/.sdk/model/feature/metrics.aontu +1 -0
- package/project/.sdk/model/feature/netsim.aontu +1 -0
- package/project/.sdk/model/feature/paging.aontu +1 -0
- package/project/.sdk/model/feature/proxy.aontu +1 -0
- package/project/.sdk/model/feature/ratelimit.aontu +1 -0
- package/project/.sdk/model/feature/rbac.aontu +1 -0
- package/project/.sdk/model/feature/retry.aontu +1 -0
- package/project/.sdk/model/feature/streaming.aontu +1 -0
- package/project/.sdk/model/feature/telemetry.aontu +1 -0
- package/project/.sdk/model/feature/test.aontu +1 -0
- package/project/.sdk/model/feature/timeout.aontu +1 -0
- package/project/.sdk/model/target/c.aontu +1 -0
- package/project/.sdk/model/target/clojure.aontu +1 -0
- package/project/.sdk/model/target/cpp.aontu +1 -0
- package/project/.sdk/model/target/dart.aontu +1 -0
- package/project/.sdk/model/target/elixir.aontu +1 -0
- package/project/.sdk/model/target/go-cli.aontu +1 -0
- package/project/.sdk/model/target/go-mcp.aontu +1 -0
- package/project/.sdk/model/target/go.aontu +1 -0
- package/project/.sdk/model/target/haskell.aontu +1 -0
- package/project/.sdk/model/target/java.aontu +1 -0
- package/project/.sdk/model/target/js.aontu +1 -0
- package/project/.sdk/model/target/kotlin.aontu +1 -0
- package/project/.sdk/model/target/lean.aontu +1 -0
- package/project/.sdk/model/target/lua.aontu +1 -0
- package/project/.sdk/model/target/ocaml.aontu +1 -0
- package/project/.sdk/model/target/perl.aontu +1 -0
- package/project/.sdk/model/target/php.aontu +1 -0
- package/project/.sdk/model/target/py-data.aontu +1 -0
- package/project/.sdk/model/target/py.aontu +1 -0
- package/project/.sdk/model/target/rb.aontu +1 -0
- package/project/.sdk/model/target/rust.aontu +1 -0
- package/project/.sdk/model/target/scala.aontu +1 -0
- package/project/.sdk/model/target/seneca-provider.aontu +1 -0
- package/project/.sdk/model/target/zig.aontu +1 -0
- package/project/.sdk/src/cmp/c/Config_c.ts +44 -0
- package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +3 -1
- package/project/.sdk/src/cmp/clojure/Config_clojure.ts +37 -42
- package/project/.sdk/src/cmp/clojure/utility_clojure.ts +42 -0
- package/project/.sdk/src/cmp/cpp/Config_cpp.ts +18 -0
- package/project/.sdk/src/cmp/csharp/Config_csharp.ts +125 -52
- package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +3 -1
- package/project/.sdk/src/cmp/csharp/utility_csharp.ts +94 -6
- package/project/.sdk/src/cmp/dart/Config_dart.ts +43 -5
- package/project/.sdk/src/cmp/dart/fragment/Config.data.fragment.dart +74 -0
- package/project/.sdk/src/cmp/dart/fragment/Config.fragment.dart +6 -9
- package/project/.sdk/src/cmp/dart/fragment/Main.fragment.dart +16 -5
- package/project/.sdk/src/cmp/dart/utility_dart.ts +18 -0
- package/project/.sdk/src/cmp/elixir/Config_elixir.ts +128 -13
- package/project/.sdk/src/cmp/elixir/fragment/Main.fragment.ex +3 -1
- package/project/.sdk/src/cmp/elixir/utility_elixir.ts +6 -0
- package/project/.sdk/src/cmp/haskell/Config_haskell.ts +35 -52
- package/project/.sdk/src/cmp/haskell/Package_haskell.ts +1 -0
- package/project/.sdk/src/cmp/haskell/Test_haskell.ts +1 -1
- package/project/.sdk/src/cmp/haskell/utility_haskell.ts +15 -5
- package/project/.sdk/src/cmp/java/Config_java.ts +21 -0
- package/project/.sdk/src/cmp/kotlin/Config_kotlin.ts +15 -0
- package/project/.sdk/src/cmp/ocaml/Config_ocaml.ts +42 -39
- package/project/.sdk/src/cmp/perl/Config_perl.ts +15 -0
- package/project/.sdk/src/cmp/perl/fragment/Main.fragment.pm +3 -1
- package/project/.sdk/src/cmp/rust/Config_rust.ts +44 -0
- package/project/.sdk/src/cmp/rust/fragment/Main.fragment.rs +4 -2
- package/project/.sdk/src/cmp/scala/Config_scala.ts +15 -0
- package/project/.sdk/src/cmp/swift/Config_swift.ts +17 -0
- package/project/.sdk/src/cmp/swift/fragment/Main.fragment.swift +3 -1
- package/project/.sdk/src/cmp/zig/Config_zig.ts +44 -0
- package/project/.sdk/src/cmp/zig/TestEntity_zig.ts +9 -2
- package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +3 -1
- package/project/.sdk/tm/c/core/sdk.h +1 -0
- package/project/.sdk/tm/c/utility/make_options.c +5 -1
- package/project/.sdk/tm/clojure/src/sdk/core.clj +51 -3
- package/project/.sdk/tm/cpp/core/types.hpp +4 -1
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +5 -1
- package/project/.sdk/tm/csharp/test/PipelineTest.cs +15 -0
- package/project/.sdk/tm/csharp/utility/MakeOptions.cs +67 -1
- package/project/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +43 -0
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +58 -2
- package/project/.sdk/tm/haskell/{test/TestJson.hs → src/SdkJson.hs} +8 -4
- package/project/.sdk/tm/haskell/src/SdkRuntime.hs +55 -2
- package/project/.sdk/tm/haskell/test/Runner.hs +1 -1
- package/project/.sdk/tm/haskell/test/StructCorpus.hs +1 -1
- package/project/.sdk/tm/java/core/SdkClient.java +3 -1
- package/project/.sdk/tm/java/utility/MakeOptions.java +5 -1
- package/project/.sdk/tm/kotlin/core/SdkClient.kt +3 -1
- package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +5 -1
- package/project/.sdk/tm/ocaml/Makefile +3 -2
- package/project/.sdk/tm/ocaml/sdk_json.ml +106 -0
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +56 -0
- package/project/.sdk/tm/ocaml/test/struct_corpus.ml +4 -86
- package/project/.sdk/tm/perl/utility/make_options.pm +5 -1
- package/project/.sdk/tm/rust/utility/make_options.rs +79 -1
- package/project/.sdk/tm/scala/core/SdkClient.scala +3 -1
- package/project/.sdk/tm/scala/utility/Make.scala +5 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +5 -1
- package/project/.sdk/tm/zig/core/utility.zig +85 -1
- package/project/sdkgen-package.json +57 -0
- package/src/action/action.ts +136 -6
- package/src/action/check.ts +495 -0
- package/src/action/dispatch.ts +105 -0
- package/src/action/docs.ts +310 -0
- package/src/action/doctor.ts +692 -81
- package/src/action/feature.ts +109 -17
- package/src/action/kind.ts +375 -0
- package/src/action/package.ts +1173 -0
- package/src/action/resolve.ts +362 -0
- package/src/action/target.ts +290 -108
- package/src/cmp/Docs.ts +125 -0
- package/src/cmp/ExternalDocs.ts +54 -0
- package/src/helpers/definition.ts +82 -0
- package/src/helpers/featureSource.ts +83 -13
- package/src/helpers/junk.ts +168 -0
- package/src/helpers/manifest.ts +474 -0
- package/src/helpers/modelcheck.ts +262 -0
- package/src/helpers/semver.ts +211 -0
- package/src/helpers/shipped.ts +41 -0
- package/src/helpers/stdrep.ts +70 -0
- package/src/sdkgen.ts +294 -66
- package/src/types.ts +33 -3
- package/src/utility.ts +17 -0
package/model/sdkgen.aontu
CHANGED
|
@@ -142,11 +142,39 @@ main: kit: contributor: &: {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
|
|
145
|
+
# PROVENANCE: where a copied target or feature came from.
|
|
146
|
+
#
|
|
147
|
+
# `target add` / `feature add` copy a shipped definition into a project and
|
|
148
|
+
# stamp these three keys into the copy, by rewriting the `base: 'BASE'` line
|
|
149
|
+
# the shipped file carries as an anchor:
|
|
150
|
+
#
|
|
151
|
+
# base the `.sdk` folder the copy came from, relative to the project
|
|
152
|
+
# (absolute only for an out-of-tree source). '/'-normalised, so a
|
|
153
|
+
# project resynced on Windows and on Linux records the same value.
|
|
154
|
+
# origname the name in the SOURCE, when installed under a different one
|
|
155
|
+
# (`target add go~go2` -> origname 'go'). Empty when they match.
|
|
156
|
+
# package the sdkgen package that provided it, when the source declared
|
|
157
|
+
# one. Empty otherwise.
|
|
158
|
+
#
|
|
159
|
+
# Read by `feature add` (to find each target's template tree) and by `doctor`
|
|
160
|
+
# (to re-resolve the scaffold a copy should be compared against). Without
|
|
161
|
+
# them both fall back to the bundled scaffold, which is right only while
|
|
162
|
+
# everything ships inside @voxgig/sdkgen.
|
|
163
|
+
#
|
|
164
|
+
# DEFAULTED, deliberately. A bare `string` inside a `&:` spread makes the key
|
|
165
|
+
# REQUIRED, which would fail the model compile of every project whose copies
|
|
166
|
+
# predate this — and `origname`/`package` are stamped only when they apply,
|
|
167
|
+
# so it would fail every ordinary install too. `*''` also keeps them FALSY
|
|
168
|
+
# when unset, which is what the two readers already test for.
|
|
145
169
|
main: kit: target: &: {
|
|
146
170
|
name: key()
|
|
147
171
|
active: *true | boolean
|
|
148
172
|
ext: string
|
|
149
173
|
comment: line: string
|
|
174
|
+
|
|
175
|
+
base: *'' | string
|
|
176
|
+
origname: *'' | string
|
|
177
|
+
package: *'' | string
|
|
150
178
|
module: {
|
|
151
179
|
name: string
|
|
152
180
|
|
|
@@ -361,6 +389,11 @@ main: kit: feature: &: {
|
|
|
361
389
|
active: *false | boolean
|
|
362
390
|
title: string
|
|
363
391
|
|
|
392
|
+
# Provenance — see the note on `main: kit: target: &:` above.
|
|
393
|
+
base: *'' | string
|
|
394
|
+
origname: *'' | string
|
|
395
|
+
package: *'' | string
|
|
396
|
+
|
|
364
397
|
# TODO: version '0.0.1' | semver # where semver is a string format type as per semver.org
|
|
365
398
|
version: *'0.0.1' | string
|
|
366
399
|
|
|
@@ -401,3 +434,39 @@ main: kit: option: &: {
|
|
|
401
434
|
|
|
402
435
|
|
|
403
436
|
|
|
437
|
+
# DOCS ITEMS — the third kind. See docs/design/sdkgen-packages.md §20.
|
|
438
|
+
#
|
|
439
|
+
# A docs item is a generation target whose destination is a DOCUMENTATION
|
|
440
|
+
# SYSTEM rather than a language: a static site, a developer-portal catalogue,
|
|
441
|
+
# a hosted service's config. sdkgen ships the kind; the items live in
|
|
442
|
+
# packages, so this spread declares only what EVERY destination needs and
|
|
443
|
+
# leaves the rest to the item's own model file (an unknown key unifies fine).
|
|
444
|
+
#
|
|
445
|
+
# Deliberately NOT copied from the target spread: `ext`, `comment.line` and
|
|
446
|
+
# `module.name` are required there and have no honest value for a site
|
|
447
|
+
# emitting .md, .yml, .css and .svg at once. `title` is defaulted rather than
|
|
448
|
+
# required, so an author is never forced to invent one to make the model
|
|
449
|
+
# compile — the `module.name` trap of §10.1.
|
|
450
|
+
main: kit: docs: &: {
|
|
451
|
+
name: key()
|
|
452
|
+
active: *true | boolean
|
|
453
|
+
title: *'' | string
|
|
454
|
+
|
|
455
|
+
# Provenance — see the note on `main: kit: target: &:` above. Written by
|
|
456
|
+
# `docs add`, read by doctor, `package list` and `package update`.
|
|
457
|
+
base: *'' | string
|
|
458
|
+
origname: *'' | string
|
|
459
|
+
package: *'' | string
|
|
460
|
+
|
|
461
|
+
# Where the item generates. '' is in-tree, at `<sdk-repo>/<name>/`;
|
|
462
|
+
# anything else is its own generate() pass rooted there, exactly as for a
|
|
463
|
+
# target (see explanation/out-of-tree-targets). Out of tree is the normal
|
|
464
|
+
# case for a docs item: a documentation site usually has its own repo, and
|
|
465
|
+
# in-tree it would collide with the SDK repo's own README and workflows.
|
|
466
|
+
output: {
|
|
467
|
+
path: *'' | string
|
|
468
|
+
repo: *'' | string
|
|
469
|
+
adopt: *false | boolean
|
|
470
|
+
sdkrel: *'' | string
|
|
471
|
+
}
|
|
472
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voxgig/sdkgen",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"main": "dist/sdkgen.js",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": ">=
|
|
7
|
+
"node": ">=24"
|
|
8
8
|
},
|
|
9
9
|
"types": "dist/sdkgen.d.ts",
|
|
10
10
|
"description": "Voxgig SDK Generator.",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"test": "node --enable-source-maps --test dist-test/**/*.test.js",
|
|
26
26
|
"test-some": "node --enable-source-maps --test-name-pattern=\"$npm_config_pattern\" --test dist-test/**/*.test.js",
|
|
27
|
+
"golden": "npm run build && SDKGEN_GOLDEN_UPDATE=1 node --test dist-test/characterize.test.js",
|
|
27
28
|
"watch": "tsc --build src test -w",
|
|
28
29
|
"build": "tsc --build src test && npm run check-scaffold && npm run stage-scaffold",
|
|
29
30
|
"clean": "rm -rf dist dist-test node_modules yarn.lock package-lock.json",
|
|
@@ -116,6 +116,28 @@ voxgig_value* make_config(void) {
|
|
|
116
116
|
return json_parse(CONFIG_DATA);
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
// SHARED CONFIG (sdkgen rung L2).
|
|
120
|
+
//
|
|
121
|
+
// The SDK reads the config on every request and never writes to it, so one
|
|
122
|
+
// instance is shared by every client rather than rebuilt per client. Above the
|
|
123
|
+
// size threshold make_config re-parses the whole embedded JSON, so this is the
|
|
124
|
+
// difference between parsing the model once and once per client.
|
|
125
|
+
//
|
|
126
|
+
// Deliberately never freed: it lives for the life of the process, like any
|
|
127
|
+
// other program-lifetime singleton.
|
|
128
|
+
static voxgig_value* shared_config_val = NULL;
|
|
129
|
+
|
|
130
|
+
// The process-wide config, built once on first use.
|
|
131
|
+
//
|
|
132
|
+
// The returned value is SHARED: treat it as read-only. Callers that need to
|
|
133
|
+
// mutate should use make_config, which always returns a fresh copy.
|
|
134
|
+
voxgig_value* shared_config(void) {
|
|
135
|
+
if (NULL == shared_config_val) {
|
|
136
|
+
shared_config_val = make_config();
|
|
137
|
+
}
|
|
138
|
+
return shared_config_val;
|
|
139
|
+
}
|
|
140
|
+
|
|
119
141
|
Feature* make_feature(const char* name) {
|
|
120
142
|
`)
|
|
121
143
|
}
|
|
@@ -131,6 +153,28 @@ voxgig_value* make_config(void) {
|
|
|
131
153
|
return ${formatCValue(config, 1)};
|
|
132
154
|
}
|
|
133
155
|
|
|
156
|
+
// SHARED CONFIG (sdkgen rung L2).
|
|
157
|
+
//
|
|
158
|
+
// The SDK reads the config on every request and never writes to it, so one
|
|
159
|
+
// instance is shared by every client rather than rebuilt per client. Above the
|
|
160
|
+
// size threshold make_config re-parses the whole embedded JSON, so this is the
|
|
161
|
+
// difference between parsing the model once and once per client.
|
|
162
|
+
//
|
|
163
|
+
// Deliberately never freed: it lives for the life of the process, like any
|
|
164
|
+
// other program-lifetime singleton.
|
|
165
|
+
static voxgig_value* shared_config_val = NULL;
|
|
166
|
+
|
|
167
|
+
// The process-wide config, built once on first use.
|
|
168
|
+
//
|
|
169
|
+
// The returned value is SHARED: treat it as read-only. Callers that need to
|
|
170
|
+
// mutate should use make_config, which always returns a fresh copy.
|
|
171
|
+
voxgig_value* shared_config(void) {
|
|
172
|
+
if (NULL == shared_config_val) {
|
|
173
|
+
shared_config_val = make_config();
|
|
174
|
+
}
|
|
175
|
+
return shared_config_val;
|
|
176
|
+
}
|
|
177
|
+
|
|
134
178
|
Feature* make_feature(const char* name) {
|
|
135
179
|
`)
|
|
136
180
|
}
|
|
@@ -16,7 +16,9 @@ ProjectNameSDK* projectname_sdk_new(voxgig_value* options) {
|
|
|
16
16
|
sdk->features_cap = 0;
|
|
17
17
|
sdk->rootctx = NULL;
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
/* The process-wide config (sdkgen rung L2): read-only on the request path,
|
|
20
|
+
* so every client shares one rather than rebuilding it. */
|
|
21
|
+
voxgig_value* config = shared_config();
|
|
20
22
|
|
|
21
23
|
CtxSpec cs;
|
|
22
24
|
memset(&cs, 0, sizeof(cs));
|