@staff0rd/assist 0.144.1 → 0.145.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 +8 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.144.1",
9
+ version: "0.145.1",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -2457,7 +2457,11 @@ async function addFromJson() {
2457
2457
  return;
2458
2458
  }
2459
2459
  const input = await readStdin2();
2460
- const data = addItemSchema.parse(JSON.parse(input));
2460
+ const sanitised = input.replace(
2461
+ /"(?:[^"\\]|\\.)*"/g,
2462
+ (match) => match.replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t")
2463
+ );
2464
+ const data = addItemSchema.parse(JSON.parse(sanitised));
2461
2465
  const items = loadBacklog();
2462
2466
  const id = getNextId(items);
2463
2467
  items.push({ ...data, id, status: "todo" });
@@ -2925,7 +2929,7 @@ async function next() {
2925
2929
  return;
2926
2930
  }
2927
2931
  const choices = todo.map((i) => ({
2928
- name: `#${i.id}: ${i.name}`,
2932
+ name: `${typeLabel(i.type)} #${i.id}: ${i.name}`,
2929
2933
  value: String(i.id)
2930
2934
  }));
2931
2935
  const { selected } = await enquirer6.prompt({
@@ -2934,7 +2938,7 @@ async function next() {
2934
2938
  message: "Choose a backlog item to start:",
2935
2939
  choices: choices.map((c) => c.name)
2936
2940
  });
2937
- const id = selected.split(":")[0].slice(1);
2941
+ const id = selected.match(/#(\d+)/)?.[1] ?? "";
2938
2942
  await run2(id);
2939
2943
  }
2940
2944
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.144.1",
3
+ "version": "0.145.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {