@jwilger/pi-development-system 0.61.0 → 0.63.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jwilger/pi-development-system",
3
- "version": "0.61.0",
3
+ "version": "0.63.0",
4
4
  "description": "A pi extension package representing a seasoned approach to software development using a full AI SDLC.",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -121,7 +121,11 @@ const stripTicks = (text: string): string => {
121
121
  if (closes(body.at(-1) ?? "", fence)) body.pop();
122
122
  return body.join("\n").trim();
123
123
  }
124
- return text.replace(/^`+|`+$/g, "").trim();
124
+ const trimmed = text.trim();
125
+ if (/^`+$/.test(trimmed)) return "";
126
+ // Only a text that is one code span is unwrapped; anything else is kept whole, ticks and all.
127
+ const whole = /^(`+)([^`]+)\1$/.exec(trimmed);
128
+ return whole?.[2]?.trim() ?? trimmed;
125
129
  };
126
130
 
127
131
  const stepsOf = (text: string): string[] => {
@@ -169,7 +173,7 @@ function problemsOf(markdown: string, split: Sections): string[] {
169
173
  const filesOf = (text: string): string[] =>
170
174
  text
171
175
  .split(/[,\n]/)
172
- .map((f) => stripTicks(f.trim()))
176
+ .map((f) => stripTicks(f.trim().replace(/^(?:[-*+]|\d+[.)])\s+/, "")))
173
177
  .filter((f) => f !== "");
174
178
 
175
179
  const NO_HEADER = "header must be `## <id> — <title>` (an id, an em dash, then the title)";
@@ -178,12 +178,14 @@ const createIssue = async (gh: Gh, input: NewWorkItem): Promise<TrackerResult<Wo
178
178
  const labelFlags = (current: WorkItem, hadMarker: boolean, patch: WorkItemPatch): string[] => {
179
179
  const wanted = patch.labels ?? current.labels;
180
180
  const marked = (patch.status ?? current.status) === "in-progress";
181
+ const has = (labels: readonly string[], l: string): boolean =>
182
+ labels.some((x) => x.toLowerCase() === l.toLowerCase());
181
183
  const add = [
182
- ...wanted.filter((l) => !current.labels.includes(l)),
184
+ ...wanted.filter((l) => !has(current.labels, l)),
183
185
  ...(marked && !hadMarker ? [IN_PROGRESS] : []),
184
186
  ];
185
187
  const remove = [
186
- ...current.labels.filter((l) => !wanted.includes(l)),
188
+ ...current.labels.filter((l) => !has(wanted, l)),
187
189
  ...(!marked && hadMarker ? [IN_PROGRESS] : []),
188
190
  ];
189
191
  return [
@@ -15,6 +15,7 @@ const COMMENTS = "\n## Comments\n";
15
15
  /** Comment lines are quoted so nothing a comment says can look like one of our headings. */
16
16
  const quote = (text: string): string =>
17
17
  text
18
+ .replace(/\r\n?|[\u2028\u2029\u0085]/g, "\n")
18
19
  .split("\n")
19
20
  .map((line) => (line === "" ? ">" : `> ${line}`))
20
21
  .join("\n");