openxiangda 1.0.168 → 1.0.170

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 +50 -5
  2. package/package.json +1 -1
package/lib/cli.js CHANGED
@@ -1692,6 +1692,33 @@ function recordStagedAppReleaseResources(
1692
1692
  return writeStagedResourcesFiles(changeId, output, context);
1693
1693
  }
1694
1694
 
1695
+ function normalizeSatisfiedAppReleaseSelectors(values) {
1696
+ return unique(
1697
+ (Array.isArray(values) ? values : [])
1698
+ .map(value => String(value || '').trim())
1699
+ .filter(value => /^form:[A-Za-z0-9][A-Za-z0-9._-]*$/.test(value))
1700
+ ).sort();
1701
+ }
1702
+
1703
+ function recordSatisfiedAppReleaseSelectors(changeId, selectors, target) {
1704
+ const incoming = normalizeSatisfiedAppReleaseSelectors(selectors);
1705
+ if (!changeId || incoming.length === 0) return [];
1706
+ const contextFile = stagedResourcesContextFileForChange(changeId);
1707
+ const context = assertStagedResourcesContext(target, changeId);
1708
+ const satisfiedSelectors = normalizeSatisfiedAppReleaseSelectors([
1709
+ ...(context.satisfiedSelectors || []),
1710
+ ...incoming,
1711
+ ]);
1712
+ const temporary = `${contextFile}.${process.pid}.tmp`;
1713
+ fs.writeFileSync(
1714
+ temporary,
1715
+ `${JSON.stringify({ ...context, satisfiedSelectors }, null, 2)}\n`,
1716
+ { mode: 0o600 }
1717
+ );
1718
+ fs.renameSync(temporary, contextFile);
1719
+ return satisfiedSelectors;
1720
+ }
1721
+
1695
1722
  function exactStringSet(left, right) {
1696
1723
  const normalize = values =>
1697
1724
  Array.from(
@@ -1723,7 +1750,7 @@ function assertStagedAppReleaseScope(target, flags, resources) {
1723
1750
  'APP_RELEASE_STAGED_SCOPE_REQUIRED: staged child activation 必须显式提供 --change'
1724
1751
  );
1725
1752
  }
1726
- assertStagedResourcesContext(target, changeId);
1753
+ const stagedContext = assertStagedResourcesContext(target, changeId);
1727
1754
  let scope;
1728
1755
  try {
1729
1756
  scope = getSddChangeScope({
@@ -1767,9 +1794,15 @@ function assertStagedAppReleaseScope(target, flags, resources) {
1767
1794
  }
1768
1795
 
1769
1796
  const expectedForms = (targets.forms || []).map(String).sort();
1770
- const actualForms = byKind('FormRelease')
1771
- .map(resource => stagedFormCode(target, resource))
1772
- .sort();
1797
+ const satisfiedForms = normalizeSatisfiedAppReleaseSelectors(
1798
+ stagedContext?.satisfiedSelectors
1799
+ )
1800
+ .filter(selector => selector.startsWith('form:'))
1801
+ .map(selector => selector.slice('form:'.length));
1802
+ const actualForms = unique([
1803
+ ...byKind('FormRelease').map(resource => stagedFormCode(target, resource)),
1804
+ ...satisfiedForms,
1805
+ ]).sort();
1773
1806
  if (!exactStringSet(actualForms, expectedForms)) {
1774
1807
  fail(
1775
1808
  `APP_RELEASE_STAGED_SCOPE_MISMATCH: FormRelease 必须精确覆盖 ${expectedForms.join(',') || '(none)'}`
@@ -8885,6 +8918,18 @@ async function resource(args) {
8885
8918
  target
8886
8919
  );
8887
8920
  }
8921
+ const satisfiedFormSelectors = (result.published || [])
8922
+ .filter(
8923
+ item => item?.kind === 'formSetting' && item?.action === 'noop'
8924
+ )
8925
+ .map(item => `form:${item.code}`);
8926
+ if (satisfiedFormSelectors.length > 0 && stagedChangeId) {
8927
+ result.satisfiedSelectors = recordSatisfiedAppReleaseSelectors(
8928
+ stagedChangeId,
8929
+ satisfiedFormSelectors,
8930
+ target
8931
+ );
8932
+ }
8888
8933
  result.timings = telemetry.stop();
8889
8934
  if (flags.json) return writeJson(result);
8890
8935
  printResourceResult(result);
@@ -14016,7 +14061,7 @@ function backendReleaseResultSummary(
14016
14061
  kind: 'BackendRelease',
14017
14062
  identity: { releaseId: release.id },
14018
14063
  action: 'update',
14019
- hash: release.verificationHash || release.manifestHash,
14064
+ hash: release.manifestHash,
14020
14065
  metadata: resolvedProtocolVersion
14021
14066
  ? {
14022
14067
  protocolVersion: resolvedProtocolVersion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.168",
3
+ "version": "1.0.170",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {