@pattern-stack/codegen 0.21.0 → 0.22.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 (48) hide show
  1. package/README.md +5 -1
  2. package/dist/{chunk-3A34R6CI.js → chunk-3VEVGL74.js} +4 -4
  3. package/dist/{chunk-GMRTI7AK.js → chunk-6DQEIXYU.js} +3 -3
  4. package/dist/{chunk-524YKITE.js → chunk-6ECCJVYW.js} +7 -5
  5. package/dist/{chunk-524YKITE.js.map → chunk-6ECCJVYW.js.map} +1 -1
  6. package/dist/{chunk-7625PLY7.js → chunk-COGHTKXY.js} +4 -4
  7. package/dist/{chunk-YXI7K4MJ.js → chunk-DB5UXJC3.js} +4 -4
  8. package/dist/{chunk-GV337QP3.js → chunk-E5FJWOMP.js} +7 -7
  9. package/dist/{chunk-TKU6VYG3.js → chunk-E6PLM6QG.js} +6 -6
  10. package/dist/{chunk-EEJC66ZF.js → chunk-FNHNSFIJ.js} +3 -3
  11. package/dist/{chunk-G3IKPDTP.js → chunk-NR7QQ6ZI.js} +2 -2
  12. package/dist/{chunk-MBFSG4KQ.js → chunk-QXVCRA23.js} +3 -3
  13. package/dist/{chunk-6CJRZHV4.js → chunk-VDL5CJ5C.js} +4 -4
  14. package/dist/runtime/base-classes/index.js +17 -17
  15. package/dist/runtime/subsystems/bridge/bridge-delivery.drizzle-backend.js +1 -1
  16. package/dist/runtime/subsystems/bridge/bridge-outbox-drain-hook.js +4 -4
  17. package/dist/runtime/subsystems/bridge/bridge.module.js +10 -10
  18. package/dist/runtime/subsystems/bridge/index.js +13 -13
  19. package/dist/runtime/subsystems/cache/cache.module.js +2 -2
  20. package/dist/runtime/subsystems/cache/index.js +4 -4
  21. package/dist/runtime/subsystems/events/event-bus.drizzle-backend.js +2 -2
  22. package/dist/runtime/subsystems/events/events.module.js +3 -3
  23. package/dist/runtime/subsystems/events/index.js +5 -5
  24. package/dist/runtime/subsystems/index.js +41 -41
  25. package/dist/runtime/subsystems/jobs/index.js +18 -18
  26. package/dist/runtime/subsystems/jobs/job-orchestrator.bullmq-backend.js +5 -5
  27. package/dist/runtime/subsystems/jobs/job-orchestrator.drizzle-backend.js +2 -2
  28. package/dist/runtime/subsystems/jobs/job-run-service.drizzle-backend.js +2 -2
  29. package/dist/runtime/subsystems/jobs/job-worker.bullmq-backend.js +3 -3
  30. package/dist/runtime/subsystems/jobs/job-worker.js +2 -2
  31. package/dist/runtime/subsystems/jobs/job-worker.module.js +6 -6
  32. package/dist/runtime/subsystems/jobs/jobs-domain.module.js +4 -4
  33. package/dist/runtime/subsystems/storage/index.js +1 -1
  34. package/dist/runtime/subsystems/storage/storage.module.js +1 -1
  35. package/dist/src/cli/index.js +16 -6
  36. package/dist/src/cli/index.js.map +1 -1
  37. package/dist/src/index.js +1 -1
  38. package/package.json +1 -1
  39. /package/dist/{chunk-3A34R6CI.js.map → chunk-3VEVGL74.js.map} +0 -0
  40. /package/dist/{chunk-GMRTI7AK.js.map → chunk-6DQEIXYU.js.map} +0 -0
  41. /package/dist/{chunk-7625PLY7.js.map → chunk-COGHTKXY.js.map} +0 -0
  42. /package/dist/{chunk-YXI7K4MJ.js.map → chunk-DB5UXJC3.js.map} +0 -0
  43. /package/dist/{chunk-GV337QP3.js.map → chunk-E5FJWOMP.js.map} +0 -0
  44. /package/dist/{chunk-TKU6VYG3.js.map → chunk-E6PLM6QG.js.map} +0 -0
  45. /package/dist/{chunk-EEJC66ZF.js.map → chunk-FNHNSFIJ.js.map} +0 -0
  46. /package/dist/{chunk-G3IKPDTP.js.map → chunk-NR7QQ6ZI.js.map} +0 -0
  47. /package/dist/{chunk-MBFSG4KQ.js.map → chunk-QXVCRA23.js.map} +0 -0
  48. /package/dist/{chunk-6CJRZHV4.js.map → chunk-VDL5CJ5C.js.map} +0 -0
package/README.md CHANGED
@@ -209,11 +209,15 @@ frontend:
209
209
  columnMapperNeedsCall: true # call the mapper (fn()) vs reference (fn)
210
210
  apiBaseUrlImport: null # when set, import API_BASE_URL from it as baseURL
211
211
  apiUrl: /api # REST base path when no apiBaseUrlImport
212
+ fields:
213
+ textareaThreshold: 500 # string→textarea cutoff (strict >); null DISABLES
212
214
  ```
213
215
 
214
216
  `null`-disables convention: an **absent** `auth.function` defaults to
215
217
  `getAuthorizationHeader`; an **explicit `null`** disables it entirely (no header
216
- lines emitted). Likewise `sync.columnMapper: null` omits the Electric mapper.
218
+ lines emitted). Likewise `sync.columnMapper: null` omits the Electric mapper, and
219
+ `fields.textareaThreshold: null` disables the string→textarea heuristic entirely
220
+ (bounded strings always render as `text` unless the author sets `ui_type: textarea`).
217
221
 
218
222
  ### Per-entity sync mode (`entity.sync`)
219
223
 
@@ -7,13 +7,13 @@ import {
7
7
  import {
8
8
  MissingTenantIdError
9
9
  } from "./chunk-T4BIIU5E.js";
10
- import {
11
- jobRuns
12
- } from "./chunk-OKXZ63IA.js";
13
10
  import {
14
11
  JOBS_MULTI_TENANT,
15
12
  JOB_ORCHESTRATOR
16
13
  } from "./chunk-ZPL74UQN.js";
14
+ import {
15
+ jobRuns
16
+ } from "./chunk-OKXZ63IA.js";
17
17
  import {
18
18
  DRIZZLE
19
19
  } from "./chunk-U64T4YZE.js";
@@ -198,4 +198,4 @@ DrizzleJobRunService = __decorateClass([
198
198
  export {
199
199
  DrizzleJobRunService
200
200
  };
201
- //# sourceMappingURL=chunk-3A34R6CI.js.map
201
+ //# sourceMappingURL=chunk-3VEVGL74.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-VQOAATIG.js";
4
4
  import {
5
5
  DrizzleJobRunService
6
- } from "./chunk-3A34R6CI.js";
6
+ } from "./chunk-3VEVGL74.js";
7
7
  import {
8
8
  MemoryJobRunService
9
9
  } from "./chunk-CDLWYZVQ.js";
@@ -23,7 +23,7 @@ import {
23
23
  } from "./chunk-I6MVCB5A.js";
24
24
  import {
25
25
  DrizzleJobOrchestrator
26
- } from "./chunk-TKU6VYG3.js";
26
+ } from "./chunk-E6PLM6QG.js";
27
27
  import {
28
28
  JOBS_LISTEN_NOTIFY,
29
29
  JOBS_MULTI_TENANT,
@@ -114,4 +114,4 @@ JobsDomainModule = __decorateClass([
114
114
  export {
115
115
  JobsDomainModule
116
116
  };
117
- //# sourceMappingURL=chunk-GMRTI7AK.js.map
117
+ //# sourceMappingURL=chunk-6DQEIXYU.js.map
@@ -4072,11 +4072,12 @@ registerLibraryPattern(MetadataPattern);
4072
4072
  registerLibraryPattern(JunctionPattern);
4073
4073
 
4074
4074
  // src/emitters/frontend/field-meta.ts
4075
+ var DEFAULT_TEXTAREA_THRESHOLD = 500;
4075
4076
  var CAMEL = (s) => s.replace(/_([a-z])/g, (_, c) => c.toUpperCase());
4076
4077
  function formatLabel(fieldName) {
4077
4078
  return fieldName.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
4078
4079
  }
4079
- function inferUiType(field) {
4080
+ function inferUiType(field, opts = {}) {
4080
4081
  if (field.ui.type) return field.ui.type;
4081
4082
  if (Array.isArray(field.choices) && field.choices.length > 0) return "enum";
4082
4083
  if (field.foreignKey) return "reference";
@@ -4090,9 +4091,10 @@ function inferUiType(field) {
4090
4091
  if (nameLower.includes("percent") || nameLower.includes("rate")) {
4091
4092
  return "percentage";
4092
4093
  }
4094
+ const threshold = opts.textareaThreshold === void 0 ? DEFAULT_TEXTAREA_THRESHOLD : opts.textareaThreshold;
4093
4095
  switch (field.type) {
4094
4096
  case "string":
4095
- return field.constraints.maxLength && field.constraints.maxLength > 500 ? "textarea" : "text";
4097
+ return threshold !== null && field.constraints.maxLength && field.constraints.maxLength > threshold ? "textarea" : "text";
4096
4098
  case "integer":
4097
4099
  case "decimal":
4098
4100
  return "number";
@@ -4125,12 +4127,12 @@ function isEntityRefField(field) {
4125
4127
  if (field.type === "entity_ref") return true;
4126
4128
  return field.name.endsWith("_entity_type") || field.name.endsWith("_entity_id");
4127
4129
  }
4128
- function deriveFieldMeta(field, defaults = {}) {
4130
+ function deriveFieldMeta(field, defaults = {}, opts = {}) {
4129
4131
  const hasChoices = Array.isArray(field.choices) && field.choices.length > 0;
4130
4132
  const meta = {
4131
4133
  field: CAMEL(field.name),
4132
4134
  label: field.ui.label ?? formatLabel(field.name),
4133
- type: inferUiType(field),
4135
+ type: inferUiType(field, opts),
4134
4136
  importance: inferUiImportance(field),
4135
4137
  sortable: field.ui.sortable ?? false,
4136
4138
  filterable: field.ui.filterable ?? false
@@ -4303,4 +4305,4 @@ export {
4303
4305
  analyzeDomain,
4304
4306
  validateEntities
4305
4307
  };
4306
- //# sourceMappingURL=chunk-524YKITE.js.map
4308
+ //# sourceMappingURL=chunk-6ECCJVYW.js.map