@voxgig/sdkgen 1.3.11 → 1.3.12

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 CHANGED
@@ -8,7 +8,7 @@ const { Shape, One } = require('shape')
8
8
 
9
9
  const { SdkGen } = require('../dist/sdkgen.js')
10
10
 
11
- const VERSION = '1.3.11'
11
+ const VERSION = '1.3.12'
12
12
  const KONSOLE = console
13
13
 
14
14
 
@@ -1 +1 @@
1
- {"root":["../src/sdkgen.ts","../src/types.ts","../src/utility.ts","../src/action/action.ts","../src/action/feature.ts","../src/action/target.ts","../src/cmp/agentguide.ts","../src/cmp/agentguidecontent.ts","../src/cmp/agentguidefeature.ts","../src/cmp/agentguidetop.ts","../src/cmp/changelog.ts","../src/cmp/deploy.ts","../src/cmp/entity.ts","../src/cmp/feature.ts","../src/cmp/featurehook.ts","../src/cmp/license.ts","../src/cmp/main.ts","../src/cmp/readme.ts","../src/cmp/readmeentity.ts","../src/cmp/readmeerrors.ts","../src/cmp/readmeexplanation.ts","../src/cmp/readmehowto.ts","../src/cmp/readmeinstall.ts","../src/cmp/readmeintro.ts","../src/cmp/readmemodel.ts","../src/cmp/readmeoptions.ts","../src/cmp/readmequick.ts","../src/cmp/readmeref.ts","../src/cmp/readmetop.ts","../src/cmp/security.ts","../src/cmp/test.ts","../src/helpers/buildidnames.ts","../src/helpers/canontype.ts","../src/helpers/collectdeps.ts","../src/helpers/getmatchentries.ts","../src/helpers/naming.ts","../src/helpers/opexample.ts","../src/helpers/opshape.ts","../src/helpers/packagemeta.ts"],"version":"6.0.3"}
1
+ {"root":["../src/sdkgen.ts","../src/types.ts","../src/utility.ts","../src/action/action.ts","../src/action/feature.ts","../src/action/target.ts","../src/cmp/AgentGuide.ts","../src/cmp/AgentGuideContent.ts","../src/cmp/AgentGuideFeature.ts","../src/cmp/AgentGuideTop.ts","../src/cmp/Changelog.ts","../src/cmp/Deploy.ts","../src/cmp/Entity.ts","../src/cmp/Feature.ts","../src/cmp/FeatureHook.ts","../src/cmp/License.ts","../src/cmp/Main.ts","../src/cmp/Readme.ts","../src/cmp/ReadmeEntity.ts","../src/cmp/ReadmeErrors.ts","../src/cmp/ReadmeExplanation.ts","../src/cmp/ReadmeHowto.ts","../src/cmp/ReadmeInstall.ts","../src/cmp/ReadmeIntro.ts","../src/cmp/ReadmeModel.ts","../src/cmp/ReadmeOptions.ts","../src/cmp/ReadmeQuick.ts","../src/cmp/ReadmeRef.ts","../src/cmp/ReadmeTop.ts","../src/cmp/Security.ts","../src/cmp/Test.ts","../src/helpers/buildIdNames.ts","../src/helpers/canonType.ts","../src/helpers/collectDeps.ts","../src/helpers/getMatchEntries.ts","../src/helpers/naming.ts","../src/helpers/opExample.ts","../src/helpers/opShape.ts","../src/helpers/packageMeta.ts"],"version":"6.0.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voxgig/sdkgen",
3
- "version": "1.3.11",
3
+ "version": "1.3.12",
4
4
  "main": "dist/sdkgen.js",
5
5
  "type": "commonjs",
6
6
  "types": "dist/sdkgen.d.ts",
@@ -19,7 +19,7 @@
19
19
  // <Name>RemoveMatch.
20
20
 
21
21
  import {
22
- cmp, each,
22
+ cmp, each, names,
23
23
  File, Content,
24
24
  } from '@voxgig/sdkgen'
25
25
 
@@ -139,6 +139,10 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
139
139
 
140
140
  const entity = getModelPath(model, `main.${KIT}.entity`)
141
141
  const entityList = each(entity).filter((e: any) => e.active !== false)
142
+ // Derive the PascalCase Name up-front — it is set LAZILY by names(), so an
143
+ // entity not yet named (e.g. a fieldless placeholder) would otherwise read
144
+ // `Name = undefined` below. Parity with the go emitter's fix.
145
+ entityList.forEach((e: any) => { if (null == e.Name) names(e, e.name) })
142
146
 
143
147
  File({ name: model.const.Name + 'Types.' + target.ext }, () => {
144
148
 
@@ -27,7 +27,7 @@
27
27
  // with every field optional (Go's analog of TS `Partial<Name>`).
28
28
 
29
29
  import {
30
- cmp, each,
30
+ cmp, each, names,
31
31
  File, Content, Folder,
32
32
  } from '@voxgig/sdkgen'
33
33
 
@@ -77,10 +77,17 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
77
77
  const { model } = props.ctx$
78
78
 
79
79
  const entity = getModelPath(model, `main.${KIT}.entity`)
80
- // Emit for every entity that gets an entity file. Main_go.ts iterates
81
- // entities WITHOUT an `active` filter, so a struct is required for each so
82
- // the typed accessors in every *_entity.go resolve at compile time.
83
- const entityList = each(entity).filter((e: any) => e && null != e.Name)
80
+ // Emit for every entity that gets an entity file. Main_go.ts / Entity_go.ts
81
+ // iterate entities WITHOUT an `active` filter and reference the typed data
82
+ // type `<Name>` in every *_entity.go, so a struct is required for each or the
83
+ // package won't compile. Filter on `name` (always present), NOT `Name`:
84
+ // `Name` is the PascalCase variant derived LAZILY by `names()`, so filtering
85
+ // on it silently drops any entity whose `Name` hasn't been derived yet by an
86
+ // earlier component (order-dependent — e.g. fieldless placeholder entities),
87
+ // producing `undefined: <Name>` in the generated Go. Derive `Name` here so
88
+ // the struct set is deterministic and matches the *_entity.go set.
89
+ const entityList = each(entity).filter((e: any) => e && null != e.name)
90
+ entityList.forEach((e: any) => { if (null == e.Name) names(e, e.name) })
84
91
 
85
92
  Folder({ name: 'entity' }, () => {
86
93
 
@@ -19,7 +19,7 @@
19
19
  // <Name>ListMatch, <Name>CreateData, <Name>UpdateData, <Name>RemoveMatch).
20
20
 
21
21
  import {
22
- cmp, each,
22
+ cmp, each, names,
23
23
  File, Content,
24
24
  } from '@voxgig/sdkgen'
25
25
 
@@ -46,6 +46,10 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
46
46
 
47
47
  const entity = getModelPath(model, `main.${KIT}.entity`)
48
48
  const entityList = each(entity).filter((e: any) => e.active !== false)
49
+ // Derive the PascalCase Name up-front — it is set LAZILY by names(), so an
50
+ // entity not yet named (e.g. a fieldless placeholder) would otherwise read
51
+ // `Name = undefined` below. Parity with the go emitter's fix.
52
+ entityList.forEach((e: any) => { if (null == e.Name) names(e, e.name) })
49
53
 
50
54
  File({ name: model.const.Name + 'Types.' + LANG }, () => {
51
55
 
@@ -17,7 +17,7 @@
17
17
  // ---@param / ---@return.
18
18
 
19
19
  import {
20
- cmp, each,
20
+ cmp, each, names,
21
21
  File, Content,
22
22
  } from '@voxgig/sdkgen'
23
23
 
@@ -45,6 +45,10 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
45
45
 
46
46
  const entity = getModelPath(model, `main.${KIT}.entity`)
47
47
  const entityList = each(entity).filter((e: any) => e.active !== false)
48
+ // Derive the PascalCase Name up-front — it is set LAZILY by names(), so an
49
+ // entity not yet named (e.g. a fieldless placeholder) would otherwise read
50
+ // `Name = undefined` below. Parity with the go emitter's fix.
51
+ entityList.forEach((e: any) => { if (null == e.Name) names(e, e.name) })
48
52
 
49
53
  File({ name: model.name + '_types.' + (target.ext || LANG) }, () => {
50
54
 
@@ -25,7 +25,7 @@
25
25
  // Package_php.ts) so `new <Name>()` / type references resolve globally.
26
26
 
27
27
  import {
28
- cmp, each,
28
+ cmp, each, names,
29
29
  File, Content, Folder,
30
30
  } from '@voxgig/sdkgen'
31
31
 
@@ -68,6 +68,10 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
68
68
 
69
69
  const entity = getModelPath(model, `main.${KIT}.entity`)
70
70
  const entityList = each(entity).filter((e: any) => e.active !== false)
71
+ // Derive the PascalCase Name up-front — it is set LAZILY by names(), so an
72
+ // entity not yet named (e.g. a fieldless placeholder) would otherwise read
73
+ // `Name = undefined` below. Parity with the go emitter's fix.
74
+ entityList.forEach((e: any) => { if (null == e.Name) names(e, e.name) })
71
75
 
72
76
  Folder({ name: 'types' }, () => {
73
77
 
@@ -32,7 +32,7 @@
32
32
  // <Name>RemoveMatch.
33
33
 
34
34
  import {
35
- cmp, each,
35
+ cmp, each, names,
36
36
  File, Content,
37
37
  } from '@voxgig/sdkgen'
38
38
 
@@ -123,6 +123,10 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
123
123
 
124
124
  const entity = getModelPath(model, `main.${KIT}.entity`)
125
125
  const entityList = each(entity).filter((e: any) => e.active !== false)
126
+ // Derive the PascalCase Name up-front — it is set LAZILY by names(), so an
127
+ // entity not yet named (e.g. a fieldless placeholder) would otherwise read
128
+ // `Name = undefined` below. Parity with the go emitter's fix.
129
+ entityList.forEach((e: any) => { if (null == e.Name) names(e, e.name) })
126
130
 
127
131
  File({ name: model.const.Name.toLowerCase() + '_types.' + ext }, () => {
128
132
 
@@ -23,7 +23,7 @@
23
23
  // The file is required by the main SDK module so these constants are always loaded.
24
24
 
25
25
  import {
26
- cmp, each,
26
+ cmp, each, names,
27
27
  File, Content,
28
28
  } from '@voxgig/sdkgen'
29
29
 
@@ -81,6 +81,10 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
81
81
 
82
82
  const entity = getModelPath(model, `main.${KIT}.entity`)
83
83
  const entityList = each(entity).filter((e: any) => e.active !== false)
84
+ // Derive the PascalCase Name up-front — it is set LAZILY by names(), so an
85
+ // entity not yet named (e.g. a fieldless placeholder) would otherwise read
86
+ // `Name = undefined` below. Parity with the go emitter's fix.
87
+ entityList.forEach((e: any) => { if (null == e.Name) names(e, e.name) })
84
88
 
85
89
  File({ name: model.const.Name + '_types.' + LANG }, () => {
86
90
 
@@ -17,7 +17,7 @@
17
17
  // <X> op fragments + entity accessor.
18
18
 
19
19
  import {
20
- cmp, each,
20
+ cmp, each, names,
21
21
  File, Content,
22
22
  } from '@voxgig/sdkgen'
23
23
 
@@ -43,6 +43,10 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
43
43
 
44
44
  const entity = getModelPath(model, `main.${KIT}.entity`)
45
45
  const entityList = each(entity).filter((e: any) => e.active !== false)
46
+ // Derive the PascalCase Name up-front — it is set LAZILY by names(), so an
47
+ // entity not yet named (e.g. a fieldless placeholder) would otherwise read
48
+ // `Name = undefined` below. Parity with the go emitter's fix.
49
+ entityList.forEach((e: any) => { if (null == e.Name) names(e, e.name) })
46
50
 
47
51
  File({ name: model.const.Name + 'Types.' + LANG }, () => {
48
52