openxiangda 1.0.183 → 1.0.185

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.
@@ -115,6 +115,33 @@ function normalizeManagedReleaseSourceRevision(
115
115
  };
116
116
  }
117
117
 
118
+ function normalizeManagedChangeSourceBase(
119
+ target,
120
+ sourceBase,
121
+ releaseSourceRevision
122
+ ) {
123
+ const logicalApp = target?.logicalApp || target?.state?.logicalApp;
124
+ if (!logicalApp?.sourceRepositoryId) {
125
+ return cloneJsonValue(sourceBase);
126
+ }
127
+ return normalizeManagedReleaseSourceRevision(
128
+ target,
129
+ {
130
+ ...(sourceBase || {}),
131
+ repositoryId: sourceBase?.repo,
132
+ repoAliases: [
133
+ sourceBase?.repo,
134
+ releaseSourceRevision?.repo,
135
+ releaseSourceRevision?.repositoryId,
136
+ ...(Array.isArray(releaseSourceRevision?.repoAliases)
137
+ ? releaseSourceRevision.repoAliases
138
+ : []),
139
+ ],
140
+ },
141
+ { errorCode: 'RELEASE_SOURCE_BASE_REPOSITORY_MISMATCH' }
142
+ );
143
+ }
144
+
118
145
  function hasStateResourceMappings(value) {
119
146
  if (Array.isArray(value)) return value.length > 0;
120
147
  if (!value || typeof value !== 'object') {
@@ -354,6 +381,7 @@ module.exports = {
354
381
  buildCandidateBundle,
355
382
  canonicalJson,
356
383
  normalizeEnvironmentKind,
384
+ normalizeManagedChangeSourceBase,
357
385
  normalizeManagedReleaseSourceRevision,
358
386
  normalizeTargetName,
359
387
  hasStateResourceMappings,
package/lib/cli.js CHANGED
@@ -131,6 +131,7 @@ const {
131
131
  bindEnvironmentTarget,
132
132
  buildCandidateBundle,
133
133
  normalizeEnvironmentKind,
134
+ normalizeManagedChangeSourceBase,
134
135
  normalizeManagedReleaseSourceRevision,
135
136
  readCandidate,
136
137
  readJsonInput,
@@ -4921,7 +4922,6 @@ async function ensureChangeBaseline(
4921
4922
  return stored;
4922
4923
  }
4923
4924
  const activeLease = getUsableStoredPublishLease(target);
4924
- const sourceBase = resolveChangeSourceBase(changeId, flags);
4925
4925
  const releaseSourceRevision = normalizeManagedReleaseSourceRevision(
4926
4926
  target,
4927
4927
  prepareReleaseSourceRevision({
@@ -4929,6 +4929,11 @@ async function ensureChangeBaseline(
4929
4929
  }),
4930
4930
  { errorCode: 'RELEASE_SOURCE_REPOSITORY_MISMATCH' }
4931
4931
  );
4932
+ const sourceBase = normalizeManagedChangeSourceBase(
4933
+ target,
4934
+ resolveChangeSourceBase(changeId, flags),
4935
+ releaseSourceRevision
4936
+ );
4932
4937
 
4933
4938
  const data = await requestWithAuth(
4934
4939
  config,
@@ -12894,7 +12899,7 @@ function saveRuntimeReleaseState(target, release) {
12894
12899
  updatedAt: new Date().toISOString(),
12895
12900
  };
12896
12901
  target.bound.updatedAt = new Date().toISOString();
12897
- if (target.state.profiles?.[target.profileName]) {
12902
+ if (!target.targetName && target.state.profiles?.[target.profileName]) {
12898
12903
  target.state.profiles[target.profileName] = target.bound;
12899
12904
  }
12900
12905
  saveProjectState(target.state);
@@ -21171,7 +21176,7 @@ function removeStateResource(target, kind, code) {
21171
21176
  if (!bucket || !target.bound.resources?.[bucket]?.[code]) return;
21172
21177
  delete target.bound.resources[bucket][code];
21173
21178
  target.bound.updatedAt = new Date().toISOString();
21174
- if (target.state.profiles?.[target.profileName]) {
21179
+ if (!target.targetName && target.state.profiles?.[target.profileName]) {
21175
21180
  target.state.profiles[target.profileName] = target.bound;
21176
21181
  }
21177
21182
  saveProjectState(target.state);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.183",
3
+ "version": "1.0.185",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {