@lumerahq/cli 0.18.8 → 0.18.9

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.js CHANGED
@@ -219,25 +219,25 @@ async function main() {
219
219
  switch (command) {
220
220
  // Resource commands
221
221
  case "plan":
222
- await import("./resources-AMQH3SJW.js").then((m) => m.plan(args.slice(1)));
222
+ await import("./resources-DQBSDWYG.js").then((m) => m.plan(args.slice(1)));
223
223
  break;
224
224
  case "apply":
225
- await import("./resources-AMQH3SJW.js").then((m) => m.apply(args.slice(1)));
225
+ await import("./resources-DQBSDWYG.js").then((m) => m.apply(args.slice(1)));
226
226
  break;
227
227
  case "pull":
228
- await import("./resources-AMQH3SJW.js").then((m) => m.pull(args.slice(1)));
228
+ await import("./resources-DQBSDWYG.js").then((m) => m.pull(args.slice(1)));
229
229
  break;
230
230
  case "destroy":
231
- await import("./resources-AMQH3SJW.js").then((m) => m.destroy(args.slice(1)));
231
+ await import("./resources-DQBSDWYG.js").then((m) => m.destroy(args.slice(1)));
232
232
  break;
233
233
  case "list":
234
- await import("./resources-AMQH3SJW.js").then((m) => m.list(args.slice(1)));
234
+ await import("./resources-DQBSDWYG.js").then((m) => m.list(args.slice(1)));
235
235
  break;
236
236
  case "show":
237
- await import("./resources-AMQH3SJW.js").then((m) => m.show(args.slice(1)));
237
+ await import("./resources-DQBSDWYG.js").then((m) => m.show(args.slice(1)));
238
238
  break;
239
239
  case "diff":
240
- await import("./resources-AMQH3SJW.js").then((m) => m.diff(args.slice(1)));
240
+ await import("./resources-DQBSDWYG.js").then((m) => m.diff(args.slice(1)));
241
241
  break;
242
242
  // Development
243
243
  case "dev":
@@ -2086,6 +2086,7 @@ async function plan(args) {
2086
2086
  showPlanHelp();
2087
2087
  return;
2088
2088
  }
2089
+ const jsonOutput = args.includes("--json");
2089
2090
  const projectRoot = findProjectRoot();
2090
2091
  loadEnv(projectRoot);
2091
2092
  const platformDir = getPlatformDir();
@@ -2093,7 +2094,7 @@ async function plan(args) {
2093
2094
  const api = createApiClient(void 0, void 0, appName);
2094
2095
  const projectId = getProjectId(projectRoot);
2095
2096
  const positionalArgs = args.filter((a) => !a.startsWith("-"));
2096
- const { type, name } = parseResource(positionalArgs[0]);
2097
+ const { type, name } = parseResource(positionalArgs.filter((a) => a !== "--json")[0]);
2097
2098
  console.log();
2098
2099
  console.log(pc.cyan(pc.bold(" Plan")));
2099
2100
  console.log(pc.dim(" Comparing local files to remote state..."));
@@ -2136,10 +2137,27 @@ async function plan(args) {
2136
2137
  }
2137
2138
  }
2138
2139
  if (allChanges.length === 0) {
2140
+ if (jsonOutput) {
2141
+ console.log(JSON.stringify({ changes: [], warnings: [] }));
2142
+ return;
2143
+ }
2139
2144
  console.log(pc.green(" \u2713 No changes detected"));
2140
2145
  console.log();
2141
2146
  return;
2142
2147
  }
2148
+ if (jsonOutput) {
2149
+ const warnings = [];
2150
+ for (const change of allChanges) {
2151
+ if (change.fieldDetails) {
2152
+ const removals = change.fieldDetails.filter((f) => f.action === "-");
2153
+ if (removals.length > 0) {
2154
+ warnings.push(`Collection "${change.name}" will have ${removals.length} field(s) removed.`);
2155
+ }
2156
+ }
2157
+ }
2158
+ console.log(JSON.stringify({ changes: allChanges, warnings }));
2159
+ return;
2160
+ }
2143
2161
  console.log(pc.bold(" Changes:"));
2144
2162
  console.log();
2145
2163
  for (const change of allChanges) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumerahq/cli",
3
- "version": "0.18.8",
3
+ "version": "0.18.9",
4
4
  "description": "CLI for building and deploying Lumera apps",
5
5
  "type": "module",
6
6
  "engines": {