Merge remote-tracking branch 'origin/main' into github

This commit is contained in:
cocobo1 2025-09-14 11:27:14 +03:00
commit cf530fe374
16 changed files with 124 additions and 221 deletions

18
.forgejo/FUNDING.yml Normal file
View file

@ -0,0 +1,18 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: cocobo1
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
thanks_dev: # Replace with a single thanks.dev username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View file

@ -0,0 +1,61 @@
name: Node.js CI / CD (Bun + Forgejo)
on:
push:
branches: [ "main" ]
jobs:
buildAndRelease:
runs-on: codeberg-tiny
steps:
- uses: actions/checkout@v3
- name: Install Bun
run: |
curl -fsSL https://bun.sh/install | bash
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
echo "$BUN_INSTALL/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
bun install
- name: Build project
run: |
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
bun run build --release-branch=${GITHUB_REF_NAME:-${CI_COMMIT_REF_NAME}} --build-minify
- name: Push JS files to dist branch
run: |
git config --local user.email "actions@forgejo.local"
git config --local user.name "Forgejo Actions"
mkdir -p temp_dist
find dist -name "*.js" -exec cp {} temp_dist/ \;
git checkout --orphan dist-temp
git rm -rf --cached .
cp -r temp_dist/* .
rm -rf temp_dist
git add *.js
git commit -m "Update build $GITHUB_SHA" || exit 0
git push -f origin HEAD:dist
git checkout -f ${GITHUB_REF_NAME:-${CI_COMMIT_REF_NAME}}
- name: Merge main into github
if: github.ref == 'refs/heads/main'
run: |
git config --local user.email "actions@forgejo.local"
git config --local user.name "Forgejo Actions"
git fetch origin
git checkout github || git checkout -b github
git merge origin/main --no-edit --allow-unrelated-histories
git push --force origin github

View file

@ -1,5 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: 🗨 Discussions
url: https://discord.gg/ddcQf3s2Uq
about: Have something unspecific to Revenge in mind? Join us on Discord!

2
.github/config.yml vendored
View file

@ -1,2 +0,0 @@
firstPRMergeComment: >
Thank you for contributing to Revenge. Join us on [Discord](https://discord.gg/ddcQf3s2Uq) to receive a role for your contribution.

View file

@ -1,87 +0,0 @@
name: Node.js CI / CD
on:
push:
branches: [ "main" ]
jobs:
buildAndRelease:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- run: |
pnpm build --release-branch=${{ github.ref_name }} --build-minify
# - name: Create Release
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: v${{ github.run_number }}
# release_name: Release v${{ github.run_number }}
# draft: false
# prerelease: false
- name: Push JS files to dist branch
run: |
# Configure git
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
# Create a temporary directory for the dist branch
mkdir -p temp_dist
# Copy only JS files from dist/ to temp directory
find dist -name "*.js" -exec cp {} temp_dist/ \;
# Create and checkout dist branch
git checkout --orphan dist-temp
git rm -rf --cached .
# Move the JS files to the root
cp -r temp_dist/* .
rm -rf temp_dist
# Add, commit and push to dist branch
git add *.js
git commit -m "Update build $GITHUB_SHA" || exit 0
git push -f origin HEAD:dist
# Return to the original branch
git checkout -f ${GITHUB_REF#refs/heads/}

View file

@ -1,71 +0,0 @@
name: "CodeQL Advanced"
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '31 8 * * 6'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
language: [ 'javascript-typescript' ]
node-version: [20.x]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: none
- name: Build project
run: pnpm build --release-branch=${{ github.ref_name }} --build-minify
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

View file

@ -1,37 +0,0 @@
name: Release
on:
push:
branches: [main, dev]
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore Bun cache
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Release
run: bunx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_BRANCH: ${{ github.ref_name }}

View file

@ -74,7 +74,7 @@ const config = {
constModules: {
globals: {
"bunny-build-info": {
version: `"v1.1.0"`
version: `"1.2.0"`
}
}
},

View file

@ -40,7 +40,7 @@ export function serve(options) {
server.listen(args.port ?? 4040);
console.info(chalk.bold.yellowBright("Serving ra1n on:"));
console.info(chalk.bold.yellowBright("Serving Kettu on:"));
const netInterfaces = os.networkInterfaces();
for (const netinterfaces of Object.values(netInterfaces)) {

View file

@ -113,7 +113,7 @@
"UH_OH": "Uh Oh",
"UNINSTALL": "Uninstall",
"UNINSTALL_TITLE": "Uninstall {title}",
"URL_PLACEHOLDER": "https://github.com/revenge-mod",
"URL_PLACEHOLDER": "https://github.com/C0C0B01/Kettu",
"VERSION": "Version",
"VERSIONS": "Versions"
}

View file

@ -105,20 +105,6 @@ export default function Plugins() {
</Card>
</View>;
}}
ListFooterComponent={() => __DEV__ && (
<View style={{ alignItems: "center", justifyContent: "center", paddingTop: 16, gap: 12 }}><Button
size="lg"
text="Browse Plugins"
icon={findAssetId("CompassIcon")}
onPress={() => {
navigation.push("PUPU_CUSTOM_PAGE", {
title: "Plugin Browser",
render: React.lazy(() => import("../PluginBrowser")),
});
}}
/>
</View>
)}
installAction={{
label: "Install a plugin",
fetchFn: async (url: string) => {

View file

@ -52,4 +52,4 @@ export default async () => {
// We good :)
logger.log("Kettu is ready!");
};
};

View file

@ -0,0 +1,38 @@
import { StatusBar } from "react-native";
import { findByStoreNameLazy } from "@metro/wrappers";
import { _colorRef } from "./updater"; // <-- import your colorRef
const ThemeStore = findByStoreNameLazy("ThemeStore");
function getBarStyle() {
// Check for custom theme
const custom = _colorRef.current;
if (custom) {
// Bunny theme (spec 3)
if (custom.spec === 3 && custom.reference) {
return custom.reference === "light" ? "dark-content" : "light-content";
}
// Vendetta theme (spec 2)
if (custom.spec === 2 && custom.reference) {
return custom.reference === "light" ? "dark-content" : "light-content";
}
}
// Fallback to Discord theme string
const theme = ThemeStore?.theme;
if (typeof theme === "string") {
const lowerTheme = theme.toLowerCase();
return (lowerTheme.includes("dark") || lowerTheme.includes("midnight")) ? "light-content" : "dark-content";
}
return "dark-content";
}
export default function fixStatusBar() {
const origSetBarStyle = StatusBar.setBarStyle;
StatusBar.setBarStyle = function (_style: any, ...args: any[]) {
return origSetBarStyle.call(this, getBarStyle(), ...args);
};
StatusBar.setBarStyle(getBarStyle());
}

View file

@ -1,4 +1,4 @@
import fixStatusBar from "./fix";
import patchChatBackground from "./patches/background";
import patchDefinitionAndResolver from "./patches/resolver";
import patchStorage from "./patches/storage";
@ -13,6 +13,8 @@ export default function initColors(manifest: ColorManifest | null) {
patchChatBackground()
];
fixStatusBar();
if (manifest) updateBunnyColor(manifest, { update: false });
return () => patches.forEach(p => p());