openxiangda 1.0.218 → 1.0.219

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 (2) hide show
  1. package/lib/cli.js +38 -4
  2. package/package.json +1 -1
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.219",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {