wawesome 0.21.0 → 0.21.1

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 +20 -5
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -12,6 +12,20 @@ import { Readable } from "node:stream";
12
12
  import readline from "node:readline";
13
13
  import { confirm, select } from "@inquirer/prompts";
14
14
  import zlib from "node:zlib";
15
+ //#region src/brand.ts
16
+ const PLAIN = "[w] wawesome";
17
+ const TRUECOLOR_INDIGO = "\x1B[38;2;107;124;255m";
18
+ const INDIGO_256 = "\x1B[38;5;105m";
19
+ const BOLD = "\x1B[1m";
20
+ const RESET = "\x1B[0m";
21
+ function lockup(stream = process.stdout, env = process.env) {
22
+ if (!stream.isTTY || env.NO_COLOR) return PLAIN;
23
+ const indigo = /^(truecolor|24bit)$/i.test(env.COLORTERM ?? "") ? TRUECOLOR_INDIGO : INDIGO_256;
24
+ const bracket = (b) => `${indigo}${BOLD}${b}${RESET}`;
25
+ return `${bracket("[")}${BOLD}w${RESET}${bracket("]")} ${BOLD}wawesome${RESET}`;
26
+ }
27
+ const LOCKUP_HTML = "<div style=\"margin-bottom: 24px; font: 700 20px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: -0.02em; color: #e8eaf0\"><span style=\"font-size: 22px; letter-spacing: -0.06em\"><span style=\"color: #6b7cff\">[</span>w<span style=\"color: #6b7cff\">]</span></span>&nbsp;wawesome</div>";
28
+ //#endregion
15
29
  //#region src/errors.ts
16
30
  /** A rejection carrying the gateway's own prose and, where given, its reason. */
17
31
  var GatewayError = class extends Error {
@@ -895,7 +909,7 @@ async function buildHandler(entryInput, config, options) {
895
909
  * that has to name this version — `--version`, the dependency a scaffolded
896
910
  * project pins — reads it here, so a release bumps one file.
897
911
  */
898
- const CLI_VERSION = "0.21.0";
912
+ const CLI_VERSION = "0.21.1";
899
913
  //#endregion
900
914
  //#region src/cli-login.ts
901
915
  const START_PATH = "/v1/cli/login/start";
@@ -1068,13 +1082,14 @@ function listen(server, port) {
1068
1082
  });
1069
1083
  });
1070
1084
  }
1071
- const STYLE = "font-family: system-ui; text-align: center; padding: 50px; background: #0f172a; color: #f8fafc;";
1085
+ const STYLE = "margin: 0; padding: 50px; text-align: center; background: #0e1016; color: #9298a8; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;";
1072
1086
  function page(title, said) {
1073
1087
  return `<!DOCTYPE html>
1074
1088
  <html>
1075
1089
  <head><title>wawesome — ${escapeHtml(title.toLowerCase())}</title></head>
1076
1090
  <body style="${STYLE}">
1077
- <h2>${escapeHtml(title)}</h2>
1091
+ ${LOCKUP_HTML}
1092
+ <h2 style="color: #e8eaf0">${escapeHtml(title)}</h2>
1078
1093
  <p>${escapeHtml(said)}</p>
1079
1094
  </body>
1080
1095
  </html>`;
@@ -1372,7 +1387,7 @@ function storeSession({ gatewayUrl, dashboardUrl, session }) {
1372
1387
  tenant_slug: session.tenant_slug,
1373
1388
  tenant_name: session.tenant_name
1374
1389
  });
1375
- console.log("\n======================================================");
1390
+ console.log(`\n${lockup()}`);
1376
1391
  console.log("🎉 \x1B[32mLOGIN SUCCESSFUL!\x1B[0m");
1377
1392
  console.log("======================================================");
1378
1393
  if (session.tenant_name) console.log(`\n Workspace: ${session.tenant_name}`);
@@ -6768,7 +6783,7 @@ cli.command("cron pause <schedule>", "Pause a schedule by name").option("-r, --r
6768
6783
  cli.command("cron resume <schedule>", "Resume a paused schedule").option("-f, --function <function>", "Function name override").option("-a, --app <app>", "App slug override").option("-v, --verbose", "Enable verbose debug output").action((schedule, options) => resumeScheduleCommand(schedule, void 0, options));
6769
6784
  cli.command("cron history [target]", "Read background run history").alias("cron runs").option("-s, --state <state>", "Filter run history by state (pending, running, dispatched, skipped, missed, cancelled, lost, failed)").option("--status <status>", "Alias for --state").option("-l, --limit <limit>", "Limit number of history rows (default: 50)").option("-a, --app <app>", "App slug override").option("-v, --verbose", "Enable verbose debug output").action((target, options) => runHistoryCommand(target, options));
6770
6785
  cli.command("schedules [action] [target]", "Alias for 'cron'").option("-a, --app <app>", "App slug override").option("-v, --verbose", "Enable verbose debug output").action((action, target, options) => cronCommand(action, target, void 0, options));
6771
- cli.help();
6786
+ cli.help((sections) => [{ body: `${lockup()} ${CLI_VERSION}` }, ...sections.slice(1)]);
6772
6787
  cli.version(CLI_VERSION);
6773
6788
  cli.parse();
6774
6789
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wawesome",
3
- "version": "0.21.0",
3
+ "version": "0.21.1",
4
4
  "description": "CLI tool for building and deploying serverless functions on wawesome.io platform",
5
5
  "type": "module",
6
6
  "bin": {