Skip to content
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

point to @webxdc/types and use @webxdc/vite-plugins for emulator #61

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/release-webxdc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release Webxdc

on:
push:
tags:
- 'v*.*.*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build
run: |
./create-xdc.sh ${{ github.event.repository.name }}

- name: Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Auto-generated release
prerelease: ${{ contains(github.event.ref, '-beta') }}
fail_on_unmatched_files: true
files: ./*.xdc
23 changes: 0 additions & 23 deletions .github/workflows/simulator_types.yml

This file was deleted.

31 changes: 11 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ Sample project with a simple implementation of the webxdc read and write APIs.

## Developing webxdc apps

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

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

## Further Hints and Troubleshooting

### Type-checking

If you want to have type-checking you can use [@webxdc/types](https://github.com/webxdc/webxdc-types/) package, check:

https://github.com/webxdc/webxdc-types/

### Limitations

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


### Type-checking and completion

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:

```js
//@ts-check
/** @typedef {import('./webxdc').Webxdc} Webxdc */
```

Without VSCode you need to install TypeScript and then run the check manually.

```sh
npm -g typescript
tsc --noEmit --allowJs --lib es2016,dom webxdc.js # to check if types and simulator are in sync
tsc --noEmit --allowJs --lib es2016,dom your_js_file.js
```

### Developing in Safari

To use the devtool in safari you need to disable the local file restrictions
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<title>Hello</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width"/>
<script src="https://cdn.jsdelivr.net/gh/webxdc/vite-plugins@latest/src/webxdc.js"></script>
<script src="webxdc.js"></script>
Comment on lines +7 to 8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, that results to one 404 in all cases?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one of them will always succeed, if you are in DC the real thing will load while in the browser the emulator is used

<style type="text/css">
body {
Expand Down
166 changes: 0 additions & 166 deletions webxdc.d.ts

This file was deleted.

Loading