Skip to content

Commit 79cad31

Browse files
committed
Add docs on running examples on local files
1 parent 1365e13 commit 79cad31

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,25 @@ deno task test:cov # Get test coverage by running tests that hit "localhost"
9696
deno task test:ci # Run tests that hit "https://serpapi.com"
9797
```
9898

99+
## Run examples on local source files
100+
101+
To run [examples](./examples/) on your local source files, follow these steps.
102+
103+
1. Run `deno task npm` to build the files.
104+
2. Update the respective example's `package.json` to depend on the local
105+
`serpapi` module instead,
106+
```json
107+
{
108+
"dependencies": {
109+
"dotenv": "*",
110+
"serpapi": "../../../npm"
111+
},
112+
"scripts": {
113+
"start": "node example.js"
114+
}
115+
}
116+
```
117+
99118
## Update documentation
100119

101120
- Every exposed function must have associated JSDoc comments.
@@ -112,7 +131,8 @@ deno task docs:gen
112131
TypeScript types are generated from the backend code. Follow these steps to
113132
update the types.
114133

115-
1. Run `bundle exec rails sdk:generate_ts_types` in the backend repository.
134+
1. Run `bundle exec rails libraries:generate_ts_types` in the backend
135+
repository.
116136
2. Replace everything in `src/engines` with the generated files from
117137
`tmp/ts/engines`.
118138
3. Update `mod.ts` with the new engine exports from `tmp/ts/mod.ts`.

0 commit comments

Comments
 (0)