@terraforge/core 0.0.24 → 0.0.25

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/dist/index.d.mts CHANGED
@@ -360,9 +360,9 @@ declare class WorkSpace {
360
360
  urn: URN;
361
361
  operation: "delete" | "update";
362
362
  commit(): void;
363
- }[] | undefined;
363
+ }[];
364
364
  commit: () => Promise<void>;
365
- }>;
365
+ } | undefined>;
366
366
  /**
367
367
  * Get the status of all resources in the app by comparing current config with state file.
368
368
  */
package/dist/index.mjs CHANGED
@@ -1118,8 +1118,8 @@ const refresh = async (app, opt) => {
1118
1118
  if (opt.filters && opt.filters.length > 0) filteredStacks = Object.entries(appState?.stacks ?? {}).filter(([stackName]) => {
1119
1119
  return opt.filters.includes(stackName);
1120
1120
  }).map(([_, state]) => state);
1121
- if (appState && filteredStacks.length > 0) return {
1122
- operations: (await Promise.all(filteredStacks.map((stackState) => {
1121
+ if (appState && filteredStacks.length > 0) {
1122
+ const filteredOperations = (await Promise.all(filteredStacks.map((stackState) => {
1123
1123
  return Promise.all(Object.entries(stackState.nodes).map(([_urn, nodeState]) => {
1124
1124
  const urn = _urn;
1125
1125
  return queue(async () => {
@@ -1150,11 +1150,15 @@ const refresh = async (app, opt) => {
1150
1150
  };
1151
1151
  });
1152
1152
  }));
1153
- }))).flat().filter((op) => !!op),
1154
- async commit() {
1155
- await opt.backend.state.update(app.urn, appState);
1156
- }
1157
- };
1153
+ }))).flat().filter((op) => !!op);
1154
+ if (filteredOperations.length === 0) return;
1155
+ return {
1156
+ operations: filteredOperations,
1157
+ async commit() {
1158
+ await opt.backend.state.update(app.urn, appState);
1159
+ }
1160
+ };
1161
+ }
1158
1162
  };
1159
1163
 
1160
1164
  //#endregion
@@ -1328,11 +1332,12 @@ var WorkSpace = class {
1328
1332
  await this.destroyProviders();
1329
1333
  await releaseLock();
1330
1334
  releaseExit();
1335
+ return;
1331
1336
  }
1332
1337
  return {
1333
- operations: result?.operations,
1338
+ operations: result.operations,
1334
1339
  commit: async () => {
1335
- await result?.commit();
1340
+ await result.commit();
1336
1341
  await this.destroyProviders();
1337
1342
  await releaseLock();
1338
1343
  releaseExit();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terraforge/core",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",