@underpeaks/generator-core 1.0.63 → 1.0.65

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.
@@ -11,6 +11,17 @@ export interface UiTypeUsage {
11
11
  * manifest). Hidden fields are excluded since they never render as a
12
12
  * widget in the generated app. Models with no attached page are excluded
13
13
  * entirely, per the anti-bloat rule: only generate for what's configured.
14
+ *
15
+ * FIX: displayTypes previously only collected col.display_ui_type when it
16
+ * was EXPLICITLY set on the column — but page-detail.ts (and any other
17
+ * display-rendering template) falls back to getDefaultDisplayUiType(ui_type)
18
+ * whenever display_ui_type is unset, which is the normal case for almost
19
+ * every field (nobody manually sets display_ui_type per-column). The scan
20
+ * and the actual render logic disagreed on how the display type is
21
+ * decided, so resolveRequiredWidgets never knew a derived display widget
22
+ * (e.g. NxfLabel, NxfChipList) was actually needed, and those widget
23
+ * files never got generated — even though templates imported and
24
+ * referenced them. Now applies the same fallback the templates use.
14
25
  */
15
26
  export declare function scanUsedUiTypes(models: Model[], pages: PageDef[]): UiTypeUsage;
16
27
  //# sourceMappingURL=scan-ui-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scan-ui-types.d.ts","sourceRoot":"","sources":["../../src/scan/scan-ui-types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAErD,MAAM,WAAW,WAAW;IAG1B,SAAS,EAAK,GAAG,CAAC,MAAM,CAAC,CAAA;IAMzB,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC1B;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,WAAW,CAyC9E"}
1
+ {"version":3,"file":"scan-ui-types.d.ts","sourceRoot":"","sources":["../../src/scan/scan-ui-types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAErD,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAK,GAAG,CAAC,MAAM,CAAC,CAAA;IACzB,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC1B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,WAAW,CA2C9E"}
@@ -2,6 +2,7 @@
2
2
  // File: underpeaks_codegen/packages/generator-core/src/scan/scan-ui-types.ts
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.scanUsedUiTypes = scanUsedUiTypes;
5
+ const default_display_types_1 = require("../schema/default-display-types");
5
6
  /**
6
7
  * Scans every model attached to at least one page in this generation run
7
8
  * and collects the full set of unique ui_type/display_ui_type values
@@ -10,6 +11,17 @@ exports.scanUsedUiTypes = scanUsedUiTypes;
10
11
  * manifest). Hidden fields are excluded since they never render as a
11
12
  * widget in the generated app. Models with no attached page are excluded
12
13
  * entirely, per the anti-bloat rule: only generate for what's configured.
14
+ *
15
+ * FIX: displayTypes previously only collected col.display_ui_type when it
16
+ * was EXPLICITLY set on the column — but page-detail.ts (and any other
17
+ * display-rendering template) falls back to getDefaultDisplayUiType(ui_type)
18
+ * whenever display_ui_type is unset, which is the normal case for almost
19
+ * every field (nobody manually sets display_ui_type per-column). The scan
20
+ * and the actual render logic disagreed on how the display type is
21
+ * decided, so resolveRequiredWidgets never knew a derived display widget
22
+ * (e.g. NxfLabel, NxfChipList) was actually needed, and those widget
23
+ * files never got generated — even though templates imported and
24
+ * referenced them. Now applies the same fallback the templates use.
13
25
  */
14
26
  function scanUsedUiTypes(models, pages) {
15
27
  const editTypes = new Set();
@@ -40,9 +52,11 @@ function scanUsedUiTypes(models, pages) {
40
52
  for (const col of model.schema.columns) {
41
53
  if (col.hidden)
42
54
  continue;
43
- if (col.display_ui_type) {
44
- displayTypes.add(col.display_ui_type);
45
- }
55
+ // Same fallback page-detail.ts (resolveDisplayType) uses: explicit
56
+ // display_ui_type wins, otherwise derive one from the field's
57
+ // edit ui_type so the scan actually matches what gets rendered.
58
+ const resolved = col.display_ui_type ?? (0, default_display_types_1.getDefaultDisplayUiType)(col.ui_type ?? 'textfield');
59
+ displayTypes.add(resolved);
46
60
  }
47
61
  }
48
62
  return { editTypes, displayTypes };
@@ -1 +1 @@
1
- {"version":3,"file":"scan-ui-types.js","sourceRoot":"","sources":["../../src/scan/scan-ui-types.ts"],"names":[],"mappings":";AAAA,6EAA6E;;AAyB7E,0CAyCC;AAlDD;;;;;;;;GAQG;AACH,SAAgB,eAAe,CAAC,MAAe,EAAE,KAAgB;IAC/D,MAAM,SAAS,GAAM,IAAI,GAAG,EAAU,CAAA;IACtC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAA;IAEtC,MAAM,aAAa,GAAG,IAAI,GAAG,CAC3B,KAAK;SACF,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;SACtB,MAAM,CAAC,CAAC,EAAE,EAAgB,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAC7C,CAAA;IAED,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC;YAAE,SAAQ;QAE7C,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,IAAI,GAAG,CAAC,MAAM;gBAAE,SAAQ;YAExB,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;gBAChB,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;IAED,mEAAmE;IACnE,uEAAuE;IACvE,sEAAsE;IACtE,KAAK,MAAM,IAAI,IAAI,KAAK,EAA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,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,IAAI,GAAG,CAAC,MAAM;gBAAE,SAAQ;YAExB,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;gBAChB,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;IAED,mEAAmE;IACnE,uEAAuE;IACvE,sEAAsE;IACtE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,UAAU,KAAK,OAAO;YAAE,SAAQ,CAAC,wCAAwC;QAElF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC3D,IAAI,CAAC,KAAK;YAAE,SAAQ;QAEpB,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,IAAI,GAAG,CAAC,MAAM;gBAAE,SAAQ;YAExB,mEAAmE;YACnE,8DAA8D;YAC9D,gEAAgE;YAChE,MAAM,QAAQ,GAAG,GAAG,CAAC,eAAe,IAAI,IAAA,+CAAuB,EAAC,GAAG,CAAC,OAAO,IAAI,WAAW,CAAC,CAAA;YAC3F,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA;AACpC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@underpeaks/generator-core",
3
- "version": "1.0.63",
3
+ "version": "1.0.65",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [