Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolaSpadari committed Feb 9, 2025
2 parents d9ae8e4 + 9d51290 commit 3fe5fba
Show file tree
Hide file tree
Showing 42 changed files with 3,627 additions and 3,464 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.2
version: 9.15.4

- name: install frontend dependencies
run: pnpm install
Expand Down
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"antfu.file-nesting",
"vue.volar",
"bradlc.vscode-tailwindcss"
]
}
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@
// Use eslint as default formatter
"editor.formatOnSave": false,

// Tailwind compatibility
"tailwindCSS.validate": true,
"tailwindCSS.experimental.classRegex": [
[
"ui:\\s*{([^)]*)\\s*}",
"[\"'`]([^\"'`]*).*?[\"'`]"
],
[
"/\\*\\s?ui\\s?\\*/\\s*{([^;]*)}",
":\\s*[\"'`]([^\"'`]*).*?[\"'`]"
]
],
"tailwindCSS.classAttributes": [
"class",
"ui"
],
"files.associations": {
"*.css": "tailwindcss"
},
"editor.quickSuggestions": {
"strings": "on"
},

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Build super fast desktop applications!

- Nuxt 3 (v4 ready!)
- Tauri 2
- UnoCSS
- NuxtUI v3
- TailwindCSS v4
- Typescript
- ESLint
- Auto imports (for Tauri api too!)
Expand Down Expand Up @@ -85,8 +86,9 @@ The same Tauri bundle will generate under `src-tauri/target`, but with the abili
## Notes

- Tauri v2 brings some big refactors, such as packages names and permission management. New permissions have to be granted under `src-tauri/capabilities/main.json`
- Tauri js functions are auto imported with the help of a custom module, named like `useTauri<LibraryName>`. If another Tauri plugin is added, then the module has to be updated to support its functions under `src/modules/tauri.ts`
- Tauri functions are auto imported with the help of a custom module, named like `useTauri<LibraryName>`. If another Tauri plugin is added, then the module has to be updated to support its functions under `app/modules/tauri.ts`
- As per documentation, Nuxt SSR must be disabled in order for Tauri to act as the backend. Still, all Nuxt goodies will be functional.
- NuxtUI is a very powerful UI library that consolidates design over the entire application. While there is a more complete pro version, it requires a license. It's up to you to buy the pro version, or stick with the free version.

## License

Expand Down
59 changes: 53 additions & 6 deletions app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,55 @@
export default defineAppConfig({
name: "Nuxtor",
author: "Nicola Spadari",
repo: "https://github.com/NicolaSpadari/nuxtor",
tauriSite: "https://v2.tauri.app",
nuxtSite: "https://nuxt.com",
unoSite: "https://unocss.dev"
app: {
name: "Nuxtor",
author: "Nicola Spadari",
repo: "https://github.com/NicolaSpadari/nuxtor",
tauriSite: "https://tauri.app",
nuxtSite: "https://nuxt.com",
nuxtUiSite: "https://ui3.nuxt.dev"
},
ui: {
colors: {
primary: "green",
neutral: "zinc"
},
button: {
slots: {
base: "cursor-pointer"
}
},
formField: {
slots: {
root: "w-full"
}
},
input: {
slots: {
root: "w-full"
}
},
textarea: {
slots: {
root: "w-full",
base: "resize-none"
}
},
accordion: {
slots: {
trigger: "cursor-pointer",
item: "md:py-2"
},
},
navigationMenu: {
slots: {
link: "cursor-pointer",
},
variants: {
disabled: {
true: {
link: "cursor-text"
}
}
}
}
}
});
38 changes: 7 additions & 31 deletions app/app.vue
Original file line number Diff line number Diff line change
@@ -1,35 +1,11 @@
<template>
<Html class="min-h-screen scroll-smooth">
<Body class="overflow-x-hidden bg-dark-800 text-white font-text antialiased">
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
<Html class="overflow-x-hidden">
<Body class="font-sans antialiased">
<UApp>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</UApp>
</Body>
</Html>
</template>

<style lang="scss">
html {
-webkit-tap-highlight-color: transparent;
}
img {
-webkit-user-drag: none;
@apply select-none;
}
// Transitions
.page-enter-active,
.page-leave-active {
@apply transition-opacity ease-in-out duration-300;
}
.layout-enter-active,
.layout-leave-active {
@apply transition-opacity ease-in-out duration-500;
}
.page-enter-from,
.page-leave-to,
.layout-enter-from,
.layout-leave-to {
@apply opacity-0;
}
</style>
45 changes: 45 additions & 0 deletions app/assets/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@import "tailwindcss";
@import "@nuxt/ui";

@theme {
--font-heading: "Montserrat", sans-serif;
--font-sans: "Inter", sans-serif;

--color-primary: var(--ui-color-primary-500);
--color-secondary: var(--ui-color-secondary-500);
--color-success: var(--ui-color-success-500);
--color-info: var(--ui-color-info-500);
--color-warning: var(--ui-color-warning-500);
--color-error: var(--ui-color-error-500)
}

@layer base {
-webkit-tap-highlight-color: transparent;
}

@layer utilities {
.flex-center {
@apply flex justify-center items-center;
}
.absolute-center-h {
@apply left-1/2 transform -translate-x-1/2;
}
.absolute-center-v {
@apply top-1/2 transform -translate-y-1/2;
}
}

.page-enter-active,
.page-leave-active {
@apply transition-opacity ease-in-out duration-300;
}
.layout-enter-active,
.layout-leave-active {
@apply transition-opacity ease-in-out duration-500;
}
.page-enter-from,
.page-leave-to,
.layout-enter-from,
.layout-leave-to {
@apply opacity-0;
}
4 changes: 4 additions & 0 deletions app/assets/icons/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 0 additions & 5 deletions app/components/Btn.vue

This file was deleted.

2 changes: 1 addition & 1 deletion app/components/Design/BottomBlob.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="top=1/5 pointer-events-none absolute inset-x-0 transform-gpu blur-3xl -z-10" aria-hidden="true">
<div class="blob relative left-[calc(50%+36rem)] aspect-[1155/678] w-[72.1875rem] from-emerald-500 to-amber-400 bg-gradient-to-tr opacity-30 -translate-x-1/2" />
<div class="blob relative left-[calc(50%+36rem)] aspect-[1155/678] w-[72.1875rem] from-(--color-warning) to-(--color-success) bg-gradient-to-br opacity-30 -translate-x-1/2" />
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion app/components/Design/TopBlob.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="pointer-events-none absolute inset-x-0 transform-gpu blur-3xl -top-1/4 -z-10" aria-hidden="true">
<div class="blob relative left-[calc(50%-30rem)] aspect-[1155/678] w-[72.1875rem] rotate-30 from-amber-400 to-emerald-500 bg-gradient-to-tr opacity-30 -translate-x-1/2" />
<div class="blob relative left-[calc(50%-30rem)] aspect-[1155/678] w-[72.1875rem] rotate-30 from-(--color-warning) to-(--color-success) bg-gradient-to-tr opacity-30 -translate-x-1/2" />
</div>
</template>

Expand Down
5 changes: 0 additions & 5 deletions app/components/Hyperlink.vue

This file was deleted.

12 changes: 6 additions & 6 deletions app/components/Layout/Tile.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<template>
<div class="grid grid-cols-1" lg="grid-cols-2">
<div class="px-6 pb-10 pt-12" sm="pt-16" lg="px-8 pt-22">
<div class="mx-auto max-w-xl" lg="mx-0 max-w-lg">
<h2 class="text-3xl text-white font-bold tracking-tight">
<div class="grid grid-cols-1 lg:grid-cols-2">
<div class="px-6 pb-10 pt-12 sm:pt-16 lg:px-8 lg:pt-22">
<div class="mx-auto max-w-xl lg:mx-0 lg:max-w-lg">
<h2 class="text-3xl font-bold tracking-tight">
{{ props.title }}
</h2>
<p class="mt-6 text-lg text-gray-300 leading-8">
<p class="mt-6 text-lg text-(--ui-text-muted) leading-8">
{{ props.description }}
</p>
</div>
</div>
<div class="px-6 pb-10 pt-12" sm="pt-16" lg="px-8 pt-22">
<div class="px-6 pb-10 pt-12 sm:pt-16 lg:px-8 lg:pt-22">
<slot />
</div>
</div>
Expand Down
5 changes: 0 additions & 5 deletions app/components/NavLink.vue

This file was deleted.

102 changes: 62 additions & 40 deletions app/components/Site/Navbar.vue
Original file line number Diff line number Diff line change
@@ -1,49 +1,71 @@
<template>
<header class="top-0 z-10">
<nav crate class="flex items-center justify-between py-6">
<div class="flex" lg="flex-1">
<NuxtLink to="/" class="home p-1.5 -m-1.5">
<SvgoLogo :font-controlled="false" class="size-8" />
</NuxtLink>
</div>
<div class="flex" lg="hidden">
<button type="button" class="inline-flex items-center justify-center rounded-md p-2.5 text-neutral-300 -m-2.5" @click="showSidebar = true">
<Icon name="heroicons-solid:bars-3" class="size-6" />
</button>
</div>
<div class="hidden" lg="flex gap-x-12">
<NavLink to="/commands">
Commands
</NavLink>
<NavLink to="/notifications">
Notifications
</NavLink>
<NavLink to="/os">
OS Informations
</NavLink>
<NavLink to="/file">
File
</NavLink>
<NavLink to="/store">
Store
</NavLink>
</div>
<div class="hidden" lg="flex flex-1 justify-end">
<p class="text-sm text-white font-semibold leading-6">
v{{ tauriVersion }}
</p>
</div>
</nav>
<UContainer class="md:py-2">
<UNavigationMenu
:items="mobileItems"
variant="link"
:ui="{
root: 'md:hidden'
}"
/>
<UNavigationMenu
:items="desktopItems"
variant="link"
:ui="{
root: 'hidden md:flex',
list: 'md:gap-x-2'
}"
/>
</UContainer>
</header>
</template>

<script lang="ts" setup>
const { pages } = usePages();
const { showSidebar } = useSidebar();
const tauriVersion = await useTauriAppGetTauriVersion();
</script>
<style scoped>
.router-link-exact-active:not(.home){
@apply text-emerald-500;
}
</style>
const mobileItems = ref<any[]>([
[
{
avatar: {
icon: "local:logo",
size: "xl",
ui: {
root: "bg-transparent"
}
},
to: "/"
}
],
[
{
icon: "lucide:menu",
onSelect: () => showSidebar.value = true
}
]
]);
const desktopItems = ref<any[]>([
[
{
avatar: {
icon: "local:logo",
size: "3xl",
ui: {
root: "group bg-transparent",
icon: "opacity-70 group-hover:opacity-100"
}
},
to: "/"
}
],
pages,
[
{
label: `v${tauriVersion}`,
disabled: true
}
]
]);
</script>
Loading

0 comments on commit 3fe5fba

Please sign in to comment.