pi-usereq 0.4.0 → 0.5.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/.gitignore +3 -0
- package/CHANGELOG.md +31 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/{req → pi-usereq}/docs/REFERENCES.md +196 -159
- package/{req → pi-usereq}/docs/REQUIREMENTS.md +65 -44
- package/{req → pi-usereq}/docs/WORKFLOW.md +66 -73
- package/src/core/config.ts +39 -12
- package/src/core/extension-status.ts +94 -58
- package/src/core/pi-notify.ts +198 -11
- package/src/core/runtime-project-paths.ts +3 -32
- package/src/core/settings-menu.ts +9 -4
- package/src/core/static-check.ts +35 -171
- package/src/index.ts +281 -86
- package/tests/attended-results-scenarios.ts +3 -13
- package/tests/cli-command-option-parity.test.ts +21 -12
- package/tests/debug-extension-harness.test.ts +11 -7
- package/tests/extension-registration.test.ts +371 -71
- package/tests/oracle-project.test.ts +8 -3
- package/tests/oracle-standalone.test.ts +7 -13
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_c.c.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_cpp.cpp.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_csharp.cs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_elixir.ex.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_go.go.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_haskell.hs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_java.java.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_javascript.js.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_kotlin.kt.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_lua.lua.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_perl.pl.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_php.php.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_python.py.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_ruby.rb.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_rust.rs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_scala.scala.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_shell.sh.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_swift.swift.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_typescript.ts.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_zig.zig.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_c.c.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_cpp.cpp.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_csharp.cs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_elixir.ex.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_go.go.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_haskell.hs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_java.java.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_javascript.js.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_kotlin.kt.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_lua.lua.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_perl.pl.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_php.php.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_python.py.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_ruby.rb.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_rust.rs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_scala.scala.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_shell.sh.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_swift.swift.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_typescript.ts.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_zig.zig.json +0 -5
|
@@ -583,6 +583,14 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
583
583
|
assert.equal(result.status, 1);
|
|
584
584
|
assert.match(result.stderr, /not an executable program/);
|
|
585
585
|
assert.ok(!fs.existsSync(getProjectConfigPath(projectBase)));
|
|
586
|
+
|
|
587
|
+
const removedModule = runNodeCli(
|
|
588
|
+
["--base", projectBase, "--enable-static-check", "Python=Ruff"],
|
|
589
|
+
projectBase,
|
|
590
|
+
);
|
|
591
|
+
assert.equal(removedModule.status, 1);
|
|
592
|
+
assert.match(removedModule.stderr, /unknown module/i);
|
|
593
|
+
assert.ok(!fs.existsSync(getProjectConfigPath(projectBase)));
|
|
586
594
|
},
|
|
587
595
|
},
|
|
588
596
|
{
|
|
@@ -594,16 +602,19 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
594
602
|
"--base",
|
|
595
603
|
projectBase,
|
|
596
604
|
"--enable-static-check",
|
|
597
|
-
"Python=
|
|
605
|
+
"Python=Command,git,--version",
|
|
598
606
|
"--enable-static-check",
|
|
599
607
|
"C=Command,git,--version",
|
|
600
608
|
"--enable-static-check",
|
|
601
|
-
"Python=
|
|
609
|
+
"Python=Command,git,--help",
|
|
602
610
|
],
|
|
603
611
|
projectBase,
|
|
604
612
|
);
|
|
605
613
|
assert.equal(persisted.status, 0, persisted.stderr);
|
|
606
|
-
assert.deepEqual(getStaticCheckEntries(projectBase, "Python"), [
|
|
614
|
+
assert.deepEqual(getStaticCheckEntries(projectBase, "Python"), [
|
|
615
|
+
{ module: "Command", cmd: "git", params: ["--version"] },
|
|
616
|
+
{ module: "Command", cmd: "git", params: ["--help"] },
|
|
617
|
+
]);
|
|
607
618
|
assert.deepEqual(getStaticCheckEntries(projectBase, "C"), [{ module: "Command", cmd: "git", params: ["--version"] }]);
|
|
608
619
|
},
|
|
609
620
|
},
|
|
@@ -616,9 +627,9 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
616
627
|
"--base",
|
|
617
628
|
projectBase,
|
|
618
629
|
"--enable-static-check",
|
|
619
|
-
"Python=
|
|
630
|
+
"Python=Command,git,--version",
|
|
620
631
|
"--enable-static-check",
|
|
621
|
-
"Python=
|
|
632
|
+
"Python=Command,git,--version",
|
|
622
633
|
"--enable-static-check",
|
|
623
634
|
"C=Command,git,--version",
|
|
624
635
|
"--enable-static-check",
|
|
@@ -627,7 +638,7 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
627
638
|
projectBase,
|
|
628
639
|
);
|
|
629
640
|
assert.equal(result.status, 0, result.stderr);
|
|
630
|
-
assert.deepEqual(getStaticCheckEntries(projectBase, "Python"), [{ module: "
|
|
641
|
+
assert.deepEqual(getStaticCheckEntries(projectBase, "Python"), [{ module: "Command", cmd: "git", params: ["--version"] }]);
|
|
631
642
|
assert.deepEqual(getStaticCheckEntries(projectBase, "C"), [
|
|
632
643
|
{ module: "Command", cmd: "git", params: ["--version"] },
|
|
633
644
|
{ module: "Command", cmd: "git", params: ["--help"] },
|
|
@@ -641,7 +652,7 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
641
652
|
const preloaded = {
|
|
642
653
|
...config,
|
|
643
654
|
"static-check": {
|
|
644
|
-
Python: [{ module: "
|
|
655
|
+
Python: [{ module: "Dummy", meta: "debug-note" } as unknown as Record<string, unknown>],
|
|
645
656
|
JavaScript: [{ module: "Command", cmd: "git", params: ["--version"] }],
|
|
646
657
|
} as unknown as UseReqConfig["static-check"],
|
|
647
658
|
} as UseReqConfig;
|
|
@@ -651,9 +662,7 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
651
662
|
"--base",
|
|
652
663
|
projectBase,
|
|
653
664
|
"--enable-static-check",
|
|
654
|
-
"Python=
|
|
655
|
-
"--enable-static-check",
|
|
656
|
-
"Python=Ruff",
|
|
665
|
+
"Python=Command,git,--version",
|
|
657
666
|
"--enable-static-check",
|
|
658
667
|
"JavaScript=Command,git,--help",
|
|
659
668
|
],
|
|
@@ -661,8 +670,8 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
661
670
|
);
|
|
662
671
|
assert.equal(result.status, 0, result.stderr);
|
|
663
672
|
assert.deepEqual(getStaticCheckEntries(projectBase, "Python"), [
|
|
664
|
-
{ module: "
|
|
665
|
-
{ module: "
|
|
673
|
+
{ module: "Dummy" },
|
|
674
|
+
{ module: "Command", cmd: "git", params: ["--version"] },
|
|
666
675
|
]);
|
|
667
676
|
assert.deepEqual(getStaticCheckEntries(projectBase, "JavaScript"), [
|
|
668
677
|
{ module: "Command", cmd: "git", params: ["--version"] },
|
|
@@ -246,18 +246,21 @@ test("replaySessionStart captures active tools, statuses, and cwd semantics", as
|
|
|
246
246
|
assert.deepEqual([...report.activeTools].sort(), ["git-path", "static-check"]);
|
|
247
247
|
assert.equal(report.effectiveCtxCwd, projectBase);
|
|
248
248
|
assert.equal(report.effectiveProcessCwd, projectBase);
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
const normalizedBasePath = projectBase.split(path.sep).join("/");
|
|
250
|
+
assert.ok(
|
|
251
|
+
status.includes(
|
|
252
|
+
`<accent>base:</accent><warning>${normalizedBasePath}</warning><dim> • </dim><accent>docs:</accent><warning>pi-usereq/docs</warning><dim> • </dim><accent>src:</accent><warning>src</warning><dim> • </dim><accent>tests:</accent><warning>tests</warning>`,
|
|
253
|
+
),
|
|
252
254
|
);
|
|
253
255
|
assert.match(
|
|
254
256
|
status,
|
|
255
257
|
/<accent>context:<\/accent><bg-from-fg-accent><warning>CLEAR<\/warning><\/bg-from-fg-accent>/,
|
|
256
258
|
);
|
|
257
|
-
assert.match(status, /<accent>
|
|
258
|
-
assert.match(status, /<accent>
|
|
259
|
-
assert.match(status, /<accent>beep:<\/accent><warning>none<\/warning>/);
|
|
259
|
+
assert.match(status, /<accent>et:<\/accent><warning>▶idle,↻--:--,Σ--:--<\/warning>/);
|
|
260
|
+
assert.match(status, /<accent>beep:<\/accent><warning>end,esc,err<\/warning>/);
|
|
260
261
|
assert.match(status, /<accent>sound:<\/accent><warning>none<\/warning>/);
|
|
262
|
+
assert.doesNotMatch(status, /<accent>git:<\/accent>/);
|
|
263
|
+
assert.doesNotMatch(status, /<accent>tools:<\/accent>/);
|
|
261
264
|
assert.equal(report.ui.notifications.length, 0);
|
|
262
265
|
} finally {
|
|
263
266
|
fs.rmSync(projectBase, { recursive: true, force: true });
|
|
@@ -294,7 +297,8 @@ test("replayCommand captures interactive UI side effects", async () => {
|
|
|
294
297
|
|
|
295
298
|
assert.deepEqual(report.activeTools, []);
|
|
296
299
|
assert.ok(report.ui.notifications.some((entry) => entry.message === "Disabled all configurable active tools"));
|
|
297
|
-
assert.
|
|
300
|
+
assert.doesNotMatch(report.ui.statuses["pi-usereq"] ?? "", /<accent>tools:<\/accent>/);
|
|
301
|
+
assert.match(report.ui.statuses["pi-usereq"] ?? "", /<accent>et:<\/accent><warning>▶idle,↻--:--,Σ--:--<\/warning>/);
|
|
298
302
|
} finally {
|
|
299
303
|
fs.rmSync(projectBase, { recursive: true, force: true });
|
|
300
304
|
}
|