diff --git a/.envrc b/.envrc index b1b4d48254..fb59b7f3b5 100644 --- a/.envrc +++ b/.envrc @@ -17,6 +17,7 @@ git config pull.rebase true use nix --max-jobs auto watch_file shell.nix build/nix/**/*.nix +export ESLINT_USE_FLAT_CONFIG=true export TAMAGUI_TARGET="web" export NEXT_PUBLIC_GRPC_HOST="https://gateway.mintter.com" # export NEXT_PUBLIC_GRPC_HOST="http://localhost:56001" diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..5eb21ba3f2 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +dist +out +frontend/*.d.ts +types/ +frontend/packages/shared/src/client/.generated +frontend/packages/ui/dist \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md deleted file mode 100644 index fb56340f51..0000000000 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ /dev/null @@ -1,16 +0,0 @@ -> ⚠️ PLEASE MAKE SURE THIS CHECKLIST IS COMPLETE BEFORE YOU SUBMIT ANY PULL -> REQUEST - -- General - - [ ] you are referencing an issue - - [ ] add a clear description of how this Pull Request will fix the referenced - issue -- Frontend - - [ ] your code is formatted properly (`yarn format`) - - [ ] your code is linted (`yarn lint`) - - [ ] your code is tested - - [ ] all tests pass (`yarn test`) -- Go - - [ ] ... -- Rust - - [ ] ... diff --git a/.github/actions/ci-setup/action.yml b/.github/actions/ci-setup/action.yml new file mode 100644 index 0000000000..bb50ffde12 --- /dev/null +++ b/.github/actions/ci-setup/action.yml @@ -0,0 +1,78 @@ +name: CI setup + +description: | + Sets up the CI environment for the project + +inputs: + matrix-os: + description: 'The Current OS' + required: true + # matrix-target: + # description: "The Current Target" + # required: true + # matrix-goarch: + # description: "The Current Go Arch" + # required: true + + +runs: + using: 'composite' + + steps: + - name: 'Setup Go' + uses: actions/setup-go@v3 + with: + go-version: 1.19 + + - name: 'Install native packages' + if: inputs.matrix-os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf + shell: bash + + - name: Setup cache Ubuntu + uses: actions/cache@v3 + if: inputs.matrix-os == 'ubuntu-latest' + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ inputs.matrix-os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ inputs.matrix-os }}-go- + + - name: Setup cache Macos + uses: actions/cache@v3 + if: inputs.matrix-os == 'macos-latest' + with: + path: | + ~/Library/Caches/go-build + ~/go/pkg/mod + key: ${{ inputs.matrix-os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ inputs.matrix-os }}-go- + + - name: Setup cache Windows + uses: actions/cache@v3 + if: inputs.matrix-os == 'windows-latest' + with: + path: | + ~\AppData\Local\go-build + ~\go\pkg\mod + key: ${{ inputs.matrix-os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ inputs.matrix-os }}-go- + + - name: Install Node.js 20 + uses: actions/setup-node@v3 + with: + node-version: 20 + cache: 'yarn' + + - name: Install Frontend Dependencies + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false + run: | + yarn + shell: bash diff --git a/.github/workflows/audit-javascript.yml b/.github/workflows/audit-javascript.yml deleted file mode 100644 index 76815c3fef..0000000000 --- a/.github/workflows/audit-javascript.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Audit JavaScript - -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' - push: - branches: - - main - paths: - - '.github/workflows/audit-javascript.yml' - - '**/yarn.lock' - - '**/package.json' - pull_request: - branches: - - main - paths: - - '.github/workflows/audit-javascript.yml' - - '**/yarn.lock' - - '**/package.json' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - audit-js: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: "yarn" - - - name: Install Dependencies - run: | - yarn set version latest - yarn - - - name: audit - run: yarn audit diff --git a/.github/workflows/audit-rust.yml b/.github/workflows/audit-rust.yml deleted file mode 100644 index 60812cccdc..0000000000 --- a/.github/workflows/audit-rust.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Audit - -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' - pull_request: - paths: - - '.github/workflows/audit-rust.yml' - - '**/Cargo.lock' - - '**/Cargo.toml' - branches-ignore: - - 'renovate/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - audit-rust: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/audit-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml deleted file mode 100644 index 59c9918a07..0000000000 --- a/.github/workflows/build-pr.yml +++ /dev/null @@ -1,234 +0,0 @@ -name: Build PR - -on: - pull_request: - types: [labeled] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - AWS_REGION: us-east-1 - -jobs: - get-version: - runs-on: ubuntu-latest - if: ${{ github.event.label.name == 'build-artifacts' }} - outputs: - version: ${{ steps.current_time.outputs.formattedTime }} - steps: - - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '🤖 Your build has started. I will notify you when the artifacts are ready.' - }) - - github.rest.issues.removeLabel({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - name: 'build-artifacts', - }) - - name: Get current time - uses: srfrnk/current-time@master - id: current_time - with: - format: YY.M.D - - build-binaries: - runs-on: ${{ matrix.config.os }} - timeout-minutes: 40 - needs: get-version - strategy: - fail-fast: false - matrix: - config: - - os: ubuntu-latest - goarch: amd64 - rust_target: x86_64-unknown-linux-gnu - - os: macos-latest - goarch: amd64 - rust_target: x86_64-apple-darwin - - os: macos-latest - goarch: arm64 - rust_target: aarch64-apple-darwin - - os: windows-latest - goarch: amd64 - rust_target: x86_64-pc-windows-msvc - # - os: windows-latest - # goarch: arm64 - # rust_target: aarch64-pc-windows-msvc - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ inputs.branch }} - - - name: 'Setup Rust' - uses: actions-rs/toolchain@v1 - with: - default: true - override: true - profile: minimal - toolchain: stable - target: ${{ matrix.config.rust_target }} - - - uses: Swatinem/rust-cache@v2 - with: - key: ${{ matrix.config.rust_target }} - - - name: 'Setup Go' - uses: actions/setup-go@v3 - with: - go-version: 1.19 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: "yarn" - - - name: Install Dependencies - run: | - yarn set version latest - yarn - - - name: 'Install native packages' - if: "matrix.config.os == 'ubuntu-latest'" - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf - - - uses: actions/cache@v3 - if: "matrix.config.os == 'ubuntu-latest'" - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - uses: actions/cache@v3 - if: "matrix.config.os == 'macos-latest'" - with: - path: | - ~/Library/Caches/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - uses: actions/cache@v3 - if: "matrix.config.os == 'windows-latest'" - with: - path: | - ~\AppData\Local\go-build - ~\go\pkg\mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Build Backend (Unix) - if: "matrix.config.os != 'windows-latest'" - run: | - mkdir -p plz-out/bin/backend - go build -o plz-out/bin/backend/mintterd-${{ matrix.config.rust_target }} ./backend/cmd/mintterd - env: - GOARCH: ${{ matrix.config.goarch }} - CGO_ENABLED: 1 - - - name: Build Backend (Windows) - if: "matrix.config.os == 'windows-latest'" - run: | - mkdir -p plz-out/bin/backend - go build -o plz-out/bin/backend/mintterd-${{ matrix.config.rust_target }}.exe ./backend/cmd/mintterd - env: - GOARCH: ${{ matrix.config.goarch }} - CGO_ENABLED: 1 - - - name: create apple private key file - if: "matrix.config.os == 'macos-latest'" - run: | - mkdir ./desktop/app/private_keys - echo "$APPLE_API_PRIVKEY" > ./desktop/app/private_keys/AuthKey_$APPLE_API_KEY.p8 - env: - APPLE_API_PRIVKEY: '${{ secrets.APPLE_API_PRIVKEY }}' - APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' - - - name: create AppImage private key file - if: "matrix.config.os == 'ubuntu-latest'" - run: | - export GPG_TTY=$(tty) - echo "$APPIMAGE_SIGN_PRIVKEY" | gpg --batch --import - env: - APPIMAGE_SIGN_PRIVKEY: '${{ secrets.APPIMAGE_SIGN_PRIVKEY }}' - - - name: Set version in Cargo.toml - run: - node scripts/update-cargo-toml.mjs ./desktop/app/Cargo.toml ${{ - needs.get-version.outputs.version }} - - - uses: JonasKruckenberg/tauri-build@v1.2.2 - id: tauri_build - env: - VERSION: ${{ needs.get-version.outputs.version }} - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - ENABLE_CODE_SIGNING: '${{ secrets.APPLE_CERTIFICATE }}' - APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}' - APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' - APPLE_CERTIFICATE: '${{ secrets.APPLE_CERTIFICATE }}' - APPLE_CERTIFICATE_PASSWORD: - '${{ secrets.APPLE_CERTIFICATE_PASSWORD }}' - APPLE_SIGNING_IDENTITY: '${{ secrets.APPLE_SIGNING_IDENTITY }}' - TAURI_KEY_PASSWORD: '${{ secrets.TAURI_KEY_PASSWORD }}' - TAURI_PRIVATE_KEY: '${{ secrets.TAURI_PRIVATE_KEY }}' - SIGN: '1' - SIGN_KEY: '${{ secrets.APPIMAGE_SIGN_KEYID }}' - APPIMAGETOOL_SIGN_PASSPHRASE: - '${{ secrets.APPIMAGE_SIGN_PASSPHRASE }}' - with: - configPath: nightly.tauri.conf.json - projectPath: ./desktop/app - target: ${{ matrix.config.rust_target }} - debug: true - args: --verbose - - - uses: actions/upload-artifact@v3 - with: - name: artifacts-${{ matrix.config.rust_target }} - path: - "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}" - - - name: - if: failure() - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '🤖🚨 Build failed. You can find the logs here ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' - }) - - build-complete: - needs: [get-version, build-binaries] - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '🤖 Build is complete. You can find the artifacts here ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' - }) diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml new file mode 100644 index 0000000000..c9577300ec --- /dev/null +++ b/.github/workflows/desktop-release.yml @@ -0,0 +1,160 @@ +name: Desktop Release + +on: + push: + branches: + - release + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + AWS_REGION: us-east-1 + +jobs: + get-version: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.get-version.outputs.version }} + steps: + - uses: actions/checkout@v3 + + - name: Run Version Script + id: get-version + run: | + echo "version=$(node scripts/get-app-version.js)" >> "$GITHUB_OUTPUT" + check-release: + needs: [get-version] + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Check Release + id: check_release + run: | + RELEASE_NAME='${{ needs.get-version.outputs.version }}' + + RELEASE_EXISTS=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/releases" | \ + jq ".[] | select(.tag_name == \"$RELEASE_NAME\")") + + if [ -z "$RELEASE_EXISTS" ]; then + echo "Release does not exist." + else + echo "Release already exists." + exit 1 + fi + build-binaries: + name: Build (${{ matrix.config.os }}) + runs-on: ${{ matrix.config.os }} + # if: startsWith(github.ref, 'refs/tags/') + needs: [get-version, check-release] + strategy: + matrix: + config: + - os: macos-latest + goarch: amd64 + target: x86_64-apple-darwin + # - os: macos-latest + # goarch: arm64 + # target: aarch64-apple-darwin + - os: ubuntu-latest + goarch: amd64 + target: x86_64-unknown-linux-gnu + # - os: windows-latest + # goarch: amd64 + # target: x86_64-pc-windows-msvc + steps: + - name: Checkout + uses: actions/checkout@v1 + + - uses: ./.github/actions/ci-setup + with: + matrix-os: ${{ matrix.config.os }} + # matrix-target: ${{ matrix.config.target }} + # matrix-goarch: ${{ matrix.config.goarch }} + + + - name: Build Backend (Unix) + if: matrix.config.os != 'windows-latest' + run: | + mkdir -p plz-out/bin/backend + go build -o plz-out/bin/backend/mintterd-${{ matrix.config.target }} ./backend/cmd/mintterd + env: + GOARCH: ${{ matrix.config.goarch }} + CGO_ENABLED: 1 + + - name: Build Backend (Windows) + if: matrix.config.os == 'windows-latest' + run: | + mkdir -p plz-out/bin/backend + go build -o plz-out/bin/backend/mintterd-${{ matrix.config.target }}.exe ./backend/cmd/mintterd + env: + GOARCH: ${{ matrix.config.goarch }} + CGO_ENABLED: 1 + + - name: Import MacOS certs + if: matrix.config.os == 'macos-latest' + uses: apple-actions/import-codesign-certs@v2 + with: + p12-file-base64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }} + p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} + + # - name: create AppImage private key file + # if: matrix.config.os == 'ubuntu-latest' + # run: | + # export GPG_TTY=$(tty) + # echo "$APPIMAGE_SIGN_PRIVKEY" | gpg --batch --import + # env: + # APPIMAGE_SIGN_PRIVKEY: '${{ secrets.APPIMAGE_SIGN_PRIVKEY }}' + + # - name: Setup flatpak + # if: matrix.config.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/') + # run: sudo apt install flatpak flatpak-builder elfutils + + - name: Build App Package + run: | + TAMAGUI_TARGET=web yarn build + TAMAGUI_TARGET=web yarn electron:make + env: + APP_VERSION: '${{ needs.get-version.outputs.version }}' + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ID_PASSWORD: '${{ secrets.APPLE_ID_PASSWORD }}' + APPLE_TEAM_ID: '${{ secrets.APPLE_TEAM_ID }}' + + # WINDOWS_PFX_FILE: '${{ steps.write_file.outputs.filePath }}' + # WINDOWS_PFX_PASSWORD: '${{ secrets.WINDOWS_PFX_PASSWORD }}' + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: artifacts-${{ matrix.config.target }} + path: frontend/apps/desktop/out/make/**/* + + publish-to-github: + needs: [get-version, build-binaries] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Download amd64 artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + + - name: 'create release' + uses: softprops/action-gh-release@master + env: + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + with: + tag_name: '${{ needs.get-version.outputs.version }}' + prerelease: false + generate_release_notes: true + files: ./artifacts/artifacts-*/**/* diff --git a/.github/workflows/electron-release.yml b/.github/workflows/electron-release.yml deleted file mode 100644 index fca8fde5f1..0000000000 --- a/.github/workflows/electron-release.yml +++ /dev/null @@ -1,154 +0,0 @@ -name: Electron Release - -on: - push: - branches: - - electron-ci - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - AWS_REGION: us-east-1 - -jobs: - get-version: - runs-on: ubuntu-latest - outputs: - version: ${{ steps.current_time.outputs.formattedTime }} - steps: - - name: Get current time - uses: srfrnk/current-time@master - id: current_time - with: - format: YY.M.D - build-binaries: - name: Build (${{ matrix.config.os }}) - runs-on: ${{ matrix.config.os }} - # if: startsWith(github.ref, 'refs/tags/') - needs: get-version - strategy: - matrix: - config: - - os: macos-latest - goarch: amd64 - target: x86_64-apple-darwin - # - os: ubuntu-latest - # goarch: amd64 - # target: x86_64-unknown-linux-gnu - # - os: windows-latest - # goarch: amd64 - # target: x86_64-pc-windows-msvc - steps: - - name: Checkout - uses: actions/checkout@v1 - - - name: 'Setup Go' - uses: actions/setup-go@v3 - with: - go-version: 1.19 - - - name: 'Install native packages' - if: matrix.config.os == 'ubuntu-latest' - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf - - - name: Setup cache Ubuntu - uses: actions/cache@v3 - if: matrix.config.os == 'ubuntu-latest' - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Setup cache Macos - uses: actions/cache@v3 - if: matrix.config.os == 'macos-latest' - with: - path: | - ~/Library/Caches/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Setup cache Windows - uses: actions/cache@v3 - if: matrix.config.os == 'windows-latest' - with: - path: | - ~\AppData\Local\go-build - ~\go\pkg\mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Build Backend (Unix) - if: matrix.config.os != 'windows-latest' - run: | - mkdir -p plz-out/bin/backend - go build -o plz-out/bin/backend/mintterd-${{ matrix.config.target }} ./backend/cmd/mintterd - env: - GOARCH: ${{ matrix.config.goarch }} - CGO_ENABLED: 1 - - - name: Build Backend (Windows) - if: matrix.config.os == 'windows-latest' - run: | - mkdir -p plz-out/bin/backend - go build -o plz-out/bin/backend/mintterd-${{ matrix.config.target }}.exe ./backend/cmd/mintterd - env: - GOARCH: ${{ matrix.config.goarch }} - CGO_ENABLED: 1 - - - name: create apple private key file - if: matrix.config.os == 'macos-latest' - run: | - mkdir ./frontend/apps/electron/private_keys - echo "$APPLE_API_PRIVKEY" > ./frontend/apps/electron/private_keys/AuthKey_$APPLE_API_KEY.p8 - env: - APPLE_API_PRIVKEY: '${{ secrets.APPLE_API_PRIVKEY }}' - APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' - - - name: create AppImage private key file - if: matrix.config.os == 'ubuntu-latest' - run: | - export GPG_TTY=$(tty) - echo "$APPIMAGE_SIGN_PRIVKEY" | gpg --batch --import - env: - APPIMAGE_SIGN_PRIVKEY: '${{ secrets.APPIMAGE_SIGN_PRIVKEY }}' - - - name: Setup flatpak - if: matrix.config.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/') - run: sudo apt install flatpak flatpak-builder elfutils - - - name: Install Node.js 20 - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: "yarn" - - - name: Install Frontend Dependencies - env: - YARN_ENABLE_IMMUTABLE_INSTALLS: false - run: | - yarn set version latest - yarn - - - name: Build App Package - run: | - TAMAGUI_TARGET=web yarn build - TAMAGUI_TARGET=web yarn electron:publish - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}' - APPLE_API_PRIVKEY: '${{ secrets.APPLE_API_PRIVKEY }}' - APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' - WINDOWS_PFX_FILE: ${{ steps.write_file.outputs.filePath }} - WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/lint-javascript.yml b/.github/workflows/lint-javascript.yml deleted file mode 100644 index f6dbc9459a..0000000000 --- a/.github/workflows/lint-javascript.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Lint JavaScript - -on: - push: - branches: - - master - paths: - - '.github/workflows/lint-javascript.yml' - - 'frontend/**' - pull_request: - paths: - - '.github/workflows/lint-javascript.yml' - - 'frontend/**' - branches-ignore: - - 'renovate/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - lint-javascript: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: "yarn" - - - name: Install Dependencies - run: | - yarn set version latest - yarn - - # - name: Lint packages - # run: yarn lint - - - name: Format files (Prettier) - run: yarn format - - # lint-go: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - name: golangci-lint - # uses: golangci/golangci-lint-action@v2 - # with: - # version: latest - # only-new-issues: true - # args: --timeout=5m diff --git a/.github/workflows/lint-rust.yml b/.github/workflows/lint-rust.yml deleted file mode 100644 index f2b4ee753e..0000000000 --- a/.github/workflows/lint-rust.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Lint Rust - -on: - push: - branches: - - master - paths: - - '.github/workflows/lint-rust.yml' - - 'Cargo.toml' - - 'desktop/**' - pull_request: - paths: - - '.github/workflows/lint-rust.yml' - - 'Cargo.toml' - - 'desktop/**' - branches-ignore: - - 'renovate/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - lint-rust: - runs-on: ubuntu-latest - # container: iterpre/tauri - steps: - - uses: actions/checkout@v3 - - - name: Install clippy with stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: clippy, rustfmt - - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - - - name: 'Install native packages' - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf - - - name: Mock Files - run: | - mkdir -p plz-out/bin/backend - touch plz-out/bin/backend/mintterd-x86_64-unknown-linux-gnu - mkdir -p frontend/app/dist - - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: - --manifest-path=Cargo.toml --all-targets --all-features -- -D - warnings - name: clippy - - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --manifest-path=Cargo.toml --all -- --check - - # lint-go: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - name: golangci-lint - # uses: golangci/golangci-lint-action@v2 - # with: - # version: latest - # only-new-issues: true - # args: --timeout=5m diff --git a/.github/workflows/playwright.yml.off b/.github/workflows/playwright.yml.off deleted file mode 100644 index 49a673799b..0000000000 --- a/.github/workflows/playwright.yml.off +++ /dev/null @@ -1,27 +0,0 @@ -name: Playwright Tests -on: - push: - branches: [ main, master ] - pull_request: - branches: [ main, master ] -jobs: - test: - timeout-minutes: 60 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - - name: Install dependencies - run: yarn - - name: Install Playwright Browsers - run: yarn playwright install --with-deps - - name: Run Playwright tests - run: yarn playwright test - - uses: actions/upload-artifact@v3 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml deleted file mode 100644 index 24dff2d7d7..0000000000 --- a/.github/workflows/release-nightly.yml +++ /dev/null @@ -1,295 +0,0 @@ -name: Release Nightly - -on: - workflow_dispatch: - schedule: - - cron: '45 6 * * 1-5' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - AWS_REGION: us-east-1 - -jobs: - get-version: - runs-on: ubuntu-latest - outputs: - version: ${{ steps.current_time.outputs.formattedTime }} - steps: - - name: Get current time - uses: srfrnk/current-time@master - id: current_time - with: - format: YY.M.D - - build-binaries: - runs-on: ${{ matrix.config.os }} - timeout-minutes: 40 - needs: get-version - strategy: - matrix: - config: - - os: ubuntu-latest - goarch: amd64 - rust_target: x86_64-unknown-linux-gnu - - os: macos-latest - goarch: amd64 - rust_target: x86_64-apple-darwin - - os: macos-latest - goarch: arm64 - rust_target: aarch64-apple-darwin - # - os: windows-latest - # goarch: amd64 - # rust_target: x86_64-pc-windows-msvc - # - os: windows-latest - # goarch: arm64 - # rust_target: aarch64-pc-windows-msvc - steps: - - uses: actions/checkout@v3 - - - name: 'Setup Rust' - uses: actions-rs/toolchain@v1 - with: - default: true - override: true - profile: minimal - toolchain: stable - target: ${{ matrix.config.rust_target }} - - - uses: Swatinem/rust-cache@v2 - with: - key: ${{ matrix.config.rust_target }} - - - name: 'Setup Go' - uses: actions/setup-go@v3 - with: - go-version: 1.19 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: "yarn" - - - name: Install Dependencies - env: - YARN_ENABLE_IMMUTABLE_INSTALLS: false - run: | - yarn set version latest - yarn - - - name: 'Install native packages' - if: "matrix.config.os == 'ubuntu-latest'" - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf - - - uses: actions/cache@v3 - if: "matrix.config.os == 'ubuntu-latest'" - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - uses: actions/cache@v3 - if: "matrix.config.os == 'macos-latest'" - with: - path: | - ~/Library/Caches/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - uses: actions/cache@v3 - if: "matrix.config.os == 'windows-latest'" - with: - path: | - ~\AppData\Local\go-build - ~\go\pkg\mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Build Backend (Unix) - if: "matrix.config.os != 'windows-latest'" - run: | - mkdir -p plz-out/bin/backend - go build -o plz-out/bin/backend/mintterd-${{ matrix.config.rust_target }} ./backend/cmd/mintterd - env: - GOARCH: ${{ matrix.config.goarch }} - CGO_ENABLED: 1 - - - name: Build Backend (Windows) - if: "matrix.config.os == 'windows-latest'" - run: | - mkdir -p plz-out/bin/backend - go build -o plz-out/bin/backend/mintterd-${{ matrix.config.rust_target }}.exe ./backend/cmd/mintterd - env: - GOARCH: ${{ matrix.config.goarch }} - CGO_ENABLED: 1 - - - name: create apple private key file - if: "matrix.config.os == 'macos-latest'" - run: | - mkdir ./desktop/app/private_keys - echo "$APPLE_API_PRIVKEY" > ./desktop/app/private_keys/AuthKey_$APPLE_API_KEY.p8 - env: - APPLE_API_PRIVKEY: '${{ secrets.APPLE_API_PRIVKEY }}' - APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' - - - name: create AppImage private key file - if: "matrix.config.os == 'ubuntu-latest'" - run: | - export GPG_TTY=$(tty) - echo "$APPIMAGE_SIGN_PRIVKEY" | gpg --batch --import - env: - APPIMAGE_SIGN_PRIVKEY: '${{ secrets.APPIMAGE_SIGN_PRIVKEY }}' - - - name: Set version in Cargo.toml - run: - node scripts/update-cargo-toml.mjs ./desktop/app/Cargo.toml ${{ - needs.get-version.outputs.version }} - - - uses: JonasKruckenberg/tauri-build@v1.2.2 - id: tauri_build - env: - VERSION: ${{ needs.get-version.outputs.version }} - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - ENABLE_CODE_SIGNING: '${{ secrets.APPLE_CERTIFICATE }}' - APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}' - APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' - APPLE_CERTIFICATE: '${{ secrets.APPLE_CERTIFICATE }}' - APPLE_CERTIFICATE_PASSWORD: - '${{ secrets.APPLE_CERTIFICATE_PASSWORD }}' - APPLE_SIGNING_IDENTITY: '${{ secrets.APPLE_SIGNING_IDENTITY }}' - TAURI_KEY_PASSWORD: '${{ secrets.TAURI_KEY_PASSWORD }}' - TAURI_PRIVATE_KEY: '${{ secrets.TAURI_PRIVATE_KEY }}' - SIGN: '1' - SIGN_KEY: '${{ secrets.APPIMAGE_SIGN_KEYID }}' - APPIMAGETOOL_SIGN_PASSPHRASE: - '${{ secrets.APPIMAGE_SIGN_PASSPHRASE }}' - with: - configPath: nightly.tauri.conf.json - projectPath: ./desktop/app - target: ${{ matrix.config.rust_target }} - debug: true - args: --verbose - - - name: Upload sourcemaps - uses: actions/upload-artifact@v3 - with: - name: sourcemaps-${{ matrix.config.rust_target }} - path: frontend/app/dist/**/*.map - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: artifacts-${{ matrix.config.goarch }} - path: - "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}" - - publish-to-github: - needs: [get-version, build-binaries] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Download amd64 artifacts - uses: actions/download-artifact@v3 - with: - path: artifacts - - - name: Create Sentry Release - uses: getsentry/action-release@v1 - with: - environment: 'development' - version: mintter@${{ needs.get-version.outputs.version }} - finalize: true - ignore_missing: true - ignore_empty: true - # sourcemaps: - # './artifacts/sourcemaps-aarch64-apple-darwin - # ./artifacts/sourcemaps-x86_64-apple-darwin - # ./artifacts/sourcemaps-x86_64-pc-windows-msvc - # ./artifacts/sourcemaps-x86_64-unknown-linux-gnu' - sourcemaps: - './artifacts/sourcemaps-x86_64-apple-darwin - ./artifacts/sourcemaps-aarch64-apple-darwin - ./artifacts/sourcemaps-x86_64-unknown-linux-gnu' - env: - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_ORG: ${{ secrets.SENTRY_ORG }} - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - - - name: Rename .app artifacts - run: | - mv ./artifacts/artifacts-amd64/macos/Mintter.app.tar.gz ./artifacts/artifacts-amd64/macos/Mintter_x86.app.tar.gz - mv ./artifacts/artifacts-arm64/macos/Mintter.app.tar.gz ./artifacts/artifacts-arm64/macos/Mintter_aarch64.app.tar.gz - mv ./artifacts/artifacts-amd64/macos/Mintter.app.tar.gz.sig ./artifacts/artifacts-amd64/macos/Mintter_x86.app.tar.gz.sig - mv ./artifacts/artifacts-arm64/macos/Mintter.app.tar.gz.sig ./artifacts/artifacts-arm64/macos/Mintter_aarch64.app.tar.gz.sig - - - name: 'create release' - uses: softprops/action-gh-release@master - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - with: - tag_name: desktop-nightly/${{ needs.get-version.outputs.version }} - prerelease: true - generate_release_notes: true - files: ./artifacts/artifacts-*/**/* - - publish-to-aws: - needs: [get-version, build-binaries] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ inputs.branch }} - - - name: Download amd64 artifacts - uses: actions/download-artifact@v3 - with: - name: artifacts-amd64 - path: artifacts/amd64 - - - name: Download arm64 artifacts - uses: actions/download-artifact@v3 - with: - name: artifacts-arm64 - path: artifacts/arm64 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: "yarn" - - - name: Install Dependencies - env: - YARN_ENABLE_IMMUTABLE_INSTALLS: false - run: | - yarn set version latest - yarn - - - name: Generate static updater manifest - run: - node scripts/generate-update-manifest-nightly.mjs ${{ - needs.get-version.outputs.version }} > ./artifacts/manifest.json - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ env.AWS_REGION }} - - - name: Upload artifacts to S3 - run: aws s3 sync ./artifacts s3://mintternightlies/ --delete diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 49079bb961..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,269 +0,0 @@ -name: Release - -on: - push: - tags: - - desktop/*.*.* - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - AWS_REGION: us-east-1 - -jobs: - build-binaries: - runs-on: ${{ matrix.config.os }} - timeout-minutes: 50 - strategy: - fail-fast: false - matrix: - config: - - os: ubuntu-latest - goarch: amd64 - rust_target: x86_64-unknown-linux-gnu - - os: macos-latest - goarch: amd64 - rust_target: x86_64-apple-darwin - - os: macos-latest - goarch: arm64 - rust_target: aarch64-apple-darwin - - os: windows-latest - goarch: amd64 - rust_target: x86_64-pc-windows-msvc - # - os: windows-latest - # goarch: arm64 - # rust_target: aarch64-pc-windows-msvc - steps: - - uses: actions/checkout@v3 - - - name: 'Setup Rust' - uses: actions-rs/toolchain@v1 - with: - default: true - override: true - profile: minimal - toolchain: stable - target: ${{ matrix.config.rust_target }} - - - uses: Swatinem/rust-cache@v2 - with: - key: ${{ matrix.config.rust_target }} - - - name: 'Setup Go' - uses: actions/setup-go@v3 - with: - go-version: 1.19 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: "yarn" - - - name: Install Dependencies - run: | - yarn set version latest - yarn - - - name: 'Install native packages' - if: "matrix.config.os == 'ubuntu-latest'" - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf - - - uses: actions/cache@v3 - if: "matrix.config.os == 'ubuntu-latest'" - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - uses: actions/cache@v3 - if: "matrix.config.os == 'macos-latest'" - with: - path: | - ~/Library/Caches/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - uses: actions/cache@v3 - if: "matrix.config.os == 'windows-latest'" - with: - path: | - ~\AppData\Local\go-build - ~\go\pkg\mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Build Backend (Unix) - if: "matrix.config.os != 'windows-latest'" - run: | - mkdir -p plz-out/bin/backend - go build -o plz-out/bin/backend/mintterd-${{ matrix.config.rust_target }} ./backend/cmd/mintterd - env: - GOARCH: ${{ matrix.config.goarch }} - CGO_ENABLED: 1 - - - name: Build Backend (Windows) - if: "matrix.config.os == 'windows-latest'" - run: | - mkdir -p plz-out/bin/backend - go build -o plz-out/bin/backend/mintterd-${{ matrix.config.rust_target }}.exe ./backend/cmd/mintterd - env: - GOARCH: ${{ matrix.config.goarch }} - CGO_ENABLED: 1 - - - name: create apple private key file - if: "matrix.config.os == 'macos-latest'" - run: | - mkdir ./desktop/app/private_keys - echo "$APPLE_API_PRIVKEY" > ./desktop/app/private_keys/AuthKey_$APPLE_API_KEY.p8 - env: - APPLE_API_PRIVKEY: '${{ secrets.APPLE_API_PRIVKEY }}' - APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' - - - name: create AppImage private key file - if: "matrix.config.os == 'ubuntu-latest'" - run: | - export GPG_TTY=$(tty) - echo "$APPIMAGE_SIGN_PRIVKEY" | gpg --batch --import - env: - APPIMAGE_SIGN_PRIVKEY: '${{ secrets.APPIMAGE_SIGN_PRIVKEY }}' - - - name: Set version in Cargo.toml - run: - node scripts/update-cargo-toml.mjs ./desktop/app/Cargo.toml ${{ - github.ref_name }} - - - uses: JonasKruckenberg/tauri-build@v1.2.2 - id: tauri_build - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - ENABLE_CODE_SIGNING: '${{ secrets.APPLE_CERTIFICATE }}' - APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}' - APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' - APPLE_CERTIFICATE: '${{ secrets.APPLE_CERTIFICATE }}' - APPLE_CERTIFICATE_PASSWORD: - '${{ secrets.APPLE_CERTIFICATE_PASSWORD }}' - APPLE_SIGNING_IDENTITY: '${{ secrets.APPLE_SIGNING_IDENTITY }}' - TAURI_KEY_PASSWORD: '${{ secrets.TAURI_KEY_PASSWORD }}' - TAURI_PRIVATE_KEY: '${{ secrets.TAURI_PRIVATE_KEY }}' - SIGN: '1' - SIGN_KEY: '${{ secrets.APPIMAGE_SIGN_KEYID }}' - APPIMAGETOOL_SIGN_PASSPHRASE: - '${{ secrets.APPIMAGE_SIGN_PASSPHRASE }}' - with: - configPath: release.tauri.conf.json - projectPath: ./desktop/app - target: ${{ matrix.config.rust_target }} - debug: true - args: --verbose - - - name: Upload sourcemaps - uses: actions/upload-artifact@v3 - with: - name: sourcemaps-${{ matrix.config.rust_target }} - path: frontend/app/dist/**/*.map - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: artifacts-${{ matrix.config.goarch }} - path: - "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}" - - publish-to-github: - needs: build-binaries - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Download amd64 artifacts - uses: actions/download-artifact@v3 - with: - path: artifacts - - - name: Create Sentry Release - uses: getsentry/action-release@v1 - with: - environment: 'development' - version: mintter@${{ needs.get-version.outputs.version }} - finalize: true - sourcemaps: - './artifacts/sourcemaps-aarch64-apple-darwin - ./artifacts/sourcemaps-x86_64-apple-darwin - ./artifacts/sourcemaps-x86_64-pc-windows-msvc - ./artifacts/sourcemaps-x86_64-unknown-linux-gnu' - env: - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_ORG: ${{ secrets.SENTRY_ORG }} - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - - - name: Rename .app artifacts - run: | - mv ./artifacts/amd64/macos/Mintter.app.tar.gz ./artifacts/amd64/macos/Mintter_x86.app.tar.gz - mv ./artifacts/arm64/macos/Mintter.app.tar.gz ./artifacts/arm64/macos/Mintter_aarch64.app.tar.gz - mv ./artifacts/amd64/macos/Mintter.app.tar.gz.sig ./artifacts/amd64/macos/Mintter_x86.app.tar.gz.sig - mv ./artifacts/arm64/macos/Mintter.app.tar.gz.sig ./artifacts/arm64/macos/Mintter_aarch64.app.tar.gz.sig - - - name: 'create release' - uses: softprops/action-gh-release@master - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - with: - draft: false - files: ./artifacts/**/* - - publish-to-aws: - needs: build-binaries - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Download amd64 artifacts - uses: actions/download-artifact@v3 - with: - name: artifacts-amd64 - path: artifacts/amd64 - - - name: Download arm64 artifacts - uses: actions/download-artifact@v3 - with: - name: artifacts-arm64 - path: artifacts/arm64 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: "yarn" - - - name: Install Dependencies - run: | - yarn set version latest - yarn - - - name: Generate static updater manifest - run: - node scripts/generate-update-manifest-stable.mjs ${{ github.ref_name - }} > ./artifacts/manifest.json - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ env.AWS_REGION }} - - - name: Upload artifacts to S3 - run: aws s3 sync ./artifacts s3://mintterreleases/ --delete diff --git a/.github/workflows/test-javascript.yml b/.github/workflows/test-javascript.yml deleted file mode 100644 index 594e9792c4..0000000000 --- a/.github/workflows/test-javascript.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Unit Test JavaScript - -on: - push: - branches: - - master - paths: - - '.github/workflows/test-javascript.yml' - - 'frontend/**' - - 'package.json' - pull_request: - paths: - - '.github/workflows/test-javascript.yml' - - 'frontend/**' - - 'package.json' - branches-ignore: - - 'renovate/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test-javascript: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: "yarn" - - - name: Install Dependencies - run: | - yarn set version latest - yarn - - # - name: Build Frontend Shared packages - # run: yarn shared:build - - - name: Run Frontend packages tests - run: yarn test diff --git a/.github/workflows/test-rust.yml b/.github/workflows/test-rust.yml deleted file mode 100644 index 971880d002..0000000000 --- a/.github/workflows/test-rust.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Test Rust - -on: - push: - branches: - - master - paths: - - '.github/workflows/lint-rust.yml' - - 'Cargo.toml' - - 'desktop/**' - pull_request: - paths: - - '.github/workflows/lint-rust.yml' - - 'Cargo.toml' - - 'desktop/**' - branches-ignore: - - 'renovate/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test-rust: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - steps: - - uses: actions/checkout@v3 - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - - name: 'Install native packages' - if: "matrix.os == 'ubuntu-latest'" - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf - - name: Mock Files - if: matrix.os == 'ubuntu-latest' - run: | - mkdir -p plz-out/bin/backend - touch plz-out/bin/backend/mintterd-x86_64-unknown-linux-gnu - mkdir -p frontend/apps/desktop/dist - - name: Mock Daemon - if: matrix.os == 'macos-latest' - run: | - mkdir -p plz-out/bin/backend - touch plz-out/bin/backend/mintterd-x86_64-apple-darwin - mkdir -p frontend/apps/desktop/dist - - name: Mock Daemon - if: matrix.os == 'windows-latest' - run: | - mkdir plz-out/bin/backend - echo "" > plz-out/bin/backend/mintterd-x86_64-pc-windows-msvc.exe - mkdir frontend/apps/desktop/dist - - name: Run tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=Cargo.toml --release diff --git a/.github/workflows/udeps.yml b/.github/workflows/udeps.yml deleted file mode 100644 index 18f8172ab8..0000000000 --- a/.github/workflows/udeps.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Rust Udeps - -on: - push: - branches: - - master - pull_request: - branches-ignore: - - 'renovate/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - udeps: - runs-on: ubuntu-latest - # container: iterpre/tauri - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - - name: 'Install native packages' - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf - - name: Mock Files - run: | - mkdir -p plz-out/bin/backend - touch plz-out/bin/backend/mintterd-x86_64-unknown-linux-gnu - mkdir -p frontend/apps/desktop/dist - - uses: actions-rs/cargo@v1 - with: - command: install - args: cargo-udeps --locked - - uses: actions-rs/cargo@v1 - with: - command: udeps - args: - --workspace --manifest-path=Cargo.toml --all-targets --all-features diff --git a/.github/workflows/validate-desktop.yml b/.github/workflows/validate-desktop.yml new file mode 100644 index 0000000000..db454b5860 --- /dev/null +++ b/.github/workflows/validate-desktop.yml @@ -0,0 +1,57 @@ +name: Validate + Test Desktop code + +on: + push: + branches: + - master + - electron-ci + paths: + - '.github/workflows/validate-desktop.yml' + - 'frontend/apps/desktop/**' + - 'frotend/packages/**' + - 'package.json' + - 'frontend/apps/desktop/package.json' + pull_request: + paths: + - '.github/workflows/validate-desktop.yml' + - 'frontend/apps/desktop/**' + - 'frotend/packages/**' + - 'package.json' + - 'frontend/apps/desktop/package.json' + branches-ignore: + - 'renovate/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + validate-test-desktop: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: ./.github/actions/ci-setup + with: + matrix-os: 'ubuntu-latest' + + - name: Validate code + run: | + yarn build + yarn desktop:validate + yarn desktop:lint + + - name: Build Backend (Unix) + run: | + mkdir -p plz-out/bin/backend + go build -o plz-out/bin/backend/mintterd-x86_64-unknown-linux-gnu ./backend/cmd/mintterd + env: + GOARCH: amd64 + CGO_ENABLED: 1 + + - name: Package desktop app + run: | + yarn desktop:package + + - name: Run desktop app tests + run: yarn desktop:test diff --git a/.github/workflows/validate-site.yml b/.github/workflows/validate-site.yml new file mode 100644 index 0000000000..c6879377e1 --- /dev/null +++ b/.github/workflows/validate-site.yml @@ -0,0 +1,54 @@ +name: Validate + Test Site code + +on: + push: + branches: + - master + - electron-ci + paths: + - '.github/workflows/validate-site.yml' + - 'frontend/apps/site/**' + - 'frotend/packages/shared/**' + - 'frotend/packages/ui/**' + - 'package.json' + - 'frontend/apps/site/package.json' + pull_request: + paths: + - '.github/workflows/validate-site.yml' + - 'frontend/apps/site/**' + - 'frotend/packages/**' + - 'package.json' + - 'frontend/apps/site/package.json' + branches-ignore: + - 'renovate/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + validate-test-site: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install Node.js 20 + uses: actions/setup-node@v3 + with: + node-version: 20 + cache: 'yarn' + + - name: Install Frontend Dependencies + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false + run: | + yarn + + - name: Validate Code + run: | + yarn build + yarn site:validate + yarn site:lint + + - name: Run Site tests + run: yarn site:test \ No newline at end of file diff --git a/.gitignore b/.gitignore index d2863fa491..1b35280f5e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,6 @@ bazel-* .bazel # Frontend -frontend/apps/desktop/.vite frontend-old # Backend code @@ -44,7 +43,6 @@ node_modules !.yarn/releases !.yarn/sdks !.yarn/versions -apps/desktop/.vite # expo **/.expo/* @@ -63,7 +61,6 @@ apps/desktop/.vite npm-debug.log* yarn-debug.log* yarn-error.log* -.pnpm-debug.log* # local env files .env.local @@ -82,7 +79,6 @@ yarn-error.log* THUMBS_DB thumbs.db -frontend/apps/forge/* /test-results/ /playwright-report/ /playwright/.cache/ diff --git a/.plzconfig b/.plzconfig index 7fceca0c23..39d21b2051 100644 --- a/.plzconfig +++ b/.plzconfig @@ -2,19 +2,19 @@ SelfUpdate = false [parse] -BuildFileName = "BUILD.plz" -GitFunctions = true -BuildDefsDir = "build/rules" BlacklistDirs = "node_modules" BlacklistDirs = "target" BlacklistDirs = "third_party" +BuildDefsDir = "build/rules" +BuildFileName = "BUILD.plz" +GitFunctions = true [build] -ExitOnError = true -Path = "/bin:/usr/bin" PassUnsafeEnv = "WORKSPACE" ; This is expected to be set via nix-shell to point to the absolute path to the workspace. Needed to do some nasty but useful work around. +ExitOnError = true PassUnsafeEnv = "NIX_SSL_CERT_FILE" PassUnsafeEnv = "NIX_PATH" +Path = "/bin:/usr/bin" [cache] Dir = ".plz-cache" @@ -26,5 +26,3 @@ DirClean = true go-tool = //build/nix:go md5sum-tool = //build/nix:md5sum yarn-tool = //build/nix:yarn -cargo-tool = //build/nix:cargo -rustc-tool = //build/nix:rustc diff --git a/.prettierignore b/.prettierignore index 57c61d0d88..0b6de10276 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,7 +4,6 @@ node_modules # build code build dist -src-tauri public out plz-out @@ -34,6 +33,7 @@ frontend/apps/site/.next frontend/apps/site/.vercel frontend/apps/site/.tamagui frontend/apps/desktop/.tamagui +frotnend/apps/desktop/out # Shared frontend/packages/shared/src/client/.generated diff --git a/.vscode/extensions.json b/.vscode/extensions.json index f02ed110f9..8f1176c5c5 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -10,14 +10,12 @@ "arcanis.vscode-zipfs", "dbaeumer.vscode-eslint", "esbenp.prettier-vscode", - "rust-lang.rust-analyzer", "bazelbuild.vscode-bazel", "zxh404.vscode-proto3", "mkhl.direnv", ], // List of extensions recommended by VS Code that should not be recommended for users of this workspace. "unwantedRecommendations": [ - "rust-lang.rust", // This one doesn't work well or at all. "rubymaniac.vscode-direnv", // This one stopped working for some reason. diff --git a/.yarn/plugins/@yarnpkg/plugin-version.cjs b/.yarn/plugins/@yarnpkg/plugin-version.cjs new file mode 100644 index 0000000000..87de4f440a --- /dev/null +++ b/.yarn/plugins/@yarnpkg/plugin-version.cjs @@ -0,0 +1,550 @@ +/* eslint-disable */ +//prettier-ignore +module.exports = { +name: "@yarnpkg/plugin-version", +factory: function (require) { +var plugin=(()=>{var ZB=Object.create,zy=Object.defineProperty,$B=Object.defineProperties,eU=Object.getOwnPropertyDescriptor,tU=Object.getOwnPropertyDescriptors,nU=Object.getOwnPropertyNames,uS=Object.getOwnPropertySymbols,rU=Object.getPrototypeOf,oS=Object.prototype.hasOwnProperty,iU=Object.prototype.propertyIsEnumerable;var lS=(i,o,f)=>o in i?zy(i,o,{enumerable:!0,configurable:!0,writable:!0,value:f}):i[o]=f,E0=(i,o)=>{for(var f in o||(o={}))oS.call(o,f)&&lS(i,f,o[f]);if(uS)for(var f of uS(o))iU.call(o,f)&&lS(i,f,o[f]);return i},Gf=(i,o)=>$B(i,tU(o)),uU=i=>zy(i,"__esModule",{value:!0});var ce=(i,o)=>()=>(o||i((o={exports:{}}).exports,o),o.exports),sS=(i,o)=>{for(var f in o)zy(i,f,{get:o[f],enumerable:!0})},oU=(i,o,f)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of nU(o))!oS.call(i,p)&&p!=="default"&&zy(i,p,{get:()=>o[p],enumerable:!(f=eU(o,p))||f.enumerable});return i},Mi=i=>oU(uU(zy(i!=null?ZB(rU(i)):{},"default",i&&i.__esModule&&"default"in i?{get:()=>i.default,enumerable:!0}:{value:i,enumerable:!0})),i);var eD=ce((F$,aS)=>{function lU(i,o){for(var f=-1,p=i==null?0:i.length,E=Array(p);++f
{function sU(){this.__data__=[],this.size=0}fS.exports=sU});var tD=ce((P$,dS)=>{function aU(i,o){return i===o||i!==i&&o!==o}dS.exports=aU});var qy=ce((I$,pS)=>{var fU=tD();function cU(i,o){for(var f=i.length;f--;)if(fU(i[f][0],o))return f;return-1}pS.exports=cU});var vS=ce((B$,hS)=>{var dU=qy(),pU=Array.prototype,hU=pU.splice;function vU(i){var o=this.__data__,f=dU(o,i);if(f<0)return!1;var p=o.length-1;return f==p?o.pop():hU.call(o,f,1),--this.size,!0}hS.exports=vU});var yS=ce((U$,mS)=>{var mU=qy();function yU(i){var o=this.__data__,f=mU(o,i);return f<0?void 0:o[f][1]}mS.exports=yU});var _S=ce((j$,gS)=>{var gU=qy();function _U(i){return gU(this.__data__,i)>-1}gS.exports=_U});var DS=ce((z$,ES)=>{var EU=qy();function DU(i,o){var f=this.__data__,p=EU(f,i);return p<0?(++this.size,f.push([i,o])):f[p][1]=o,this}ES.exports=DU});var Hy=ce((q$,wS)=>{var wU=cS(),SU=vS(),TU=yS(),CU=_S(),xU=DS();function jv(i){var o=-1,f=i==null?0:i.length;for(this.clear();++o {var xz=sd(),Az=function(){try{var i=xz(Object,"defineProperty");return i({},"",{}),i}catch(o){}}();UT.exports=Az});var sD=ce((Aee,jT)=>{var zT=lD();function Rz(i,o,f){o=="__proto__"&&zT?zT(i,o,{configurable:!0,enumerable:!0,value:f,writable:!0}):i[o]=f}jT.exports=Rz});var aD=ce((Ree,qT)=>{var Oz=sD(),kz=tD(),Mz=Object.prototype,Nz=Mz.hasOwnProperty;function Lz(i,o,f){var p=i[o];(!(Nz.call(i,o)&&kz(p,f))||f===void 0&&!(o in i))&&Oz(i,o,f)}qT.exports=Lz});var Gv=ce((Oee,HT)=>{var Fz=aD(),bz=sD();function Pz(i,o,f,p){var E=!f;f||(f={});for(var t=-1,k=o.length;++t {function LH(i,o){for(var f=-1,p=i==null?0:i.length,E=0,t=[];++f {function FH(){return[]}qC.exports=FH});var U_=ce((nte,HC)=>{var bH=zC(),PH=yD(),IH=Object.prototype,BH=IH.propertyIsEnumerable,WC=Object.getOwnPropertySymbols,UH=WC?function(i){return i==null?[]:(i=Object(i),bH(WC(i),function(o){return BH.call(i,o)}))}:PH;HC.exports=UH});var GC=ce((rte,VC)=>{var jH=Gv(),zH=U_();function qH(i,o){return jH(i,zH(i),o)}VC.exports=qH});var j_=ce((ite,YC)=>{function HH(i,o){for(var f=-1,p=o.length,E=i.length;++f {var WH=vD(),VH=WH(Object.getPrototypeOf,Object);KC.exports=VH});var gD=ce((ote,XC)=>{var GH=j_(),YH=z_(),KH=U_(),XH=yD(),QH=Object.getOwnPropertySymbols,JH=QH?function(i){for(var o=[];i;)GH(o,KH(i)),i=YH(i);return o}:XH;XC.exports=JH});var JC=ce((lte,QC)=>{var ZH=Gv(),$H=gD();function eW(i,o){return ZH(i,$H(i),o)}QC.exports=eW});var _D=ce((ste,ZC)=>{var tW=j_(),nW=fd();function rW(i,o,f){var p=o(i);return nW(i)?p:tW(p,f(i))}ZC.exports=rW});var e6=ce((ate,$C)=>{var iW=_D(),uW=U_(),oW=I_();function lW(i){return iW(i,oW,uW)}$C.exports=lW});var ED=ce((fte,t6)=>{var sW=_D(),aW=gD(),fW=B_();function cW(i){return sW(i,fW,aW)}t6.exports=cW});var r6=ce((cte,n6)=>{var dW=sd(),pW=Yf(),hW=dW(pW,"DataView");n6.exports=hW});var u6=ce((dte,i6)=>{var vW=sd(),mW=Yf(),yW=vW(mW,"Promise");i6.exports=yW});var l6=ce((pte,o6)=>{var gW=sd(),_W=Yf(),EW=gW(_W,"Set");o6.exports=EW});var a6=ce((hte,s6)=>{var DW=sd(),wW=Yf(),SW=DW(wW,"WeakMap");s6.exports=SW});var q_=ce((vte,f6)=>{var DD=r6(),wD=L_(),SD=u6(),TD=l6(),CD=a6(),c6=Qp(),Qv=uD(),d6="[object Map]",TW="[object Object]",p6="[object Promise]",h6="[object Set]",v6="[object WeakMap]",m6="[object DataView]",CW=Qv(DD),xW=Qv(wD),AW=Qv(SD),RW=Qv(TD),OW=Qv(CD),Jp=c6;(DD&&Jp(new DD(new ArrayBuffer(1)))!=m6||wD&&Jp(new wD)!=d6||SD&&Jp(SD.resolve())!=p6||TD&&Jp(new TD)!=h6||CD&&Jp(new CD)!=v6)&&(Jp=function(i){var o=c6(i),f=o==TW?i.constructor:void 0,p=f?Qv(f):"";if(p)switch(p){case CW:return m6;case xW:return d6;case AW:return p6;case RW:return h6;case OW:return v6}return o});f6.exports=Jp});var g6=ce((mte,y6)=>{var kW=Object.prototype,MW=kW.hasOwnProperty;function NW(i){var o=i.length,f=new i.constructor(o);return o&&typeof i[0]=="string"&&MW.call(i,"index")&&(f.index=i.index,f.input=i.input),f}y6.exports=NW});var E6=ce((yte,_6)=>{var LW=Yf(),FW=LW.Uint8Array;_6.exports=FW});var H_=ce((gte,D6)=>{var w6=E6();function bW(i){var o=new i.constructor(i.byteLength);return new w6(o).set(new w6(i)),o}D6.exports=bW});var T6=ce((_te,S6)=>{var PW=H_();function IW(i,o){var f=o?PW(i.buffer):i.buffer;return new i.constructor(f,i.byteOffset,i.byteLength)}S6.exports=IW});var x6=ce((Ete,C6)=>{var BW=/\w*$/;function UW(i){var o=new i.constructor(i.source,BW.exec(i));return o.lastIndex=i.lastIndex,o}C6.exports=UW});var M6=ce((Dte,A6)=>{var R6=zv(),O6=R6?R6.prototype:void 0,k6=O6?O6.valueOf:void 0;function jW(i){return k6?Object(k6.call(i)):{}}A6.exports=jW});var L6=ce((wte,N6)=>{var zW=H_();function qW(i,o){var f=o?zW(i.buffer):i.buffer;return new i.constructor(f,i.byteOffset,i.length)}N6.exports=qW});var b6=ce((Ste,F6)=>{var HW=H_(),WW=T6(),VW=x6(),GW=M6(),YW=L6(),KW="[object Boolean]",XW="[object Date]",QW="[object Map]",JW="[object Number]",ZW="[object RegExp]",$W="[object Set]",eV="[object String]",tV="[object Symbol]",nV="[object ArrayBuffer]",rV="[object DataView]",iV="[object Float32Array]",uV="[object Float64Array]",oV="[object Int8Array]",lV="[object Int16Array]",sV="[object Int32Array]",aV="[object Uint8Array]",fV="[object Uint8ClampedArray]",cV="[object Uint16Array]",dV="[object Uint32Array]";function pV(i,o,f){var p=i.constructor;switch(o){case nV:return HW(i);case KW:case XW:return new p(+i);case rV:return WW(i,f);case iV:case uV:case oV:case lV:case sV:case aV:case fV:case cV:case dV:return YW(i,f);case QW:return new p;case JW:case eV:return new p(i);case ZW:return VW(i);case $W:return new p;case tV:return GW(i)}}F6.exports=pV});var B6=ce((Tte,P6)=>{var hV=qv(),I6=Object.create,vV=function(){function i(){}return function(o){if(!hV(o))return{};if(I6)return I6(o);i.prototype=o;var f=new i;return i.prototype=void 0,f}}();P6.exports=vV});var j6=ce((Cte,U6)=>{var mV=B6(),yV=z_(),gV=P_();function _V(i){return typeof i.constructor=="function"&&!gV(i)?mV(yV(i)):{}}U6.exports=_V});var q6=ce((xte,z6)=>{var EV=q_(),DV=ad(),wV="[object Map]";function SV(i){return DV(i)&&EV(i)==wV}z6.exports=SV});var G6=ce((Ate,H6)=>{var TV=q6(),CV=F_(),W6=b_(),V6=W6&&W6.isMap,xV=V6?CV(V6):TV;H6.exports=xV});var K6=ce((Rte,Y6)=>{var AV=q_(),RV=ad(),OV="[object Set]";function kV(i){return RV(i)&&AV(i)==OV}Y6.exports=kV});var Z6=ce((Ote,X6)=>{var MV=K6(),NV=F_(),Q6=b_(),J6=Q6&&Q6.isSet,LV=J6?NV(J6):MV;X6.exports=LV});var rx=ce((kte,$6)=>{var FV=PT(),bV=BT(),PV=aD(),IV=CC(),BV=NC(),UV=IC(),jV=UC(),zV=GC(),qV=JC(),HV=e6(),WV=ED(),VV=q_(),GV=g6(),YV=b6(),KV=j6(),XV=fd(),QV=cD(),JV=G6(),ZV=qv(),$V=Z6(),eG=I_(),tG=B_(),nG=1,rG=2,iG=4,ex="[object Arguments]",uG="[object Array]",oG="[object Boolean]",lG="[object Date]",sG="[object Error]",tx="[object Function]",aG="[object GeneratorFunction]",fG="[object Map]",cG="[object Number]",nx="[object Object]",dG="[object RegExp]",pG="[object Set]",hG="[object String]",vG="[object Symbol]",mG="[object WeakMap]",yG="[object ArrayBuffer]",gG="[object DataView]",_G="[object Float32Array]",EG="[object Float64Array]",DG="[object Int8Array]",wG="[object Int16Array]",SG="[object Int32Array]",TG="[object Uint8Array]",CG="[object Uint8ClampedArray]",xG="[object Uint16Array]",AG="[object Uint32Array]",Wu={};Wu[ex]=Wu[uG]=Wu[yG]=Wu[gG]=Wu[oG]=Wu[lG]=Wu[_G]=Wu[EG]=Wu[DG]=Wu[wG]=Wu[SG]=Wu[fG]=Wu[cG]=Wu[nx]=Wu[dG]=Wu[pG]=Wu[hG]=Wu[vG]=Wu[TG]=Wu[CG]=Wu[xG]=Wu[AG]=!0;Wu[sG]=Wu[tx]=Wu[mG]=!1;function W_(i,o,f,p,E,t){var k,L=o&nG,N=o&rG,C=o&iG;if(f&&(k=E?f(i,p,E,t):f(i)),k!==void 0)return k;if(!ZV(i))return i;var U=XV(i);if(U){if(k=GV(i),!L)return jV(i,k)}else{var q=VV(i),W=q==tx||q==aG;if(QV(i))return UV(i,L);if(q==nx||q==ex||W&&!E){if(k=N||W?{}:KV(i),!L)return N?qV(i,BV(k,i)):zV(i,IV(k,i))}else{if(!Wu[q])return E?i:{};k=YV(i,q,L)}}t||(t=new FV);var ne=t.get(i);if(ne)return ne;t.set(i,k),$V(i)?i.forEach(function(Se){k.add(W_(Se,o,f,Se,i,t))}):JV(i)&&i.forEach(function(Se,he){k.set(he,W_(Se,o,f,he,i,t))});var m=C?N?WV:HV:N?tG:eG,we=U?void 0:m(i);return bV(we||i,function(Se,he){we&&(he=Se,Se=i[he]),PV(k,he,W_(Se,o,f,he,i,t))}),k}$6.exports=W_});var V_=ce((Mte,ix)=>{var RG=Qp(),OG=ad(),kG="[object Symbol]";function MG(i){return typeof i=="symbol"||OG(i)&&RG(i)==kG}ix.exports=MG});var ox=ce((Nte,ux)=>{var NG=fd(),LG=V_(),FG=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bG=/^\w*$/;function PG(i,o){if(NG(i))return!1;var f=typeof i;return f=="number"||f=="symbol"||f=="boolean"||i==null||LG(i)?!0:bG.test(i)||!FG.test(i)||o!=null&&i in Object(o)}ux.exports=PG});var ax=ce((Lte,lx)=>{var sx=oD(),IG="Expected a function";function xD(i,o){if(typeof i!="function"||o!=null&&typeof o!="function")throw new TypeError(IG);var f=function(){var p=arguments,E=o?o.apply(this,p):p[0],t=f.cache;if(t.has(E))return t.get(E);var k=i.apply(this,p);return f.cache=t.set(E,k)||t,k};return f.cache=new(xD.Cache||sx),f}xD.Cache=sx;lx.exports=xD});var cx=ce((Fte,fx)=>{var BG=ax(),UG=500;function jG(i){var o=BG(i,function(p){return f.size===UG&&f.clear(),p}),f=o.cache;return o}fx.exports=jG});var px=ce((bte,dx)=>{var zG=cx(),qG=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,HG=/\\(\\)?/g,WG=zG(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(qG,function(f,p,E,t){o.push(E?t.replace(HG,"$1"):p||f)}),o});dx.exports=WG});var _x=ce((Pte,hx)=>{var vx=zv(),VG=eD(),GG=fd(),YG=V_(),KG=1/0,mx=vx?vx.prototype:void 0,yx=mx?mx.toString:void 0;function gx(i){if(typeof i=="string")return i;if(GG(i))return VG(i,gx)+"";if(YG(i))return yx?yx.call(i):"";var o=i+"";return o=="0"&&1/i==-KG?"-0":o}hx.exports=gx});var Dx=ce((Ite,Ex)=>{var XG=_x();function QG(i){return i==null?"":XG(i)}Ex.exports=QG});var G_=ce((Bte,wx)=>{var JG=fd(),ZG=ox(),$G=px(),eY=Dx();function tY(i,o){return JG(i)?i:ZG(i,o)?[i]:$G(eY(i))}wx.exports=tY});var Tx=ce((Ute,Sx)=>{function nY(i){var o=i==null?0:i.length;return o?i[o-1]:void 0}Sx.exports=nY});var AD=ce((jte,Cx)=>{var rY=V_(),iY=1/0;function uY(i){if(typeof i=="string"||rY(i))return i;var o=i+"";return o=="0"&&1/i==-iY?"-0":o}Cx.exports=uY});var Ax=ce((zte,xx)=>{var oY=G_(),lY=AD();function sY(i,o){o=oY(o,i);for(var f=0,p=o.length;i!=null&&f {function aY(i,o,f){var p=-1,E=i.length;o<0&&(o=-o>E?0:E+o),f=f>E?E:f,f<0&&(f+=E),E=o>f?0:f-o>>>0,o>>>=0;for(var t=Array(E);++p1&&arguments[1]!==void 0?arguments[1]:NaN,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Jf.DIRECTION_LTR;return k.call(this,L,N,C)}),$K({Config:o.Config,Node:o.Node,Layout:i("Layout",eX),Size:i("Size",C9),Value:i("Value",x9),getInstanceCount:function(){return o.getInstanceCount.apply(o,arguments)}},Jf)}});var R9=ce((exports,module)=>{(function(i,o){typeof define=="function"&&define.amd?define([],function(){return o}):typeof module=="object"&&module.exports?module.exports=o:(i.nbind=i.nbind||{}).init=o})(exports,function(Module,cb){typeof Module=="function"&&(cb=Module,Module={}),Module.onRuntimeInitialized=function(i,o){return function(){i&&i.apply(this,arguments);try{Module.ccall("nbind_init")}catch(f){o(f);return}o(null,{bind:Module._nbind_value,reflect:Module.NBind.reflect,queryType:Module.NBind.queryType,toggleLightGC:Module.toggleLightGC,lib:Module})}}(Module.onRuntimeInitialized,cb);var Module;Module||(Module=(typeof Module!="undefined"?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1;if(Module.ENVIRONMENT)if(Module.ENVIRONMENT==="WEB")ENVIRONMENT_IS_WEB=!0;else if(Module.ENVIRONMENT==="WORKER")ENVIRONMENT_IS_WORKER=!0;else if(Module.ENVIRONMENT==="NODE")ENVIRONMENT_IS_NODE=!0;else if(Module.ENVIRONMENT==="SHELL")ENVIRONMENT_IS_SHELL=!0;else throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");else ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof require=="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn);var nodeFS,nodePath;Module.read=function(o,f){nodeFS||(nodeFS={}("")),nodePath||(nodePath={}("")),o=nodePath.normalize(o);var p=nodeFS.readFileSync(o);return f?p:p.toString()},Module.readBinary=function(o){var f=Module.read(o,!0);return f.buffer||(f=new Uint8Array(f)),assert(f.buffer),f},Module.load=function(o){globalEval(read(o))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),typeof module!="undefined"&&(module.exports=Module),Module.inspect=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),typeof printErr!="undefined"&&(Module.printErr=printErr),typeof read!="undefined"?Module.read=read:Module.read=function(){throw"no read() available"},Module.readBinary=function(o){if(typeof readbuffer=="function")return new Uint8Array(readbuffer(o));var f=read(o,"binary");return assert(typeof f=="object"),f},typeof scriptArgs!="undefined"?Module.arguments=scriptArgs:typeof arguments!="undefined"&&(Module.arguments=arguments),typeof quit=="function"&&(Module.quit=function(i,o){quit(i)});else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(Module.read=function(o){var f=new XMLHttpRequest;return f.open("GET",o,!1),f.send(null),f.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(o){var f=new XMLHttpRequest;return f.open("GET",o,!1),f.responseType="arraybuffer",f.send(null),new Uint8Array(f.response)}),Module.readAsync=function(o,f,p){var E=new XMLHttpRequest;E.open("GET",o,!0),E.responseType="arraybuffer",E.onload=function(){E.status==200||E.status==0&&E.response?f(E.response):p()},E.onerror=p,E.send(null)},typeof arguments!="undefined"&&(Module.arguments=arguments),typeof console!="undefined")Module.print||(Module.print=function(o){console.log(o)}),Module.printErr||(Module.printErr=function(o){console.warn(o)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&typeof dump!="undefined"?function(i){dump(i)}:function(i){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),typeof Module.setWindowTitle=="undefined"&&(Module.setWindowTitle=function(i){document.title=i})}else throw"Unknown runtime environment. Where are we?";function globalEval(i){eval.call(null,i)}!Module.load&&Module.read&&(Module.load=function(o){globalEval(Module.read(o))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.quit||(Module.quit=function(i,o){throw o}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=void 0;var Runtime={setTempRet0:function(i){return tempRet0=i,i},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(i){STACKTOP=i},getNativeTypeSize:function(i){switch(i){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(i[i.length-1]==="*")return Runtime.QUANTUM_SIZE;if(i[0]==="i"){var o=parseInt(i.substr(1));return assert(o%8==0),o/8}else return 0}}},getNativeFieldSize:function(i){return Math.max(Runtime.getNativeTypeSize(i),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(i,o){return o==="double"||o==="i64"?i&7&&(assert((i&7)==4),i+=4):assert((i&3)==0),i},getAlignSize:function(i,o,f){return!f&&(i=="i64"||i=="double")?8:i?Math.min(o||(i?Runtime.getNativeFieldSize(i):0),Runtime.QUANTUM_SIZE):Math.min(o,8)},dynCall:function(i,o,f){return f&&f.length?Module["dynCall_"+i].apply(null,[o].concat(f)):Module["dynCall_"+i].call(null,o)},functionPointers:[],addFunction:function(i){for(var o=0;o
>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?P>>>0>>1>>>0?S>>>0>>1>>>0?S>>>0