openxiangda 1.0.217 → 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 +46 -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
  ? []
@@ -27408,6 +27427,14 @@ function getCandidateBuildControlFiles() {
27408
27427
  return unique(files).sort();
27409
27428
  }
27410
27429
 
27430
+ function isDirectory(value) {
27431
+ try {
27432
+ return fs.statSync(value).isDirectory();
27433
+ } catch {
27434
+ return false;
27435
+ }
27436
+ }
27437
+
27411
27438
  function getCandidateSourceFiles(plan) {
27412
27439
  const files = new Set(plan.changedFiles || []);
27413
27440
  for (const file of getCandidateBuildControlFiles()) files.add(file);
@@ -29059,6 +29086,9 @@ async function resolveStagedLocalFormContractSnapshots(
29059
29086
  changeId,
29060
29087
  { formCodes }
29061
29088
  );
29089
+ const satisfiedFormCodes = satisfiedFormCodesFromContext(
29090
+ reusableStagedResourcesContext(target, changeId)
29091
+ );
29062
29092
  const snapshots = new Map();
29063
29093
  for (const formCode of formCodes) {
29064
29094
  const formUuid = resolveManifestFormUuid(
@@ -29067,7 +29097,18 @@ async function resolveStagedLocalFormContractSnapshots(
29067
29097
  { fallbackToCode: false }
29068
29098
  );
29069
29099
  const staged = stagedOverlays.get(formCode);
29070
- 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) {
29071
29112
  fail(
29072
29113
  `FORM_FIELD_STAGED_CONTRACT_REQUIRED: ${formCode} 尚未在 change ${changeId} 的当前 deployment 中获得 verified FormRelease`
29073
29114
  );
@@ -29216,4 +29257,5 @@ function buildWorkspacePublishEnv(
29216
29257
  module.exports = {
29217
29258
  buildResourceManifestSddTargets,
29218
29259
  main,
29260
+ satisfiedFormCodesFromContext,
29219
29261
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.217",
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": {