openxiangda 1.0.218 → 1.0.220

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.
@@ -592,6 +592,22 @@ function hashWorkspaceFile(cwd, relativePath) {
592
592
  };
593
593
  }
594
594
 
595
+ function normalizeCandidateResourceBindings(value) {
596
+ if (Array.isArray(value)) {
597
+ return value.map(item => normalizeCandidateResourceBindings(item));
598
+ }
599
+ if (!value || typeof value !== 'object') return value;
600
+ return Object.fromEntries(
601
+ Object.entries(value)
602
+ .filter(([key]) => !['createdAt', 'updatedAt', 'syncedAt'].includes(key))
603
+ .sort(([left], [right]) => left.localeCompare(right))
604
+ .map(([key, item]) => [
605
+ key,
606
+ normalizeCandidateResourceBindings(item),
607
+ ])
608
+ );
609
+ }
610
+
595
611
  function buildCandidateEnvironmentBindings(state) {
596
612
  const targets =
597
613
  state?.targets && typeof state.targets === 'object'
@@ -615,7 +631,9 @@ function buildCandidateEnvironmentBindings(state) {
615
631
  binding?.revision === undefined
616
632
  ? null
617
633
  : binding.revision,
618
- resources: cloneJsonValue(binding?.resources || {}) || {},
634
+ resources:
635
+ normalizeCandidateResourceBindings(binding?.resources || {}) ||
636
+ {},
619
637
  },
620
638
  ])
621
639
  );
package/lib/cli.js CHANGED
@@ -6132,6 +6132,14 @@ function normalizeSatisfiedAppReleaseSelectors(values) {
6132
6132
  ).sort();
6133
6133
  }
6134
6134
 
6135
+ function satisfiedFormCodesFromContext(context) {
6136
+ return new Set(
6137
+ normalizeSatisfiedAppReleaseSelectors(context?.satisfiedSelectors)
6138
+ .filter(selector => selector.startsWith('form:'))
6139
+ .map(selector => selector.slice('form:'.length))
6140
+ );
6141
+ }
6142
+
6135
6143
  function recordSatisfiedAppReleaseSelectors(changeId, selectors, target) {
6136
6144
  const incoming = normalizeSatisfiedAppReleaseSelectors(selectors);
6137
6145
  if (!changeId || incoming.length === 0) return [];
@@ -6178,14 +6186,14 @@ function stagedFormCode(target, resource) {
6178
6186
  return formUuid;
6179
6187
  }
6180
6188
 
6181
- function reusableStagedFormReleaseCandidates(target, changeId) {
6189
+ function reusableStagedResourcesContext(target, changeId) {
6182
6190
  const normalizedChangeId = String(changeId || '').trim();
6183
- if (!normalizedChangeId) return [];
6191
+ if (!normalizedChangeId) return null;
6184
6192
  const file = stagedResourcesFileForChange(
6185
6193
  normalizedChangeId,
6186
6194
  target.deploymentId
6187
6195
  );
6188
- if (!fs.existsSync(file)) return [];
6196
+ if (!fs.existsSync(file)) return null;
6189
6197
  const contextFile = stagedResourcesContextFileForChange(
6190
6198
  normalizedChangeId,
6191
6199
  target.deploymentId
@@ -6210,6 +6218,17 @@ function reusableStagedFormReleaseCandidates(target, changeId) {
6210
6218
  );
6211
6219
  }
6212
6220
  }
6221
+ return context;
6222
+ }
6223
+
6224
+ function reusableStagedFormReleaseCandidates(target, changeId) {
6225
+ const normalizedChangeId = String(changeId || '').trim();
6226
+ if (!normalizedChangeId) return [];
6227
+ if (!reusableStagedResourcesContext(target, normalizedChangeId)) return [];
6228
+ const file = stagedResourcesFileForChange(
6229
+ normalizedChangeId,
6230
+ target.deploymentId
6231
+ );
6213
6232
  const parsed = JSON.parse(fs.readFileSync(file, 'utf8'));
6214
6233
  const resources = Array.isArray(parsed) && parsed.length === 0
6215
6234
  ? []
@@ -29067,6 +29086,9 @@ async function resolveStagedLocalFormContractSnapshots(
29067
29086
  changeId,
29068
29087
  { formCodes }
29069
29088
  );
29089
+ const satisfiedFormCodes = satisfiedFormCodesFromContext(
29090
+ reusableStagedResourcesContext(target, changeId)
29091
+ );
29070
29092
  const snapshots = new Map();
29071
29093
  for (const formCode of formCodes) {
29072
29094
  const formUuid = resolveManifestFormUuid(
@@ -29075,7 +29097,18 @@ async function resolveStagedLocalFormContractSnapshots(
29075
29097
  { fallbackToCode: false }
29076
29098
  );
29077
29099
  const staged = stagedOverlays.get(formCode);
29078
- if (!staged || staged.formUuid !== formUuid) {
29100
+ if (!staged) {
29101
+ if (satisfiedFormCodes.has(formCode)) {
29102
+ // form-stage proved this exact selector is a noop in the current
29103
+ // deployment. Let buildFormFieldContractPlan read the active frozen
29104
+ // snapshot instead of requiring an unnecessary immutable child.
29105
+ continue;
29106
+ }
29107
+ fail(
29108
+ `FORM_FIELD_STAGED_CONTRACT_REQUIRED: ${formCode} 尚未在 change ${changeId} 的当前 deployment 中获得 verified FormRelease`
29109
+ );
29110
+ }
29111
+ if (staged.formUuid !== formUuid) {
29079
29112
  fail(
29080
29113
  `FORM_FIELD_STAGED_CONTRACT_REQUIRED: ${formCode} 尚未在 change ${changeId} 的当前 deployment 中获得 verified FormRelease`
29081
29114
  );
@@ -29224,4 +29257,5 @@ function buildWorkspacePublishEnv(
29224
29257
  module.exports = {
29225
29258
  buildResourceManifestSddTargets,
29226
29259
  main,
29260
+ satisfiedFormCodesFromContext,
29227
29261
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.218",
3
+ "version": "1.0.220",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {