Skip to content

Commit 251e85e

Browse files
chore(release): prepare v3.1.0
Signed-off-by: night-slayer18 <samanuaia257@gmail.com>
1 parent 286dd03 commit 251e85e

3 files changed

Lines changed: 39 additions & 2 deletions

File tree

docs/releases.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
11
# Release Notes
22

3+
## v3.1.0
4+
5+
> **Release Date**: 2026-05-01
6+
> **Focus**: LeetCode China (leetcode.cn) Full Support + Credential UX
7+
8+
### 🌏 LeetCode China Support
9+
10+
- Full `leetcode.cn` integration across CLI and TUI.
11+
- New `LeetCodeSite` type with site utility helpers (`normalizeLeetCodeSiteInput`, `getLeetCodeSiteLabel`).
12+
- GraphQL query packs split into site-specific files (`queries.global.ts`, `queries.cn.ts`) — CN uses the correct native schema for problem list, daily, and problem detail.
13+
- CN-specific Zod schemas for type-safe response parsing.
14+
- CN response adapters that normalize China API responses into the shared CLI data model.
15+
- `LeetCodeClient` is now fully site-aware: switches base URL, query pack, and cookie headers automatically.
16+
- Site selection available in `login`, `config`, and `workspace` commands.
17+
- Site preference persisted per workspace in config file.
18+
- TUI Config screen: site switching with a mandatory confirmation modal that forces an immediate session logout and redirect to login.
19+
20+
### 🔐 Credential & Auth UX
21+
22+
- `leetcode login --help` now documents all three credential storage backends:
23+
1. **System Keychain** (default) — macOS/Windows/Linux OS-native secure storage via `keytar`.
24+
2. **Encrypted File** — AES-256-GCM via `LEETCODECLI_CREDENTIAL_BACKEND=file` + `LEETCODECLI_MASTER_KEY`.
25+
3. **Environment Variables** — read-only headless mode via `LEETCODE_SESSION` + `LEETCODE_CSRF_TOKEN`.
26+
- TUI site switch now correctly wipes the in-memory session (not just persisted config), ensuring users are immediately signed out and redirected to the login screen.
27+
28+
### 🧪 Test Stability
29+
30+
- Mocked `versionStorage` in update/changelog tests to prevent phantom `999.0.0` update cache leakage into real environments.
31+
- Mocked outbound `got` network requests in changelog tests to prevent rate-limit failures in CI.
32+
- All 283 tests pass cleanly across Node 20/22/24 on Ubuntu and macOS.
33+
34+
### ⚙️ CI
35+
36+
- CI and CodeQL workflows now also run on `dev` branch pushes.
37+
38+
---
39+
340
## v3.0.1
441

542
> **Release Date**: 2026-04-20

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@night-slayer18/leetcode-cli",
3-
"version": "3.0.1",
3+
"version": "3.1.0",
44
"description": "A modern LeetCode CLI built with TypeScript",
55
"type": "module",
66
"main": "dist/index.js",

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ program
6767
.name('leetcode')
6868
.usage('[command] [options]')
6969
.description(chalk.bold.cyan('🔥 A modern LeetCode CLI built with TypeScript'))
70-
.version('3.0.1', '-v, --version', 'Output the version number')
70+
.version('3.1.0', '-v, --version', 'Output the version number')
7171
.helpOption('-h, --help', 'Display help for command')
7272
.addHelpText(
7373
'after',

0 commit comments

Comments
 (0)