@oneaddress/setup 2.1.0 → 2.1.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.js +15 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -856,7 +856,7 @@ var _R = ["\u2588\u2588\u2588\u2588\u2588\u2588 ", "\u2588\u2588 \u2588\u2588"
856
856
  var _S = [" \u2588\u2588\u2588\u2588\u2588\u2588", "\u2588\u2588 ", "\u2588\u2588 ", " \u2588\u2588\u2588\u2588\u2588 ", " \u2588\u2588", " \u2588\u2588", "\u2588\u2588\u2588\u2588\u2588\u2588 "];
857
857
  var ONE_ROWS = Array.from({ length: 7 }, (_3, i) => [_O[i], _N[i], _E[i]].join(" "));
858
858
  var ADDR_ROWS = Array.from({ length: 7 }, (_3, i) => [_A[i], _D2[i], _D2[i], _R[i], _E[i], _S[i], _S[i]].join(" "));
859
- var WIZARD_VERSION = true ? "2.1.0" : "?";
859
+ var WIZARD_VERSION = true ? "2.1.1" : "?";
860
860
  function printCompactHeader() {
861
861
  const INNER = 42;
862
862
  const TOP = fn("\u250C") + dm("\u2500".repeat(INNER)) + fn("\u2510");
@@ -7990,7 +7990,7 @@ async function scaffold(platform, outputDir, partnerId, webhookSecret, webhookUr
7990
7990
 
7991
7991
  // src/register.ts
7992
7992
  var import_node_crypto = require("crypto");
7993
- var PKG_VERSION = true ? "2.1.0" : "dev";
7993
+ var PKG_VERSION = true ? "2.1.1" : "dev";
7994
7994
  var REGISTER_URL = "https://partners.oneaddress.io/api/partner/installs";
7995
7995
  function hmacSha256(secret, message) {
7996
7996
  return (0, import_node_crypto.createHmac)("sha256", secret).update(message).digest("hex");
@@ -8228,6 +8228,12 @@ var COMMANDS2 = {
8228
8228
  "java-spring": { cmd: "mvn", args: ["spring-boot:run"] }
8229
8229
  // no mvnw wrapper is scaffolded
8230
8230
  };
8231
+ var DASHBOARD_COMMANDS = {
8232
+ "ts-node": { cmd: "npx", args: ["tsx", "src/index.ts"] }
8233
+ };
8234
+ function platformHasDashboard(platform) {
8235
+ return Boolean(DASHBOARD_COMMANDS[platform]);
8236
+ }
8231
8237
  var serverProcess = null;
8232
8238
  var serverOutput = "";
8233
8239
  var PASSTHROUGH_KEYS = [
@@ -8356,9 +8362,11 @@ async function waitForPortFree(port, timeoutMs = 8e3) {
8356
8362
  return false;
8357
8363
  }
8358
8364
  async function handOverTerminal(platform, outputDir, port, secrets = {}) {
8359
- const spec = COMMANDS2[platform];
8360
- const manualCommand = spec ? `cd ${outputDir} && ${spec.cmd} ${spec.args.join(" ")}` : `cd ${outputDir} && npm start`;
8361
- if (!spec) return { ok: false, reason: `No start command defined for platform: ${platform}`, manualCommand };
8365
+ const spec = DASHBOARD_COMMANDS[platform];
8366
+ const manualCommand = `cd ${outputDir} && npm start`;
8367
+ if (!spec) {
8368
+ return { ok: false, reason: `The ${platform} scaffold has no dashboard.`, manualCommand };
8369
+ }
8362
8370
  stopServer();
8363
8371
  if (!await waitForPortFree(port)) {
8364
8372
  return {
@@ -9261,10 +9269,7 @@ tunnel needing this wizard to stay open. Re-run once that URL loads in a browser
9261
9269
  Me(nextSteps, "Next steps");
9262
9270
  Se("Setup complete! Welcome to the OneAddress Partner Network.");
9263
9271
  if (serverRunning) {
9264
- const openDashboard = await ye({
9265
- message: "Open the receiver dashboard now?",
9266
- initialValue: true
9267
- });
9272
+ const openDashboard = platformHasDashboard(platform) ? await ye({ message: "Open the receiver dashboard now?", initialValue: true }) : false;
9268
9273
  if (openDashboard === true) {
9269
9274
  const handover = await handOverTerminal(platform, outDir, SERVER_PORT, {
9270
9275
  WEBHOOK_SECRET: secret,
@@ -9288,7 +9293,7 @@ Your receiver is set up and working. Start it yourself with:
9288
9293
  ` ${GRN}\u25C8${R3} ${CRM2}Server live${R3} ${MID2}on http://localhost:3001/webhook${R3}`,
9289
9294
  ` ${AMB2}\u25C8${R3} ${MID2}Edit ${CRM2}src/store.ts${R3} ${MID2}to wire your database${R3}`,
9290
9295
  ` ${MID2}Press Ctrl+C to stop the server and exit.${R3}`,
9291
- ` ${MID2}Run ${CRM2}npm start${R3} ${MID2}here any time for the dashboard.${R3}`
9296
+ ...platformHasDashboard(platform) ? [` ${MID2}Run ${CRM2}npm start${R3} ${MID2}here any time for the dashboard.${R3}`] : []
9292
9297
  ]) {
9293
9298
  console.log(boxRow(inner, BOX_WIDTH, DIM2, R3));
9294
9299
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneaddress/setup",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Interactive setup wizard for OneAddress partner webhook integrations",
5
5
  "main": "dist/index.js",
6
6
  "bin": {