Skip to content

Commit 45ae995

Browse files
authored
Merge pull request #21 from VU-ASE/docs/rovercom-typescript
Added docs about installing rovercom for typescript
2 parents c1d6569 + 64fa286 commit 45ae995

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

docs/02-installation.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,33 @@ You can find the transpiled C header and source files in our repository [here](h
4444
</TabItem>
4545
<TabItem value="roverlib-typescript" label="TypeScript">
4646

47+
We recommend using `bun` to install `rovercom` from our repository directly. You can do so by running:
48+
49+
```bash
50+
# Install lateset version
51+
bun add "github:VU-ASE/rovercom"
52+
# Install a specific version
53+
bun add "github:VU-ASE/rovercom#v2.0.0"
54+
```
55+
56+
Then, add the following postinstall script to your _package.json_ file:
57+
58+
```json
59+
...
60+
"scripts": {
61+
"postinstall": "cp -r node_modules/rovercom/packages/typescript/. node_modules/rovercom-temp && rm -rf node_modules/rovercom && mv node_modules/rovercom-temp node_modules/rovercom",
62+
...
63+
```
64+
65+
After installation, the package is available as `rovercom`. Which you can import like so:
66+
67+
```typescript
68+
// Import control types from rovercom
69+
import { ConnectionState, ControlError } from 'rovercom/gen/control/control';
70+
```
71+
72+
## Using `NPM` (legacy)
73+
4774
You can install `rovercom` as an NPM package for your TypeScript project as follows:
4875

4976
```bash

0 commit comments

Comments
 (0)