From ad49b6eb1d149c15bc25e36fcd15f5a4db1e14d5 Mon Sep 17 00:00:00 2001 From: mosure Date: Tue, 5 Mar 2024 23:16:58 -0600 Subject: [PATCH] feat: repository scaffold --- .cargo/config.toml | 17 +++++++ .devcontainer/Dockerfile | 20 +++++++++ .devcontainer/devcontainer.json | 33 ++++++++++++++ .devcontainer/docker-compose.yaml | 10 +++++ .gitattributes | 8 ++++ .github/dependabot.yml | 14 ++++++ .github/workflows/test.yml | 40 +++++++++++++++++ .github/workflows/todo_tracker.yml | 24 ++++++++++ .gitignore | 16 +++++++ .vscode/settings.json | 5 +++ Cargo.toml | 71 ++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++ README.md | 16 +++++++ examples/minimal.rs | 0 src/lib.rs | 0 15 files changed, 295 insertions(+) create mode 100644 .cargo/config.toml create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/docker-compose.yaml create mode 100644 .gitattributes create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/test.yml create mode 100644 .github/workflows/todo_tracker.yml create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 Cargo.toml create mode 100644 LICENSE create mode 100644 examples/minimal.rs create mode 100644 src/lib.rs diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..ad43947 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,17 @@ +# alternatively, `export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=wasm-server-runner` + +[target.wasm32-unknown-unknown] +runner = "wasm-server-runner" +rustflags = [ + "--cfg=web_sys_unstable_apis", + # "-C", + # "target-feature=+atomics,+bulk-memory,+mutable-globals", # for wasm-bindgen-rayon +] + + +# fix spurious network error on windows +# [source.crates-io] +# registry = "https://github.com/rust-lang/crates.io-index" + +[http] +proxy = "" diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..725c1cb --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,20 @@ +FROM mcr.microsoft.com/devcontainers/rust:0-1 + +WORKDIR /workspace + +RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y \ + build-essential \ + libpulse-dev \ + libdbus-1-dev \ + libudev-dev \ + libssl-dev \ + xorg \ + openbox \ + alsa-tools \ + librust-alsa-sys-dev \ + && rm -rf /var/lib/apt/lists/* + +RUN rustup target install wasm32-unknown-unknown + +RUN cargo install flamegraph +RUN cargo install wasm-server-runner diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..3a1380e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,33 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/rust +{ + "dockerComposeFile": ["docker-compose.yaml"], + "workspaceFolder": "/workspace", + "remoteUser": "vscode", + "shutdownAction": "stopCompose", + "service": "devcontainer", + + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": "true", + "username": "vscode", + "userUid": "1000", + "userGid": "1000", + "upgradePackages": "true" + }, + "ghcr.io/devcontainers/features/rust:1": "latest", + "ghcr.io/devcontainers-contrib/features/zsh-plugins:0": { + "plugins": "history history-substring-search" + } + }, + "customizations": { + "vscode": { + "settings": {}, + "extensions": [ + "rust-lang.rust-analyzer", + "serayuzgur.crates", + "vadimcn.vscode-lldb" + ] + } + } +} diff --git a/.devcontainer/docker-compose.yaml b/.devcontainer/docker-compose.yaml new file mode 100644 index 0000000..18b700b --- /dev/null +++ b/.devcontainer/docker-compose.yaml @@ -0,0 +1,10 @@ +services: + devcontainer: + build: + context: . + dockerfile: ./Dockerfile + volumes: + - type: bind + source: .. + target: /workspace + command: sleep infinity diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..43fc914 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +* text=auto eol=lf +*.{cmd,[cC][mM][dD]} text eol=crlf +*.{bat,[bB][aA][tT]} text eol=crlf +*.sh text eol=lf +*.conf text eol=lf + +*.ply binary +*.splat binary diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5755d69 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "weekly" + ignore: + # These are peer deps of Cargo and should not be automatically bumped + - dependency-name: "semver" + - dependency-name: "crates-io" + rebase-strategy: "disabled" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d9b99f0 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +name: test + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [windows-latest, macos-latest] + rust-toolchain: + - nightly + + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + + steps: + - uses: actions/checkout@v3 + + - name: Setup ${{ matrix.rust-toolchain }} rust toolchain with caching + uses: brndnmtthws/rust-action@v1 + with: + toolchain: ${{ matrix.rust-toolchain }} + + - name: lint + run: cargo clippy -- -Dwarnings + + - name: build + run: cargo build --example=minimal + + # - name: build (web) + # run: cargo build --example=minimal --target wasm32-unknown-unknown --release diff --git a/.github/workflows/todo_tracker.yml b/.github/workflows/todo_tracker.yml new file mode 100644 index 0000000..a3b1eb6 --- /dev/null +++ b/.github/workflows/todo_tracker.yml @@ -0,0 +1,24 @@ + +name: 'todo tracker' + +on: + push: + branches: [ main ] + +jobs: + build: + permissions: + issues: write + + name: todo_tracker + runs-on: [ubuntu-latest] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: "TODO to Issue" + uses: "alstr/todo-to-issue-action@v4" + id: "todo" + with: + AUTO_ASSIGN: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..520f614 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +debug/ +target/ +vendor/ +out/ +Cargo.lock +**/*.rs.bk +*.pdb + +*.py + +*.ply +*.gcloud + +.DS_Store + +www/assets/ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..352a626 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "rust-analyzer.linkedProjects": [ + "./Cargo.toml" + ] +} \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..f91276a --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,71 @@ +[package] +name = "bevy_light_field" +description = "rust bevy light field array tooling" +version = "0.1.0" +edition = "2021" +authors = ["mosure "] +license = "MIT" +keywords = [ + "bevy", + "light-field", + "rtsp", +] +homepage = "https://github.com/mosure/bevy_light_field" +repository = "https://github.com/mosure/bevy_light_field" +readme = "README.md" +exclude = [ + ".devcontainer", + ".github", + "docs", + "dist", + "build", + "assets", + "credits", +] + + +[dependencies] + + +[dependencies.bevy] +version = "0.13" +default-features = false + + +[target.'cfg(target_arch = "wasm32")'.dependencies] +console_error_panic_hook = "0.1" +wasm-bindgen = "0.2" + + +[dependencies.web-sys] +version = "0.3" +features = [ + 'Document', + 'Element', + 'HtmlElement', + 'Location', + 'Node', + 'Window', +] + + +[profile.dev.package."*"] +opt-level = 3 + +[profile.dev] +opt-level = 1 + +[profile.release] +lto = "thin" +codegen-units = 1 +opt-level = 3 + +[profile.wasm-release] +inherits = "release" +opt-level = "z" +lto = "fat" +codegen-units = 1 + + +[lib] +path = "src/lib.rs" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..484fa2e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Mitchell Mosure + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 285865e..8f48b6a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,18 @@ # bevy_light_field +[![test](https://github.com/mosure/bevy_light_field/workflows/test/badge.svg)](https://github.com/Mosure/bevy_light_field/actions?query=workflow%3Atest) +[![GitHub License](https://img.shields.io/github/license/mosure/bevy_light_field)](https://raw.githubusercontent.com/mosure/bevy_light_field/main/LICENSE) +[![GitHub Last Commit](https://img.shields.io/github/last-commit/mosure/bevy_light_field)](https://github.com/mosure/bevy_light_field) +[![GitHub Releases](https://img.shields.io/github/v/release/mosure/bevy_light_field?include_prereleases&sort=semver)](https://github.com/mosure/bevy_light_field/releases) +[![GitHub Issues](https://img.shields.io/github/issues/mosure/bevy_light_field)](https://github.com/mosure/bevy_light_field/issues) +[![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/mosure/bevy_light_field.svg)](http://isitmaintained.com/project/mosure/bevy_light_field) +[![crates.io](https://img.shields.io/crates/v/bevy_light_field.svg)](https://crates.io/crates/bevy_light_field) + rust bevy light field array tooling + + + +## compatible bevy versions + +| `bevy_light_field` | `bevy` | +| :-- | :-- | +| `0.1.0` | `0.13` | diff --git a/examples/minimal.rs b/examples/minimal.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..e69de29