fluncle 0.90.0 → 0.91.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/bin/fluncle.mjs +43 -7
  2. package/package.json +1 -1
package/bin/fluncle.mjs CHANGED
@@ -497,14 +497,32 @@ var init_util = __esm(() => {
497
497
  });
498
498
 
499
499
  // src/output.ts
500
+ import { writeSync as writeSync2 } from "node:fs";
501
+ function writeStdoutSync2(text) {
502
+ const buf = Buffer.from(text, "utf8");
503
+ let offset = 0;
504
+ while (offset < buf.length) {
505
+ try {
506
+ offset += writeSync2(1, buf, offset);
507
+ } catch (error) {
508
+ if (error.code === "EAGAIN") {
509
+ Atomics.wait(EAGAIN_WAIT2, 0, 0, 1);
510
+ continue;
511
+ }
512
+ throw error;
513
+ }
514
+ }
515
+ }
500
516
  function isJsonFailure(value) {
501
517
  return typeof value === "object" && value !== null && typeof value.code === "string" && typeof value.message === "string";
502
518
  }
503
519
  function printJson2(value) {
504
- console.log(JSON.stringify(value, null, 2));
520
+ writeStdoutSync2(JSON.stringify(value, null, 2) + `
521
+ `);
505
522
  }
506
- var CliError2;
523
+ var EAGAIN_WAIT2, CliError2;
507
524
  var init_output = __esm(() => {
525
+ EAGAIN_WAIT2 = new Int32Array(new SharedArrayBuffer(4));
508
526
  CliError2 = class CliError2 extends Error {
509
527
  code;
510
528
  constructor(code, message) {
@@ -538,7 +556,7 @@ function parseVersion(version) {
538
556
  var currentVersion;
539
557
  var init_version = __esm(() => {
540
558
  init_output();
541
- currentVersion = "0.90.0".trim() ? "0.90.0".trim() : "0.1.0";
559
+ currentVersion = "0.91.0".trim() ? "0.91.0".trim() : "0.1.0";
542
560
  });
543
561
 
544
562
  // src/update-notifier.ts
@@ -2168,7 +2186,7 @@ function parseVersion2(version) {
2168
2186
  var currentVersion2, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
2169
2187
  var init_version2 = __esm(() => {
2170
2188
  init_output();
2171
- currentVersion2 = "0.90.0".trim() ? "0.90.0".trim() : "0.1.0";
2189
+ currentVersion2 = "0.91.0".trim() ? "0.91.0".trim() : "0.1.0";
2172
2190
  });
2173
2191
 
2174
2192
  // ../../packages/registry/src/index.ts
@@ -7106,6 +7124,23 @@ var spotifyPlaylistUrl = "https://open.spotify.com/playlist/1m5LADqpLjiBERdtqrIi
7106
7124
  var telegramUrl = "https://t.me/fluncle";
7107
7125
 
7108
7126
  // src/output.ts
7127
+ import { writeSync } from "node:fs";
7128
+ var EAGAIN_WAIT = new Int32Array(new SharedArrayBuffer(4));
7129
+ function writeStdoutSync(text) {
7130
+ const buf = Buffer.from(text, "utf8");
7131
+ let offset = 0;
7132
+ while (offset < buf.length) {
7133
+ try {
7134
+ offset += writeSync(1, buf, offset);
7135
+ } catch (error) {
7136
+ if (error.code === "EAGAIN") {
7137
+ Atomics.wait(EAGAIN_WAIT, 0, 0, 1);
7138
+ continue;
7139
+ }
7140
+ throw error;
7141
+ }
7142
+ }
7143
+ }
7109
7144
  class CliError extends Error {
7110
7145
  code;
7111
7146
  constructor(code, message) {
@@ -7115,7 +7150,8 @@ class CliError extends Error {
7115
7150
  }
7116
7151
  }
7117
7152
  function printJson(value) {
7118
- console.log(JSON.stringify(value, null, 2));
7153
+ writeStdoutSync(JSON.stringify(value, null, 2) + `
7154
+ `);
7119
7155
  }
7120
7156
  function toJsonFailure(error) {
7121
7157
  if (error instanceof CliError) {
@@ -7275,7 +7311,7 @@ function addAdminCommands(program2) {
7275
7311
  const { queueCommand: queueCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
7276
7312
  await runAdminQueue(options, queueCommand2);
7277
7313
  });
7278
- adminTracks.command("list").description("List findings, filterable by musical-key presence (--no-key / --has-key)").option("--limit <limit>", "Number of findings to show", "50").option("--no-key", "Only findings with NO stored musical key (the key-backfill backlog)").option("--has-key <bool>", "Filter by key presence: true (has key) or false (missing)").option("--order <order>", "Sort: asc (oldest first) or desc (newest first)", "desc").option("--json", "Print JSON", false).action(async (options) => {
7314
+ adminTracks.command("list").description("List findings, filterable by musical-key presence (--no-key / --has-key)").option("--limit <limit>", "Number of findings to show (1-100)", "50").option("--all", "Fetch the ENTIRE catalogue, paginating past the 100-row cap (overrides --limit)", false).option("--no-key", "Only findings with NO stored musical key (the key-backfill backlog)").option("--has-key <bool>", "Filter by key presence: true (has key) or false (missing)").option("--order <order>", "Sort: asc (oldest first) or desc (newest first)", "desc").option("--json", "Print JSON", false).action(async (options) => {
7279
7315
  const { listCommand: listCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
7280
7316
  await runAdminTracksList(options, listCommand2);
7281
7317
  });
@@ -8192,7 +8228,7 @@ function resolveHasKey(options) {
8192
8228
  return;
8193
8229
  }
8194
8230
  async function runAdminTracksList(options, listCommand2) {
8195
- const limit = parseListLimit(options.limit);
8231
+ const limit = options.all ? Number.POSITIVE_INFINITY : parseListLimit(options.limit);
8196
8232
  const order = options.order === "asc" ? "asc" : "desc";
8197
8233
  const hasKey = resolveHasKey(options);
8198
8234
  const tracks = await listCommand2({ hasKey, limit, order });
package/package.json CHANGED
@@ -31,5 +31,5 @@
31
31
  "url": "git+https://github.com/mauricekleine/fluncle.git"
32
32
  },
33
33
  "type": "module",
34
- "version": "0.90.0"
34
+ "version": "0.91.0"
35
35
  }