diff --git a/.github/workflows/docker.yml b/.github/workflows/daedalus-docker.yml similarity index 73% rename from .github/workflows/docker.yml rename to .github/workflows/daedalus-docker.yml index 274085ff..f3e5a2d7 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/daedalus-docker.yml @@ -1,15 +1,21 @@ -name: docker-build +name: daedalus-docker-build on: push: - branches: - - '**' - tags: - - 'v*' + branches: [ "main" ] + paths: + - .github/workflows/daedalus-docker.yml + - 'apps/daedalus/**' pull_request: + types: [ opened, synchronize ] + paths: + - .github/workflows/daedalus-docker.yml + - 'apps/daedalus/**' + merge_group: + types: [ checks_requested ] + jobs: docker: - if: github.repository_owner == 'modrinth' runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/run.yml b/.github/workflows/daedalus-run.yml similarity index 96% rename from .github/workflows/run.yml rename to .github/workflows/daedalus-run.yml index 635c6119..dcdbd049 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/daedalus-run.yml @@ -23,7 +23,7 @@ jobs: - name: Pull Docker image from GHCR - run: docker pull ghcr.io/modrinth/daedalus:master + run: docker pull ghcr.io/modrinth/daedalus:main - name: Run Docker container env: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 8bf19521..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Rust lint - -on: - push: - branches: [ master ] - pull_request: -env: - CARGO_TERM_COLOR: always -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - components: rustfmt, clippy - - name: Cache build artifacts - id: cache-build - uses: actions/cache@v2 - with: - path: target/** - key: ${{ runner.os }}-build-cache - - name: Annotate commit with clippy warnings - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 9e224e2a..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Publish to crates.io - -on: - push: - tags: - - 'v*' -env: - CARGO_TERM_COLOR: always -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - run: cargo login ${CRATES_IO_TOKEN} - working-directory: ./daedalus - env: - CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} - - run: cargo publish - working-directory: ./daedalus diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index a55aaf6e..00000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Rust building - -on: - push: - branches: [ master ] - pull_request: -env: - CARGO_TERM_COLOR: always -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Get build cache - id: cache-build - uses: actions/cache@v2 - with: - path: target/** - key: ${{ runner.os }}-build-cache - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - env: - SQLX_OFFLINE: true - - uses: actions-rs/cargo@v1 - name: Build program - with: - command: build diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 06b153ac..00000000 --- a/.gitignore +++ /dev/null @@ -1,122 +0,0 @@ -### Intellij ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 -caches/ - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# AWS User-specific -.idea/**/aws.xml - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/artifacts -# .idea/compiler.xml -# .idea/jarRepositories.xml -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - -### Intellij Patch ### -# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 - -# *.iml -# modules.xml -# .idea/misc.xml -# *.ipr - -# Sonarlint plugin -# https://plugins.jetbrains.com/plugin/7973-sonarlint -.idea/**/sonarlint/ - -# SonarQube Plugin -# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin -.idea/**/sonarIssues.xml - -# Markdown Navigator plugin -# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced -.idea/**/markdown-navigator.xml -.idea/**/markdown-navigator-enh.xml -.idea/**/markdown-navigator/ - -# Cache file creation bug -# See https://youtrack.jetbrains.com/issue/JBR-2257 -.idea/$CACHE_FILE$ - -# CodeStream plugin -# https://plugins.jetbrains.com/plugin/12206-codestream -.idea/codestream.xml - -### Rust ### -# Generated by Cargo -# will have compiled files and executables -debug/ -target/ - -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - -# These are backup files generated by rustfmt -**/*.rs.bk - -# MSVC Windows builds of rustc generate these, which store debugging information -*.pdb diff --git a/.idea/daedalus.iml b/.idea/daedalus.iml index cc8620ac..3d715289 100644 --- a/.idea/daedalus.iml +++ b/.idea/daedalus.iml @@ -3,10 +3,10 @@ - - + + diff --git a/.idea/libraries/KotlinJavaRuntime.xml b/.idea/libraries/KotlinJavaRuntime.xml new file mode 100644 index 00000000..78d18789 --- /dev/null +++ b/.idea/libraries/KotlinJavaRuntime.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index dc360c2e..00000000 --- a/Cargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[workspace] - -members = [ - "daedalus", - "daedalus_client" -] \ No newline at end of file diff --git a/.env b/apps/daedalus_client/.env similarity index 100% rename from .env rename to apps/daedalus_client/.env diff --git a/daedalus_client/Cargo.toml b/apps/daedalus_client/Cargo.toml similarity index 100% rename from daedalus_client/Cargo.toml rename to apps/daedalus_client/Cargo.toml diff --git a/Dockerfile b/apps/daedalus_client/Dockerfile similarity index 100% rename from Dockerfile rename to apps/daedalus_client/Dockerfile diff --git a/LICENSE b/apps/daedalus_client/LICENSE similarity index 97% rename from LICENSE rename to apps/daedalus_client/LICENSE index 75e4f779..bc179be0 100644 --- a/LICENSE +++ b/apps/daedalus_client/LICENSE @@ -1,4 +1,4 @@ -Copyright © 2023 Rinth, Inc. +Copyright © 2024 Rinth, Inc. 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: diff --git a/README.md b/apps/daedalus_client/README.md similarity index 100% rename from README.md rename to apps/daedalus_client/README.md diff --git a/docker-compose.yml b/apps/daedalus_client/docker-compose.yml similarity index 100% rename from docker-compose.yml rename to apps/daedalus_client/docker-compose.yml diff --git a/daedalus_client/library-patches.json b/apps/daedalus_client/library-patches.json similarity index 100% rename from daedalus_client/library-patches.json rename to apps/daedalus_client/library-patches.json diff --git a/apps/daedalus_client/package.json b/apps/daedalus_client/package.json new file mode 100644 index 00000000..41c8b0ae --- /dev/null +++ b/apps/daedalus_client/package.json @@ -0,0 +1,10 @@ +{ + "name": "@modrinth/daedalus_client", + "scripts": { + "build": "cargo build --release", + "lint": "cargo fmt --check && cargo clippy --all-targets --all-features -- -D warnings", + "fix": "cargo fmt && cargo clippy --fix", + "dev": "cargo run", + "test": "cargo test" + } +} \ No newline at end of file diff --git a/daedalus_client/src/error.rs b/apps/daedalus_client/src/error.rs similarity index 100% rename from daedalus_client/src/error.rs rename to apps/daedalus_client/src/error.rs diff --git a/daedalus_client/src/fabric.rs b/apps/daedalus_client/src/fabric.rs similarity index 100% rename from daedalus_client/src/fabric.rs rename to apps/daedalus_client/src/fabric.rs diff --git a/daedalus_client/src/forge.rs b/apps/daedalus_client/src/forge.rs similarity index 100% rename from daedalus_client/src/forge.rs rename to apps/daedalus_client/src/forge.rs diff --git a/daedalus_client/src/main.rs b/apps/daedalus_client/src/main.rs similarity index 100% rename from daedalus_client/src/main.rs rename to apps/daedalus_client/src/main.rs diff --git a/daedalus_client/src/minecraft.rs b/apps/daedalus_client/src/minecraft.rs similarity index 100% rename from daedalus_client/src/minecraft.rs rename to apps/daedalus_client/src/minecraft.rs diff --git a/daedalus_client/src/util.rs b/apps/daedalus_client/src/util.rs similarity index 100% rename from daedalus_client/src/util.rs rename to apps/daedalus_client/src/util.rs diff --git a/daedalus/Cargo.toml b/packages/daedalus/Cargo.toml similarity index 100% rename from daedalus/Cargo.toml rename to packages/daedalus/Cargo.toml diff --git a/packages/daedalus/LICENSE b/packages/daedalus/LICENSE new file mode 100644 index 00000000..bc179be0 --- /dev/null +++ b/packages/daedalus/LICENSE @@ -0,0 +1,7 @@ +Copyright © 2024 Rinth, Inc. + +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. \ No newline at end of file diff --git a/daedalus/README.md b/packages/daedalus/README.md similarity index 86% rename from daedalus/README.md rename to packages/daedalus/README.md index fb57d0f0..aa560259 100644 --- a/daedalus/README.md +++ b/packages/daedalus/README.md @@ -2,5 +2,3 @@ Daedalus (the rust library) is a library providing model structs and methods for requesting and parsing things from Minecraft and other mod loaders meta APIs. - -This is a work in progress! \ No newline at end of file diff --git a/packages/daedalus/package.json b/packages/daedalus/package.json new file mode 100644 index 00000000..41c8b0ae --- /dev/null +++ b/packages/daedalus/package.json @@ -0,0 +1,10 @@ +{ + "name": "@modrinth/daedalus_client", + "scripts": { + "build": "cargo build --release", + "lint": "cargo fmt --check && cargo clippy --all-targets --all-features -- -D warnings", + "fix": "cargo fmt && cargo clippy --fix", + "dev": "cargo run", + "test": "cargo test" + } +} \ No newline at end of file diff --git a/daedalus/src/lib.rs b/packages/daedalus/src/lib.rs similarity index 100% rename from daedalus/src/lib.rs rename to packages/daedalus/src/lib.rs diff --git a/daedalus/src/minecraft.rs b/packages/daedalus/src/minecraft.rs similarity index 100% rename from daedalus/src/minecraft.rs rename to packages/daedalus/src/minecraft.rs diff --git a/daedalus/src/modded.rs b/packages/daedalus/src/modded.rs similarity index 100% rename from daedalus/src/modded.rs rename to packages/daedalus/src/modded.rs diff --git a/rustfmt.toml b/rustfmt.toml deleted file mode 100644 index f5a8b867..00000000 --- a/rustfmt.toml +++ /dev/null @@ -1,2 +0,0 @@ -edition = "2018" -max_width = 80 \ No newline at end of file