@gotgenes/pi-permission-system 3.0.1 → 3.0.2

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
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.0.2](https://github.com/gotgenes/pi-permission-system/compare/v3.0.1...v3.0.2) (2026-05-03)
9
+
10
+
11
+ ### Documentation
12
+
13
+ * plan align test mock-cleanup and node:* default-export rules ([#35](https://github.com/gotgenes/pi-permission-system/issues/35)) ([480aa02](https://github.com/gotgenes/pi-permission-system/commit/480aa02183009a6693a6699948563345871f198d))
14
+ * **retro:** add retro notes for issue [#21](https://github.com/gotgenes/pi-permission-system/issues/21) ([c7aae09](https://github.com/gotgenes/pi-permission-system/commit/c7aae099a48e58506195d843de797a1ae45b723a))
15
+
8
16
  ## [3.0.1](https://github.com/gotgenes/pi-permission-system/compare/v3.0.0...v3.0.1) (2026-05-03)
9
17
 
10
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gotgenes/pi-permission-system",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Permission enforcement extension for the Pi coding agent.",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -1,4 +1,4 @@
1
- import { afterEach, describe, expect, test, vi } from "vitest";
1
+ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
2
2
 
3
3
  import type { PermissionState } from "../src/types.js";
4
4
 
@@ -20,10 +20,15 @@ import {
20
20
  findCompiledWildcardMatch,
21
21
  } from "../src/wildcard-matcher.js";
22
22
 
23
+ const mockedCompilePatterns = vi.mocked(compileWildcardPatterns);
23
24
  const mockedFindMatch = vi.mocked(findCompiledWildcardMatch);
24
25
 
26
+ beforeEach(() => {
27
+ mockedCompilePatterns.mockClear();
28
+ mockedFindMatch.mockReset();
29
+ });
30
+
25
31
  afterEach(() => {
26
- vi.clearAllMocks();
27
32
  vi.restoreAllMocks();
28
33
  });
29
34
 
@@ -2,9 +2,13 @@ import { join } from "node:path";
2
2
  import { afterEach, describe, expect, test, vi } from "vitest";
3
3
 
4
4
  // Mock node:os so tilde-expansion is deterministic across platforms.
5
- vi.mock("node:os", () => ({
6
- homedir: vi.fn(() => "/mock/home"),
7
- }));
5
+ vi.mock("node:os", () => {
6
+ const homedir = vi.fn(() => "/mock/home");
7
+ return {
8
+ homedir,
9
+ default: { homedir },
10
+ };
11
+ });
8
12
 
9
13
  import {
10
14
  formatExternalDirectoryAskPrompt,
@@ -1,4 +1,4 @@
1
- import { afterEach, describe, expect, test, vi } from "vitest";
1
+ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
2
2
 
3
3
  // Mock tool-input-preview collaborator before importing the module under test.
4
4
  vi.mock("../src/tool-input-preview.js", () => ({
@@ -22,8 +22,11 @@ import type { PermissionCheckResult } from "../src/types.js";
22
22
 
23
23
  const mockedFormatToolInput = vi.mocked(formatToolInputForPrompt);
24
24
 
25
+ beforeEach(() => {
26
+ mockedFormatToolInput.mockReset();
27
+ });
28
+
25
29
  afterEach(() => {
26
- vi.clearAllMocks();
27
30
  vi.restoreAllMocks();
28
31
  });
29
32
 
@@ -1,4 +1,4 @@
1
- import { afterEach, describe, expect, test, vi } from "vitest";
1
+ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
2
2
 
3
3
  // Mock logging collaborator before importing the module under test.
4
4
  vi.mock("../src/logging.js", () => ({
@@ -29,8 +29,11 @@ import type { PermissionCheckResult } from "../src/types.js";
29
29
 
30
30
  const mockedStringify = vi.mocked(safeJsonStringify);
31
31
 
32
+ beforeEach(() => {
33
+ mockedStringify.mockReset();
34
+ });
35
+
32
36
  afterEach(() => {
33
- vi.clearAllMocks();
34
37
  vi.restoreAllMocks();
35
38
  });
36
39