Skip to content

Commit 8ab9594

Browse files
nullvariantclaude
andauthored
fix(git-id-switcher): use node: prefix for built-in modules (#155)
Use node: prefix for Node.js built-in modules to improve ESM compatibility. Changes: - secureExec.ts: node:child_process, node:util - All 27 test files: node:assert 🖥️ IDE: [Cursor](https://cursor.sh) 🔌 Extension: [Claude Code](https://claude.ai/download) Model-Raw: claude-opus-4-5-20251101 Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0405c0d commit 8ab9594

30 files changed

Lines changed: 42 additions & 31 deletions

extensions/git-id-switcher/CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.12.1] - 2026-01-14
11+
12+
### Internal
13+
14+
- **Code Quality Improvements**: Use `node:` prefix for Node.js built-in modules
15+
- `child_process``node:child_process` in secureExec.ts
16+
- `util``node:util` in secureExec.ts
17+
- `assert``node:assert` in all test files
18+
1019
## [0.12.0] - 2026-01-14
1120

1221
### Removed
@@ -1164,7 +1173,9 @@ This release includes comprehensive security hardening across multiple areas.
11641173
- `gitIdentitySwitcher.autoSwitchSshKey`: Auto SSH key switching
11651174
- `gitIdentitySwitcher.showNotifications`: Show switch notifications
11661175

1167-
[Unreleased]: https://github.com/nullvariant/nullvariant-vscode-extensions/compare/git-id-switcher-v0.11.3...HEAD
1176+
[Unreleased]: https://github.com/nullvariant/nullvariant-vscode-extensions/compare/git-id-switcher-v0.12.1...HEAD
1177+
[0.12.1]: https://github.com/nullvariant/nullvariant-vscode-extensions/compare/git-id-switcher-v0.12.0...git-id-switcher-v0.12.1
1178+
[0.12.0]: https://github.com/nullvariant/nullvariant-vscode-extensions/compare/git-id-switcher-v0.11.3...git-id-switcher-v0.12.0
11681179
[0.11.3]: https://github.com/nullvariant/nullvariant-vscode-extensions/compare/git-id-switcher-v0.11.2...git-id-switcher-v0.11.3
11691180
[0.11.2]: https://github.com/nullvariant/nullvariant-vscode-extensions/compare/git-id-switcher-v0.11.1...git-id-switcher-v0.11.2
11701181
[0.11.1]: https://github.com/nullvariant/nullvariant-vscode-extensions/compare/git-id-switcher-v0.11.0...git-id-switcher-v0.11.1

extensions/git-id-switcher/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "git-id-switcher",
33
"displayName": "%extension.displayName%",
44
"description": "%extension.description%",
5-
"version": "0.12.0",
5+
"version": "0.12.1",
66
"publisher": "nullvariant",
77
"icon": "images/icon.png",
88
"engines": {

extensions/git-id-switcher/src/secureExec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* @see https://nodejs.org/api/child_process.html#child_processexecfilefile-args-options-callback
1515
*/
1616

17-
import { execFile, ExecFileException } from 'child_process';
18-
import { promisify } from 'util';
17+
import { execFile, ExecFileException } from 'node:child_process';
18+
import { promisify } from 'node:util';
1919
import { isCommandAllowed } from './commandAllowlist';
2020
import { securityLogger, type ISecurityLogger } from './securityLogger';
2121
import { getWorkspace } from './vscodeLoader';

extensions/git-id-switcher/src/test/combinedFlagValidation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* rare in practice. The pre-normalization checks catch virtually all cases.
2626
*/
2727

28-
import * as assert from 'assert';
28+
import * as assert from 'node:assert';
2929
import { validateCombinedFlags } from '../flagValidator';
3030
import { isCommandAllowed } from '../commandAllowlist';
3131

extensions/git-id-switcher/src/test/commandAllowlist.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Tests the strict validation logic for command allowlisting.
55
*/
66

7-
import * as assert from 'assert';
7+
import * as assert from 'node:assert';
88
import { isCommandAllowed } from '../commandAllowlist';
99

1010
export async function runCommandAllowlistTests(): Promise<void> {

extensions/git-id-switcher/src/test/configChangeDetector.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
* Total: Comprehensive test coverage for all code paths including edge cases and error handling.
5757
*/
5858

59-
import * as assert from 'assert';
59+
import * as assert from 'node:assert';
6060
import {
6161
ConfigChangeDetector,
6262
configChangeDetector,

extensions/git-id-switcher/src/test/configSchema.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* - Schema validation edge cases
1111
*/
1212

13-
import * as assert from 'assert';
13+
import * as assert from 'node:assert';
1414
import {
1515
validateIdentitySchema,
1616
validateIdentitiesSchema,

extensions/git-id-switcher/src/test/documentation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* resolveRelativePath, getDocumentDisplayName, escapeHtmlEntities
4141
*/
4242

43-
import * as assert from 'assert';
43+
import * as assert from 'node:assert';
4444
import {
4545
sanitizeHtml,
4646
escapeHtmlEntities,

extensions/git-id-switcher/src/test/e2e/documentation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* - Test panel lifecycle (creation, close, re-creation)
4040
*/
4141

42-
import * as assert from 'assert';
42+
import * as assert from 'node:assert';
4343
import * as vscode from 'vscode';
4444

4545
const EXTENSION_ID = 'nullvariant.git-id-switcher';

extensions/git-id-switcher/src/test/e2e/extension.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Note: These tests use the real VS Code API (no mocks) to ensure actual behavior.
1717
*/
1818

19-
import * as assert from 'assert';
19+
import * as assert from 'node:assert';
2020
import * as vscode from 'vscode';
2121

2222
const EXTENSION_ID = 'nullvariant.git-id-switcher';

0 commit comments

Comments
 (0)