Code Monkey home page Code Monkey logo

thruster-basic-template's Introduction

thruster-basic-template

A minimal template for starting a thruster website project with:

  • tests
  • coverage 100%
  • browser refresh

Help

  • First install cargo generate: cargo install --force cargo-generate
  • cargo generate --git https://github.com/ami44/thruster-basic-template.git --name myproject
  • cd myproject
  • fastmod -d . 'YOURORGANISATION' 'myorganisation'

delete lines above after clone

===============================

keep lines below after clone

{{project-name}}

Install

  • git clone https://github.com/YOURORGANISATION/{{project-name}}.git
  • cd {{project-name}}
  • cargo run
  • open http://localhost:4321

Develop

Watcher

  • install catflap + cargo-cmd + cargo-watch beforehand cargo install --force catflap cargo-cmd cargo-watch
  • export RUST_LOG=myapp=trace - optional trace|debug|info|warn|error
  • export PORT=4321 - optional, default 4321
  • cargo cmd watch_debug or cargo cmd watch (alias to watch_debug)

Liverelaod

Firefox, Chrome, Edge but your html must contain the tag <script src="http://127.0.0.1:35729/livereload.js"></script>

  • install nodejs beforehand
  • npm install nodemon -g to add cmd nodemon
  • npm install make-livereload -g to add cmd tiny-lr
  • tiny-lr start livereload server, port=35729
  • navigate to http://localhost:4321
  • nodemon --delay 3000ms --watch target/debug/myapp --exec 'curl --noproxy "*" http://localhost:35729/changed?files=index.html' (adapt delay according to your compilation time)

Test & coverage

Test only

  • cargo test
  • or nodemon -e rs --watch tests --exec 'carg test'

Tarpaulin (Linux only)

  • install pycobertura beforehand export http_proxy=https://user@mydomain:port && export https_proxy=https://user@mydomain:port && export HTTP_PROXY=https://user@mydomain:port && export HTTPS_PROXY=https://user@mydomain:port && sudo pip --verbose --proxy=https://user@mydomain:port install --upgrade pip setuptools setuptools_git pycobertura --verbose ref
  • install tarpaulin beforehand RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install --force cargo-tarpaulin ref
  • cargo tarpaulin --ignore-tests --out Xml
  • or nodemon -e rs --watch tests --exec 'cargo tarpaulin --ignore-tests --out Xml'
  • pycobertura show --format html --output coverage.html cobertura.xml && open coverage.html

thruster-basic-template's People

Contributors

ami44 avatar trezm avatar xcb6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

trezm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.