Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2f4078c
添加 lodash 依赖到 package.json 和 pnpm-lock.yaml
dp9u0 Aug 29, 2026
dc7b9ed
cache: add 24h TTL for problems list
dp9u0 Aug 30, 2026
3b34e4d
cache: purge user problem cache on every login method
dp9u0 Aug 30, 2026
11fe5bc
commands: size output columns to data
dp9u0 Aug 30, 2026
ce96e44
leetcode: stop reporting cloudflare 403 as session expired
dp9u0 Aug 30, 2026
95be16f
log: skip null/undefined args instead of crashing on toString
dp9u0 Aug 30, 2026
ee22186
leetcode: fix parseCookie call mismatch and crash on invalid cookie
dp9u0 Aug 30, 2026
750481e
leetcode: query userStatus for name/premium, surface fetch failures
dp9u0 Aug 30, 2026
81df37e
retry: skip auto relogin when no password is saved
dp9u0 Aug 30, 2026
147d748
stat: floor the calendar month label offset for Buffer.write
dp9u0 Aug 30, 2026
18e32b6
show: add -d/--daily for question of the day
dp9u0 Aug 30, 2026
f92a194
show: display official hints, include them in generated files
dp9u0 Aug 30, 2026
af69529
core: accept a full problem url as the keyword
dp9u0 Aug 30, 2026
042d8f5
deps: drop dead packages, modernize the stack
dp9u0 Aug 30, 2026
2d6acd7
deps: replace prompt with a readline-based helper
dp9u0 Aug 30, 2026
841771a
deps: eslint 5 -> 10 with an effective-rules flat config
dp9u0 Aug 30, 2026
4114862
cli: strip -v/-vv before yargs loads
dp9u0 Aug 30, 2026
a299ac3
deps: replace deprecated request with an axios-backed adapter
dp9u0 Aug 30, 2026
4b80105
show: render problem description and hints as plain text
dp9u0 Aug 30, 2026
fea5f5f
leetcode: fetch problem tags for -t filtering
dp9u0 Aug 30, 2026
d9dd335
cli: signal failures through the exit code
dp9u0 Aug 30, 2026
d357627
cache: mark solved problems, fix discuss solution url
dp9u0 Aug 30, 2026
92113ce
misc: drop the dead padLevels warning shim, use pnpm for plugins
dp9u0 Aug 30, 2026
8ffafee
security + sweep: private user.json, dead code, honest messages
dp9u0 Aug 30, 2026
a680c74
ci: lint and test on push via github actions
dp9u0 Aug 30, 2026
a4d2dc2
test: cover the command layer
dp9u0 Aug 30, 2026
35792c7
ci: build standalone binaries and release on main
dp9u0 Aug 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .eslintrc.js

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: ci

on:
push:
branches: [main, dev]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [20, 22, 24]
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm test

46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: release

on:
push:
branches: [main]

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- run: pnpm install --frozen-lockfile

- name: build standalone binaries
run: pnpm exec pkg . --out-path dist

- name: checksums
run: |
cd dist
for f in *; do sha256sum "$f" > "$f.sha256"; done

- name: create release
env:
GH_TOKEN: ${{ github.token }}
run: |
TAG="v$(node -p "require('./package.json').version")"
if git ls-remote --exit-code --tags origin "refs/tags/$TAG" > /dev/null; then
echo "tag $TAG already exists, skipping (bump version in package.json for a new release)"
exit 0
fi
gh release create "$TAG" dist/* \
--title "$TAG" \
--generate-notes
29 changes: 29 additions & 0 deletions 1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* @lc app=leetcode id=1 lang=javascript
*
* [1] Two Sum
*/

// @lc code=start
/**
* @param {number[]} nums
* @param {number} target
* @return {number[]}
*/
var twoSum = function(nums, target) {
let map = {};
for (var index = 0; index < nums.length; index++) {
var element = nums[index];
let rest = target - element;
if (map.hasOwnProperty(rest)) {
return [map[rest], index];
}
map[element] = index;
}
return [-1, -1];
};
/**
// TEST:
console.log(twoSum([2, 9, 4, 5], 7));
*/
// @lc code=end
9 changes: 0 additions & 9 deletions bin/leetcode
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
#!/usr/bin/env node

process.emitWarning = (function(original) {
return function(warning, type, code, ctor) {
if (type === 'DeprecationWarning' || (typeof warning === 'string' && warning.includes('padLevels'))) {
return;
}
return original.call(process, warning, type, code, ctor);
};
})(process.emitWarning);

require('../lib/cli').run();
1 change: 0 additions & 1 deletion docs/_config.yml

This file was deleted.

205 changes: 0 additions & 205 deletions docs/advanced.md

This file was deleted.

Loading
Loading