-
Notifications
You must be signed in to change notification settings - Fork 82
refactor: update to yarn@v4, migrate to vitest, switch to typescript, add tests #192
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
38b231b
chore: update to yarn@v4
MarshallOfSound 3158450
chore: migrate to vitest
MarshallOfSound 4642251
chore: rewrite in typescript
MarshallOfSound cadbe5f
chore: add more tests
MarshallOfSound 42bc31f
chore: remove unused dep and fix thingy
MarshallOfSound 07e0651
clean deps
MarshallOfSound 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| nodeLinker: node-modules | ||
|
|
||
| yarnPath: .yarn/releases/yarn-4.10.3.cjs |
This file was deleted.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| import { createServer } from "../test/helpers/create-server.js"; | ||
|
|
||
| async function main() { | ||
| const { address } = await createServer(); | ||
| console.log(`Server running at ${address}`); | ||
| } | ||
|
|
||
| main(); |
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 |
|---|---|---|
| @@ -1,29 +1,46 @@ | ||
| { | ||
| "name": "update.electronjs.org", | ||
| "private": true, | ||
| "type": "module", | ||
| "scripts": { | ||
| "start": "nodemon bin/update-server.js", | ||
| "start-test-server": "cross-env NODE_ENV=test nodemon bin/test-update-server.js", | ||
| "lint": "prettier --check '**/*.js'", | ||
| "prettier": "prettier --write '**/*.js'", | ||
| "test": "npm run lint && cross-env NODE_ENV=test nyc tap test/*.js" | ||
| "build": "tsc", | ||
| "start": "node dist/bin/update-server.js", | ||
| "start-test-server": "cross-env NODE_ENV=test node dist/bin/test-update-server.js", | ||
| "lint": "prettier --check '**/*.{js,ts}' --ignore-path .gitignore", | ||
| "prettier": "prettier --write '**/*.{js,ts}' --ignore-path .gitignore", | ||
| "typecheck": "tsc --noEmit", | ||
| "test": "npm run lint && npm run typecheck && cross-env NODE_ENV=test vitest run", | ||
| "test:watch": "cross-env NODE_ENV=test vitest watch", | ||
| "test:ui": "cross-env NODE_ENV=test vitest --ui", | ||
| "test:coverage": "cross-env NODE_ENV=test vitest run --coverage" | ||
| }, | ||
| "dependencies": { | ||
| "dotenv-safe": "^8.2.0", | ||
| "dotenv": "^17.2.3", | ||
| "dotenv-safe": "^9.1.0", | ||
| "ms": "^2.1.3", | ||
| "pino": "^8.12.1", | ||
| "redis": "^4.6.6", | ||
| "redlock": "^3.1.2", | ||
| "redis": "^5.8.3", | ||
| "redlock": "^4.2.0", | ||
| "request-ip": "^3.3.0", | ||
| "semver": "^7.5.2" | ||
| }, | ||
| "devDependencies": { | ||
| "@tsconfig/node22": "^22.0.2", | ||
| "@types/dotenv-safe": "^9.1.0", | ||
| "@types/ms": "^2.1.0", | ||
| "@types/node": "^24.6.2", | ||
| "@types/node-fetch": "^2.6.13", | ||
| "@types/redlock": "^4.0.7", | ||
| "@types/request-ip": "^0.0.41", | ||
| "@types/semver": "^7.7.1", | ||
| "@vitest/coverage-v8": "^3.2.4", | ||
| "@vitest/ui": "^3.2.4", | ||
| "cross-env": "^7.0.3", | ||
| "nock": "^13.3.1", | ||
| "node-fetch": "2.6.9", | ||
| "nodemon": "^3.0.1", | ||
| "nyc": "^15.1.0", | ||
| "prettier": "^2.8.8", | ||
| "tap": "^16.3.4" | ||
| } | ||
| "typescript": "^5.9.3", | ||
| "vitest": "^3.2.4" | ||
| }, | ||
| "packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f" | ||
| } | ||
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 was deleted.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| export const PLATFORM = { | ||
| WIN32: "win32", | ||
| DARWIN: "darwin", | ||
| } as const; | ||
|
|
||
| export const PLATFORM_ARCH = { | ||
| DARWIN_X64: "darwin-x64", | ||
| DARWIN_ARM64: "darwin-arm64", | ||
| DARWIN_UNIVERSAL: "darwin-universal", | ||
| WIN_X64: "win32-x64", | ||
| WIN_IA32: "win32-ia32", | ||
| WIN_ARM64: "win32-arm64", | ||
| } as const; | ||
|
|
||
| export type Platform = (typeof PLATFORM)[keyof typeof PLATFORM]; | ||
| export type PlatformArch = (typeof PLATFORM_ARCH)[keyof typeof PLATFORM_ARCH]; | ||
|
|
||
| export const ENV = process.env.NODE_ENV || "development"; | ||
|
|
||
| export const PLATFORM_ARCHS: readonly PlatformArch[] = | ||
| Object.values(PLATFORM_ARCH); |
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.