-
-
Notifications
You must be signed in to change notification settings - Fork 181
docs: add npm registry note for OpenCode #586
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,10 @@ describe("UsageDocPage - 目录/快速链接交互", () => { | |
| writable: true, | ||
| }); | ||
|
|
||
| document.cookie = "auth-token=test-token"; | ||
| Object.defineProperty(document, "cookie", { | ||
| configurable: true, | ||
| get: () => "auth-token=test-token", | ||
| }); | ||
|
Comment on lines
+65
to
+68
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
|
|
||
| const { unmount } = await renderWithIntl("en", <UsageDocPage />); | ||
|
|
||
|
|
@@ -73,6 +76,8 @@ describe("UsageDocPage - 目录/快速链接交互", () => { | |
| expect(dashboardLink).not.toBeNull(); | ||
|
|
||
| await unmount(); | ||
|
|
||
| Reflect.deleteProperty(document, "cookie"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }); | ||
|
|
||
| test("目录项点击后应触发平滑滚动", async () => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this change is correct, I noticed that the entire
npminstallation section, including this new note, is duplicated for Windows (here) and for macOS/Linux (around line 1049). This duplication can make future updates more difficult and error-prone.To improve maintainability, consider refactoring the
npminstallation UI into a separate component that accepts the shell language (powershellorbash) as a prop. This would centralize the logic and markup for this section.For example:
While a full refactor is outside the scope of this PR, it's a good improvement to keep in mind for the future.