@everystack/cli 0.4.15 → 0.4.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everystack/cli",
3
- "version": "0.4.15",
3
+ "version": "0.4.17",
4
4
  "description": "CLI and OTA updates for Expo apps on everystack",
5
5
  "license": "AGPL-3.0-only",
6
6
  "author": "Scalable Technology, Inc. <licensing@scalable.technology>",
@@ -82,7 +82,7 @@
82
82
  "structured-headers": "1.0.1",
83
83
  "tsx": "4.21.0",
84
84
  "typescript": "5.9.3",
85
- "@everystack/model": "0.4.3"
85
+ "@everystack/model": "0.4.4"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "@everystack/server": ">=0.1.0",
@@ -296,10 +296,15 @@ export function renderDerivedSource(catalog: DerivedCatalog, opts: DerivedRender
296
296
  need('defineMaterializedTable');
297
297
  need('field');
298
298
  need('sql');
299
+ // MODEL naming idiom: bare table + a schema prop. The derived layer's
300
+ // qualified-first-arg spelling must NOT leak here — defineModel stores the
301
+ // table name verbatim, so 'stats.x' would become a dot-containing identifier
302
+ // in public and 3-part-qualify (public.stats.x) downstream.
299
303
  lines.push(
300
304
  ...fixmes,
301
- `export const ${varName} = defineMaterializedTable(${tsString(declaredName(o))}, {`,
305
+ `export const ${varName} = defineMaterializedTable(${tsString(o.name)}, {`,
302
306
  ` ${abilities.length ? `abilities: [${abilities.join(', ')}],` : 'private: true,'}`,
307
+ ...(o.schema !== 'public' ? [` schema: ${tsString(o.schema)},`] : []),
303
308
  ' fields: {',
304
309
  ...fieldLines,
305
310
  ' },',
@@ -112,6 +112,7 @@ const FIELD_FACTORY: Record<string, string> = {
112
112
  real: 'real',
113
113
  'double precision': 'doublePrecision',
114
114
  boolean: 'boolean',
115
+ json: 'json',
115
116
  jsonb: 'jsonb',
116
117
  date: 'date',
117
118
  'timestamp with time zone': 'timestamptz',
@@ -86,6 +86,7 @@ const PG_TYPE: Record<string, string> = {
86
86
  uuid: 'uuid',
87
87
  integer: 'integer',
88
88
  boolean: 'boolean',
89
+ json: 'json',
89
90
  jsonb: 'jsonb',
90
91
  bigint: 'bigint',
91
92
  serial: 'integer',
@@ -96,6 +96,8 @@ function baseColumnSource(columnName: string, spec: FieldSpec): { call: string;
96
96
  : { call: `varchar(${n})`, builder: 'varchar' };
97
97
  case 'jsonb':
98
98
  return { call: `jsonb(${n})`, builder: 'jsonb' };
99
+ case 'json':
100
+ return { call: `json(${n})`, builder: 'json' };
99
101
  case 'enum': {
100
102
  if (!spec.enumName) throw new Error('enum field is missing enumName');
101
103
  return { call: `${enumConstName(spec.enumName)}(${n})`, builder: enumConstName(spec.enumName) };