@voxgig/sdkgen 3.5.1 → 3.7.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 +1 -1
- package/dist/cmp/AgentGuideTop.js +17 -0
- package/dist/cmp/AgentGuideTop.js.map +1 -1
- package/dist/cmp/ExternalTarget.js +1 -1
- package/dist/cmp/ExternalTarget.js.map +1 -1
- package/dist/cmp/Readme.js +2 -0
- package/dist/cmp/Readme.js.map +1 -1
- package/dist/cmp/ReadmeStation.d.ts +2 -0
- package/dist/cmp/ReadmeStation.js +57 -0
- package/dist/cmp/ReadmeStation.js.map +1 -0
- package/dist/helpers/naming.d.ts +6 -1
- package/dist/helpers/naming.js +156 -5
- package/dist/helpers/naming.js.map +1 -1
- package/dist/helpers/opShape.js +72 -0
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/helpers/packageMeta.d.ts +2 -1
- package/dist/helpers/packageMeta.js +57 -20
- package/dist/helpers/packageMeta.js.map +1 -1
- package/dist/sdkgen.d.ts +3 -3
- package/dist/sdkgen.js +63 -18
- package/dist/sdkgen.js.map +1 -1
- package/dist/testkit.d.ts +39 -0
- package/dist/testkit.js +663 -0
- package/dist/testkit.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utility.d.ts +1 -1
- package/dist/utility.js +16 -2
- package/dist/utility.js.map +1 -1
- package/package.json +32 -8
- package/project/.sdk/src/cmp/c/Config_c.ts +34 -13
- package/project/.sdk/src/cmp/c/Test_c.ts +5 -7
- package/project/.sdk/src/cmp/clojure/Test_clojure.ts +3 -7
- package/project/.sdk/src/cmp/cpp/Config_cpp.ts +9 -46
- package/project/.sdk/src/cmp/cpp/Test_cpp.ts +4 -7
- package/project/.sdk/src/cmp/csharp/Config_csharp.ts +7 -1
- package/project/.sdk/src/cmp/csharp/Package_csharp.ts +1 -1
- package/project/.sdk/src/cmp/csharp/Test_csharp.ts +5 -7
- package/project/.sdk/src/cmp/dart/Config_dart.ts +14 -2
- package/project/.sdk/src/cmp/dart/Test_dart.ts +3 -4
- package/project/.sdk/src/cmp/dart/fragment/Config.data.fragment.dart +5 -0
- package/project/.sdk/src/cmp/dart/fragment/Config.fragment.dart +6 -0
- package/project/.sdk/src/cmp/dart/fragment/Main.fragment.dart +13 -4
- package/project/.sdk/src/cmp/elixir/Config_elixir.ts +12 -2
- package/project/.sdk/src/cmp/elixir/Package_elixir.ts +42 -3
- package/project/.sdk/src/cmp/elixir/Test_elixir.ts +5 -6
- package/project/.sdk/src/cmp/go/Config_go.ts +8 -1
- package/project/.sdk/src/cmp/go/EntityTypes_go.ts +1 -1
- package/project/.sdk/src/cmp/go/Entity_go.ts +1 -1
- package/project/.sdk/src/cmp/go/Gitignore_go.ts +6 -0
- package/project/.sdk/src/cmp/go/Main_go.ts +2 -2
- package/project/.sdk/src/cmp/go/Package_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeExamplesTest_go.ts +59 -6
- package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +1 -1
- package/project/.sdk/src/cmp/go/Test_go.ts +6 -8
- package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +6 -2
- package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +6 -2
- package/project/.sdk/src/cmp/java/Config_java.ts +8 -1
- package/project/.sdk/src/cmp/java/Test_java.ts +4 -7
- package/project/.sdk/src/cmp/js/Config_js.ts +9 -1
- package/project/.sdk/src/cmp/js/Package_js.ts +1 -1
- package/project/.sdk/src/cmp/js/Test_js.ts +4 -7
- package/project/.sdk/src/cmp/js/fragment/Config.data.fragment.js +7 -0
- package/project/.sdk/src/cmp/js/fragment/Config.fragment.js +8 -0
- package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +33 -5
- package/project/.sdk/src/cmp/kotlin/Config_kotlin.ts +8 -1
- package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +4 -7
- package/project/.sdk/src/cmp/lean/Test_lean.ts +3 -3
- package/project/.sdk/src/cmp/lua/Config_lua.ts +11 -2
- package/project/.sdk/src/cmp/lua/Package_lua.ts +26 -3
- package/project/.sdk/src/cmp/lua/Test_lua.ts +5 -7
- package/project/.sdk/src/cmp/ocaml/Test_ocaml.ts +3 -7
- package/project/.sdk/src/cmp/perl/Config_perl.ts +8 -60
- package/project/.sdk/src/cmp/perl/Package_perl.ts +1 -1
- package/project/.sdk/src/cmp/perl/Test_perl.ts +5 -7
- package/project/.sdk/src/cmp/php/Config_php.ts +11 -2
- package/project/.sdk/src/cmp/php/EntityTypes_php.ts +13 -2
- package/project/.sdk/src/cmp/php/Main_php.ts +25 -0
- package/project/.sdk/src/cmp/php/Package_php.ts +2 -2
- package/project/.sdk/src/cmp/php/Test_php.ts +5 -7
- package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +23 -6
- package/project/.sdk/src/cmp/py/Config_py.ts +11 -2
- package/project/.sdk/src/cmp/py/Main_py.ts +17 -7
- package/project/.sdk/src/cmp/py/Package_py.ts +2 -2
- package/project/.sdk/src/cmp/py/Test_py.ts +5 -7
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +23 -6
- package/project/.sdk/src/cmp/py-data/Main_py-data.ts +14 -19
- package/project/.sdk/src/cmp/rb/Config_rb.ts +7 -1
- package/project/.sdk/src/cmp/rb/Package_rb.ts +3 -3
- package/project/.sdk/src/cmp/rb/ReadmeInstall_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/Test_rb.ts +5 -7
- package/project/.sdk/src/cmp/rust/Config_rust.ts +5 -2
- package/project/.sdk/src/cmp/rust/Test_rust.ts +5 -7
- package/project/.sdk/src/cmp/scala/Test_scala.ts +5 -2
- package/project/.sdk/src/cmp/seneca-provider/Gitignore_seneca-provider.ts +161 -0
- package/project/.sdk/src/cmp/seneca-provider/Main_seneca-provider.ts +20 -11
- package/project/.sdk/src/cmp/swift/Config_swift.ts +8 -54
- package/project/.sdk/src/cmp/swift/Package_swift.ts +52 -10
- package/project/.sdk/src/cmp/swift/Test_swift.ts +5 -7
- package/project/.sdk/src/cmp/ts/Config_ts.ts +9 -1
- package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +5 -2
- package/project/.sdk/src/cmp/ts/Entity_ts.ts +8 -2
- package/project/.sdk/src/cmp/ts/Package_ts.ts +1 -1
- package/project/.sdk/src/cmp/ts/Test_ts.ts +8 -7
- package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +7 -0
- package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +8 -0
- package/project/.sdk/src/cmp/ts/fragment/Entity.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +12 -4
- package/project/.sdk/src/cmp/zig/Test_zig.ts +3 -7
- package/project/.sdk/tm/c/Makefile +6 -1
- package/project/.sdk/tm/c/utility/make_options.c +12 -1
- package/project/.sdk/tm/c/utility/make_point.c +64 -3
- package/project/.sdk/tm/clojure/src/sdk/core.clj +49 -14
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +64 -4
- package/project/.sdk/tm/csharp/feature/TestFeature.cs +36 -2
- package/project/.sdk/tm/csharp/utility/Fetcher.cs +23 -5
- package/project/.sdk/tm/csharp/utility/MakeOptions.cs +13 -0
- package/project/.sdk/tm/csharp/utility/MakePoint.cs +65 -2
- package/project/.sdk/tm/dart/lib/feature/test/TestFeature.dart +34 -4
- package/project/.sdk/tm/dart/lib/utility/FetcherUtility.dart +9 -0
- package/project/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +17 -0
- package/project/.sdk/tm/dart/lib/utility/MakePointUtility.dart +48 -2
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +109 -13
- package/project/.sdk/tm/elixir/test/feature_test.exs +19 -0
- package/project/.sdk/tm/elixir/test/primary_utility_test.exs +72 -0
- package/project/.sdk/tm/go/feature/test_feature.go +34 -2
- package/project/.sdk/tm/go/test/primary_utility_test.go +42 -20
- package/project/.sdk/tm/go/test/runner_test.go +1 -1
- package/project/.sdk/tm/go/utility/fetcher.go +14 -0
- package/project/.sdk/tm/go/utility/make_options.go +31 -4
- package/project/.sdk/tm/go/utility/make_point.go +66 -2
- package/project/.sdk/tm/java/feature/TestFeature.java +42 -2
- package/project/.sdk/tm/java/utility/Fetcher.java +11 -1
- package/project/.sdk/tm/java/utility/MakeOptions.java +11 -0
- package/project/.sdk/tm/java/utility/MakePoint.java +61 -2
- package/project/.sdk/tm/js/src/feature/test/TestFeature.js +22 -3
- package/project/.sdk/tm/js/src/utility/MakeOptionsUtility.js +20 -2
- package/project/.sdk/tm/js/src/utility/MakePointUtility.js +72 -2
- package/project/.sdk/tm/kotlin/feature/TestFeature.kt +31 -2
- package/project/.sdk/tm/kotlin/utility/Fetcher.kt +10 -1
- package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +11 -0
- package/project/.sdk/tm/kotlin/utility/MakePoint.kt +58 -2
- package/project/.sdk/tm/lean/src/SdkUtility.lean +28 -0
- package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +13 -2
- package/project/.sdk/tm/lua/utility/make_options.lua +44 -0
- package/project/.sdk/tm/lua/utility/make_point.lua +65 -2
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +40 -2
- package/project/.sdk/tm/perl/utility/fetcher.pm +10 -1
- package/project/.sdk/tm/perl/utility/make_options.pm +36 -0
- package/project/.sdk/tm/perl/utility/make_point.pm +55 -2
- package/project/.sdk/tm/php/feature/TestFeature.php +30 -1
- package/project/.sdk/tm/php/test/PipelineTest.php +20 -0
- package/project/.sdk/tm/php/utility/Fetcher.php +12 -1
- package/project/.sdk/tm/php/utility/MakeOptions.php +58 -0
- package/project/.sdk/tm/php/utility/MakePoint.php +49 -1
- package/project/.sdk/tm/py/pkg/utility/fetcher.py +13 -1
- package/project/.sdk/tm/py/pkg/utility/make_options.py +23 -0
- package/project/.sdk/tm/py/pkg/utility/make_point.py +56 -2
- package/project/.sdk/tm/rb/utility/make_options.rb +18 -0
- package/project/.sdk/tm/rb/utility/make_point.rb +42 -2
- package/project/.sdk/tm/rust/tests/common/mod.rs +1 -1
- package/project/.sdk/tm/rust/tests/feature_test.rs +27 -0
- package/project/.sdk/tm/rust/utility/fetcher.rs +8 -0
- package/project/.sdk/tm/rust/utility/make_options.rs +15 -0
- package/project/.sdk/tm/rust/utility/make_point.rs +69 -2
- package/project/.sdk/tm/scala/feature/TestFeature.scala +36 -1
- package/project/.sdk/tm/scala/utility/Make.scala +57 -3
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TestFeature.swift +29 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Fetcher.swift +24 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Make.swift +51 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +12 -0
- package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +22 -3
- package/project/.sdk/tm/ts/src/utility/MakeOptionsUtility.ts +20 -2
- package/project/.sdk/tm/ts/src/utility/MakePointUtility.ts +72 -2
- package/project/.sdk/tm/ts/test/utility/Corpus.test.ts +85 -0
- package/project/.sdk/tm/ts/test/utility/PrimaryUtility.test.ts +10 -17
- package/project/.sdk/tm/zig/core/utility.zig +66 -3
- package/project/sdkgen-package.json +1 -2
- package/src/cmp/AgentGuideTop.ts +18 -0
- package/src/cmp/ExternalTarget.ts +1 -1
- package/src/cmp/Readme.ts +2 -0
- package/src/cmp/ReadmeStation.ts +69 -0
- package/src/helpers/naming.ts +172 -5
- package/src/helpers/opShape.ts +85 -0
- package/src/helpers/packageMeta.ts +59 -20
- package/src/sdkgen.ts +70 -20
- package/src/testkit.ts +863 -0
- package/src/utility.ts +17 -2
- package/testkit.d.ts +3 -0
- package/testkit.js +12 -0
- package/project/.sdk/model/target/haskell.aontu +0 -72
- package/project/.sdk/src/cmp/haskell/Config_haskell.ts +0 -98
- package/project/.sdk/src/cmp/haskell/Entity_haskell.ts +0 -13
- package/project/.sdk/src/cmp/haskell/Gitignore_haskell.ts +0 -27
- package/project/.sdk/src/cmp/haskell/Main_haskell.ts +0 -123
- package/project/.sdk/src/cmp/haskell/Package_haskell.ts +0 -60
- package/project/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +0 -186
- package/project/.sdk/src/cmp/haskell/ReadmeExamplesTest_haskell.ts +0 -135
- package/project/.sdk/src/cmp/haskell/ReadmeExplanation_haskell.ts +0 -48
- package/project/.sdk/src/cmp/haskell/ReadmeHowto_haskell.ts +0 -168
- package/project/.sdk/src/cmp/haskell/ReadmeInstall_haskell.ts +0 -51
- package/project/.sdk/src/cmp/haskell/ReadmeIntro_haskell.ts +0 -67
- package/project/.sdk/src/cmp/haskell/ReadmeModel_haskell.ts +0 -162
- package/project/.sdk/src/cmp/haskell/ReadmeOptions_haskell.ts +0 -74
- package/project/.sdk/src/cmp/haskell/ReadmeQuick_haskell.ts +0 -241
- package/project/.sdk/src/cmp/haskell/ReadmeRef_haskell.ts +0 -408
- package/project/.sdk/src/cmp/haskell/ReadmeTopHowto_haskell.ts +0 -31
- package/project/.sdk/src/cmp/haskell/ReadmeTopQuick_haskell.ts +0 -104
- package/project/.sdk/src/cmp/haskell/ReadmeTopTest_haskell.ts +0 -80
- package/project/.sdk/src/cmp/haskell/Test_haskell.ts +0 -300
- package/project/.sdk/src/cmp/haskell/tsconfig.json +0 -15
- package/project/.sdk/src/cmp/haskell/utility_haskell.ts +0 -166
- package/project/.sdk/tm/haskell/LICENSE +0 -21
- package/project/.sdk/tm/haskell/Makefile +0 -22
- package/project/.sdk/tm/haskell/VERSION +0 -1
- package/project/.sdk/tm/haskell/src/SdkFeatures.hs +0 -1440
- package/project/.sdk/tm/haskell/src/SdkHelpers.hs +0 -337
- package/project/.sdk/tm/haskell/src/SdkJson.hs +0 -111
- package/project/.sdk/tm/haskell/src/SdkRuntime.hs +0 -1219
- package/project/.sdk/tm/haskell/src/SdkTypes.hs +0 -195
- package/project/.sdk/tm/haskell/src/VoxgigStruct.hs +0 -2299
- package/project/.sdk/tm/haskell/src/Vregex.hs +0 -237
- package/project/.sdk/tm/haskell/src/feature/README.md +0 -5
- package/project/.sdk/tm/haskell/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/test/Harness.hs +0 -281
- package/project/.sdk/tm/haskell/test/Runner.hs +0 -47
- package/project/.sdk/tm/haskell/test/StructCorpus.hs +0 -449
- package/project/.sdk/tm/haskell/test/TCustomUtility.hs +0 -38
- package/project/.sdk/tm/haskell/test/TFeature.hs +0 -794
- package/project/.sdk/tm/haskell/test/TNetsim.hs +0 -50
- package/project/.sdk/tm/haskell/test/TPipeline.hs +0 -334
- package/project/.sdk/tm/haskell/test/TPrimaryUtility.hs +0 -386
- package/project/.sdk/tm/haskell/test/Testutil.hs +0 -59
|
@@ -158,24 +158,34 @@ from ${model.const.Name.toLowerCase()}_sdk.feature.base_feature import ${model.c
|
|
|
158
158
|
|
|
159
159
|
Content(`
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
"base": lambda: ${model.const.Name}BaseFeature(),
|
|
161
|
+
_FEATURES = {
|
|
162
|
+
"base": lambda: ${model.const.Name}BaseFeature(),
|
|
164
163
|
`)
|
|
165
164
|
|
|
166
165
|
each(feature, (feat: any) => {
|
|
167
166
|
if (feat.name !== 'base') {
|
|
168
167
|
const fname = feat.name.charAt(0).toUpperCase() + feat.name.slice(1)
|
|
169
|
-
Content(`
|
|
168
|
+
Content(` "${feat.name}": lambda: ${model.const.Name}${fname}Feature(),
|
|
170
169
|
`)
|
|
171
170
|
}
|
|
172
171
|
})
|
|
173
172
|
|
|
174
|
-
Content(`
|
|
175
|
-
|
|
173
|
+
Content(`}
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def _make_feature(name):
|
|
177
|
+
factory = _FEATURES.get(name)
|
|
176
178
|
if factory is not None:
|
|
177
179
|
return factory()
|
|
178
|
-
return
|
|
180
|
+
return _FEATURES["base"]()
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
# True when this SDK was generated with the named feature class - the
|
|
184
|
+
# constructor's tolerance for extend-carried features reads this (an
|
|
185
|
+
# active name with no generated class must not become a BaseFeature
|
|
186
|
+
# stray when an extend instance carries it).
|
|
187
|
+
def _has_feature(name):
|
|
188
|
+
return name in _FEATURES
|
|
179
189
|
`)
|
|
180
190
|
})
|
|
181
191
|
|
|
@@ -27,7 +27,7 @@ const Package = cmp(async function Package(props: any) {
|
|
|
27
27
|
// package (the `${model.name}_sdk/` dir) is unchanged.
|
|
28
28
|
const ns = model.origin || 'voxgig-sdk'
|
|
29
29
|
const pkgBase = ns.endsWith('-sdk') ? model.name : `${model.name}-sdk`
|
|
30
|
-
const distName = packageName(model,
|
|
30
|
+
const distName = packageName(model, target.name)
|
|
31
31
|
const { repoUrl, issuesUrl } = repoInfo(model)
|
|
32
32
|
const kw = keywords(model).map((k) => `"${k}"`).join(', ')
|
|
33
33
|
|
|
@@ -39,7 +39,7 @@ build-backend = "setuptools.build_meta"
|
|
|
39
39
|
[project]
|
|
40
40
|
name = "${distName}"
|
|
41
41
|
version = "${packageVersion(model, target.name)}"
|
|
42
|
-
description = "${pkgDescription(model,
|
|
42
|
+
description = "${pkgDescription(model, target.name)}"
|
|
43
43
|
readme = "README.md"
|
|
44
44
|
license = "MIT"
|
|
45
45
|
requires-python = ">=3.8"
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
KIT,
|
|
4
|
-
getModelPath
|
|
5
|
-
} from '@voxgig/apidef'
|
|
6
|
-
|
|
7
2
|
import type {
|
|
8
3
|
ModelEntity
|
|
9
4
|
} from '@voxgig/apidef'
|
|
10
5
|
|
|
11
|
-
import { cmp, each, Folder, File, Content } from '@voxgig/sdkgen'
|
|
6
|
+
import { cmp, each, Folder, File, Content, entityCollection } from '@voxgig/sdkgen'
|
|
12
7
|
|
|
13
8
|
|
|
14
9
|
import { TestEntity } from './TestEntity_py'
|
|
@@ -46,7 +41,10 @@ class TestExists:
|
|
|
46
41
|
`)
|
|
47
42
|
})
|
|
48
43
|
|
|
49
|
-
each(model
|
|
44
|
+
const entity = each(entityCollection(model))
|
|
45
|
+
.filter((e: any) => false !== e.active)
|
|
46
|
+
|
|
47
|
+
each(entity, (entity: ModelEntity) => {
|
|
50
48
|
TestEntity({ target, entity })
|
|
51
49
|
TestDirect({ target, entity })
|
|
52
50
|
})
|
|
@@ -10,7 +10,7 @@ from projectname_sdk.utility import register
|
|
|
10
10
|
|
|
11
11
|
# Load features
|
|
12
12
|
from projectname_sdk.feature.base_feature import ProjectNameBaseFeature
|
|
13
|
-
from projectname_sdk.features import _make_feature
|
|
13
|
+
from projectname_sdk.features import _has_feature, _make_feature
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class ProjectNameSDK:
|
|
@@ -46,21 +46,38 @@ class ProjectNameSDK:
|
|
|
46
46
|
# `test` feature installs the base mock transport and the transport
|
|
47
47
|
# features (retry/cache/netsim/proxy/ratelimit) wrap whatever is
|
|
48
48
|
# current, so `test` must be added before them to sit at the base.
|
|
49
|
+
# Extension feature INSTANCES come from the RAW construction
|
|
50
|
+
# options - extend is consumed exactly once, here. make_options
|
|
51
|
+
# strips the key before cloning (vs.clone flattens arbitrary
|
|
52
|
+
# objects), so self.options never carries the instances.
|
|
49
53
|
feature_opts = helpers.to_map(vs.getprop(self.options, "feature"))
|
|
54
|
+
extend = options.get("extend") if isinstance(options, dict) else None
|
|
55
|
+
if not isinstance(extend, list):
|
|
56
|
+
extend = []
|
|
50
57
|
if feature_opts is not None:
|
|
51
58
|
featureorder = vs.getpath(self.options, "__derived__.featureorder")
|
|
52
59
|
if isinstance(featureorder, list):
|
|
53
60
|
for fname in featureorder:
|
|
54
61
|
fopts = helpers.to_map(feature_opts.get(fname))
|
|
55
62
|
if fopts is not None and fopts.get("active") is True:
|
|
63
|
+
# An active name with no generated feature class is
|
|
64
|
+
# legal when an extend-supplied instance carries that
|
|
65
|
+
# name (station's adopt path): the instance is added
|
|
66
|
+
# below, positioned by its own __after__ entry, so
|
|
67
|
+
# skip it here rather than add a BaseFeature stray
|
|
68
|
+
# that would silently shift feature positions.
|
|
69
|
+
if not _has_feature(fname) and any(
|
|
70
|
+
fname == (f.get("name") if isinstance(f, dict)
|
|
71
|
+
else getattr(f, "name", None))
|
|
72
|
+
for f in extend
|
|
73
|
+
):
|
|
74
|
+
continue
|
|
56
75
|
utility.feature_add(self._rootctx, _make_feature(fname))
|
|
57
76
|
|
|
58
77
|
# Add extension features.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if isinstance(f, dict) or (hasattr(f, "get_name") and callable(f.get_name)):
|
|
63
|
-
utility.feature_add(self._rootctx, f)
|
|
78
|
+
for f in extend:
|
|
79
|
+
if isinstance(f, dict) or (hasattr(f, "get_name") and callable(f.get_name)):
|
|
80
|
+
utility.feature_add(self._rootctx, f)
|
|
64
81
|
|
|
65
82
|
# Initialize features.
|
|
66
83
|
for f in self.features:
|
|
@@ -111,9 +111,9 @@ const Main = cmp(function Main(props: any) {
|
|
|
111
111
|
Gitignore({})
|
|
112
112
|
Package({ target, model, lower, dataModule })
|
|
113
113
|
EntityFramesTest({ frameEnts, seriesEnts, lower, sdkModule, sdkClass, dataModule })
|
|
114
|
-
Readme({ model, name, lower, ENV, dataModule, frameEnts, seriesEnts, needsBase, svars })
|
|
114
|
+
Readme({ target, model, name, lower, ENV, dataModule, frameEnts, seriesEnts, needsBase, svars })
|
|
115
115
|
AgentGuide({ model, name, lower, ENV, dataModule, frameEnts, seriesEnts, needsBase })
|
|
116
|
-
Quickstart({ model, name, lower, ENV, dataModule, frameEnts, needsBase })
|
|
116
|
+
Quickstart({ target, model, name, lower, ENV, dataModule, frameEnts, needsBase })
|
|
117
117
|
})
|
|
118
118
|
|
|
119
119
|
|
|
@@ -136,6 +136,8 @@ const Package = cmp(function Package(props: any) {
|
|
|
136
136
|
const ns = model.origin || 'voxgig-sdk'
|
|
137
137
|
const pkgBase = ns.endsWith('-sdk') ? model.name : `${model.name}-sdk`
|
|
138
138
|
const distName = `${ns}-${pkgBase}-data`
|
|
139
|
+
// The `py` SDK this package WRAPS — a different target, so it keeps its
|
|
140
|
+
// own name and does not follow this target's alias.
|
|
139
141
|
const sdkDist = packageName(model, 'py')
|
|
140
142
|
const { repoUrl, issuesUrl } = repoInfo(model)
|
|
141
143
|
const kw = keywords(model).concat(['pandas', 'dataframe', 'notebook', 'colab'])
|
|
@@ -149,7 +151,7 @@ build-backend = "setuptools.build_meta"
|
|
|
149
151
|
[project]
|
|
150
152
|
name = "${distName}"
|
|
151
153
|
version = "${packageVersion(model, target.name)}"
|
|
152
|
-
description = "${pkgDescription(model,
|
|
154
|
+
description = "${pkgDescription(model, target.name)}"
|
|
153
155
|
readme = "README.md"
|
|
154
156
|
license = "MIT"
|
|
155
157
|
requires-python = ">=3.9"
|
|
@@ -599,18 +601,18 @@ class TestFramesAgainstTestMode:
|
|
|
599
601
|
// ---------------------------------------------------------------------------
|
|
600
602
|
|
|
601
603
|
const Readme = cmp(function Readme(props: any) {
|
|
602
|
-
const { model, name, ENV, dataModule, frameEnts, seriesEnts, needsBase } = props
|
|
604
|
+
const { target, model, name, ENV, dataModule, frameEnts, seriesEnts, needsBase } = props
|
|
603
605
|
const ctx$ = props.ctx$
|
|
604
606
|
|
|
605
|
-
const distName =
|
|
607
|
+
const distName = packageName(model, target.name)
|
|
606
608
|
const sdkDist = packageName(model, 'py')
|
|
607
|
-
const pending = 'active' !== registryState(model,
|
|
609
|
+
const pending = 'active' !== registryState(model, target.name)
|
|
608
610
|
const { repoUrl, releasesUrl } = repoInfo(model)
|
|
609
611
|
|
|
610
612
|
const install = pending
|
|
611
613
|
? `# Not yet on PyPI — install both packages from this repo:
|
|
612
614
|
!pip install "git+${repoUrl}#subdirectory=py" \\
|
|
613
|
-
"git+${repoUrl}#subdirectory
|
|
615
|
+
"git+${repoUrl}#subdirectory=${target.name}"`
|
|
614
616
|
: `!pip install ${distName}`
|
|
615
617
|
|
|
616
618
|
const first = frameEnts[0]
|
|
@@ -666,7 +668,7 @@ from the repo — in a notebook, prefix with \`!\`:
|
|
|
666
668
|
|
|
667
669
|
\`\`\`sh
|
|
668
670
|
pip install "git+${repoUrl}#subdirectory=py" \\
|
|
669
|
-
"git+${repoUrl}#subdirectory
|
|
671
|
+
"git+${repoUrl}#subdirectory=${target.name}"
|
|
670
672
|
\`\`\`
|
|
671
673
|
|
|
672
674
|
Released versions are tagged at ${releasesUrl}.`
|
|
@@ -841,15 +843,15 @@ are overwritten. Change the model and regenerate.
|
|
|
841
843
|
// A runnable Colab notebook. .ipynb is just JSON; keeping outputs empty means
|
|
842
844
|
// the file is diffable and CI can execute it as a smoke test.
|
|
843
845
|
const Quickstart = cmp(function Quickstart(props: any) {
|
|
844
|
-
const { model, name, ENV, dataModule, frameEnts, needsBase } = props
|
|
846
|
+
const { target, model, name, ENV, dataModule, frameEnts, needsBase } = props
|
|
845
847
|
|
|
846
848
|
const { repoUrl } = repoInfo(model)
|
|
847
|
-
const pending = 'active' !== registryState(model,
|
|
848
|
-
const distName =
|
|
849
|
+
const pending = 'active' !== registryState(model, target.name)
|
|
850
|
+
const distName = packageName(model, target.name)
|
|
849
851
|
|
|
850
852
|
const installCode = pending
|
|
851
853
|
? [`!pip install -q "git+${repoUrl}#subdirectory=py" \\`,
|
|
852
|
-
` "git+${repoUrl}#subdirectory
|
|
854
|
+
` "git+${repoUrl}#subdirectory=${target.name}"`]
|
|
853
855
|
: [`!pip install -q ${distName}`]
|
|
854
856
|
|
|
855
857
|
const first = frameEnts[0]
|
|
@@ -976,13 +978,6 @@ function exampleGroupField(fields: { name: string, dtype: string, req: boolean }
|
|
|
976
978
|
}
|
|
977
979
|
|
|
978
980
|
|
|
979
|
-
function pyDistName(model: any): string {
|
|
980
|
-
const ns = model.origin || 'voxgig-sdk'
|
|
981
|
-
const pkgBase = ns.endsWith('-sdk') ? model.name : `${model.name}-sdk`
|
|
982
|
-
return `${ns}-${pkgBase}-data`
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
|
|
986
981
|
export {
|
|
987
982
|
Main,
|
|
988
983
|
}
|
|
@@ -71,7 +71,10 @@ const Config = cmp(async function Config(props: any) {
|
|
|
71
71
|
// literal and the data that replaces it above the threshold are the same
|
|
72
72
|
// config by construction. The JSON is what the threshold is measured on -
|
|
73
73
|
// emitted source size varies by language, the model does not.
|
|
74
|
-
|
|
74
|
+
// Passing the target name opts in to the main slug/version/target identity
|
|
75
|
+
// fields (station descriptor inputs) - the literal path below emits them
|
|
76
|
+
// too, keeping data and literal reps in step.
|
|
77
|
+
const { def: configDef, json: configJson } = configDefinition(model, target.name)
|
|
75
78
|
const asData = isConfigData(configJson, configReprSetting(model))
|
|
76
79
|
|
|
77
80
|
File({ name: 'config.' + target.ext }, () => {
|
|
@@ -127,6 +130,9 @@ module ${model.const.Name}Config
|
|
|
127
130
|
{
|
|
128
131
|
"main" => {
|
|
129
132
|
"name" => "${model.const.Name}",
|
|
133
|
+
"slug" => ${rbs(String(configDef.main.slug))},
|
|
134
|
+
"version" => ${rbs(String(configDef.main.version))},
|
|
135
|
+
"target" => ${rbs(String(configDef.main.target))},
|
|
130
136
|
},
|
|
131
137
|
"feature" => {
|
|
132
138
|
`)
|
|
@@ -33,7 +33,7 @@ const Package = cmp(async function Package(props: any) {
|
|
|
33
33
|
// path (`${model.name}_sdk`) is unchanged.
|
|
34
34
|
const ns = model.origin || 'voxgig-sdk'
|
|
35
35
|
const pkgBase = ns.endsWith('-sdk') ? model.name : `${model.name}-sdk`
|
|
36
|
-
const gemName = packageName(model,
|
|
36
|
+
const gemName = packageName(model, target.name)
|
|
37
37
|
const { repoUrl, issuesUrl, changelogUrl } = repoInfo(model)
|
|
38
38
|
|
|
39
39
|
const versionOf = (d: { version: string; source: 'feature' | 'target' }) =>
|
|
@@ -66,8 +66,8 @@ gemspec
|
|
|
66
66
|
spec.name = "${gemName}"
|
|
67
67
|
spec.version = "${packageVersion(model, target.name)}"
|
|
68
68
|
spec.authors = ["${author.name}"]
|
|
69
|
-
spec.summary = "${pkgDescription(model,
|
|
70
|
-
spec.description = "${pkgDescription(model,
|
|
69
|
+
spec.summary = "${pkgDescription(model, target.name)}"
|
|
70
|
+
spec.description = "${pkgDescription(model, target.name)}"
|
|
71
71
|
spec.license = "MIT"
|
|
72
72
|
spec.homepage = "${repoUrl}"
|
|
73
73
|
spec.metadata = {
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
KIT,
|
|
4
|
-
getModelPath
|
|
5
|
-
} from '@voxgig/apidef'
|
|
6
|
-
|
|
7
2
|
import type {
|
|
8
3
|
ModelEntity
|
|
9
4
|
} from '@voxgig/apidef'
|
|
10
5
|
|
|
11
|
-
import { cmp, each, Folder, File, Content } from '@voxgig/sdkgen'
|
|
6
|
+
import { cmp, each, Folder, File, Content, entityCollection } from '@voxgig/sdkgen'
|
|
12
7
|
|
|
13
8
|
|
|
14
9
|
import { TestEntity } from './TestEntity_rb'
|
|
@@ -38,7 +33,10 @@ end
|
|
|
38
33
|
`)
|
|
39
34
|
})
|
|
40
35
|
|
|
41
|
-
each(model
|
|
36
|
+
const entity = each(entityCollection(model))
|
|
37
|
+
.filter((e: any) => false !== e.active)
|
|
38
|
+
|
|
39
|
+
each(entity, (entity: ModelEntity) => {
|
|
42
40
|
TestEntity({ target, entity })
|
|
43
41
|
TestDirect({ target, entity })
|
|
44
42
|
})
|
|
@@ -50,8 +50,11 @@ const Config = cmp(async function Config(props: any) {
|
|
|
50
50
|
// representations render from the same `def`, so they cannot describe
|
|
51
51
|
// different configs - and this target picks up `options.server` (the
|
|
52
52
|
// OpenAPI server-variable defaults), which the hand-rolled build here
|
|
53
|
-
// omitted entirely.
|
|
54
|
-
|
|
53
|
+
// omitted entirely. Passing target.name opts into the main
|
|
54
|
+
// slug/version/target identity fields (station descriptor input, mirrors
|
|
55
|
+
// Config_ts) - both reps below render from this same def, so the data
|
|
56
|
+
// and literal branches pick the fields up together.
|
|
57
|
+
const { def: config, json: configJson } = configDefinition(model, target.name)
|
|
55
58
|
const asData = isConfigData(configJson, configReprSetting(model))
|
|
56
59
|
|
|
57
60
|
File({ name: 'config.' + target.ext }, () => {
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
KIT,
|
|
4
|
-
getModelPath
|
|
5
|
-
} from '@voxgig/apidef'
|
|
6
|
-
|
|
7
2
|
import type {
|
|
8
3
|
ModelEntity
|
|
9
4
|
} from '@voxgig/apidef'
|
|
10
5
|
|
|
11
|
-
import { cmp, each, Folder, File, Content } from '@voxgig/sdkgen'
|
|
6
|
+
import { cmp, each, Folder, File, Content, entityCollection } from '@voxgig/sdkgen'
|
|
12
7
|
|
|
13
8
|
|
|
14
9
|
import { TestEntity } from './TestEntity_rust'
|
|
@@ -39,7 +34,10 @@ fn exists_test_mode() {
|
|
|
39
34
|
`)
|
|
40
35
|
})
|
|
41
36
|
|
|
42
|
-
each(model
|
|
37
|
+
const entity = each(entityCollection(model))
|
|
38
|
+
.filter((e: any) => false !== e.active)
|
|
39
|
+
|
|
40
|
+
each(entity, (entity: ModelEntity) => {
|
|
43
41
|
TestEntity({ target, entity, rustcrate })
|
|
44
42
|
TestDirect({ target, entity, rustcrate })
|
|
45
43
|
})
|
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
ModelEntity
|
|
10
10
|
} from '@voxgig/apidef'
|
|
11
11
|
|
|
12
|
-
import { cmp, each, Folder, File, Content } from '@voxgig/sdkgen'
|
|
12
|
+
import { cmp, each, Folder, File, Content, entityCollection } from '@voxgig/sdkgen'
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
import { TestEntity } from './TestEntity_scala'
|
|
@@ -33,7 +33,10 @@ const Test = cmp(function Test(props: any) {
|
|
|
33
33
|
|
|
34
34
|
const entities: { Name: string; entity: boolean; direct: boolean }[] = []
|
|
35
35
|
|
|
36
|
-
each(model
|
|
36
|
+
const entity = each(entityCollection(model))
|
|
37
|
+
.filter((e: any) => false !== e.active)
|
|
38
|
+
|
|
39
|
+
each(entity, (entity: ModelEntity) => {
|
|
37
40
|
const EntityName = nom(entity, 'Name')
|
|
38
41
|
|
|
39
42
|
const basicflow: any =
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// The provider repo's `.gitignore` — GENERATED, not templated, and it has
|
|
2
|
+
// to be.
|
|
3
|
+
//
|
|
4
|
+
// npm NEVER publishes a file named `.gitignore`. It sits on npm's own
|
|
5
|
+
// always-excluded list, and naming the parent directory in package.json
|
|
6
|
+
// `files` does not override it: `npm pack --dry-run` on this package omits
|
|
7
|
+
// `project/.sdk/tm/seneca-provider/.gitignore` while shipping every sibling
|
|
8
|
+
// in that folder. So the template worked from a checkout and reached NOBODY
|
|
9
|
+
// who installed @voxgig/sdkgen from the registry — their generated provider
|
|
10
|
+
// had no ignore file, and the very first regeneration left the repo dirty
|
|
11
|
+
// with the `.jostraca/` output duplicate this content exists to hide.
|
|
12
|
+
//
|
|
13
|
+
// Every one of the 23 language targets already emits its `.gitignore` from a
|
|
14
|
+
// `Gitignore_<lang>.ts` for this same reason. seneca-provider was the only
|
|
15
|
+
// target still doing it with a template, and the only one npm could break.
|
|
16
|
+
//
|
|
17
|
+
// `packaging.test.ts` asks npm directly whether every shipped file survives
|
|
18
|
+
// packing, so the next dotfile added to the scaffold cannot repeat this.
|
|
19
|
+
//
|
|
20
|
+
// The content below is the template's, byte for byte. It carried no
|
|
21
|
+
// placeholder, so nothing about `stdrep` substitution changes by moving it.
|
|
22
|
+
|
|
23
|
+
import {
|
|
24
|
+
Content,
|
|
25
|
+
File,
|
|
26
|
+
cmp,
|
|
27
|
+
} from '@voxgig/sdkgen'
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
const Gitignore = cmp(async function Gitignore(_props: any) {
|
|
31
|
+
File({ name: '.gitignore' }, () => {
|
|
32
|
+
Content(`# Logs
|
|
33
|
+
logs
|
|
34
|
+
*.log
|
|
35
|
+
npm-debug.log*
|
|
36
|
+
yarn-debug.log*
|
|
37
|
+
yarn-error.log*
|
|
38
|
+
lerna-debug.log*
|
|
39
|
+
|
|
40
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
41
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
42
|
+
|
|
43
|
+
# Runtime data
|
|
44
|
+
pids
|
|
45
|
+
*.pid
|
|
46
|
+
*.seed
|
|
47
|
+
*.pid.lock
|
|
48
|
+
|
|
49
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
50
|
+
lib-cov
|
|
51
|
+
|
|
52
|
+
# Coverage directory used by tools like istanbul
|
|
53
|
+
coverage
|
|
54
|
+
*.lcov
|
|
55
|
+
|
|
56
|
+
# nyc test coverage
|
|
57
|
+
.nyc_output
|
|
58
|
+
|
|
59
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
60
|
+
.grunt
|
|
61
|
+
|
|
62
|
+
# Bower dependency directory (https://bower.io/)
|
|
63
|
+
bower_components
|
|
64
|
+
|
|
65
|
+
# node-waf configuration
|
|
66
|
+
.lock-wscript
|
|
67
|
+
|
|
68
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
69
|
+
build/Release
|
|
70
|
+
|
|
71
|
+
# Dependency directories
|
|
72
|
+
node_modules/
|
|
73
|
+
jspm_packages/
|
|
74
|
+
|
|
75
|
+
# TypeScript v1 declaration files
|
|
76
|
+
typings/
|
|
77
|
+
|
|
78
|
+
# TypeScript cache
|
|
79
|
+
*.tsbuildinfo
|
|
80
|
+
|
|
81
|
+
# Optional npm cache directory
|
|
82
|
+
.npm
|
|
83
|
+
|
|
84
|
+
# Optional eslint cache
|
|
85
|
+
.eslintcache
|
|
86
|
+
|
|
87
|
+
# Microbundle cache
|
|
88
|
+
.rpt2_cache/
|
|
89
|
+
.rts2_cache_cjs/
|
|
90
|
+
.rts2_cache_es/
|
|
91
|
+
.rts2_cache_umd/
|
|
92
|
+
|
|
93
|
+
# Optional REPL history
|
|
94
|
+
.node_repl_history
|
|
95
|
+
|
|
96
|
+
# Output of 'npm pack'
|
|
97
|
+
*.tgz
|
|
98
|
+
|
|
99
|
+
# Yarn Integrity file
|
|
100
|
+
.yarn-integrity
|
|
101
|
+
|
|
102
|
+
# dotenv environment variables file
|
|
103
|
+
.env
|
|
104
|
+
.env.test
|
|
105
|
+
|
|
106
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
107
|
+
.cache
|
|
108
|
+
|
|
109
|
+
# Next.js build output
|
|
110
|
+
.next
|
|
111
|
+
|
|
112
|
+
# Nuxt.js build / generate output
|
|
113
|
+
.nuxt
|
|
114
|
+
|
|
115
|
+
# Gatsby files
|
|
116
|
+
.cache/
|
|
117
|
+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
|
|
118
|
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
119
|
+
# public
|
|
120
|
+
|
|
121
|
+
# vuepress build output
|
|
122
|
+
.vuepress/dist
|
|
123
|
+
|
|
124
|
+
# Serverless directories
|
|
125
|
+
.serverless/
|
|
126
|
+
|
|
127
|
+
# FuseBox cache
|
|
128
|
+
.fusebox/
|
|
129
|
+
|
|
130
|
+
# DynamoDB Local files
|
|
131
|
+
.dynamodb/
|
|
132
|
+
|
|
133
|
+
# TernJS port file
|
|
134
|
+
.tern-port
|
|
135
|
+
|
|
136
|
+
*~
|
|
137
|
+
|
|
138
|
+
package-lock.json
|
|
139
|
+
yarn.lock
|
|
140
|
+
|
|
141
|
+
test/local-config.js
|
|
142
|
+
test/local-env.js
|
|
143
|
+
# TypeScript build info
|
|
144
|
+
*.tsbuildinfo
|
|
145
|
+
.tsbuildinfo/
|
|
146
|
+
|
|
147
|
+
# Generator bookkeeping. This package is GENERATED into this repo by
|
|
148
|
+
# @voxgig/sdkgen from the SDK project, and jostraca drops its meta log plus a
|
|
149
|
+
# full duplicate of the last generated output here on every run. The SDK repo
|
|
150
|
+
# commits its own copy; this repo has no reason to, and without this line
|
|
151
|
+
# every regeneration leaves the provider repo dirty with hundreds of
|
|
152
|
+
# untracked files.
|
|
153
|
+
.jostraca/
|
|
154
|
+
`)
|
|
155
|
+
})
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
export {
|
|
160
|
+
Gitignore
|
|
161
|
+
}
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
} from '@voxgig/apidef'
|
|
15
15
|
|
|
16
16
|
import { Tests, Scripts, Workflow, Readme, Docs } from './Extras_seneca-provider'
|
|
17
|
+
import { Gitignore } from './Gitignore_seneca-provider'
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
// The `seneca-provider` target: a Seneca plugin exposing this API's entities
|
|
@@ -206,9 +207,10 @@ function parentEntityOf(key: string, names: string[]): string {
|
|
|
206
207
|
// published package to the SDK instead.
|
|
207
208
|
//
|
|
208
209
|
// Order: the project's `output: repo`, else the Seneca convention.
|
|
209
|
-
function providerRepo(model: any, lower: string
|
|
210
|
+
function providerRepo(model: any, lower: string, tname: string):
|
|
211
|
+
{ url: string, path: string } {
|
|
210
212
|
const host = model?.main?.[KIT]?.repo?.host || 'github.com'
|
|
211
|
-
const declared = model?.main?.[KIT]?.target?.[
|
|
213
|
+
const declared = model?.main?.[KIT]?.target?.[tname]?.output?.repo
|
|
212
214
|
const path = null != declared && '' !== declared ?
|
|
213
215
|
String(declared) : `senecajs/seneca-${lower}-provider`
|
|
214
216
|
|
|
@@ -219,8 +221,8 @@ function providerRepo(model: any, lower: string): { url: string, path: string }
|
|
|
219
221
|
// The provider's published package name: the project's pin when it has one,
|
|
220
222
|
// else `@seneca/<name>-provider`. packageName() cannot answer this — its
|
|
221
223
|
// derivations are all SDK-shaped (`@<origin>/<slug>-sdk`).
|
|
222
|
-
function providerPackage(model: any, lower: string): string {
|
|
223
|
-
const declared = model?.main?.[KIT]?.target?.[
|
|
224
|
+
function providerPackage(model: any, lower: string, tname: string): string {
|
|
225
|
+
const declared = model?.main?.[KIT]?.target?.[tname]
|
|
224
226
|
?.publish?.registry?.package
|
|
225
227
|
return null != declared && '' !== declared ?
|
|
226
228
|
String(declared) : `@seneca/${lower}-provider`
|
|
@@ -253,6 +255,8 @@ const Main = cmp(function Main(props: any) {
|
|
|
253
255
|
// The SDK is a PUBLISHED dependency, not a path: this package lives in its
|
|
254
256
|
// own repo. Its name is whatever the ts target publishes under, pin
|
|
255
257
|
// included, so the two can never disagree.
|
|
258
|
+
// The TypeScript SDK this provider WRAPS — a different target, so it
|
|
259
|
+
// keeps its own name and does not follow this provider's alias.
|
|
256
260
|
const sdkPkg = packageName(model, 'npm')
|
|
257
261
|
const sdkVersion = packageVersion(model, 'ts')
|
|
258
262
|
|
|
@@ -374,7 +378,7 @@ const Main = cmp(function Main(props: any) {
|
|
|
374
378
|
'all. Remove the target, or add an entity with CRUD ops.')
|
|
375
379
|
}
|
|
376
380
|
|
|
377
|
-
const repo = providerRepo(model, lower)
|
|
381
|
+
const repo = providerRepo(model, lower, target.name)
|
|
378
382
|
|
|
379
383
|
// The companion test server lives in the SDK repo's `app/` and is NOT
|
|
380
384
|
// published, so the only way to reach it is the local checkout. The path
|
|
@@ -440,7 +444,7 @@ const Main = cmp(function Main(props: any) {
|
|
|
440
444
|
// The provider's OWN published name. Not derived from the SDK slug the
|
|
441
445
|
// way a language target's is — a provider is `@seneca/<name>-provider` —
|
|
442
446
|
// so read the project's pin directly and default to that shape.
|
|
443
|
-
pkgName: providerPackage(model, lower),
|
|
447
|
+
pkgName: providerPackage(model, lower, target.name),
|
|
444
448
|
// Whether this API authenticates at all. Decides if the plugin plumbs a
|
|
445
449
|
// credential: the SDK's auth stage emits nothing for an auth-inactive
|
|
446
450
|
// model and strips the authorization header regardless of options, so
|
|
@@ -448,14 +452,20 @@ const Main = cmp(function Main(props: any) {
|
|
|
448
452
|
authActive: isAuthActive(model),
|
|
449
453
|
}
|
|
450
454
|
|
|
451
|
-
//
|
|
452
|
-
//
|
|
455
|
+
// `.gitignore` is EMITTED rather than copied — npm strips that filename
|
|
456
|
+
// from the tarball, so as a template it reached only checkout users. See
|
|
457
|
+
// Gitignore_seneca-provider. Called before the Copy, as every language
|
|
458
|
+
// target calls its own.
|
|
459
|
+
Gitignore({})
|
|
460
|
+
|
|
461
|
+
// Static furniture: LICENSE, CODE_OF_CONDUCT, Makefile, tsfmt.json and
|
|
462
|
+
// both tsconfigs. Same for every provider.
|
|
453
463
|
Copy({
|
|
454
464
|
from: 'tm/' + target.name,
|
|
455
465
|
replace: { ...ctx$.stdrep },
|
|
456
466
|
})
|
|
457
467
|
|
|
458
|
-
PackageJson({ provider })
|
|
468
|
+
PackageJson({ provider, target })
|
|
459
469
|
ProviderSource({ provider })
|
|
460
470
|
ProviderDoc({ provider })
|
|
461
471
|
Tests({ provider })
|
|
@@ -469,9 +479,8 @@ const Main = cmp(function Main(props: any) {
|
|
|
469
479
|
// --- package.json -----------------------------------------------------------
|
|
470
480
|
|
|
471
481
|
const PackageJson = cmp(function PackageJson(props: any) {
|
|
472
|
-
const { provider } = props
|
|
482
|
+
const { provider, target } = props
|
|
473
483
|
const { model } = props.ctx$
|
|
474
|
-
const target = model.main[KIT].target['seneca-provider']
|
|
475
484
|
|
|
476
485
|
const deps = collectDeps(model, target.name, target.deps, props.ctx$.log)
|
|
477
486
|
|