@revoengine/cli 1.0.30 → 1.0.31

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.
package/README.md CHANGED
@@ -261,6 +261,8 @@ Subsequent resource synchronization creates `.revoengine/revo.lock.json` baselin
261
261
 
262
262
  Use `revo project update` to refresh an existing project. When the RevoEngine workspace is nested, pass its path, for example `revo project init ./backend`.
263
263
 
264
+ Migrated JS/TS libraries contain a permanent `@default` element and explicit named exports. Its source remains editable. Plan and push reject omitting an existing target default, including forced pushes and environment migration; refresh the library from the target and reconcile local changes before deployment. The CLI preserves the target default element ID when saving source.
265
+
264
266
  Stable Keys are the durable identity used across instances. UUIDs and versions remain instance-local and are not used to match portable resources. Before the first migration, inspect and apply missing keys on the source:
265
267
 
266
268
  ```bash
@@ -1109,7 +1109,7 @@ function buildPushElements(component, remote, identity) {
1109
1109
  throw new Error(errors.join('; '));
1110
1110
  const remoteElementsByKey = new Map((remote.elements || []).map((element) => [element.key, element]));
1111
1111
  return (component.elements || []).map((element) => {
1112
- const targetElementId = identity.mode === 'stableKey'
1112
+ const targetElementId = identity.mode === 'stableKey' || element.key === '@default'
1113
1113
  ? remoteElementsByKey.get(element.key)?.componentElementId
1114
1114
  : element.componentElementId;
1115
1115
  return {
@@ -1181,6 +1181,9 @@ async function pushSingleComponent(context, manifestPath, remoteCatalog) {
1181
1181
  const configurationErrors = componentSourceConfigurationErrors(component);
1182
1182
  if (configurationErrors.length)
1183
1183
  throw new Error(`Cannot push ${targetPath}: ${configurationErrors.join('; ')}`);
1184
+ const updateError = remote ? componentUpdateValidationError(component, remote) : null;
1185
+ if (updateError)
1186
+ throw new Error(`Cannot push ${targetPath}: ${updateError}`);
1184
1187
  const activationError = componentActivationValidationError(component);
1185
1188
  if (activationError)
1186
1189
  throw new Error(`Cannot push ${targetPath}: ${activationError}`);
@@ -173,6 +173,12 @@ export function buildPortableComponentUpdatePayload(source, target, changedField
173
173
  return payload;
174
174
  }
175
175
  export function componentUpdateValidationError(source, target) {
176
+ const targetType = String(target.type || '').toUpperCase();
177
+ if (['CODE_JS_LIB', 'CODE_TS_LIB'].includes(targetType)
178
+ && target.elements?.some(element => element.key === '@default')
179
+ && !source.elements?.some(element => element.key === '@default')) {
180
+ return 'The target library has a permanent @default element that is missing from the local source. Pull and reconcile the migrated library, including its explicit exports, before deploying; @default cannot be deleted.';
181
+ }
176
182
  const configurationErrors = componentSourceConfigurationErrors(source);
177
183
  if (configurationErrors.length)
178
184
  return configurationErrors.join('; ');
@@ -327,6 +327,9 @@ async function applyPlanItem(targetClient, item, source, target, stableKeyName =
327
327
  if (!sourceEntry || !targetEntry) {
328
328
  throw new Error('component disappeared from the snapshot');
329
329
  }
330
+ const updateError = componentUpdateValidationError(sourceEntry.component, targetEntry.component);
331
+ if (updateError)
332
+ throw new Error(updateError);
330
333
  const configurationErrors = componentSourceConfigurationErrors(sourceEntry.component);
331
334
  if (configurationErrors.length)
332
335
  throw new Error(configurationErrors.join('; '));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revoengine/cli",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "CLI package for the RevoEngine Platform API",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",