{"id":13665279,"url":"https://github.com/sn99/wasm-template-rust","last_synced_at":"2025-03-26T23:31:01.940Z","repository":{"id":38320501,"uuid":"240769272","full_name":"sn99/wasm-template-rust","owner":"sn99","description":"A wasm 🕸 template for Rust 🦀 to publish to gh-pages without npm-deploy","archived":false,"fork":false,"pushed_at":"2023-09-29T05:59:53.000Z","size":156,"stargazers_count":118,"open_issues_count":0,"forks_count":20,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-22T17:22:38.432Z","etag":null,"topics":["deploy","gh-pages","github-page","rust","template","wasm","wasm-template"],"latest_commit_sha":null,"homepage":"https://sn99.github.io/wasm-template-rust/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sn99.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-15T18:43:22.000Z","updated_at":"2025-03-10T15:42:48.000Z","dependencies_parsed_at":"2024-10-30T07:41:48.328Z","dependency_job_id":null,"html_url":"https://github.com/sn99/wasm-template-rust","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sn99%2Fwasm-template-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sn99%2Fwasm-template-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sn99%2Fwasm-template-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sn99%2Fwasm-template-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sn99","download_url":"https://codeload.github.com/sn99/wasm-template-rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245753877,"owners_count":20666828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deploy","gh-pages","github-page","rust","template","wasm","wasm-template"],"created_at":"2024-08-02T06:00:31.662Z","updated_at":"2025-03-26T23:31:01.596Z","avatar_url":"https://github.com/sn99.png","language":"Rust","funding_links":[],"categories":["开发工具 Development tools"],"sub_categories":["部署 Deployment"],"readme":"# Wasm template for Rust hosting without npm-deploy on github pages using Travis script\n\n**Featured on [This Week in Rust 327](https://this-week-in-rust.org/blog/2020/02/25/this-week-in-rust-327/)**\n\nLast updated: 29th-September-2023\n\n[![Build Status](https://app.travis-ci.com/sn99/wasm-template-rust.svg?branch=master)](https://app.travis-ci.com/sn99/wasm-template-rust)\n\nIt automatically hosts you wasm projects on gh-pages using a travis script on the latest commit.\n\n## Requirements\n- [`rust-toolchain`](https://www.rust-lang.org/tools/install)\n- [`wasm-pack`](https://rustwasm.github.io/wasm-pack/installer/)\n- [`npm`](https://www.npmjs.com/get-npm)\n\n\n## Steps : \n### For building :\n- [Download](https://codeload.github.com/sn99/wasm-template-rust/zip/master) the template as it is\n- Change [`Cargo.toml`](https://github.com/sn99/wasm-template-rust/blob/master/Cargo.toml) to suit yourself\n- Change [`www/package.json`](https://github.com/sn99/wasm-template-rust/blob/master/www/package.json) to suit yourself, also remember to change \n```json \n  \"dependencies\": {\n    \"wasm-template-rust\": \"file:../pkg\"\n  },\n```\nInto : \n```json \n  \"dependencies\": {\n    \"YOUR-PROJECT-NAME-SAME-AS-IN-CARGO.toml\": \"file:../pkg\"\n  },\n``` \n- Run `wasm-pack build` inside your project dictionary\n- Run `npm install` inside [`www`](https://github.com/sn99/wasm-template-rust/tree/master/www) folder\n- Next, modify [`www/index.js`](https://github.com/sn99/wasm-template-rust/blob/master/www/index.js) to import your `PROJECT` instead of the `wasm-template-rust` package\n- Again run `npm install` inside [`www`](https://github.com/sn99/wasm-template-rust/tree/master/www) folder (just to be sure)\n- Finally run `npm run start` inside [`www`](https://github.com/sn99/wasm-template-rust/tree/master/www) and visit http://localhost:8080 to see the results\n\n### For deployment :\nThe template comes with a preconfigured [`.travis.yml`](https://github.com/sn99/wasm-template-rust/blob/master/.travis.yml) but you will still need to :\n- Create a [new branch](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-and-deleting-branches-within-your-repository) by the name [`gh-pages`](https://github.com/sn99/wasm-template-rust/tree/gh-pages)\n- [Github pages](https://pages.github.com/) should be enabled by default but if not go to `Settings -\u003e GitHub Pages` and enable it on your `gh-pages` branch. You will also find the link to your to-be hosted page there\n- Make a [personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) (only the token no need for command line here)\n- Next we will need to put this token [into our travis](https://docs.travis-ci.com/user/deployment/pages/) settings, go to `more options -\u003e settings -\u003e Environment Variables` and enter the token `value` (the generated token code) and `name` as `GITHUB_TOKEN`, it should look like :\n![token](readme_resources/travis_token.png)\n\n### Additional : \n- Update [LICENSE-MIT](https://github.com/sn99/wasm-template-rust/blob/master/LICENSE-MIT) and [LICENSE-APACHE](https://github.com/sn99/wasm-template-rust/blob/master/LICENSE-APACHE) to reflect your name and year\n- Read [Rust and WebAssembly](https://rustwasm.github.io/docs/book/introduction.html) \n- Also read [wasm-pack](https://rustwasm.github.io/docs/wasm-pack/tutorials/hybrid-applications-with-webpack/index.html)\n- Also see [wasm-conway](https://github.com/sn99/wasm-conway) made using [Rust 🦀 and WebAssembly 🕸](https://rustwasm.github.io/docs/book/) hosted at [gh-pages](https://sn99.github.io/wasm-conway/)\n\n## License\n\nLicensed under either of these:\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n   https://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsn99%2Fwasm-template-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsn99%2Fwasm-template-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsn99%2Fwasm-template-rust/lists"}