Skip to content

Give wasm a proper API, add a small example of how to use that library, and add codemirror to the demo site. #238

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

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
03c619f
Rearrange website directory and change webpack config
coolreader18 Dec 19, 2018
4c32693
Switch to using one workspace, move profile to root Cargo.toml
coolreader18 Dec 18, 2018
ca30ebc
Genericize the wasm lib to not be specifically for the demo
coolreader18 Dec 22, 2018
2ea9dca
Add example, change some stuff in the demo to align with example
coolreader18 Dec 23, 2018
d54d2b1
Make scripts executable
coolreader18 Dec 23, 2018
840c507
Improve UX for demo
coolreader18 Dec 23, 2018
ab23f2c
Use str.format for the demo
coolreader18 Dec 23, 2018
24507de
Re-add conflicting files
coolreader18 Dec 24, 2018
ffcd40b
Remove conflicting files
coolreader18 Dec 24, 2018
d1d9585
Change the instances of Fn(..) -> PyResult to a RustPyFunc trait alias
coolreader18 Dec 24, 2018
63b3f3e
Fix blanket impl of RustPyFunc
coolreader18 Dec 24, 2018
132930e
Allow passing closures from JS to python via `vars`
coolreader18 Dec 26, 2018
e0959b9
Implement error conversion for js_to_py
coolreader18 Dec 26, 2018
94d6a91
Fix js_to_py with JS `undefined`
coolreader18 Dec 26, 2018
c38796b
Add some documentation for functions on the demo site
coolreader18 Dec 26, 2018
877206d
Switch from shell to npm scripts for demo using webpack and @wasm-too…
coolreader18 Dec 27, 2018
2968982
Change README portion for compiling wasm
coolreader18 Dec 27, 2018
ada92d3
Add conflicting files
coolreader18 Dec 19, 2018
dfadd03
Remove (now outdated) previously conflicting files
coolreader18 Dec 27, 2018
396842e
Readd conflicting files
coolreader18 Dec 19, 2018
8303743
Remove RustPyFunc trait, just use Fn(..) everywhere
coolreader18 Dec 27, 2018
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/target
wasm/target
**/*.rs.bk
**/*.bytecode
__pycache__
Expand Down
157 changes: 80 additions & 77 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

language: rust

rust:
Expand All @@ -7,102 +6,106 @@ rust:
- nightly

script:
- cargo build --verbose --all
- cargo test --verbose --all
- cargo build --verbose --all
- cargo test --verbose --all

env:
# This is used to only capture the regular nightly test in allow_failures
- REGULAR_TEST=true
# This is used to only capture the regular nightly test in allow_failures
- REGULAR_TEST=true

cache: cargo

matrix:
include:
# To test the snippets, we use Travis' Python environment (because
# installing rust ourselves is a lot easier than installing Python)
- language: python
python: 3.6
cache:
pip: true
# Because we're using the Python Travis environment, we can't use
# the built-in cargo cacher
directories:
- /home/travis/.cargo
- target
env:
- TRAVIS_RUST_VERSION=stable
- REGULAR_TEST=false
script: tests/.travis-runner.sh
- language: python
python: 3.6
cache:
pip: true
# Because we're using the Python Travis environment, we can't use
# the built-in cargo cacher
directories:
- /home/travis/.cargo
- target
env:
- TRAVIS_RUST_VERSION=beta
- REGULAR_TEST=false
script: tests/.travis-runner.sh
- name: rustfmt
language: rust
rust: stable
cache: cargo
before_script:
- rustup component add rustfmt-preview
script:
# Code references the generated python.rs, so put something in
# place to make `cargo fmt` happy. (We use `echo` rather than
# `touch` because rustfmt complains about the empty file touch
# creates.)
- echo > parser/src/python.rs
- cargo fmt --all -- --check
env:
- REGULAR_TEST=false
- name: publish documentation
language: rust
rust: stable
cache: cargo
script:
- cargo doc --no-deps --all
if: branch = release
env:
- REGULAR_TEST=false
- name: WASM online demo
language: rust
rust: nightly
cache: cargo
install:
- nvm install node
- curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh # install wasm-pack
script:
- cd wasm
- bash release.sh
if: branch = release
env:
- REGULAR_TEST=false
allow_failures:
- rust: nightly
env: REGULAR_TEST=true
include:
# To test the snippets, we use Travis' Python environment (because
# installing rust ourselves is a lot easier than installing Python)
- language: python
python: 3.6
cache:
pip: true
# Because we're using the Python Travis environment, we can't use
# the built-in cargo cacher
directories:
- /home/travis/.cargo
- target
env:
- TRAVIS_RUST_VERSION=stable
- REGULAR_TEST=false
script: tests/.travis-runner.sh
- language: python
python: 3.6
cache:
pip: true
# Because we're using the Python Travis environment, we can't use
# the built-in cargo cacher
directories:
- /home/travis/.cargo
- target
env:
- TRAVIS_RUST_VERSION=beta
- REGULAR_TEST=false
script: tests/.travis-runner.sh
- name: rustfmt
language: rust
rust: stable
cache: cargo
before_script:
- rustup component add rustfmt-preview
script:
# Code references the generated python.rs, so put something in
# place to make `cargo fmt` happy. (We use `echo` rather than
# `touch` because rustfmt complains about the empty file touch
# creates.)
- echo > parser/src/python.rs
- cargo fmt --all -- --check
env:
- REGULAR_TEST=false
- name: publish documentation
language: rust
rust: stable
cache: cargo
script:
- cargo doc --no-deps --all
if: branch = release
env:
- REGULAR_TEST=false
- name: WASM online demo
language: rust
rust: nightly
cache: cargo
install:
- nvm install node
# install wasm-pack
- curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
script:
- cd wasm/demo
- npm install
- npm run dist
if: branch = release
env:
- REGULAR_TEST=false
allow_failures:
- rust: nightly
env: REGULAR_TEST=true

deploy:
- provider: pages
repo: RustPython/website
target-branch: master
local-dir: target/doc
skip-cleanup: true
github-token: $WEBSITE_GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
# Set in the settings page of your repository, as a secure variable
github-token: $WEBSITE_GITHUB_TOKEN
keep-history: true
on:
branch: release
- provider: pages
repo: RustPython/demo
target-branch: master
local-dir: wasm/app/dist
local-dir: wasm/demo/dist
skip-cleanup: true
github-token: $WEBSITE_GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
# Set in the settings page of your repository, as a secure variable
github-token: $WEBSITE_GITHUB_TOKEN
keep-history: true
on:
branch: release
Loading