@voxgig/sdkgen 3.5.0 → 3.6.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 (171) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/cmp/ExternalTarget.js +1 -1
  3. package/dist/cmp/ExternalTarget.js.map +1 -1
  4. package/dist/helpers/naming.d.ts +4 -1
  5. package/dist/helpers/naming.js +119 -5
  6. package/dist/helpers/naming.js.map +1 -1
  7. package/dist/helpers/opShape.js +72 -0
  8. package/dist/helpers/opShape.js.map +1 -1
  9. package/dist/helpers/packageMeta.d.ts +2 -1
  10. package/dist/helpers/packageMeta.js +57 -20
  11. package/dist/helpers/packageMeta.js.map +1 -1
  12. package/dist/sdkgen.d.ts +3 -3
  13. package/dist/sdkgen.js +61 -18
  14. package/dist/sdkgen.js.map +1 -1
  15. package/dist/testkit.d.ts +39 -0
  16. package/dist/testkit.js +663 -0
  17. package/dist/testkit.js.map +1 -0
  18. package/dist/tsconfig.tsbuildinfo +1 -1
  19. package/package.json +32 -8
  20. package/project/.sdk/src/cmp/c/Test_c.ts +5 -7
  21. package/project/.sdk/src/cmp/clojure/Test_clojure.ts +3 -7
  22. package/project/.sdk/src/cmp/cpp/Test_cpp.ts +4 -7
  23. package/project/.sdk/src/cmp/csharp/Package_csharp.ts +1 -1
  24. package/project/.sdk/src/cmp/csharp/Test_csharp.ts +5 -7
  25. package/project/.sdk/src/cmp/dart/Test_dart.ts +3 -4
  26. package/project/.sdk/src/cmp/elixir/Package_elixir.ts +1 -1
  27. package/project/.sdk/src/cmp/elixir/Test_elixir.ts +5 -6
  28. package/project/.sdk/src/cmp/go/EntityTypes_go.ts +1 -1
  29. package/project/.sdk/src/cmp/go/Entity_go.ts +1 -1
  30. package/project/.sdk/src/cmp/go/Gitignore_go.ts +6 -0
  31. package/project/.sdk/src/cmp/go/Main_go.ts +2 -2
  32. package/project/.sdk/src/cmp/go/Package_go.ts +1 -1
  33. package/project/.sdk/src/cmp/go/ReadmeExamplesTest_go.ts +59 -6
  34. package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +1 -1
  35. package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +1 -1
  36. package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +1 -1
  37. package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +1 -1
  38. package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +1 -1
  39. package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +1 -1
  40. package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +1 -1
  41. package/project/.sdk/src/cmp/go/Test_go.ts +6 -8
  42. package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +6 -2
  43. package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +6 -2
  44. package/project/.sdk/src/cmp/java/Test_java.ts +4 -7
  45. package/project/.sdk/src/cmp/js/Package_js.ts +1 -1
  46. package/project/.sdk/src/cmp/js/Test_js.ts +4 -7
  47. package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +4 -7
  48. package/project/.sdk/src/cmp/lean/Test_lean.ts +3 -3
  49. package/project/.sdk/src/cmp/lua/Package_lua.ts +2 -2
  50. package/project/.sdk/src/cmp/lua/Test_lua.ts +5 -7
  51. package/project/.sdk/src/cmp/ocaml/Test_ocaml.ts +3 -7
  52. package/project/.sdk/src/cmp/perl/Package_perl.ts +1 -1
  53. package/project/.sdk/src/cmp/perl/Test_perl.ts +5 -7
  54. package/project/.sdk/src/cmp/php/EntityTypes_php.ts +13 -2
  55. package/project/.sdk/src/cmp/php/Package_php.ts +2 -2
  56. package/project/.sdk/src/cmp/php/Test_php.ts +5 -7
  57. package/project/.sdk/src/cmp/py/Package_py.ts +2 -2
  58. package/project/.sdk/src/cmp/py/Test_py.ts +5 -7
  59. package/project/.sdk/src/cmp/py-data/Main_py-data.ts +14 -19
  60. package/project/.sdk/src/cmp/rb/Package_rb.ts +3 -3
  61. package/project/.sdk/src/cmp/rb/ReadmeInstall_rb.ts +1 -1
  62. package/project/.sdk/src/cmp/rb/Test_rb.ts +5 -7
  63. package/project/.sdk/src/cmp/rust/Test_rust.ts +5 -7
  64. package/project/.sdk/src/cmp/scala/Test_scala.ts +5 -2
  65. package/project/.sdk/src/cmp/seneca-provider/Gitignore_seneca-provider.ts +161 -0
  66. package/project/.sdk/src/cmp/seneca-provider/Main_seneca-provider.ts +20 -11
  67. package/project/.sdk/src/cmp/swift/Test_swift.ts +5 -7
  68. package/project/.sdk/src/cmp/ts/Package_ts.ts +1 -1
  69. package/project/.sdk/src/cmp/ts/Test_ts.ts +8 -7
  70. package/project/.sdk/src/cmp/zig/Test_zig.ts +3 -7
  71. package/project/.sdk/tm/c/utility/make_point.c +64 -3
  72. package/project/.sdk/tm/clojure/src/sdk/core.clj +49 -14
  73. package/project/.sdk/tm/cpp/utility/pipeline.hpp +55 -3
  74. package/project/.sdk/tm/csharp/feature/TestFeature.cs +36 -2
  75. package/project/.sdk/tm/csharp/utility/MakePoint.cs +65 -2
  76. package/project/.sdk/tm/dart/lib/feature/test/TestFeature.dart +34 -4
  77. package/project/.sdk/tm/dart/lib/utility/MakePointUtility.dart +48 -2
  78. package/project/.sdk/tm/elixir/lib/projectname/utility.ex +70 -10
  79. package/project/.sdk/tm/go/feature/test_feature.go +34 -2
  80. package/project/.sdk/tm/go/utility/make_point.go +66 -2
  81. package/project/.sdk/tm/java/feature/TestFeature.java +42 -2
  82. package/project/.sdk/tm/java/utility/MakePoint.java +61 -2
  83. package/project/.sdk/tm/js/src/feature/test/TestFeature.js +22 -3
  84. package/project/.sdk/tm/js/src/utility/MakePointUtility.js +72 -2
  85. package/project/.sdk/tm/kotlin/feature/TestFeature.kt +31 -2
  86. package/project/.sdk/tm/kotlin/utility/MakePoint.kt +58 -2
  87. package/project/.sdk/tm/lean/src/SdkUtility.lean +28 -0
  88. package/project/.sdk/tm/lua/utility/make_point.lua +65 -2
  89. package/project/.sdk/tm/ocaml/sdk_runtime.ml +40 -2
  90. package/project/.sdk/tm/perl/utility/make_point.pm +55 -2
  91. package/project/.sdk/tm/php/feature/TestFeature.php +30 -1
  92. package/project/.sdk/tm/php/utility/MakePoint.php +49 -1
  93. package/project/.sdk/tm/py/pkg/utility/make_point.py +56 -2
  94. package/project/.sdk/tm/rb/utility/make_point.rb +42 -2
  95. package/project/.sdk/tm/rust/utility/make_point.rs +69 -2
  96. package/project/.sdk/tm/scala/feature/TestFeature.scala +36 -1
  97. package/project/.sdk/tm/scala/utility/Make.scala +57 -3
  98. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TestFeature.swift +29 -1
  99. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Make.swift +51 -2
  100. package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +22 -3
  101. package/project/.sdk/tm/ts/src/utility/MakePointUtility.ts +72 -2
  102. package/project/.sdk/tm/zig/core/utility.zig +66 -3
  103. package/project/sdkgen-package.json +1 -2
  104. package/src/cmp/ExternalTarget.ts +1 -1
  105. package/src/helpers/naming.ts +129 -5
  106. package/src/helpers/opShape.ts +85 -0
  107. package/src/helpers/packageMeta.ts +59 -20
  108. package/src/sdkgen.ts +68 -20
  109. package/src/testkit.ts +863 -0
  110. package/testkit.d.ts +3 -0
  111. package/testkit.js +12 -0
  112. package/project/.sdk/model/target/haskell.aontu +0 -72
  113. package/project/.sdk/src/cmp/haskell/Config_haskell.ts +0 -98
  114. package/project/.sdk/src/cmp/haskell/Entity_haskell.ts +0 -13
  115. package/project/.sdk/src/cmp/haskell/Gitignore_haskell.ts +0 -27
  116. package/project/.sdk/src/cmp/haskell/Main_haskell.ts +0 -123
  117. package/project/.sdk/src/cmp/haskell/Package_haskell.ts +0 -60
  118. package/project/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +0 -186
  119. package/project/.sdk/src/cmp/haskell/ReadmeExamplesTest_haskell.ts +0 -135
  120. package/project/.sdk/src/cmp/haskell/ReadmeExplanation_haskell.ts +0 -48
  121. package/project/.sdk/src/cmp/haskell/ReadmeHowto_haskell.ts +0 -168
  122. package/project/.sdk/src/cmp/haskell/ReadmeInstall_haskell.ts +0 -51
  123. package/project/.sdk/src/cmp/haskell/ReadmeIntro_haskell.ts +0 -67
  124. package/project/.sdk/src/cmp/haskell/ReadmeModel_haskell.ts +0 -162
  125. package/project/.sdk/src/cmp/haskell/ReadmeOptions_haskell.ts +0 -74
  126. package/project/.sdk/src/cmp/haskell/ReadmeQuick_haskell.ts +0 -241
  127. package/project/.sdk/src/cmp/haskell/ReadmeRef_haskell.ts +0 -408
  128. package/project/.sdk/src/cmp/haskell/ReadmeTopHowto_haskell.ts +0 -31
  129. package/project/.sdk/src/cmp/haskell/ReadmeTopQuick_haskell.ts +0 -104
  130. package/project/.sdk/src/cmp/haskell/ReadmeTopTest_haskell.ts +0 -80
  131. package/project/.sdk/src/cmp/haskell/Test_haskell.ts +0 -300
  132. package/project/.sdk/src/cmp/haskell/tsconfig.json +0 -15
  133. package/project/.sdk/src/cmp/haskell/utility_haskell.ts +0 -166
  134. package/project/.sdk/tm/haskell/LICENSE +0 -21
  135. package/project/.sdk/tm/haskell/Makefile +0 -22
  136. package/project/.sdk/tm/haskell/VERSION +0 -1
  137. package/project/.sdk/tm/haskell/src/SdkFeatures.hs +0 -1440
  138. package/project/.sdk/tm/haskell/src/SdkHelpers.hs +0 -337
  139. package/project/.sdk/tm/haskell/src/SdkJson.hs +0 -111
  140. package/project/.sdk/tm/haskell/src/SdkRuntime.hs +0 -1219
  141. package/project/.sdk/tm/haskell/src/SdkTypes.hs +0 -195
  142. package/project/.sdk/tm/haskell/src/VoxgigStruct.hs +0 -2299
  143. package/project/.sdk/tm/haskell/src/Vregex.hs +0 -237
  144. package/project/.sdk/tm/haskell/src/feature/README.md +0 -5
  145. package/project/.sdk/tm/haskell/src/feature/audit/.gitkeep +0 -0
  146. package/project/.sdk/tm/haskell/src/feature/base/.gitkeep +0 -0
  147. package/project/.sdk/tm/haskell/src/feature/cache/.gitkeep +0 -0
  148. package/project/.sdk/tm/haskell/src/feature/clienttrack/.gitkeep +0 -0
  149. package/project/.sdk/tm/haskell/src/feature/debug/.gitkeep +0 -0
  150. package/project/.sdk/tm/haskell/src/feature/idempotency/.gitkeep +0 -0
  151. package/project/.sdk/tm/haskell/src/feature/log/.gitkeep +0 -0
  152. package/project/.sdk/tm/haskell/src/feature/metrics/.gitkeep +0 -0
  153. package/project/.sdk/tm/haskell/src/feature/netsim/.gitkeep +0 -0
  154. package/project/.sdk/tm/haskell/src/feature/paging/.gitkeep +0 -0
  155. package/project/.sdk/tm/haskell/src/feature/proxy/.gitkeep +0 -0
  156. package/project/.sdk/tm/haskell/src/feature/ratelimit/.gitkeep +0 -0
  157. package/project/.sdk/tm/haskell/src/feature/rbac/.gitkeep +0 -0
  158. package/project/.sdk/tm/haskell/src/feature/retry/.gitkeep +0 -0
  159. package/project/.sdk/tm/haskell/src/feature/streaming/.gitkeep +0 -0
  160. package/project/.sdk/tm/haskell/src/feature/telemetry/.gitkeep +0 -0
  161. package/project/.sdk/tm/haskell/src/feature/test/.gitkeep +0 -0
  162. package/project/.sdk/tm/haskell/src/feature/timeout/.gitkeep +0 -0
  163. package/project/.sdk/tm/haskell/test/Harness.hs +0 -281
  164. package/project/.sdk/tm/haskell/test/Runner.hs +0 -47
  165. package/project/.sdk/tm/haskell/test/StructCorpus.hs +0 -449
  166. package/project/.sdk/tm/haskell/test/TCustomUtility.hs +0 -38
  167. package/project/.sdk/tm/haskell/test/TFeature.hs +0 -794
  168. package/project/.sdk/tm/haskell/test/TNetsim.hs +0 -50
  169. package/project/.sdk/tm/haskell/test/TPipeline.hs +0 -334
  170. package/project/.sdk/tm/haskell/test/TPrimaryUtility.hs +0 -386
  171. package/project/.sdk/tm/haskell/test/Testutil.hs +0 -59
@@ -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 } from '@voxgig/sdkgen'
6
+ import { cmp, each, Folder, entityCollection } from '@voxgig/sdkgen'
12
7
 
13
8
 
14
9
  import { TestDirect } from './TestDirect_js'
@@ -22,7 +17,9 @@ const Test = cmp(function Test(props: any) {
22
17
  Folder({ name: 'test' }, () => {
23
18
 
24
19
  Folder({ name: 'entity' }, () => {
25
- each(model.main[KIT].entity, (entity: ModelEntity) => {
20
+ const entity = each(entityCollection(model))
21
+ .filter((e: any) => false !== e.active)
22
+ each(entity, (entity: ModelEntity) => {
26
23
  TestEntity({ target, entity })
27
24
  TestDirect({ target, entity })
28
25
  })
@@ -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 } from '@voxgig/sdkgen'
6
+ import { cmp, each, Folder, entityCollection } from '@voxgig/sdkgen'
12
7
 
13
8
 
14
9
  import { TestEntity } from './TestEntity_kotlin'
@@ -30,7 +25,9 @@ const Test = cmp(function Test(props: any) {
30
25
  // CustomUtilityTest, StructRunner/StructCorpusTest, ExistsTest and
31
26
  // sdk-test-control.json) ships as templates in tm/kotlin/test/ and is
32
27
  // copied by Main_kotlin. Here we generate only the API-specific tests.
33
- each(model.main[KIT].entity, (entity: ModelEntity) => {
28
+ const entity = each(entityCollection(model))
29
+ .filter((e: any) => false !== e.active)
30
+ each(entity, (entity: ModelEntity) => {
34
31
  TestEntity({ target, entity, kotlinpackage })
35
32
  TestDirect({ target, entity, kotlinpackage })
36
33
  })
@@ -4,12 +4,11 @@ import {
4
4
  Folder,
5
5
  cmp,
6
6
  each,
7
+ entityCollection,
7
8
  } from '@voxgig/sdkgen'
8
9
 
9
10
  import {
10
- KIT,
11
11
  Model,
12
- getModelPath,
13
12
  } from '@voxgig/apidef'
14
13
 
15
14
 
@@ -70,7 +69,8 @@ const Test = cmp(async function Test(props: any) {
70
69
  const target = props.target
71
70
  const model: Model = ctx$.model
72
71
 
73
- const entity = getModelPath(model, `main.${KIT}.entity`)
72
+ const entity = each(entityCollection(model))
73
+ .filter((e: any) => false !== e.active)
74
74
 
75
75
  // Per-entity OFFLINE (test-mode) blocks: seeded store, no server.
76
76
  let offline = ''
@@ -27,7 +27,7 @@ const Package = cmp(async function Package(props: any) {
27
27
  // (`${model.name}_sdk`) used by `require` is unchanged.
28
28
  const ns = model.origin || 'voxgig-sdk'
29
29
  const pkgBase = ns.endsWith('-sdk') ? model.name : `${model.name}-sdk`
30
- const rockName = packageName(model, 'lua')
30
+ const rockName = packageName(model, target.name)
31
31
  const { repoUrl, issuesUrl } = repoInfo(model)
32
32
  const labels = keywords(model).map((k) => `"${k}"`).join(', ')
33
33
 
@@ -46,7 +46,7 @@ source = {
46
46
  dir = "${model.name}-sdk/lua"
47
47
  }
48
48
  description = {
49
- summary = "${pkgDescription(model, 'lua')}",
49
+ summary = "${pkgDescription(model, target.name)}",
50
50
  homepage = "${repoUrl}",
51
51
  issues_url = "${issuesUrl}",
52
52
  license = "MIT",
@@ -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_lua'
@@ -37,7 +32,10 @@ end)
37
32
  `)
38
33
  })
39
34
 
40
- each(model.main[KIT].entity, (entity: ModelEntity) => {
35
+ const entity = each(entityCollection(model))
36
+ .filter((e: any) => false !== e.active)
37
+
38
+ each(entity, (entity: ModelEntity) => {
41
39
  TestEntity({ target, entity })
42
40
  TestDirect({ target, entity })
43
41
  })
@@ -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 } from '@voxgig/sdkgen'
6
+ import { cmp, each, Folder, entityCollection } from '@voxgig/sdkgen'
12
7
 
13
8
 
14
9
  import { TestEntity } from './TestEntity_ocaml'
@@ -20,7 +15,8 @@ const Test = cmp(function Test(props: any) {
20
15
  const { model } = props.ctx$
21
16
  const { target } = props
22
17
 
23
- const entity = getModelPath(model, `main.${KIT}.entity`)
18
+ const entity = each(entityCollection(model))
19
+ .filter((e: any) => false !== e.active)
24
20
 
25
21
  Folder({ name: 'test' }, () => {
26
22
  each(entity, (entity: ModelEntity) => {
@@ -48,7 +48,7 @@ use ExtUtils::MakeMaker;
48
48
  WriteMakefile(
49
49
  NAME => '${Name}SDK',
50
50
  VERSION_FROM => 'lib/${Name}SDK.pm',
51
- ABSTRACT => '${pkgDescription(model, 'perl')}',
51
+ ABSTRACT => '${pkgDescription(model, target.name)}',
52
52
  AUTHOR => 'Voxgig',
53
53
  LICENSE => 'mit',
54
54
  MIN_PERL_VERSION => '5.018',
@@ -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_perl'
@@ -42,7 +37,10 @@ done_testing();
42
37
  `)
43
38
  })
44
39
 
45
- each(model.main[KIT].entity, (entity: ModelEntity) => {
40
+ const entity = each(entityCollection(model))
41
+ .filter((e: any) => false !== e.active)
42
+
43
+ each(entity, (entity: ModelEntity) => {
46
44
  TestEntity({ target, entity })
47
45
  TestDirect({ target, entity })
48
46
  })
@@ -29,7 +29,7 @@ import {
29
29
  File, Content, Folder,
30
30
  } from '@voxgig/sdkgen'
31
31
 
32
- import { canonToType, opTypeName, opRequestShape, warnEntityTypeCollisions , deriveEntityNames } from '@voxgig/sdkgen'
32
+ import { canonToType, opTypeName, opRequestShape, warnEntityTypeCollisions , deriveEntityNames, phpSafeTypeName } from '@voxgig/sdkgen'
33
33
 
34
34
  import {
35
35
  KIT,
@@ -114,9 +114,20 @@ declare(strict_types=1);
114
114
  const fields = (ent.fields ? each(ent.fields) : [])
115
115
  .filter((f: any) => f.active !== false && validName(f.name))
116
116
 
117
+ // PHP refuses a reserved word where a class name is expected, and the
118
+ // check is CASE-INSENSITIVE — an entity named `Namespace` emitted
119
+ // `class Namespace`, which does not parse, and took the whole types
120
+ // file with it (issue #64). phpSafeTypeName appends `Type` on a real
121
+ // collision and leaves every other name untouched.
122
+ //
123
+ // Only the bare data class needs it: the per-op names below already
124
+ // carry a suffix no reserved word matches, and the entity accessor is
125
+ // a method, which PHP resolves separately.
126
+ const TypeName = phpSafeTypeName(Name)
127
+
117
128
  // Entity data model: one typed property per field (`req:false` -> nullable).
118
129
  Content(`/** ${Name} entity data model. */
119
- class ${Name}
130
+ class ${TypeName}
120
131
  {
121
132
  `)
122
133
  fields.forEach((f: any) => {
@@ -39,8 +39,8 @@ const Package = cmp(async function Package(props: any) {
39
39
  // Generate composer.json
40
40
  File({ name: 'composer.json' }, () => {
41
41
  Content(`{
42
- "name": "${packageName(model, 'php')}",
43
- "description": "${pkgDescription(model, 'php')}",
42
+ "name": "${packageName(model, target.name)}",
43
+ "description": "${pkgDescription(model, target.name)}",
44
44
  "type": "library",
45
45
  "keywords": [${kw}],
46
46
  "homepage": "${repoUrl}",
@@ -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_php'
@@ -44,7 +39,10 @@ class ExistsTest extends TestCase
44
39
  `)
45
40
  })
46
41
 
47
- each(model.main[KIT].entity, (entity: ModelEntity) => {
42
+ const entity = each(entityCollection(model))
43
+ .filter((e: any) => false !== e.active)
44
+
45
+ each(entity, (entity: ModelEntity) => {
48
46
  TestEntity({ target, entity })
49
47
  TestDirect({ target, entity })
50
48
  })
@@ -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, 'py')
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, 'py')}"
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.main[KIT].entity, (entity: ModelEntity) => {
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
  })
@@ -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, 'py-data')}"
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 = pyDistName(model)
607
+ const distName = packageName(model, target.name)
606
608
  const sdkDist = packageName(model, 'py')
607
- const pending = 'active' !== registryState(model, 'py-data')
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=py-data"`
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=py-data"
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, 'py-data')
848
- const distName = pyDistName(model)
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=py-data"`]
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
  }
@@ -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, 'rb')
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, 'rb')}"
70
- spec.description = "${pkgDescription(model, 'rb')}"
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 = {
@@ -14,7 +14,7 @@ ${installCommand(model, target.name)}
14
14
  Or add to your \`Gemfile\`:
15
15
 
16
16
  \`\`\`ruby
17
- gem "${packageName(model, 'gem')}"
17
+ gem "${packageName(model, target.name)}"
18
18
  \`\`\`
19
19
 
20
20
  Then run:
@@ -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.main[KIT].entity, (entity: ModelEntity) => {
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
  })
@@ -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.main[KIT].entity, (entity: ModelEntity) => {
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.main[KIT].entity, (entity: ModelEntity) => {
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
+ }