@stardeck-customer-apps/compose 0.14.1 → 0.15.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.
package/dist/index.mjs CHANGED
@@ -1143,16 +1143,16 @@ var require_range = __commonJS({
1143
1143
  };
1144
1144
  var replaceTilde = (comp, options) => {
1145
1145
  const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
1146
- const z10 = options.includePrerelease ? "-0" : "";
1146
+ const z11 = options.includePrerelease ? "-0" : "";
1147
1147
  return comp.replace(r, (_, M, m, p, pr) => {
1148
1148
  debug("tilde", comp, _, M, m, p, pr);
1149
1149
  let ret;
1150
1150
  if (isX(M)) {
1151
1151
  ret = "";
1152
1152
  } else if (isX(m)) {
1153
- ret = `>=${M}.0.0${z10} <${+M + 1}.0.0-0`;
1153
+ ret = `>=${M}.0.0${z11} <${+M + 1}.0.0-0`;
1154
1154
  } else if (isX(p)) {
1155
- ret = `>=${M}.${m}.0${z10} <${M}.${+m + 1}.0-0`;
1155
+ ret = `>=${M}.${m}.0${z11} <${M}.${+m + 1}.0-0`;
1156
1156
  } else if (pr) {
1157
1157
  debug("replaceTilde pr", pr);
1158
1158
  ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
@@ -1169,19 +1169,19 @@ var require_range = __commonJS({
1169
1169
  var replaceCaret = (comp, options) => {
1170
1170
  debug("caret", comp, options);
1171
1171
  const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
1172
- const z10 = options.includePrerelease ? "-0" : "";
1172
+ const z11 = options.includePrerelease ? "-0" : "";
1173
1173
  return comp.replace(r, (_, M, m, p, pr) => {
1174
1174
  debug("caret", comp, _, M, m, p, pr);
1175
1175
  let ret;
1176
1176
  if (isX(M)) {
1177
1177
  ret = "";
1178
1178
  } else if (isX(m)) {
1179
- ret = `>=${M}.0.0${z10} <${+M + 1}.0.0-0`;
1179
+ ret = `>=${M}.0.0${z11} <${+M + 1}.0.0-0`;
1180
1180
  } else if (isX(p)) {
1181
1181
  if (M === "0") {
1182
- ret = `>=${M}.${m}.0${z10} <${M}.${+m + 1}.0-0`;
1182
+ ret = `>=${M}.${m}.0${z11} <${M}.${+m + 1}.0-0`;
1183
1183
  } else {
1184
- ret = `>=${M}.${m}.0${z10} <${+M + 1}.0.0-0`;
1184
+ ret = `>=${M}.${m}.0${z11} <${+M + 1}.0.0-0`;
1185
1185
  }
1186
1186
  } else if (pr) {
1187
1187
  debug("replaceCaret pr", pr);
@@ -4017,6 +4017,24 @@ function analyzeClientSafeEntryImports(sourceText, fileName) {
4017
4017
  return analyzeClientSafeEntryImportsWithTs(ts3, sourceText, fileName);
4018
4018
  }
4019
4019
 
4020
+ // ../../packages/lib/src/shared/ownership-record.ts
4021
+ import { z as z7 } from "zod";
4022
+ var OWNERSHIP_RECORD_VERSION = 1;
4023
+ var moduleList = z7.array(z7.string().refine(isValidModuleName, "not a Module name"));
4024
+ var ownershipRecordSchema = z7.object({
4025
+ version: z7.literal(OWNERSHIP_RECORD_VERSION),
4026
+ /** False once the app stopped all Stardeck updates: then every file is the app's. */
4027
+ stardeckUpdates: z7.boolean(),
4028
+ /** projects.ejected_modules: updates stopped for these Modules, so their folders are the app's. */
4029
+ updatesStoppedModules: moduleList,
4030
+ /** projects.ui_ejected_modules: Customize UI, so their screens are the app's. */
4031
+ customizedUiModules: moduleList,
4032
+ /** projects.external_modules: installed from another app, so the app owns the copy. */
4033
+ externalModules: moduleList,
4034
+ /** projects.removed_modules names: uninstalled on purpose. */
4035
+ uninstalledModules: moduleList
4036
+ });
4037
+
4020
4038
  // ../../packages/lib/src/shared/platform-owned-paths.ts
4021
4039
  var APP_WEB_PREFIX = "apps/web/";
4022
4040
  var BLUEPRINT_LINT_MARKER = `${APP_WEB_PREFIX}eslint-rules/module-boundaries.mjs`;
@@ -5971,14 +5989,14 @@ function rejectPseudoModuleEntries(entries, parentDir, label) {
5971
5989
  }
5972
5990
 
5973
5991
  // ../../packages/lib/src/shared/module-composition.ts
5974
- import { z as z7 } from "zod";
5975
- var creationSourceBlankSchema = z7.object({
5976
- type: z7.literal("blank")
5992
+ import { z as z8 } from "zod";
5993
+ var creationSourceBlankSchema = z8.object({
5994
+ type: z8.literal("blank")
5977
5995
  });
5978
- var creationSourceBlueprintSchema = z7.object({
5979
- type: z7.literal("blueprint"),
5996
+ var creationSourceBlueprintSchema = z8.object({
5997
+ type: z8.literal("blueprint"),
5980
5998
  /** Internal template/fork project id — keep template naming in identifiers. */
5981
- blueprintProjectId: z7.string().uuid(),
5999
+ blueprintProjectId: z8.string().uuid(),
5982
6000
  /**
5983
6001
  * `null`/absent means every feature Module: the platform stores that as the
5984
6002
  * explicit list of feature Modules in the published Blueprint version the fork
@@ -5986,192 +6004,197 @@ var creationSourceBlueprintSchema = z7.object({
5986
6004
  * a custom app: no feature Module, Library Modules only (`resolvePlatformEnv`
5987
6005
  * emits it as a set value naming no Module).
5988
6006
  */
5989
- enabledModules: z7.array(moduleNameSchema).max(100).nullable().optional()
6007
+ enabledModules: z8.array(moduleNameSchema).max(100).nullable().optional(),
6008
+ /**
6009
+ * The kind of business (a preset id the published version defines). Its Modules are built
6010
+ * and `enabledModules` adds extras on top; for the general kind `enabledModules` is the pick.
6011
+ */
6012
+ businessKind: z8.string().regex(/^[a-z][a-z0-9-]{0,39}$/).optional()
5990
6013
  });
5991
- var creationSourceSchema = z7.discriminatedUnion("type", [
6014
+ var creationSourceSchema = z8.discriminatedUnion("type", [
5992
6015
  creationSourceBlankSchema,
5993
6016
  creationSourceBlueprintSchema
5994
6017
  ]);
5995
- var moduleInstallHandoffSchema = z7.object({
5996
- moduleName: z7.string().min(1),
5997
- homeProjectId: z7.string().uuid(),
5998
- installedVersion: z7.string().min(1),
5999
- baselineSha: z7.string().min(1),
6000
- mounts: z7.array(
6001
- z7.object({
6002
- group: z7.string(),
6003
- segment: z7.string()
6018
+ var moduleInstallHandoffSchema = z8.object({
6019
+ moduleName: z8.string().min(1),
6020
+ homeProjectId: z8.string().uuid(),
6021
+ installedVersion: z8.string().min(1),
6022
+ baselineSha: z8.string().min(1),
6023
+ mounts: z8.array(
6024
+ z8.object({
6025
+ group: z8.string(),
6026
+ segment: z8.string()
6004
6027
  })
6005
6028
  ),
6006
- integration: z7.array(z7.string()),
6007
- workflows: z7.array(z7.string()),
6008
- prunedEnhancements: z7.array(z7.string()),
6009
- restoredEnhancements: z7.array(z7.string()).optional(),
6010
- permissions: z7.array(
6011
- z7.object({
6012
- key: z7.string().min(1),
6013
- description: z7.string().min(1)
6029
+ integration: z8.array(z8.string()),
6030
+ workflows: z8.array(z8.string()),
6031
+ prunedEnhancements: z8.array(z8.string()),
6032
+ restoredEnhancements: z8.array(z8.string()).optional(),
6033
+ permissions: z8.array(
6034
+ z8.object({
6035
+ key: z8.string().min(1),
6036
+ description: z8.string().min(1)
6014
6037
  })
6015
6038
  ).optional()
6016
6039
  });
6017
6040
 
6018
6041
  // ../../packages/lib/src/shared/schema-ops.ts
6019
- import { z as z8 } from "zod";
6020
- var columnSpecSchema = z8.object({
6021
- name: z8.string().min(1).max(63),
6022
- pgType: z8.string().min(1),
6023
- nullable: z8.boolean(),
6042
+ import { z as z9 } from "zod";
6043
+ var columnSpecSchema = z9.object({
6044
+ name: z9.string().min(1).max(63),
6045
+ pgType: z9.string().min(1),
6046
+ nullable: z9.boolean(),
6024
6047
  /**
6025
6048
  * A SQL expression used as the column default, as a raw string (e.g. `'t'`,
6026
6049
  * `0`, `now()`, `gen_random_uuid()`). `null` or omitted means no default.
6027
6050
  * NOT a JS literal — must already be a valid SQL expression.
6028
6051
  */
6029
- default: z8.string().nullable().optional(),
6030
- fieldType: z8.string().optional(),
6031
- fieldConfig: z8.record(z8.string(), z8.unknown()).optional()
6052
+ default: z9.string().nullable().optional(),
6053
+ fieldType: z9.string().optional(),
6054
+ fieldConfig: z9.record(z9.string(), z9.unknown()).optional()
6032
6055
  });
6033
- var referentialActionSchema = z8.enum([
6056
+ var referentialActionSchema = z9.enum([
6034
6057
  "cascade",
6035
6058
  "set null",
6036
6059
  "set default",
6037
6060
  "restrict",
6038
6061
  "no action"
6039
6062
  ]);
6040
- var schemaOpSchema = z8.discriminatedUnion("type", [
6063
+ var schemaOpSchema = z9.discriminatedUnion("type", [
6041
6064
  // Tables
6042
- z8.object({
6043
- type: z8.literal("createTable"),
6044
- table: z8.string().min(1).max(63),
6045
- columns: z8.array(columnSpecSchema).min(1),
6046
- primaryKey: z8.array(z8.string()).optional(),
6047
- ifNotExists: z8.boolean().optional()
6065
+ z9.object({
6066
+ type: z9.literal("createTable"),
6067
+ table: z9.string().min(1).max(63),
6068
+ columns: z9.array(columnSpecSchema).min(1),
6069
+ primaryKey: z9.array(z9.string()).optional(),
6070
+ ifNotExists: z9.boolean().optional()
6048
6071
  }),
6049
- z8.object({
6050
- type: z8.literal("dropTable"),
6051
- table: z8.string().min(1).max(63),
6052
- cascade: z8.boolean().optional(),
6053
- ifExists: z8.boolean().optional()
6072
+ z9.object({
6073
+ type: z9.literal("dropTable"),
6074
+ table: z9.string().min(1).max(63),
6075
+ cascade: z9.boolean().optional(),
6076
+ ifExists: z9.boolean().optional()
6054
6077
  }),
6055
- z8.object({
6056
- type: z8.literal("renameTable"),
6057
- from: z8.string().min(1).max(63),
6058
- to: z8.string().min(1).max(63)
6078
+ z9.object({
6079
+ type: z9.literal("renameTable"),
6080
+ from: z9.string().min(1).max(63),
6081
+ to: z9.string().min(1).max(63)
6059
6082
  }),
6060
6083
  // Columns
6061
- z8.object({
6062
- type: z8.literal("addColumn"),
6063
- table: z8.string().min(1).max(63),
6084
+ z9.object({
6085
+ type: z9.literal("addColumn"),
6086
+ table: z9.string().min(1).max(63),
6064
6087
  column: columnSpecSchema,
6065
- ifNotExists: z8.boolean().optional()
6088
+ ifNotExists: z9.boolean().optional()
6066
6089
  }),
6067
- z8.object({
6068
- type: z8.literal("dropColumn"),
6069
- table: z8.string().min(1).max(63),
6070
- column: z8.string().min(1).max(63),
6071
- cascade: z8.boolean().optional(),
6072
- ifExists: z8.boolean().optional()
6090
+ z9.object({
6091
+ type: z9.literal("dropColumn"),
6092
+ table: z9.string().min(1).max(63),
6093
+ column: z9.string().min(1).max(63),
6094
+ cascade: z9.boolean().optional(),
6095
+ ifExists: z9.boolean().optional()
6073
6096
  }),
6074
- z8.object({
6075
- type: z8.literal("renameColumn"),
6076
- table: z8.string().min(1).max(63),
6077
- from: z8.string().min(1).max(63),
6078
- to: z8.string().min(1).max(63)
6097
+ z9.object({
6098
+ type: z9.literal("renameColumn"),
6099
+ table: z9.string().min(1).max(63),
6100
+ from: z9.string().min(1).max(63),
6101
+ to: z9.string().min(1).max(63)
6079
6102
  }),
6080
- z8.object({
6081
- type: z8.literal("alterColumnType"),
6082
- table: z8.string().min(1).max(63),
6083
- column: z8.string().min(1).max(63),
6084
- newType: z8.string().min(1),
6103
+ z9.object({
6104
+ type: z9.literal("alterColumnType"),
6105
+ table: z9.string().min(1).max(63),
6106
+ column: z9.string().min(1).max(63),
6107
+ newType: z9.string().min(1),
6085
6108
  /** Optional USING expression for potentially-lossy casts */
6086
- using: z8.string().optional()
6109
+ using: z9.string().optional()
6087
6110
  }),
6088
- z8.object({
6089
- type: z8.literal("alterColumnNullable"),
6090
- table: z8.string().min(1).max(63),
6091
- column: z8.string().min(1).max(63),
6092
- nullable: z8.boolean()
6111
+ z9.object({
6112
+ type: z9.literal("alterColumnNullable"),
6113
+ table: z9.string().min(1).max(63),
6114
+ column: z9.string().min(1).max(63),
6115
+ nullable: z9.boolean()
6093
6116
  }),
6094
- z8.object({
6095
- type: z8.literal("alterColumnDefault"),
6096
- table: z8.string().min(1).max(63),
6097
- column: z8.string().min(1).max(63),
6117
+ z9.object({
6118
+ type: z9.literal("alterColumnDefault"),
6119
+ table: z9.string().min(1).max(63),
6120
+ column: z9.string().min(1).max(63),
6098
6121
  /** null means drop the default; otherwise a SQL expression string. */
6099
- default: z8.string().nullable()
6122
+ default: z9.string().nullable()
6100
6123
  }),
6101
6124
  // Indexes
6102
- z8.object({
6103
- type: z8.literal("addIndex"),
6104
- table: z8.string().min(1).max(63),
6105
- name: z8.string().min(1).max(63),
6106
- columns: z8.array(z8.string().min(1)).min(1),
6107
- unique: z8.boolean().optional(),
6125
+ z9.object({
6126
+ type: z9.literal("addIndex"),
6127
+ table: z9.string().min(1).max(63),
6128
+ name: z9.string().min(1).max(63),
6129
+ columns: z9.array(z9.string().min(1)).min(1),
6130
+ unique: z9.boolean().optional(),
6108
6131
  /** Partial-index WHERE clause, as a raw SQL expression */
6109
- where: z8.string().optional(),
6110
- ifNotExists: z8.boolean().optional()
6132
+ where: z9.string().optional(),
6133
+ ifNotExists: z9.boolean().optional()
6111
6134
  }),
6112
- z8.object({
6113
- type: z8.literal("dropIndex"),
6114
- name: z8.string().min(1).max(63),
6115
- cascade: z8.boolean().optional(),
6116
- ifExists: z8.boolean().optional()
6135
+ z9.object({
6136
+ type: z9.literal("dropIndex"),
6137
+ name: z9.string().min(1).max(63),
6138
+ cascade: z9.boolean().optional(),
6139
+ ifExists: z9.boolean().optional()
6117
6140
  }),
6118
6141
  // Constraints
6119
- z8.object({
6120
- type: z8.literal("addForeignKey"),
6121
- table: z8.string().min(1).max(63),
6122
- name: z8.string().min(1).max(63),
6123
- columns: z8.array(z8.string().min(1)).min(1),
6124
- refTable: z8.string().min(1).max(63),
6125
- refColumns: z8.array(z8.string().min(1)).min(1),
6142
+ z9.object({
6143
+ type: z9.literal("addForeignKey"),
6144
+ table: z9.string().min(1).max(63),
6145
+ name: z9.string().min(1).max(63),
6146
+ columns: z9.array(z9.string().min(1)).min(1),
6147
+ refTable: z9.string().min(1).max(63),
6148
+ refColumns: z9.array(z9.string().min(1)).min(1),
6126
6149
  onDelete: referentialActionSchema.optional(),
6127
6150
  onUpdate: referentialActionSchema.optional()
6128
6151
  }),
6129
- z8.object({
6130
- type: z8.literal("addUniqueConstraint"),
6131
- table: z8.string().min(1).max(63),
6132
- name: z8.string().min(1).max(63),
6133
- columns: z8.array(z8.string().min(1)).min(1)
6152
+ z9.object({
6153
+ type: z9.literal("addUniqueConstraint"),
6154
+ table: z9.string().min(1).max(63),
6155
+ name: z9.string().min(1).max(63),
6156
+ columns: z9.array(z9.string().min(1)).min(1)
6134
6157
  }),
6135
- z8.object({
6136
- type: z8.literal("addCheckConstraint"),
6137
- table: z8.string().min(1).max(63),
6138
- name: z8.string().min(1).max(63),
6139
- expression: z8.string().min(1)
6158
+ z9.object({
6159
+ type: z9.literal("addCheckConstraint"),
6160
+ table: z9.string().min(1).max(63),
6161
+ name: z9.string().min(1).max(63),
6162
+ expression: z9.string().min(1)
6140
6163
  }),
6141
- z8.object({
6142
- type: z8.literal("dropConstraint"),
6143
- table: z8.string().min(1).max(63),
6144
- name: z8.string().min(1).max(63),
6145
- cascade: z8.boolean().optional(),
6146
- ifExists: z8.boolean().optional()
6164
+ z9.object({
6165
+ type: z9.literal("dropConstraint"),
6166
+ table: z9.string().min(1).max(63),
6167
+ name: z9.string().min(1).max(63),
6168
+ cascade: z9.boolean().optional(),
6169
+ ifExists: z9.boolean().optional()
6147
6170
  }),
6148
6171
  // Enum types
6149
- z8.object({
6150
- type: z8.literal("createEnum"),
6151
- name: z8.string().min(1).max(63),
6152
- values: z8.array(z8.string().min(1)).min(1)
6172
+ z9.object({
6173
+ type: z9.literal("createEnum"),
6174
+ name: z9.string().min(1).max(63),
6175
+ values: z9.array(z9.string().min(1)).min(1)
6153
6176
  }),
6154
- z8.object({
6155
- type: z8.literal("alterEnumAddValue"),
6156
- name: z8.string().min(1).max(63),
6157
- value: z8.string().min(1),
6177
+ z9.object({
6178
+ type: z9.literal("alterEnumAddValue"),
6179
+ name: z9.string().min(1).max(63),
6180
+ value: z9.string().min(1),
6158
6181
  /** Position the new value before an existing one (mutually exclusive with `after`) */
6159
- before: z8.string().optional(),
6182
+ before: z9.string().optional(),
6160
6183
  /** Position the new value after an existing one (mutually exclusive with `before`) */
6161
- after: z8.string().optional(),
6162
- ifNotExists: z8.boolean().optional()
6184
+ after: z9.string().optional(),
6185
+ ifNotExists: z9.boolean().optional()
6163
6186
  }),
6164
- z8.object({
6165
- type: z8.literal("dropEnum"),
6166
- name: z8.string().min(1).max(63),
6167
- cascade: z8.boolean().optional(),
6168
- ifExists: z8.boolean().optional()
6187
+ z9.object({
6188
+ type: z9.literal("dropEnum"),
6189
+ name: z9.string().min(1).max(63),
6190
+ cascade: z9.boolean().optional(),
6191
+ ifExists: z9.boolean().optional()
6169
6192
  }),
6170
6193
  // Extensions
6171
- z8.object({
6172
- type: z8.literal("createExtension"),
6173
- name: z8.string().min(1),
6174
- ifNotExists: z8.boolean().optional()
6194
+ z9.object({
6195
+ type: z9.literal("createExtension"),
6196
+ name: z9.string().min(1),
6197
+ ifNotExists: z9.boolean().optional()
6175
6198
  }),
6176
6199
  // Data operations
6177
6200
  /**
@@ -6179,26 +6202,26 @@ var schemaOpSchema = z8.discriminatedUnion("type", [
6179
6202
  * destructive — requires explicit confirm to replay on prod. The
6180
6203
  * `description` is what the agent/user sees at confirm time.
6181
6204
  */
6182
- z8.object({
6183
- type: z8.literal("backfill"),
6184
- description: z8.string().min(1),
6185
- sql: z8.string().min(1)
6205
+ z9.object({
6206
+ type: z9.literal("backfill"),
6207
+ description: z9.string().min(1),
6208
+ sql: z9.string().min(1)
6186
6209
  }),
6187
6210
  /**
6188
6211
  * Escape hatch for DDL the structured ops can't express. `destructive`
6189
6212
  * forces classification — use false only for genuinely additive-only SQL
6190
6213
  * (e.g. CREATE EXTENSION variants the structured op doesn't cover).
6191
6214
  */
6192
- z8.object({
6193
- type: z8.literal("rawSql"),
6194
- description: z8.string().min(1),
6195
- sql: z8.string().min(1),
6196
- destructive: z8.boolean()
6215
+ z9.object({
6216
+ type: z9.literal("rawSql"),
6217
+ description: z9.string().min(1),
6218
+ sql: z9.string().min(1),
6219
+ destructive: z9.boolean()
6197
6220
  })
6198
6221
  ]);
6199
6222
 
6200
6223
  // ../../packages/lib/src/server/module-rail/ops.ts
6201
- import { z as z9 } from "zod";
6224
+ import { z as z10 } from "zod";
6202
6225
 
6203
6226
  // ../../packages/lib/src/server/module-rail/reconcile.ts
6204
6227
  var SANDBOX_BATCH_SIZE = 200;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stardeck-customer-apps/compose",
3
- "version": "0.14.1",
3
+ "version": "0.15.0",
4
4
  "description": "Regenerates a Stardeck app's Module-rail artifacts — the six src/*.gen.ts registries and every route/endpoint stub — from src/modules/*/module.json",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",