wawesome 0.2.0 → 0.3.0

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/dist/index.mjs +9 -6
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -720,7 +720,7 @@ async function buildJs(entryInput, options) {
720
720
  * that has to name this version — `--version`, the dependency a scaffolded
721
721
  * project pins — reads it here, so a release bumps one file.
722
722
  */
723
- const CLI_VERSION = "0.2.0";
723
+ const CLI_VERSION = "0.3.0";
724
724
  //#endregion
725
725
  //#region src/prompt.ts
726
726
  /**
@@ -2815,6 +2815,8 @@ export default {
2815
2815
  }
2816
2816
  //#endregion
2817
2817
  //#region src/version.ts
2818
+ /** How both surfaces name a version nobody can switch to. */
2819
+ const RECLAIMED = "⚠ [assets reclaimed]";
2818
2820
  async function fetchVersions(gatewayUrl, tenantJwt, app, funcName, env, isVerbose) {
2819
2821
  const url = `${gatewayUrl}/v1/apps/${encodeURIComponent(app)}/functions/${encodeURIComponent(funcName)}/versions?environment=${encodeURIComponent(env)}`;
2820
2822
  if (isVerbose) console.log(`[wawesome:verbose] GET ${url}`);
@@ -2864,7 +2866,8 @@ async function listVersions(options) {
2864
2866
  const hashStr = v.cwasm_hash.slice(0, 8).padEnd(8);
2865
2867
  const dateStr = new Date(v.created_at).toISOString().replace("T", " ").slice(0, 19).padEnd(20);
2866
2868
  const statusStr = v.status.padEnd(9);
2867
- console.log(`${verStr} | ${hashStr} | ${dateStr} | ${statusStr} | ${isActive ? "\x1B[32m★ [active]\x1B[0m" : ""}`);
2869
+ const badge = isActive ? "\x1B[32m★ [active]\x1B[0m" : v.rollbackable === false ? `\x1b[33m${RECLAIMED}\x1b[0m` : "";
2870
+ console.log(`${verStr} | ${hashStr} | ${dateStr} | ${statusStr} | ${badge}`);
2868
2871
  }
2869
2872
  console.log("");
2870
2873
  }
@@ -2912,7 +2915,7 @@ async function switchVersion(targetInput, options) {
2912
2915
  const isActive = v.version_number === data.active_version_number;
2913
2916
  const hashShort = v.cwasm_hash.slice(0, 8);
2914
2917
  const dateStr = new Date(v.created_at).toISOString().replace("T", " ").slice(0, 19);
2915
- const badge = isActive ? " ★ [active]" : "";
2918
+ const badge = isActive ? " ★ [active]" : v.rollbackable === false ? ` ${RECLAIMED}` : "";
2916
2919
  return {
2917
2920
  name: `v${v.version_number} (${hashShort}) • ${dateStr}${badge}`,
2918
2921
  value: v.version_number
@@ -2943,9 +2946,9 @@ async function switchVersion(targetInput, options) {
2943
2946
  })
2944
2947
  });
2945
2948
  if (!deployRes.ok) {
2946
- const errorBody = await deployRes.text();
2947
- console.error(`[wawesome] Error: Failed to set active version (HTTP ${deployRes.status}).`);
2948
- if (isVerbose) console.error(`[wawesome:verbose] Response: ${errorBody}`);
2949
+ const rejection = await asGatewayError(deployRes, `Failed to set active version (HTTP ${deployRes.status}).`);
2950
+ console.error(`[wawesome] Error: ${rejection.message}`);
2951
+ if (isVerbose) console.error(`[wawesome:verbose] Response: ${rejection.body}`);
2949
2952
  process.exit(1);
2950
2953
  }
2951
2954
  console.log(`\n======================================================`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wawesome",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "CLI tool for building and deploying serverless functions on wawesome.io platform",
5
5
  "type": "module",
6
6
  "bin": {