siteplane 0.1.47 → 0.1.49

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/README.md CHANGED
@@ -43,6 +43,10 @@ For a direct field ID, put `siteplane.attrs(fieldId, { routeKey })` on the visib
43
43
  element using the same canonical route pattern as its value call. The value call
44
44
  does not attach DOM metadata. Missing or mismatched DOM routes block apply and
45
45
  the Next build; dynamic pages use their pattern, such as `/services/[slug]`.
46
+ Direct attrs defaults to `fieldType: "text"`; for longText, link and image,
47
+ pass the matching `fieldType` explicitly. The value call does not infer it for attrs.
48
+ `setup apply` reports `field_scan.attrs_field_type_mismatch` before any contract write.
49
+ This type diagnostic remains a scanner warning for normal website builds.
46
50
 
47
51
  ```bash
48
52
  siteplane setup apply --definition editor-definition.json --selection-summary-file selection.txt
@@ -1864,6 +1864,7 @@ var activateSetupModulesInputSchema = activateSiteSetupInputSchema.extend({
1864
1864
  z16.object({ decision: z16.literal("pending") }).strict(),
1865
1865
  z16.object({
1866
1866
  decision: z16.literal("enable"),
1867
+ readinessTestRunId: z16.string().regex(/^analytics_owner_[0-9a-f-]{36}$/u),
1867
1868
  expectedInstallationGeneration: z16.number().int().positive(),
1868
1869
  measurementApproved: z16.literal(true)
1869
1870
  }).strict(),
@@ -2211,6 +2212,9 @@ var EARLY_ACCESS_PLAN = {
2211
2212
  bookingRemindersEnabled: true
2212
2213
  };
2213
2214
 
2215
+ // ../shared/dist/first-party-image-upload.js
2216
+ var maxFirstPartyImageUploadBytes = 4 * 1024 * 1024;
2217
+
2214
2218
  // ../shared/dist/readiness.js
2215
2219
  import { z as z23 } from "zod";
2216
2220
  var READINESS_CHECK_KEYS = [
@@ -4333,6 +4337,14 @@ function scanSourceFacts(files) {
4333
4337
  }
4334
4338
  for (const attr of directAttrs) {
4335
4339
  const field = fields.find((candidate) => candidate.fieldId === attr.fieldId);
4340
+ if (field && attr.fieldType !== field.fieldType) {
4341
+ warnings.push({
4342
+ code: "field_scan.attrs_field_type_mismatch",
4343
+ message: `DOM attrs for ${attr.fieldId} declare ${attr.fieldType}, but its value call returns ${field.fieldType}. Pass fieldType: "${field.fieldType}" with the matching routeKey to siteplane.attrs on the visible element. This affects editor preview, not the website build.`,
4344
+ fieldId: attr.fieldId,
4345
+ filePath: attr.filePath
4346
+ });
4347
+ }
4336
4348
  const expectedRoute = field?.technicalRouteKey ?? field?.routeHint;
4337
4349
  if (!attr.routeKey || expectedRoute && attr.routeKey !== expectedRoute) {
4338
4350
  hardErrors.push({
@@ -4614,6 +4626,7 @@ function collectAttrsCall(node, attrFieldIds, attrRouteRefs, eventPreviewAttrs,
4614
4626
  directAttrs.push({
4615
4627
  fieldId: directFieldId,
4616
4628
  routeKey: secondArg && typeof secondArg === "object" && "routeKey" in secondArg ? stringValue2(secondArg.routeKey) : void 0,
4629
+ fieldType: secondArg && typeof secondArg === "object" && "fieldType" in secondArg ? stringValue2(secondArg.fieldType) ?? "text" : "text",
4617
4630
  filePath: file.filePath
4618
4631
  });
4619
4632
  if (hasEventPreviewStrategy(secondArg)) {
@@ -4975,6 +4988,14 @@ async function siteSetupApplyCommand(input) {
4975
4988
  sourceText: await readSourceFile(filePath)
4976
4989
  })));
4977
4990
  const scan = scanSourceFiles(files, { projectRoot: input.projectDir });
4991
+ const invalidDomTypes = scan.warnings.filter((issue) => issue.code === "field_scan.attrs_field_type_mismatch");
4992
+ if (invalidDomTypes.length > 0) {
4993
+ return {
4994
+ status: "action_required",
4995
+ code: "field_scan.attrs_field_type_mismatch",
4996
+ message: invalidDomTypes.map((issue) => issue.message).join("\n")
4997
+ };
4998
+ }
4978
4999
  if (scan.hardErrors.length > 0) {
4979
5000
  return {
4980
5001
  status: "action_required",
@@ -5679,7 +5700,6 @@ async function setupDeployCommand(input, deps = defaults) {
5679
5700
  SITEPLANE_SETUP_RUN_ID: config.runId,
5680
5701
  SITEPLANE_PORTAL_PATH: task.site.portalPath,
5681
5702
  SITEPLANE_BUILD_FIELD_CONTRACT_HASH: config.fieldContractHash,
5682
- SITEPLANE_BUILD_REVISION: revision,
5683
5703
  ...analyticsPublicKey ? {
5684
5704
  NEXT_PUBLIC_SITEPLANE_ANALYTICS_SITE_KEY: analyticsPublicKey,
5685
5705
  NEXT_PUBLIC_SITEPLANE_ANALYTICS_ENDPOINT: `${config.apiBaseUrl.replace(/\/$/u, "")}/api/analytics/collect`
@@ -5687,6 +5707,7 @@ async function setupDeployCommand(input, deps = defaults) {
5687
5707
  };
5688
5708
  const fingerprint = digest({
5689
5709
  publicBindings,
5710
+ revision,
5690
5711
  siteId: config.siteId,
5691
5712
  publicKeyId: config.publicSiteKeyId,
5692
5713
  apiBaseUrl: config.apiBaseUrl,
package/dist/index.js CHANGED
@@ -1592,6 +1592,7 @@ var activateSetupModulesInputSchema = activateSiteSetupInputSchema.extend({
1592
1592
  z16.object({ decision: z16.literal("pending") }).strict(),
1593
1593
  z16.object({
1594
1594
  decision: z16.literal("enable"),
1595
+ readinessTestRunId: z16.string().regex(/^analytics_owner_[0-9a-f-]{36}$/u),
1595
1596
  expectedInstallationGeneration: z16.number().int().positive(),
1596
1597
  measurementApproved: z16.literal(true)
1597
1598
  }).strict(),
@@ -1939,6 +1940,9 @@ var EARLY_ACCESS_PLAN = {
1939
1940
  bookingRemindersEnabled: true
1940
1941
  };
1941
1942
 
1943
+ // ../shared/dist/first-party-image-upload.js
1944
+ var maxFirstPartyImageUploadBytes = 4 * 1024 * 1024;
1945
+
1942
1946
  // ../shared/dist/readiness.js
1943
1947
  import { z as z23 } from "zod";
1944
1948
  var READINESS_CHECK_KEYS = [
package/dist/next.js CHANGED
@@ -1795,6 +1795,7 @@ var activateSetupModulesInputSchema = activateSiteSetupInputSchema.extend({
1795
1795
  z16.object({ decision: z16.literal("pending") }).strict(),
1796
1796
  z16.object({
1797
1797
  decision: z16.literal("enable"),
1798
+ readinessTestRunId: z16.string().regex(/^analytics_owner_[0-9a-f-]{36}$/u),
1798
1799
  expectedInstallationGeneration: z16.number().int().positive(),
1799
1800
  measurementApproved: z16.literal(true)
1800
1801
  }).strict(),
@@ -2142,6 +2143,9 @@ var EARLY_ACCESS_PLAN = {
2142
2143
  bookingRemindersEnabled: true
2143
2144
  };
2144
2145
 
2146
+ // ../shared/dist/first-party-image-upload.js
2147
+ var maxFirstPartyImageUploadBytes = 4 * 1024 * 1024;
2148
+
2145
2149
  // ../shared/dist/readiness.js
2146
2150
  import { z as z23 } from "zod";
2147
2151
  var READINESS_CHECK_KEYS = [
@@ -3078,6 +3082,14 @@ function scanSourceFacts(files) {
3078
3082
  }
3079
3083
  for (const attr of directAttrs) {
3080
3084
  const field = fields.find((candidate) => candidate.fieldId === attr.fieldId);
3085
+ if (field && attr.fieldType !== field.fieldType) {
3086
+ warnings.push({
3087
+ code: "field_scan.attrs_field_type_mismatch",
3088
+ message: `DOM attrs for ${attr.fieldId} declare ${attr.fieldType}, but its value call returns ${field.fieldType}. Pass fieldType: "${field.fieldType}" with the matching routeKey to siteplane.attrs on the visible element. This affects editor preview, not the website build.`,
3089
+ fieldId: attr.fieldId,
3090
+ filePath: attr.filePath
3091
+ });
3092
+ }
3081
3093
  const expectedRoute = field?.technicalRouteKey ?? field?.routeHint;
3082
3094
  if (!attr.routeKey || expectedRoute && attr.routeKey !== expectedRoute) {
3083
3095
  hardErrors.push({
@@ -3359,6 +3371,7 @@ function collectAttrsCall(node, attrFieldIds, attrRouteRefs, eventPreviewAttrs,
3359
3371
  directAttrs.push({
3360
3372
  fieldId: directFieldId,
3361
3373
  routeKey: secondArg && typeof secondArg === "object" && "routeKey" in secondArg ? stringValue(secondArg.routeKey) : void 0,
3374
+ fieldType: secondArg && typeof secondArg === "object" && "fieldType" in secondArg ? stringValue(secondArg.fieldType) ?? "text" : "text",
3362
3375
  filePath: file.filePath
3363
3376
  });
3364
3377
  if (hasEventPreviewStrategy(secondArg)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "siteplane",
3
3
  "private": false,
4
- "version": "0.1.47",
4
+ "version": "0.1.49",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",
7
7
  "publishConfig": {