@jwilger/pi-development-system 0.3.7 → 0.3.8

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.3.7",
3
+ "version": "0.3.8",
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"
@@ -30,7 +30,10 @@ function splitLines(command: string): string[] {
30
30
  let quote: "'" | '"' | undefined;
31
31
  for (let i = 0; i < command.length; i++) {
32
32
  const ch = command.charAt(i);
33
- if (quote !== undefined) {
33
+ if (quote === '"' && ch === "\\") {
34
+ current += ch + command.charAt(i + 1);
35
+ i++;
36
+ } else if (quote !== undefined) {
34
37
  if (ch === quote) quote = undefined;
35
38
  current += ch;
36
39
  } else if (ch === "\\" && command.charAt(i + 1) === "\n") {
@@ -49,6 +49,15 @@ export function isTestPath(path: string, profile?: TestPathProfile): boolean {
49
49
  return (profile?.testGlobs ?? []).some((g) => matchGlob(g, normalized));
50
50
  }
51
51
 
52
+ /** A malformed `file://` URL is treated as the raw path rather than throwing out of a guard. */
53
+ function decodeFileUrl(url: string): string {
54
+ try {
55
+ return fileURLToPath(url);
56
+ } catch {
57
+ return url;
58
+ }
59
+ }
60
+
52
61
  /**
53
62
  * Repo-relative form of a path exactly as pi would resolve it: a leading `@` is dropped, `~` expands
54
63
  * to the home directory and `file://` URLs are decoded, so guards see the file that is really touched.
@@ -57,6 +66,6 @@ export function normalizeRepoPath(cwd: string, input: string, home: string): str
57
66
  let path = input.startsWith("@") ? input.slice(1) : input;
58
67
  if (path === "~") path = home;
59
68
  else if (path.startsWith("~/")) path = join(home, path.slice(2));
60
- else if (/^file:\/\//.test(path)) path = fileURLToPath(path);
69
+ else if (/^file:\/\//.test(path)) path = decodeFileUrl(path);
61
70
  return isAbsolute(path) ? relative(cwd, path) : relative(cwd, resolve(cwd, path)) || ".";
62
71
  }
@@ -6,7 +6,7 @@ export type WeakeningSignals = { addsSkip: boolean; emptied: boolean; commentedO
6
6
  const SKIP_MARKERS: readonly RegExp[] = [
7
7
  /\b(?:it|test|describe|context)\.(?:skip|only)\b/g,
8
8
  /\b(?:this|t|self|ctx)\.skip\(/g,
9
- /\bskip:\s*true\b/g,
9
+ /\bskip:\s*(?:true\b|["'`])/g,
10
10
  /\bskipTest\(/g,
11
11
  /(?<![.\w])f(?:it|describe)\(/g,
12
12
  /(?<![.\w])x(?:it|describe|test)\(/g,
@@ -130,7 +130,13 @@ function splitLines(command: string): string {
130
130
  let quote: "'" | '"' | undefined;
131
131
  for (let i = 0; i < command.length; i++) {
132
132
  const c = command.charAt(i);
133
- if (quote === undefined && c === "\\" && command.charAt(i + 1) === "\n") {
133
+ if (quote === undefined && c === "#" && (out === "" || /[\s;&|(]$/.test(out))) {
134
+ // A comment runs to the end of the line; keep the newline so the next command is still seen.
135
+ while (i + 1 < command.length && command.charAt(i + 1) !== "\n") i++;
136
+ } else if (quote === '"' && c === "\\") {
137
+ out += c + command.charAt(i + 1);
138
+ i++;
139
+ } else if (quote === undefined && c === "\\" && command.charAt(i + 1) === "\n") {
134
140
  out += " ";
135
141
  i++;
136
142
  } else if (quote === undefined && c === "\\") {