Skip to content

Commit d7d3831

Browse files
committed
point to @webxdc/types and use @webxdc/vite-plugins for emulator
1 parent d648feb commit d7d3831

File tree

4 files changed

+12
-510
lines changed

4 files changed

+12
-510
lines changed

README.md

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ Sample project with a simple implementation of the webxdc read and write APIs.
1212

1313
## Developing webxdc apps
1414

15-
Simply copy `webxdc.js` from this repo beside your `index.html` and you are ready to go
16-
to **develop and test your app in most browsers.**
15+
Include:
16+
```html
17+
<script src="https://cdn.jsdelivr.net/gh/webxdc/vite-plugins@latest/src/webxdc.js"></script>
18+
```
19+
in your `index.html` to use a webxdc emulator and you are ready to
20+
**develop and test your app in most browsers.**
1721

1822
Bundle your app using `./create-xdc.sh your-app-name`
1923
and **send it to your friends** 🙂
@@ -23,6 +27,11 @@ and **send it to your friends** 🙂
2327

2428
## Further Hints and Troubleshooting
2529

30+
### Type-checking
31+
32+
If you want to have type-checking you can use [@webxdc/types](https://github.com/webxdc/webxdc-types/) package, check:
33+
34+
https://github.com/webxdc/webxdc-types/
2635

2736
### Limitations
2837

@@ -34,24 +43,6 @@ bundle the app and test it in Delta Chat directly
3443
where all peers get their own `localStorage`.
3544
Alternatively, use the more advanced [webxdc-dev](https://github.com/webxdc/webxdc-dev) tool.
3645

37-
38-
### Type-checking and completion
39-
40-
If you are using VSCode you can have autocompletion and type-checking even without using TypeScript by adding these two lines to your JavaScript source files:
41-
42-
```js
43-
//@ts-check
44-
/** @typedef {import('./webxdc').Webxdc} Webxdc */
45-
```
46-
47-
Without VSCode you need to install TypeScript and then run the check manually.
48-
49-
```sh
50-
npm -g typescript
51-
tsc --noEmit --allowJs --lib es2016,dom webxdc.js # to check if types and simulator are in sync
52-
tsc --noEmit --allowJs --lib es2016,dom your_js_file.js
53-
```
54-
5546
### Developing in Safari
5647

5748
To use the devtool in safari you need to disable the local file restrictions

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<title>Hello</title>
55
<meta charset="utf-8"/>
66
<meta name="viewport" content="width=device-width"/>
7+
<script src="https://cdn.jsdelivr.net/gh/webxdc/vite-plugins@latest/src/webxdc.js"></script>
78
<script src="webxdc.js"></script>
89
<style type="text/css">
910
body {

webxdc.d.ts

Lines changed: 0 additions & 166 deletions
This file was deleted.

0 commit comments

Comments
 (0)