Skip to content

Commit cf39d50

Browse files
committed
fix: update README installation commands and correct test assertions for solution articles
1 parent 92ad02f commit cf39d50

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

.github/workflows/npm-publish.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
node-version: 20
1818
- run: npm ci
1919
- run: npm test
20+
- run: npm run build
2021

2122
publish-npm:
2223
needs: build
@@ -28,7 +29,7 @@ jobs:
2829
node-version: 20
2930
registry-url: https://registry.npmjs.org/
3031
- run: npm ci
31-
- run: npm publish
32+
- run: npm publish --access=public
3233
env:
3334
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
3435

@@ -37,3 +38,4 @@ jobs:
3738
with:
3839
token: ${{ secrets.GITHUB_TOKEN }}
3940
commit-message: "chore(release): update CHANGELOG.md and version"
41+
base: main

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@ The LeetCode MCP Server is a [Model Context Protocol (MCP)](https://modelcontext
2222

2323
```bash
2424
# Install from npm
25-
npm install mcp-server-leetcode -g
26-
27-
# Run the server with default settings (Global LeetCode site)
28-
mcp-server-leetcode
25+
npm install @jinzcdev/mcp-server-leetcode -g
2926

3027
# Run with China site configuration
31-
mcp-server-leetcode --site cn
28+
@jinzcdev/mcp-server-leetcode --site cn
3229

3330
# Run with authentication (for accessing private data)
34-
mcp-server-leetcode --site global --session <YOUR_LEETCODE_SESSION_COOKIE>
31+
@jinzcdev/mcp-server-leetcode --site global --session <YOUR_LEETCODE_SESSION_COOKIE>
3532
```
3633

3734
## Usage

tests/services/solution-services.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Credential, LeetCode, LeetCodeCN } from "leetcode-query";
22
import { describe, expect, it } from "vitest";
3-
import { LeetCodeCNService } from "../../src/services/leetcode-cn-service";
4-
import { LeetCodeGlobalService } from "../../src/services/leetcode-global-service";
3+
import { LeetCodeCNService } from "../../src/leetcode/leetcode-cn-service.js";
4+
import { LeetCodeGlobalService } from "../../src/leetcode/leetcode-global-service.js";
55

66
describe("LeetCode Solution Services", () => {
77
describe("LeetCodeGlobalService", () => {
@@ -20,7 +20,7 @@ describe("LeetCode Solution Services", () => {
2020

2121
expect(result).toBeDefined();
2222
expect(result.totalNum).toBeTypeOf("number");
23-
expect(Array.isArray(result.edges)).toBe(true);
23+
expect(Array.isArray(result.articles)).toBe(true);
2424
}, 30000);
2525

2626
it("should fetch solution articles with custom options", async () => {
@@ -35,9 +35,9 @@ describe("LeetCode Solution Services", () => {
3535

3636
expect(result).toBeDefined();
3737
expect(result.totalNum).toBeTypeOf("number");
38-
expect(Array.isArray(result.edges)).toBe(true);
38+
expect(Array.isArray(result.articles)).toBe(true);
3939

40-
expect(result.edges.length).toBeLessThanOrEqual(5);
40+
expect(result.articles.length).toBeLessThanOrEqual(5);
4141
}, 30000);
4242

4343
it("should handle errors properly for invalid slugs", async () => {
@@ -108,7 +108,7 @@ describe("LeetCode Solution Services", () => {
108108

109109
expect(result).toBeDefined();
110110
expect(result.totalNum).toBeTypeOf("number");
111-
expect(Array.isArray(result.edges)).toBe(true);
111+
expect(Array.isArray(result.articles)).toBe(true);
112112

113113
console.log(
114114
`Found ${result.totalNum} solutions for ${questionSlug} on CN`
@@ -127,9 +127,9 @@ describe("LeetCode Solution Services", () => {
127127

128128
expect(result).toBeDefined();
129129
expect(result.totalNum).toBeTypeOf("number");
130-
expect(Array.isArray(result.edges)).toBe(true);
130+
expect(Array.isArray(result.articles)).toBe(true);
131131

132-
expect(result.edges.length).toBeLessThanOrEqual(5);
132+
expect(result.articles.length).toBeLessThanOrEqual(5);
133133
}, 30000);
134134

135135
it("should handle errors properly for invalid slugs", async () => {

0 commit comments

Comments
 (0)