Skip to content

Commit 46d570e

Browse files
authored
Merge branch 'main' into main
2 parents e41a04a + 16f5dd0 commit 46d570e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2477
-179
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1515
with:
1616
fetch-depth: 0
1717

1818
- name: Set up Node.js
19-
uses: actions/setup-node@v2
19+
uses: actions/setup-node@v5
2020
with:
21-
node-version: '18.0.0'
21+
node-version: '20.0.0'
2222

2323
- name: Install Dependencies
2424
run: npm install

.github/workflows/prettify_code.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212

1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616
with:
1717
ref: ${{ github.head_ref }}
1818
fetch-depth: 0
1919

2020
- name: Prettify code
21-
uses: creyD/prettier_action@v4.3
21+
uses: creyD/prettier_action@v4.6
2222
with:
2323
# This part is also where you can pass other options, for example:
2424
prettier_version: 2.8.8

.github/workflows/vale-lint-action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
reporter: github-pr-check
1919
# Fails the action if there are errors
2020
fail_on_error: true
21-
# Lint the files in the "versioned_docs/version-2.0.0/" directory
22-
files: 'versioned_docs/version-2.0.0'
21+
# Lint the files in the "versioned_docs/version-3.0.0/" directory
22+
files: 'versioned_docs/version-3.0.0'
2323
# Specify the Vale version
2424
version: 3.0.3
2525
env:

docs/hacktoberfest/contribution-guide.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ If you’ve ever wanted to contribute to open source, now is your chance! You ca
1919
Anyone around the globe who desires to help drive the growth of open source and make positive contributions to an ever-growing community. All backgrounds and skill levels are encouraged to participate.
2020

2121
- Code Contributribution to Keploy Projects includes:
22-
2322
- Bug fixes
2423
- New features
2524
- Design

src/components/CollapsibleCode.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import React, {useState} from "react";
2+
import CodeBlock from "@theme/CodeBlock";
3+
4+
export default function CollapsibleCode({
5+
code,
6+
language = "json",
7+
previewLines = 10,
8+
}) {
9+
const [expanded, setExpanded] = useState(false);
10+
const codeLines = code.trim().split("\n");
11+
const visibleCode = expanded
12+
? code.trim()
13+
: codeLines.slice(0, previewLines).join("\n") + "\n# ...";
14+
15+
const handleCopy = () => {
16+
try {
17+
navigator.clipboard.writeText(code.trim());
18+
const btn = document.getElementById("copy-full-code");
19+
if (btn) {
20+
const originalText = btn.innerText;
21+
btn.innerText = "Copied!";
22+
setTimeout(() => (btn.innerText = originalText), 2000);
23+
}
24+
} catch (err) {
25+
console.error("Failed to copy code:", err);
26+
}
27+
};
28+
29+
return (
30+
<div className="margin-vert--md">
31+
{/* Pass the full code to CodeBlock so default copy button works */}
32+
<CodeBlock language={language}>{visibleCode}</CodeBlock>
33+
34+
<div
35+
style={{
36+
display: "flex",
37+
gap: "10px",
38+
justifyContent: "flex-end",
39+
marginTop: "-8px", // Pulls buttons closer to code block
40+
}}
41+
>
42+
{codeLines.length > previewLines && (
43+
<button
44+
onClick={() => setExpanded(!expanded)}
45+
className="button button--sm button--secondary"
46+
>
47+
{expanded ? "Show Less" : "Show More"}
48+
</button>
49+
)}
50+
<button
51+
id="copy-full-code"
52+
onClick={handleCopy}
53+
className="button button--sm button--primary"
54+
>
55+
Copy
56+
</button>
57+
</div>
58+
</div>
59+
);
60+
}

src/css/custom.css

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,137 @@ h4,
136136
display: flex;
137137
}
138138
.menu__link--sublist:after {
139+
/* Keep sidebar chevron size consistent with leaf items */
139140
background: var(--ifm-menu-link-sublist-icon) 50% / 1.5rem 1.5rem;
140141
}
141142

143+
/* Ensure category caret variants use the same icon size in the sidebar */
144+
div[class^="sidebar_"] .menu__link--sublist-caret:after {
145+
background: var(--ifm-menu-link-sublist-icon) 50% / 1.5rem 1.5rem;
146+
height: 1.5rem;
147+
min-width: 1.5rem;
148+
}
149+
div[class^="sidebar_"] .menu__caret:before {
150+
background: var(--ifm-menu-link-sublist-icon) 50% / 1.5rem 1.5rem;
151+
height: 1.5rem;
152+
width: 1.5rem;
153+
}
154+
142155
div[class^="sidebar_"]
143156
.menu__link.menu__link--active:not(.menu__link--sublist) {
144157
padding-right: calc(var(--ifm-menu-link-padding-horizontal) - 2px);
145158
}
146159

160+
/* Do not highlight category labels (that also have pages) as active; only leaf pages should be highlighted */
161+
div[class^="sidebar_"] .menu__link--sublist.menu__link--active {
162+
color: inherit !important;
163+
font-weight: inherit;
164+
}
165+
166+
/* Do NOT bold category when on its own page */
167+
div[class^="sidebar_"] .menu__list-item-collapsible--active .menu__link--sublist {
168+
color: inherit !important;
169+
font-weight: inherit;
170+
}
171+
/* And keep color unchanged even on hover when on its own page */
172+
div[class^="sidebar_"] .menu__list-item-collapsible--active .menu__link--sublist:hover {
173+
color: inherit !important;
174+
}
175+
176+
/* Explicitly neutralize color when category link is both sublist and active (own page) */
177+
div[class^="sidebar_"] .menu__list-item-collapsible--active .menu__link--sublist.menu__link--active {
178+
color: inherit !important;
179+
}
180+
181+
/* When the category's own page is current, do not change its color/background/weight */
182+
div[class^="sidebar_"] .menu__list-item-collapsible .menu__link[aria-current="page"] {
183+
color: inherit !important;
184+
background: transparent !important;
185+
font-weight: inherit !important;
186+
}
187+
div[class^="sidebar_"] .menu__list-item-collapsible .menu__link[aria-current="page"]:hover,
188+
div[class^="sidebar_"] .menu__list-item-collapsible .menu__link[aria-current="page"]:focus,
189+
div[class^="sidebar_"] .menu__list-item-collapsible .menu__link[aria-current="page"].menu__link--active {
190+
color: inherit !important;
191+
/* prevent extra link-layer background; container provides unified hover */
192+
background-color: transparent !important;
193+
font-weight: inherit !important;
194+
}
195+
196+
/* Strong override: category with its own current page should use normal menu color (not active black) */
197+
div[class^="sidebar_"] .menu__link--sublist.menu__link--active[aria-current="page"] {
198+
color: var(--ifm-menu-color) !important;
199+
}
200+
201+
/* Extra-specific guard: ensure normal color for category labels on their own page */
202+
div[class^="sidebar_"] li.menu__list-item > a.menu__link.menu__link--sublist[aria-current="page"],
203+
div[class^="sidebar_"] li.menu__list-item > a.menu__link.menu__link--sublist[aria-current="page"].menu__link--active,
204+
div[class^="sidebar_"] li.menu__list-item > div.menu__list-item-collapsible > a.menu__link.menu__link--sublist[aria-current="page"] {
205+
color: var(--ifm-menu-color) !important;
206+
background: transparent !important;
207+
font-weight: inherit !important;
208+
}
209+
210+
/* Restore hover background for categories with their own page when hovering that link */
211+
div[class^="sidebar_"] li.menu__list-item > a.menu__link.menu__link--sublist[aria-current="page"]:hover,
212+
div[class^="sidebar_"] li.menu__list-item > div.menu__list-item-collapsible > a.menu__link.menu__link--sublist[aria-current="page"]:hover {
213+
/* prevent extra link-layer hover; container provides unified hover */
214+
background-color: transparent !important;
215+
}
216+
217+
/* Unify hover background for text + caret (arrow) when category has its own page */
218+
/* Use unified hover on container; clear child backgrounds to prevent double overlays */
219+
div[class^="sidebar_"] .menu__list-item-collapsible--active:hover {
220+
background-color: var(--ifm-menu-color-background-hover) !important;
221+
}
222+
div[class^="sidebar_"] .menu__list-item-collapsible--active:hover > a.menu__link,
223+
div[class^="sidebar_"] .menu__list-item-collapsible--active:hover > .menu__caret {
224+
background-color: transparent !important;
225+
}
226+
227+
/* For categories with pages (collapsible) when NOT on their page: hover on arrow OR text gives one unified background */
228+
div[class^="sidebar_"] .menu__list-item-collapsible:not(.menu__list-item-collapsible--active):hover {
229+
background-color: var(--ifm-menu-color-background-hover) !important;
230+
}
231+
div[class^="sidebar_"] .menu__list-item-collapsible:not(.menu__list-item-collapsible--active):hover > a.menu__link,
232+
div[class^="sidebar_"] .menu__list-item-collapsible:not(.menu__list-item-collapsible--active):hover > .menu__caret {
233+
background-color: transparent !important;
234+
}
235+
/* Ensure link text color does not change on hover in this specific case */
236+
div[class^="sidebar_"] .menu__list-item-collapsible--active:hover > a.menu__link {
237+
color: inherit !important;
238+
}
239+
240+
/* Remove background highlight when category's own page is active; keep hover behavior */
241+
div[class^="sidebar_"] .menu__list-item-collapsible--active {
242+
background: transparent !important;
243+
}
244+
245+
246+
/* Parent style when a child page is active is handled below for light mode (orange) */
247+
248+
/* Light mode: use orange color (no bold) for parent when a child page is active */
249+
html[data-theme="light"] div[class^="sidebar_"] .menu__list-item-collapsible:not(.menu__list-item-collapsible--active) .menu__link--sublist.menu__link--active {
250+
color: var(--ifm-color-primary) !important;
251+
font-weight: inherit;
252+
}
253+
147254
div[class^="sidebar_"] .button {
148255
@apply mx-auto mb-2 w-full border-0;
149256
}
150257
div[class^="sidebar_"] .button svg {
151258
@apply mx-auto;
152259
}
153260

261+
/* Prevent descenders (g, y, p) from clipping in sidebar, including when bold/active */
262+
div[class^="sidebar_"] .menu__link {
263+
line-height: 1.5;
264+
padding-bottom: calc(var(--ifm-menu-link-padding-vertical) + 1px);
265+
}
266+
div[class^="sidebar_"] .menu__link.menu__link--active {
267+
line-height: 1.5; /* ensure active/bold state also has enough leading */
268+
}
269+
154270
.table-of-contents {
155271
@apply border-none pt-12;
156272
}

versioned_docs/version-1.0.0/concepts/what-is-a-keploy-sdk.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ keywords:
1414
A Keploy SDK is a language-specific library that offers APIs to do the following:
1515

1616
1. Capture all the network calls like
17-
1817
- API Request
1918
- Dependency calls
2019
- API Response

versioned_docs/version-1.0.0/hacktoberfest/contribution-guide.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ If you’ve ever wanted to contribute to open source, now is your chance! You ca
1919
Anyone around the globe who desires to help drive the growth of open source and make positive contributions to an ever-growing community. All backgrounds and skill levels are encouraged to participate.
2020

2121
- Code Contributribution to Keploy Projects includes:
22-
2322
- Bug fixes
2423
- New features
2524
- Design

versioned_docs/version-1.0.0/java/integration.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,13 @@ Sync dependencies or to _build.gradle_:
3434
compile 'io.keploy:keploy-sdk:1.0.13'
3535

3636
2. Install Keploy Jar
37-
3837
- Download the latest jar from [here](https://search.maven.org/artifact/io.keploy/keploy-sdk/1.2.6/jar) (eg: 1.2.6) to mock external/internal dependency calls like DB queries, GMaps, S3 etc..
39-
4038
- Add the jar into the `main` directory
41-
4239
- Add `-javaagent:` prefix with absolute classpath of Keploy jar downloaded above
4340

4441
(For example: `-javaagent:/Users/jhon/project/src/main/agent-1.2.5.jar`)
4542

4643
You can set this through 3 ways:-
47-
4844
1. {'<'}details{'>'}{'<'}summary{'>'}
4945
Using Intellij
5046
{'<'}/summary{'>'}
@@ -75,7 +71,6 @@ Sync dependencies or to _build.gradle_:
7571
## Supported Frameworks
7672
7773
- **For Spring based application**
78-
7974
- Add `@Import(KeployMiddleware.class)` below `@SpringBootApplication` in your main class.
8075
8176
```java
@@ -93,7 +88,6 @@ Sync dependencies or to _build.gradle_:
9388
```
9489
9590
- **For Java EE application**
96-
9791
- Specify the below filter above all other filters and servlets in the **web.xml** file.
9892
9993
```xml
@@ -109,7 +103,6 @@ Sync dependencies or to _build.gradle_:
109103
```
110104
111105
- **Configure Environment Variables** (optional)
112-
113106
- `APP_NAME` (default APP_NAME = myApp)
114107
- `APP_PORT` (default APP_PORT = 6789)
115108
- `KEPLOY_URL` (default KEPLOY_URL = localhost:6789/api)

versioned_docs/version-1.0.0/java/quickstart/spring-sql.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,12 @@ Sync dependencies or to _build.gradle_:
3939
2. Install Keploy Jar
4040

4141
- Download the latest jar from [here](https://search.maven.org/artifact/io.keploy/keploy-sdk/1.2.6/jar) (eg: 1.2.6) to mock external/internal dependency calls like DB queries, GMaps, S3 etc..
42-
4342
- Add the jar into the `main` directory
44-
4543
- **Copy** `-javaagent:` prefix with absolute classpath of Keploy jar downloaded above
4644

4745
(For example: `-javaagent:/Users/jhon/project/src/main/agent-1.2.5.jar`)
4846

4947
You can set this through 3 ways:-
50-
5148
1. {'<'}details{'>'}{'<'}summary{'>'}
5249
Using Intellij
5350
{'<'}/summary{'>'}
@@ -181,12 +178,10 @@ _NOTE: You will be required to set the `javaagent` again in your test profile ju
181178
```
182179

183180
- **Using IDE:** _(for local use-case we prefer running tests via IDE)_
184-
185181
1. Run your application.
186182
2. You can also run the application with coverage to see the test coverage.
187183

188184
- **Using CLI**
189-
190185
1. Add maven-surefire-plugin to your `pom.xml`. In `<argLine > </ argLine >` **don't** add jacoco agent if you don't want coverage report.
191186

192187
{'<'}details{'>'}{'<'}summary{'>'}
@@ -214,9 +209,7 @@ _NOTE: You will be required to set the `javaagent` again in your test profile ju
214209
</plugin>
215210
```
216211

217-
{'<'}/details{'>'}
218-
219-
2. If you want coverage report also add Jacoco plugin to your _pom.xml_.
212+
{'<'}/details{'>'} 2. If you want coverage report also add Jacoco plugin to your _pom.xml_.
220213

221214
{'<'}details{'>'}{'<'}summary{'>'}
222215
Add plugin
@@ -259,9 +252,7 @@ _NOTE: You will be required to set the `javaagent` again in your test profile ju
259252
</plugin>
260253
```
261254

262-
{'<'}/details{'>'}
263-
264-
3. Run your tests using command : `mvn test`.
255+
{'<'}/details{'>'} 3. Run your tests using command : `mvn test`.
265256

266257
It will create .html files as test-reports which can be found in your target folder !!
267258

0 commit comments

Comments
 (0)