Skip to content

Commit

Permalink
breaking: Switch from Prisma to Drizzle ORM (#319)
Browse files Browse the repository at this point in the history
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 20, 2024
1 parent a3a31bb commit c27dadc
Show file tree
Hide file tree
Showing 139 changed files with 3,422 additions and 2,308 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ dist
.pnp.*

# Turbo
.turbo
.turbo/*

# Intellij
.idea
Expand Down
2 changes: 1 addition & 1 deletion apps/lp/.config/shelve.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "https://raw.githubusercontent.com/HugoRCD/shelve/main/packages/types/shelveConfigSchema.json",
"$schema": "https://raw.githubusercontent.com/HugoRCD/shelve/main/packages/types/shelve-config-schema.json",
"project": "shelve-lp"
}
4 changes: 2 additions & 2 deletions apps/lp/app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ useSeoMeta({
title,
description,
author: 'Hugo Richard',
twitter: '@HugoRCD__',
twitterCreator: '@HugoRCD__',
twitterTitle: title,
twitterDescription: description,
twitterCard: 'summary_large_image',
Expand All @@ -34,7 +34,7 @@ useSeoMeta({

<template>
<Html lang="en">
<Body class="selection:bg-primary font-geist relative overflow-x-hidden bg-white text-black selection:text-inverted dark:bg-neutral-950 dark:text-white">
<Body class="overscroll-y-none selection:bg-primary font-geist relative overflow-x-hidden bg-white text-black selection:text-inverted dark:bg-neutral-950 dark:text-white">
<UApp :tooltip="{ delayDuration: 0 }">
<NuxtLayout>
<NuxtPage />
Expand Down
11 changes: 4 additions & 7 deletions apps/lp/app/assets/style/main.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
@import "tailwindcss";
@import "@nuxt/ui";

/* Global styles, css resets, etc. */
html, body, #__nuxt, #__layout {
width: 100%;
height: 100%;
overscroll-behavior: none;
}

::-webkit-scrollbar {
width: 5px;
height: 2px;
Expand All @@ -18,6 +11,10 @@ html, body, #__nuxt, #__layout {
border-radius: 5px;
}

:root {
--ui-radius: var(--radius-sm);
}

@theme {
--font-newsreader: 'Newsreader', serif;
--font-inter: 'Inter', sans-serif;
Expand Down
12 changes: 0 additions & 12 deletions apps/lp/app/components/UDivider.vue

This file was deleted.

4 changes: 4 additions & 0 deletions apps/lp/app/components/layout/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ const items = navigation.map((item) => ({
slot: item.name.toLowerCase(),
}))
type RepoType = {
stars: number
}
const githubStars = ref('0')
async function fetchRepo() {
try {
Expand Down
2 changes: 1 addition & 1 deletion apps/lp/app/components/vault/Decrypt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function decryptEnvFile() {
readsLeft.value = reads
timeLeft.value = ttl
toast.success('Your secret(s) has been decrypted')
} catch (error) {
} catch (error: any) {
if (error.statusCode === 400) {
toast.error(error.statusMessage)
} else {
Expand Down
8 changes: 4 additions & 4 deletions apps/lp/app/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ function useClipboard(text: string) {

<template>
<div class="flex flex-col gap-4">
<div class="flex h-full flex-col items-center justify-center gap-3 p-5">
<div class="flex h-full flex-col items-center justify-center gap-3 p-5 mb-10">
<LandingHero class="h-64" />
</div>
<div class="mx-auto mt-16 flex max-w-6xl flex-col gap-16 px-8 sm:flex-row sm:gap-8 sm:px-16">
<div class="mx-auto h-64 flex max-w-6xl flex-col gap-16 px-8 sm:flex-row sm:gap-8 sm:px-16">
<div class="flex w-fit flex-col gap-2">
<NuxtLink
class="mb-4"
Expand Down Expand Up @@ -61,7 +61,7 @@ function useClipboard(text: string) {
</div>
</div>

<div class="relative -top-12 py-20">
<div class="relative -top-12 py-28">
<div class="absolute inset-0 flex items-center justify-center [mask-image:linear-gradient(to_bottom,white,transparent)]">
<div class="bg-white/2.5 absolute size-96 rounded-full shadow-xl" />

Expand All @@ -80,7 +80,7 @@ function useClipboard(text: string) {
</div>
</div>
</div>
<div class="flex flex-col gap-16 p-5">
<div class="flex flex-col max-sm:mt-64 gap-16 p-5">
<div>
<LandingFeatures />
</div>
Expand Down
8 changes: 4 additions & 4 deletions apps/lp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
"vue-sonner": "^1.2.5",
"@shelve/types": "*",
"@shelve/crypto": "*",
"@tsparticles/engine": "^3.5.0",
"@tsparticles/slim": "^3.5.0",
"@tsparticles/engine": "^3.6.0",
"@tsparticles/slim": "^3.6.0",
"@nuxt/image": "^1.8.1",
"@nuxt/scripts": "^0.9.5",
"@nuxt/ui": "https://pkg.pr.new/@nuxt/ui@845f85a",
"@nuxt/ui": "https://pkg.pr.new/@nuxt/ui@25091ba",
"@nuxtjs/seo": "^2.0.0-rc.23",
"@iconify-json/heroicons": "^1.2.1",
"@iconify-json/lucide": "^1.2.12",
"@iconify-json/lucide": "^1.2.15",
"@iconify-json/simple-icons": "^1.2.11",
"@nuxt/content": "^2.13.4"
}
Expand Down
3 changes: 1 addition & 2 deletions apps/lp/server/api/vault.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { H3Event } from 'h3'
import { VaultService } from '~~/server/services/vault.service'

export default defineEventHandler(async (event: H3Event) => {
export default defineEventHandler(async (event) => {
const vault = new VaultService()
const { id } = await getQuery(event)

Expand Down
2 changes: 1 addition & 1 deletion apps/shelve/.config/shelve.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "https://raw.githubusercontent.com/HugoRCD/shelve/main/packages/types/shelveConfigSchema.json",
"$schema": "https://raw.githubusercontent.com/HugoRCD/shelve/main/packages/types/shelve-config-schema.json",
"project": "shelve"
}
3 changes: 0 additions & 3 deletions apps/shelve/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Stage 1: Build Stage
FROM oven/bun:latest AS build

ARG DATABASE_URL
ARG TURBO_TEAM
ARG TURBO_TOKEN

Check warning on line 5 in apps/shelve/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "TURBO_TOKEN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 5 in apps/shelve/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "TURBO_TOKEN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

ENV DATABASE_URL=$DATABASE_URL
ENV TURBO_TEAM=$TURBO_TEAM
ENV TURBO_TOKEN=$TURBO_TOKEN

Check warning on line 8 in apps/shelve/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TURBO_TOKEN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 8 in apps/shelve/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TURBO_TOKEN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV NODE_ENV=production
Expand All @@ -29,7 +27,6 @@ FROM oven/bun:latest
WORKDIR /app

COPY --from=build /app/apps/shelve/.output .output
COPY --from=build /app/apps/shelve/prisma ./prisma

RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*

Expand Down
24 changes: 22 additions & 2 deletions apps/shelve/app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ useSeoMeta({
title,
description,
author: 'Hugo Richard',
twitter: '@HugoRCD__',
twitterCreator: '@HugoRCD__',
twitterTitle: title,
twitterDescription: description,
twitterCard: 'summary_large_image',
Expand All @@ -37,11 +37,31 @@ const reduceMotion = useCookie<boolean>('reduceMotion', {
})
if (import.meta.client) setPrefersReducedMotion(reduceMotion.value)
const { fetchTeams } = useTeams()
defineShortcuts({
'p': () => {
navigateTo('/')
},
'm': () => {
navigateTo('/members')
},
't': () => {
navigateTo('/tokens')
},
's': () => {
navigateTo('/settings')
},
})
if (!fetchTeams())
await fetchTeams()
</script>

<template>
<Html lang="en">
<Body class="selection:bg-primary font-geist relative overflow-x-hidden bg-white text-black selection:text-inverted dark:bg-neutral-950 dark:text-white">
<Body class="overscroll-y-none selection:bg-primary font-geist relative overflow-x-hidden bg-white text-black selection:text-inverted dark:bg-neutral-950 dark:text-white">
<UApp :tooltip="{ delayDuration: 0 }">
<NuxtLayout>
<NuxtPage />
Expand Down
7 changes: 0 additions & 7 deletions apps/shelve/app/assets/style/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
@import "@nuxt/ui";
@import "./animations.css";

/* Global styles, css resets, etc. */
html, body, #__nuxt, #__layout {
width: 100%;
height: 100%;
overscroll-behavior: none;
}

::-webkit-scrollbar {
width: 5px;
height: 2px;
Expand Down
12 changes: 0 additions & 12 deletions apps/shelve/app/components/UDivider.vue

This file was deleted.

26 changes: 5 additions & 21 deletions apps/shelve/app/components/UserDropdown.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
<script setup lang="ts">
import { Role } from '@shelve/types'
const navigations = getNavigation('app')
const navItem = navigations.map((nav) => {
return {
label: nav.name,
icon: nav.icon,
to: nav.path,
}
})
const adminNavigations = getNavigation('admin')
const adminNavItem = adminNavigations.map((nav) => {
return {
label: nav.name,
icon: nav.icon,
to: nav.path,
}
})
const { loggedIn, user, clear } = useUserSession()
const items = [
Expand All @@ -29,8 +11,6 @@ const items = [
disabled: true
}
],
navItem,
...(user.value?.role === Role.ADMIN ? [adminNavItem] : []),
[
{
label: 'Sign out',
Expand All @@ -49,7 +29,11 @@ const items = [
<UDropdownMenu
v-if="loggedIn"
:items
:popper="{ placement: 'bottom-start' }"
:content="{
align: 'start',
side: 'right',
sideOffset: 8
}"
>
<UAvatar :src="user.avatar" :alt="user.username" class="cursor-pointer" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import { Role } from '@shelve/types'
const { user } = useUserSession()
const navigations = getNavigation('app')
const teamNavigations = getNavigation('team')
const userNavigations = getNavigation('user')
const adminNavigations = getNavigation('admin')
const route = useRoute()
Expand All @@ -15,16 +16,16 @@ const handleProjectNavigation = () => {
name: 'Project Details',
}
if (isCryptoRoute) {
const indexToReplace = navigations.findIndex((item) => item.path.includes('/project/'))
const indexToReplace = teamNavigations.findIndex((item) => item.path.includes('/project/'))
if (indexToReplace !== -1) {
navigations.splice(indexToReplace, 1, projectNavigation)
teamNavigations.splice(indexToReplace, 1, projectNavigation)
} else {
navigations.unshift(projectNavigation)
teamNavigations.unshift(projectNavigation)
}
} else {
const indexToRemove = navigations.findIndex((item) => item.path.includes('/project/'))
const indexToRemove = teamNavigations.findIndex((item) => item.path.includes('/project/'))
if (indexToRemove !== -1) {
navigations.splice(indexToRemove, 1)
teamNavigations.splice(indexToRemove, 1)
}
}
}
Expand All @@ -33,25 +34,44 @@ watch(() => route.path, handleProjectNavigation, { immediate: true })
</script>

<template>
<div class="flex flex-col gap-4 p-4 sm:w-[250px]">
<div class="mb-4">
<div class="flex h-full flex-col gap-4 p-4 sm:w-[250px]">
<div class="mb-2 flex items-center justify-between gap-2">
<NuxtLink to="/" class="font-newsreader text-2xl font-light italic">
Shelve
</NuxtLink>
</div>

<div>
<TeamManager />
</div>

<!-- Team -->
<div class="flex flex-col gap-2">
<TransitionGroup name="bezier" tag="ul" class="flex flex-col gap-2" mode="out-in">
<LayoutNavItem v-for="nav in navigations" :key="nav.name" :active="nav.path === $route.path" :nav-item="nav" />
</TransitionGroup>
<div class="text-xs font-medium text-neutral-500 dark:text-neutral-400">
Team
</div>
<div class="flex flex-col gap-2">
<TransitionGroup name="bezier" tag="ul" class="flex flex-col gap-2" mode="out-in">
<LayoutNavItem v-for="nav in teamNavigations" :key="nav.name" :active="nav.path === route.path" :nav-item="nav" />
</TransitionGroup>
</div>
</div>

<div v-if="user" class="flex flex-col gap-2">
<USeparator class="my-3" />
<div class="text-xs font-medium text-neutral-500 dark:text-neutral-400">
User
</div>
<LayoutNavItem v-for="nav in userNavigations" :key="nav.name" :active="nav.path === route.path" :nav-item="nav" />
</div>

<!-- Admin -->
<div v-if="user && user.role === Role.ADMIN" class="flex flex-col gap-2">
<UDivider class="my-3" />
<USeparator class="my-3" />
<div class="text-xs font-medium text-neutral-500 dark:text-neutral-400">
Admin
</div>
<LayoutNavItem v-for="nav in adminNavigations" :key="nav.name" :active="nav.path === $route.path" :nav-item="nav" />
<LayoutNavItem v-for="nav in adminNavigations" :key="nav.name" :active="nav.path === route.path" :nav-item="nav" />
</div>

<div class="flex-1" />
Expand Down
Loading

0 comments on commit c27dadc

Please sign in to comment.