Skip to content

refactor: centralize Windows platform checks - #165

Merged
fengmk2 merged 2 commits into
voidzero-dev:mainfrom
naokihaba:refactor/157-centralize-windows-platform-checks
Sep 18, 2026
Merged

fengmk2 merged 2 commits into
voidzero-dev:mainfrom
naokihaba:refactor/157-centralize-windows-platform-checks

Conversation

@naokihaba

Copy link
Copy Markdown
Collaborator

resolves: #157

Context

Windows platform checks, such as process.platform === "win32", were duplicated across multiple
modules. This PR extracts them into a shared isWindows helper.

Functions that accept an explicit platform value continue to pass it to the helper to keep
platform-dependent behavior easy to test.

@naokihaba naokihaba self-assigned this Sep 18, 2026
@naokihaba
naokihaba marked this pull request as ready for review September 18, 2026 02:23
@naokihaba

Copy link
Copy Markdown
Collaborator Author

@codex review

@naokihaba

naokihaba commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator Author

#165 (comment)
not working 😢

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review issues were identified.

Pull request overview

Centralizes Windows platform detection through a shared isWindows helper while preserving explicit platform testability.

Changes:

  • Adds and tests the shared helper.
  • Replaces duplicated Windows checks across source and tests.
  • Regenerates GitLab and Azure bundles.
File summaries
File Description
src/utils.ts Uses shared helper for home-directory selection.
src/run-install.ts Uses helper for Windows warm-up logic.
src/install-sfw.ts Uses helper for SFW behavior.
src/ci/vp-dirs.ts Uses helper for installer selection.
src/ci/vp-dirs.test.ts Updates platform-based skips.
src/ci/run-install.ts Uses helper for retry behavior.
src/ci/process.ts Uses helper for command lookup.
src/ci/process.test.ts Updates Windows-only test detection.
src/ci/platform.ts Adds shared Windows detection helper.
src/ci/platform.test.ts Tests platform detection.
src/ci/install-viteplus.ts Uses helper for paths and shell fallback.
src/ci/install-sfw.ts Uses helper for SFW assets and paths.
src/ci/install-script-urls.ts Uses helper for script selection.
src/ci/cache-snapshot.test.ts Updates Windows link handling.
dist/gitlab/index.mjs Regenerated GitLab bundle.
dist/azure/index.mjs Regenerated Azure bundle.
Review details
  • Files reviewed: 14/17 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@naokihaba
naokihaba requested a review from fengmk2 September 18, 2026 02:35
@fengmk2

fengmk2 commented Sep 18, 2026

Copy link
Copy Markdown
Member

@codex review

@fengmk2
fengmk2 merged commit 8ed2eee into voidzero-dev:main Sep 18, 2026
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: centralize Windows platform checks

3 participants