Skip to content

Commit

Permalink
Merge pull request #11 from BRAVO68WEB/core/major-changes
Browse files Browse the repository at this point in the history
core/major changes
  • Loading branch information
BRAVO68WEB authored Jun 19, 2024
2 parents 8c12812 + 15e0886 commit 96d3e4d
Show file tree
Hide file tree
Showing 51 changed files with 15,662 additions and 11,954 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
HASURA_GRAPHQL_METADATA_URL=
HASURA_GRAPHQL_URL=
HASURA_GRAPHQL_ADMIN_SECRET=
98 changes: 49 additions & 49 deletions .github/workflows/sync-run.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
name: "Project Sync Run"

on:
workflow_dispatch:
inputs:
sync:
description: 'Dump DB'
required: true
default: false
type: boolean
schedule:
- cron: '0 */12 * * *'
workflow_dispatch:
inputs:
sync:
description: "Dump DB"
required: true
default: false
type: boolean
schedule:
- cron: "0 */12 * * *"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Installing Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: ankane/setup-postgres@v1
with:
postgres-version: 15
- name: Download PKG Databases
run: ./scripts/get_pkgs.sh
- name: Init Local Database
run: ./scripts/init_db.sh
- name: Building with Cargo
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Run DBGen Parse
run: cargo run --release --bin dbgen
- name: Run AUR Parser
run: cargo run --release --bin aurparser
- name: Index Local Database
run: ./scripts/index_db.sh
- name: DB Clean Up
run: |
psql -d ${{ secrets.PG_CONNECTION_STRING }} -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public;"
- name: Run Additional Scripts
run: |
curl https://github.com/Roxedus/Pgloader-bin/releases/download/ec8f41d/pgloader -L -o pgloader
chmod +x pgloader
./pgloader sqlite://db/local.db ${{ secrets.PG_CONNECTION_STRING }} >/dev/null 2>&1
- name: Sync Hasura Metadata
run: |
./scripts/hasura_sync.sh ${{ secrets.HASURA_GRAPHQL_ADMIN_SECRET }}
- uses: actions/upload-artifact@v4
if: ${{ github.event.inputs.sync == 'true' }}
name: Upload DB
with:
name: localdbs
path: |
**/local.db
db/local.db
- uses: actions/checkout@v2
- name: Installing Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: ankane/setup-postgres@v1
with:
postgres-version: 15
- name: Download PKG Databases
run: ./scripts/get_pkgs.sh
- name: Init Local Database
run: ./scripts/init_db.sh
- name: Building with Cargo
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Run DBGen Parse
run: cargo run --release --bin dbgen
- name: Run AUR Parser
run: cargo run --release --bin aurparser
- name: Index Local Database
run: ./scripts/index_db.sh
- name: DB Clean Up
run: |
psql -d ${{ secrets.PG_CONNECTION_STRING }} -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public;"
- name: Run Additional Scripts
run: |
curl https://github.com/Roxedus/Pgloader-bin/releases/download/ec8f41d/pgloader -L -o pgloader
chmod +x pgloader
./pgloader sqlite://db/local.db ${{ secrets.PG_CONNECTION_STRING }} >/dev/null 2>&1
- name: Sync Hasura Metadata
run: |
./scripts/hasura_sync.sh ${{ secrets.HASURA_GRAPHQL_ADMIN_SECRET }}
- uses: actions/upload-artifact@v4
if: ${{ github.event.inputs.sync == 'true' }}
name: Upload DB
with:
name: localdbs
path: |
**/local.db
db/local.db
46 changes: 23 additions & 23 deletions .github/workflows/test-run.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
name: "Project Test Run"

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
workflow_dispatch:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Installing Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Download PKG Databases
run: ./scripts/get_pkgs.sh
- name: Init Local Database
run: ./scripts/init_db.sh
- name: Building with Cargo
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Run DBGen Parse
run: cargo run --release --bin dbgen
- name: Run AUR Parser
run: cargo run --release --bin aurparser
- name: Index Local Database
run: ./scripts/index_db.sh
- uses: actions/checkout@v2
- name: Installing Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Download PKG Databases
run: ./scripts/get_pkgs.sh
- name: Init Local Database
run: ./scripts/init_db.sh
- name: Building with Cargo
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Run DBGen Parse
run: cargo run --release --bin dbgen
- name: Run AUR Parser
run: cargo run --release --bin aurparser
- name: Index Local Database
run: ./scripts/index_db.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ target/
node_modules
.turbo
.vercel
.env
10 changes: 5 additions & 5 deletions .graphqlrc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
schema: 'graphql/schema.graphql'
documents: 'packages/**/*.{ts,tsx,js,jsx,graphql}'
schema: "graphql/schema.graphql"
documents: "packages/**/*.{ts,tsx,js,jsx,graphql}"
extensions:
languageService:
cacheSchemaFileForLookup: true
enableValidation: false
languageService:
cacheSchemaFileForLookup: true
enableValidation: false
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apps/pacsearch-app/.next
node_modules
target
apps/pacsearch-app/node_modules
.turbo
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": true
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# Pacman Package Finder (In Dev)

2 changes: 1 addition & 1 deletion apps/pacsearch-app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "next/core-web-vitals"
"extends": "next/core-web-vitals"
}
4 changes: 2 additions & 2 deletions apps/pacsearch-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ This project uses [`next/font`](https://nextjs.org/docs/app/building-your-applic

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

Expand Down
58 changes: 53 additions & 5 deletions apps/pacsearch-app/app/[repo]/[pkg]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,66 @@
import type { Metadata, ResolvingMetadata } from "next";

import NameContext from "@/components/NameContext";
import PackageInfo from "@/components/PackageInfo";

import getPkgsInfo from "@/libs/get_package_info";

import Link from "next/link";

export default function Page({ params }: Readonly<{ params: { repo: string, pkg: string } }>) {
type Props = {
params: {
repo: string;
pkg: string;
};
};

export async function generateMetadata(
{ params }: Props,
parent: ResolvingMetadata,
): Promise<Metadata> {
const pkg = params.pkg;
const repo = params.repo;

const pkgData = await getPkgsInfo({ pkgName: pkg, repoName: repo });

if (!pkgData.packages[0]) {
return {
title: `No package found`,
};
}

return {
title: `${pkg} | ${repo}`,
description: pkgData.packages[0].description,
authors: [
{
name: pkgData.packages[0].packager ?? pkgData.packages[0].repo,
},
],
openGraph: {
title: `${pkg} | ${repo}`,
description: pkgData.packages[0].description,
type: "website",
images: [
{
url: "https://pacsearch.b68.dev/og-image.png",
width: 1200,
height: 630,
alt: "pacsearch",
},
],
},
};
}

export default function Page({ params }: Readonly<{ params: { repo: string; pkg: string } }>) {
return (
<NameContext>
<div className="font-sans min-h-screen p-8 pb-20 gap-16 sm:p-20">
<div className="flex gap-16 flex-row sm:flex-row">
<div className="flex flex-col items-center justify-items-center">
<div className="items-center justify-items-center text-2xl pt-2 border-2 border-sky-500">
<Link href={`/`}>
Go back
</Link>
<div className="items-center justify-items-center text-2xl pt-2">
<Link href={`/`}>&#8592; Go back</Link>
</div>
</div>
<div className="flex gap-4 flex-col border-sky-500 border-2">
Expand Down
Binary file removed apps/pacsearch-app/app/favicon.ico
Binary file not shown.
Binary file removed apps/pacsearch-app/app/fonts/GeistMonoVF.woff
Binary file not shown.
Binary file removed apps/pacsearch-app/app/fonts/GeistVF.woff
Binary file not shown.
30 changes: 15 additions & 15 deletions apps/pacsearch-app/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
@tailwind utilities;

:root {
--background: #ffffff;
--foreground: #171717;
--background: #ffffff;
--foreground: #171717;
}

@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}

body {
color: var(--foreground);
background: var(--background);
font-synthesis: none;
color: var(--foreground);
background: var(--background);
font-synthesis: none;
}

.react-dropdown-select-item {
color: var(--foreground);
background: var(--background);
.react-dropdown-select-item {
color: var(--foreground);
background: var(--background);
}

.react-dropdown-select-item:hover {
color: var(--background);
background: var(--foreground);
}
color: var(--background);
background: var(--foreground);
}
Loading

0 comments on commit 96d3e4d

Please sign in to comment.