@arbidocs/cli 0.3.141 → 0.3.143

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.3.143
4
+
5
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.3.142...HEAD)
6
+
7
+ ### 🩹 Fixes
8
+
9
+ - **notes:** Sort the gantt chronologically, and filter every view from one list ([#1160](https://github.com/arbicity/ARBI-frontend/pull/1160))
10
+
11
+ ### 💅 Refactors
12
+
13
+ - **blocks:** Move the timeline views into @arbidocs/blocks ([b30810d4](https://github.com/arbicity/ARBI-frontend/commit/b30810d4))
14
+ - Retire what the shared timeline made redundant ([33510915](https://github.com/arbicity/ARBI-frontend/commit/33510915))
15
+
16
+ ### ✅ Tests
17
+
18
+ - **e2e:** Invalidate the notes query after seeding through the API ([#1158](https://github.com/arbicity/ARBI-frontend/pull/1158))
19
+
20
+ ## v0.3.142
21
+
22
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.3.141...HEAD)
23
+
24
+ ### 🚀 Enhancements
25
+
26
+ - **notes:** Timeline UI — calendar, gantt, grid, and a proper page ([#1157](https://github.com/arbicity/ARBI-frontend/pull/1157))
27
+
3
28
  ## v0.3.141
4
29
 
5
30
  [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.3.140...HEAD)
package/dist/index.js CHANGED
@@ -3694,7 +3694,7 @@ function getLatestVersion(skipCache = false) {
3694
3694
  }
3695
3695
  }
3696
3696
  function getCurrentVersion() {
3697
- return "0.3.141";
3697
+ return "0.3.143";
3698
3698
  }
3699
3699
  function readChangelog(fromVersion, toVersion) {
3700
3700
  try {
@@ -3747,17 +3747,17 @@ function showChangelog(fromVersion, toVersion) {
3747
3747
  async function checkForUpdates(autoUpdate) {
3748
3748
  try {
3749
3749
  const latest = getLatestVersion();
3750
- if (!latest || latest === "0.3.141") return;
3750
+ if (!latest || latest === "0.3.143") return;
3751
3751
  if (autoUpdate) {
3752
3752
  warn(`
3753
- Your arbi version is out of date (${"0.3.141"} \u2192 ${latest}). Updating...`);
3753
+ Your arbi version is out of date (${"0.3.143"} \u2192 ${latest}). Updating...`);
3754
3754
  child_process.execSync("npm install -g @arbidocs/cli@latest", { stdio: "inherit" });
3755
- showChangelog("0.3.141", latest);
3755
+ showChangelog("0.3.143", latest);
3756
3756
  console.log(`Updated to ${latest}.`);
3757
3757
  } else {
3758
3758
  warn(
3759
3759
  `
3760
- Your arbi version is out of date (${"0.3.141"} \u2192 ${latest}).
3760
+ Your arbi version is out of date (${"0.3.143"} \u2192 ${latest}).
3761
3761
  Run "arbi update" to upgrade, or "arbi update auto" to always stay up to date.`
3762
3762
  );
3763
3763
  }
@@ -3789,10 +3789,10 @@ function markNagShown(latest) {
3789
3789
  function hintUpdateOnError() {
3790
3790
  try {
3791
3791
  const cached = readCache();
3792
- if (!cached || cached.latest === "0.3.141") return;
3792
+ if (!cached || cached.latest === "0.3.143") return;
3793
3793
  if (!shouldShowNag(cached.latest)) return;
3794
3794
  warn(
3795
- `Your arbi version is out of date (${"0.3.141"} \u2192 ${cached.latest}). Run "arbi update".`
3795
+ `Your arbi version is out of date (${"0.3.143"} \u2192 ${cached.latest}). Run "arbi update".`
3796
3796
  );
3797
3797
  markNagShown(cached.latest);
3798
3798
  } catch {
@@ -8199,14 +8199,19 @@ function formatSpan(startIso, endIso) {
8199
8199
  const sameDay = start.toISOString().slice(0, 10) === end.toISOString().slice(0, 10);
8200
8200
  if (sameDay) return start.toISOString().slice(0, 10);
8201
8201
  const firstOfMonth = start.getUTCDate() === 1;
8202
+ const lastOfMonth = end.getUTCDate() === new Date(Date.UTC(end.getUTCFullYear(), end.getUTCMonth() + 1, 0)).getUTCDate();
8202
8203
  const sameMonth = start.toISOString().slice(0, 7) === end.toISOString().slice(0, 7);
8203
- if (firstOfMonth && sameMonth) return start.toISOString().slice(0, 7);
8204
- const wholeYear = firstOfMonth && start.getUTCMonth() === 0 && end.getUTCMonth() === 11;
8204
+ if (firstOfMonth && lastOfMonth && sameMonth) return start.toISOString().slice(0, 7);
8205
+ const wholeYear = firstOfMonth && lastOfMonth && start.getUTCMonth() === 0 && end.getUTCMonth() === 11;
8205
8206
  if (wholeYear) return String(start.getUTCFullYear());
8206
8207
  return `${start.toISOString().slice(0, 10)} \u2192 ${end.toISOString().slice(0, 10)}`;
8207
8208
  }
8208
8209
  return `${start.toISOString().slice(0, 16)}Z \u2192 ${end.toISOString().slice(0, 16)}Z`;
8209
8210
  }
8211
+ function bail(message) {
8212
+ error(message);
8213
+ process.exit(1);
8214
+ }
8210
8215
  async function fetchDatedNoteChoices(arbi) {
8211
8216
  const data = await sdk.notes.listNotes(arbi, { datedOnly: true });
8212
8217
  if (data.length === 0) {
@@ -8264,8 +8269,9 @@ function registerTimelineCommand(program2) {
8264
8269
  timeline.command("add [description...]").description("Add a dated note (prompts if arguments are omitted)").option("-w, --workspace <id>", "Workspace ID (defaults to selected workspace)").option("-d, --date <date>", "Date, any precision (2019, 2019-10, 2019-10-14, or a timestamp)").option("--end <date>", "End of a custom range (takes the end of its own precision)").option("--timezone <iana>", "IANA zone for a real appointment, e.g. America/New_York").option("--shared", "Visible to all workspace collaborators").option("--json", "Output as JSON").action(
8265
8270
  (words, opts) => runAction(async () => {
8266
8271
  const { arbi } = await resolveWorkspace(opts.workspace);
8267
- const description = words.join(" ").trim() || await promptInput("What happened?");
8268
- const date = opts.date ?? await promptInput("When? (2019, 2019-10, 2019-10-14, or a timestamp)");
8272
+ const interactive = process.stdin.isTTY === true;
8273
+ const description = words.join(" ").trim() || (interactive ? await promptInput("What happened?") : bail("Give the note text, or run interactively."));
8274
+ const date = opts.date ?? (interactive ? await promptInput("When? (2019, 2019-10, 2019-10-14, or a timestamp)") : bail("A timeline note needs a date \u2014 pass --date (e.g. --date 2019-10)."));
8269
8275
  const created = await sdk.notes.createNote(arbi, {
8270
8276
  text: description,
8271
8277
  date,
@@ -8322,7 +8328,10 @@ function registerTimelineCommand(program2) {
8322
8328
  printJson(reminded);
8323
8329
  return;
8324
8330
  }
8325
- success(`Reminder set on ${ref(reminded.external_id)} (${ref(reminded.task_ext_id ?? "")})`);
8331
+ const ids = reminded.reminder_task_ext_ids ?? [];
8332
+ const added = ids[ids.length - 1] ?? "";
8333
+ const also = ids.length > 1 ? ` \u2014 ${ids.length} reminders on this note` : "";
8334
+ success(`Reminder set on ${ref(reminded.external_id)} (${ref(added)})${also}`);
8326
8335
  })()
8327
8336
  );
8328
8337
  timeline.command("delete [id]").description("Delete a note (picker if no ID)").option("-w, --workspace <id>", "Workspace ID (defaults to selected workspace)").option("-y, --yes", "Skip confirmation").action(
@@ -10644,7 +10653,7 @@ console.info = (...args) => {
10644
10653
  _origInfo(...args);
10645
10654
  };
10646
10655
  var program = new commander.Command();
10647
- program.name("arbi").description("ARBI CLI \u2014 interact with ARBI from the terminal").version("0.3.141").showHelpAfterError(true).showSuggestionAfterError(true);
10656
+ program.name("arbi").description("ARBI CLI \u2014 interact with ARBI from the terminal").version("0.3.143").showHelpAfterError(true).showSuggestionAfterError(true);
10648
10657
  registerConfigCommand(program);
10649
10658
  registerLoginCommand(program);
10650
10659
  registerRegisterCommand(program);