-
Notifications
You must be signed in to change notification settings - Fork 10
feat: add sfw input to wrap vp install with Socket Firewall Free #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
fengmk2
wants to merge
18
commits into
main
Choose a base branch
from
feat/sfw-input
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
112ee5f
feat: add sfw input to wrap vp install with Socket Firewall Free
fengmk2 fafe07a
test(ci): add test-sfw-blocks-malicious job using lodahs canary
fengmk2 c4df421
ci: limit test-sfw to ubuntu-latest, document sfw rustls TLS limitation
fengmk2 f5f2b16
feat(sfw): fall back to plain vp install on non-Linux with a warning
fengmk2 b3e3a58
chore: point sfw non-Linux warning at setup-vp tracker issue
fengmk2 4d71ec2
docs: point README sfw fallback note at setup-vp#73 tracker
fengmk2 b0bece4
docs(ci): collapse sfw-free issue references to setup-vp#73 tracker
fengmk2 f0618a4
docs: point isSfwSupported comment at setup-vp#73 tracker
fengmk2 d2ed525
test(ci): add test-sfw-package-managers covering pnpm/npm/yarn/bun
fengmk2 f13d0ba
test(ci): fix yarn job + promote bun to required
fengmk2 9fbb519
test(ci): force Yarn nodeLinker=node-modules so verify step is uniform
fengmk2 e6024b3
test(ci): merge test-sfw and test-sfw-package-managers into one matrix
fengmk2 aa92f44
ci+docs: address code-review findings on the matrix-merge diff
fengmk2 381ef2b
ci+src: handle PR #72 review comments
fengmk2 2e0144f
ci: only test latest vp release in test-sfw matrix
fengmk2 65e179d
ci: also drop alpha from test-sfw-alpine and test-sfw-blocks-malicious
fengmk2 b6a100f
ci: drop single-value version axis from sfw jobs entirely
fengmk2 c69ca6f
ci+src: fix code-review findings on commits since aa92f44
fengmk2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| import { describe, it, expect } from "vite-plus/test"; | ||
| import { getSfwAssetName, isSfwSupported } from "./install-sfw.js"; | ||
|
|
||
| describe("getSfwAssetName", () => { | ||
| it("returns macOS arm64 asset", () => { | ||
| expect(getSfwAssetName("darwin", "arm64", false)).toBe("sfw-free-macos-arm64"); | ||
| }); | ||
|
|
||
| it("returns macOS x64 asset", () => { | ||
| expect(getSfwAssetName("darwin", "x64", false)).toBe("sfw-free-macos-x86_64"); | ||
| }); | ||
|
|
||
| it("ignores isMusl on darwin", () => { | ||
| expect(getSfwAssetName("darwin", "arm64", true)).toBe("sfw-free-macos-arm64"); | ||
| expect(getSfwAssetName("darwin", "x64", true)).toBe("sfw-free-macos-x86_64"); | ||
| }); | ||
|
|
||
| it("returns Linux glibc arm64 asset", () => { | ||
| expect(getSfwAssetName("linux", "arm64", false)).toBe("sfw-free-linux-arm64"); | ||
| }); | ||
|
|
||
| it("returns Linux glibc x64 asset", () => { | ||
| expect(getSfwAssetName("linux", "x64", false)).toBe("sfw-free-linux-x86_64"); | ||
| }); | ||
|
|
||
| it("returns Linux musl arm64 asset", () => { | ||
| expect(getSfwAssetName("linux", "arm64", true)).toBe("sfw-free-musl-linux-arm64"); | ||
| }); | ||
|
|
||
| it("returns Linux musl x64 asset", () => { | ||
| expect(getSfwAssetName("linux", "x64", true)).toBe("sfw-free-musl-linux-x86_64"); | ||
| }); | ||
|
|
||
| it("returns Windows arm64 asset", () => { | ||
| expect(getSfwAssetName("win32", "arm64", false)).toBe("sfw-free-windows-arm64.exe"); | ||
| }); | ||
|
|
||
| it("returns Windows x64 asset", () => { | ||
| expect(getSfwAssetName("win32", "x64", false)).toBe("sfw-free-windows-x86_64.exe"); | ||
| }); | ||
|
|
||
| it("ignores isMusl on win32", () => { | ||
| expect(getSfwAssetName("win32", "x64", true)).toBe("sfw-free-windows-x86_64.exe"); | ||
| }); | ||
|
|
||
| it("throws on unsupported platform", () => { | ||
| expect(() => getSfwAssetName("freebsd" as NodeJS.Platform, "x64", false)).toThrow( | ||
| /freebsd\/x64/, | ||
| ); | ||
| }); | ||
|
|
||
| it("throws on unsupported arch", () => { | ||
| expect(() => getSfwAssetName("linux", "ia32", false)).toThrow(/linux\/ia32/); | ||
| }); | ||
|
|
||
| it("includes libc in error message for unsupported Linux arch", () => { | ||
| expect(() => getSfwAssetName("linux", "ia32", true)).toThrow(/musl/); | ||
| expect(() => getSfwAssetName("linux", "ia32", false)).toThrow(/glibc/); | ||
| }); | ||
| }); | ||
|
|
||
| describe("isSfwSupported", () => { | ||
| it("returns true on Linux, false elsewhere (matches current platform)", () => { | ||
| expect(isSfwSupported()).toBe(process.platform === "linux"); | ||
|
Comment on lines
+63
to
+64
|
||
| }); | ||
| }); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.