diff --git a/.github/workflows/release-webxdc.yml b/.github/workflows/release-webxdc.yml new file mode 100644 index 0000000..20a403e --- /dev/null +++ b/.github/workflows/release-webxdc.yml @@ -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 diff --git a/.github/workflows/simulator_types.yml b/.github/workflows/simulator_types.yml deleted file mode 100644 index be25baf..0000000 --- a/.github/workflows/simulator_types.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Are types and sim in sync? - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 14.x - uses: actions/setup-node@v1 - with: - node-version: 14.x - - name: install typescript - run: | - npm i -g typescript - - name: check if simulator (webxdc.js) and types (webxdc.d.ts) are in sync - run: | - tsc --noEmit --allowJs --lib es2016,dom webxdc.js diff --git a/README.md b/README.md index 793abfe..1bd60c3 100644 --- a/README.md +++ b/README.md @@ -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 + +``` +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** 🙂 @@ -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 @@ -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 diff --git a/index.html b/index.html index 594563e..d65cb4b 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ Hello +