deadman-fm 0.1.1 → 0.1.3

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.
@@ -250,13 +250,13 @@ export async function interactive() {
250
250
  options: [
251
251
  {
252
252
  value: "create",
253
- label: "Create a station",
254
- hint: "pick genre, sync music",
253
+ label: "Start Mining",
254
+ hint: "point to your music, start earning $FM",
255
255
  },
256
256
  {
257
257
  value: "sync",
258
- label: "Sync music",
259
- hint: "upload tracks to your station",
258
+ label: "Sync Music",
259
+ hint: "add or update tracks on your station",
260
260
  },
261
261
  {
262
262
  value: "connect",
@@ -299,69 +299,34 @@ export async function interactive() {
299
299
  // Option 1 — Create a station
300
300
  // ---------------------------------------------------------------------------
301
301
  async function handleCreate() {
302
- // Station name
303
- const rawName = await p.text({
304
- message: "Station name",
305
- placeholder: "My Pirate Radio",
306
- validate: (val) => {
307
- if (!val || !val.trim())
308
- return "Station name is required.";
309
- },
310
- });
311
- guardCancel(rawName);
312
- const stationName = rawName.trim();
313
- // Genre picker
314
- const genre = await p.select({
315
- message: "Genre",
316
- options: [
317
- { value: "Talk", label: "Talk" },
318
- { value: "Music", label: "Music" },
319
- { value: "Live DJ", label: "Live DJ" },
320
- { value: "Other", label: "Other" },
321
- ],
322
- });
323
- guardCancel(genre);
324
- // On-chain registration
325
- p.note(`Your station needs to be registered on Base so others can find it.\nOpening https://deadman.fm/create in your browser...`, "On-chain registration");
326
- try {
327
- const opener = process.platform === "darwin"
328
- ? "open"
329
- : process.platform === "win32"
330
- ? "start"
331
- : "xdg-open";
332
- execSync(`${opener} "https://deadman.fm/create?name=${encodeURIComponent(stationName)}&genre=${encodeURIComponent(genre)}" 2>/dev/null`);
333
- }
334
- catch {
335
- p.log.warn(`Visit: https://deadman.fm/create\nName: ${stationName} Genre: ${genre}`);
336
- }
337
- const stationIdRaw = await p.text({
338
- message: "Station ID from the page (leave blank to skip)",
339
- placeholder: "42",
340
- });
341
- guardCancel(stationIdRaw);
342
- const stationIdParsed = stationIdRaw
343
- ? parseInt(stationIdRaw, 10)
344
- : NaN;
345
- const stationId = !isNaN(stationIdParsed) ? stationIdParsed : null;
346
- if (stationId !== null) {
347
- p.log.success(`Station #${stationId} created — "${stationName}" (${genre})`);
348
- }
349
- else {
350
- p.log.success(`Station "${stationName}" ready.`);
351
- p.log.info("Run Sync music once your on-chain tx confirms.");
352
- }
353
- // Auto-flow into sync
354
- const goSync = await p.confirm({
355
- message: "Sync music to this station now?",
356
- initialValue: true,
357
- });
358
- guardCancel(goSync);
359
- if (goSync) {
360
- await handleSyncForStation(stationName, stationId);
361
- }
362
- else {
363
- p.log.info("Pick Sync music any time to upload tracks.");
302
+ const stations = loadLocalStations();
303
+ if (stations.length === 0) {
304
+ p.log.warn("You don't own a station yet.");
305
+ p.log.info("Win one in the daily emoji auction at deadman.fm");
306
+ const openAuction = await p.confirm({
307
+ message: "Open the auction page?",
308
+ initialValue: true,
309
+ });
310
+ guardCancel(openAuction);
311
+ if (openAuction) {
312
+ try {
313
+ const opener = process.platform === "darwin"
314
+ ? "open"
315
+ : process.platform === "win32"
316
+ ? "start"
317
+ : "xdg-open";
318
+ execSync(`${opener} "https://deadman.fm" 2>/dev/null`);
319
+ p.log.success("Opened deadman.fm win an emoji, then come back here to sync music.");
320
+ }
321
+ catch {
322
+ p.log.info("Visit: https://deadman.fm");
323
+ }
324
+ }
325
+ return;
364
326
  }
327
+ // Has stations — go straight to sync
328
+ p.log.success(`You own ${stations.length} station${stations.length === 1 ? "" : "s"}. Let's sync music.`);
329
+ await handleSync();
365
330
  }
366
331
  // ---------------------------------------------------------------------------
367
332
  // Option 2 — Sync music (standalone entry point)
@@ -369,7 +334,8 @@ async function handleCreate() {
369
334
  async function handleSync() {
370
335
  const stations = loadLocalStations();
371
336
  if (stations.length === 0) {
372
- p.log.warn("No local stations found. Create one first.");
337
+ p.log.warn("You don't own a station yet.");
338
+ p.log.info("Win one in the daily auction at deadman.fm");
373
339
  return;
374
340
  }
375
341
  let stationName;
@@ -577,7 +543,7 @@ async function handleList() {
577
543
  }
578
544
  listSpinner.stop(`Found ${logs.length} station${logs.length === 1 ? "" : "s"} on Base`);
579
545
  if (logs.length === 0) {
580
- p.log.info("No stations yet. Run Create a station to be the first.");
546
+ p.log.info("No stations yet. Run Start Mining to begin.");
581
547
  return;
582
548
  }
583
549
  const lines = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deadman-fm",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "💀.fm — Create and seed decentralized radio stations",
5
5
  "type": "module",
6
6
  "files": [