Skip to content

Commit

Permalink
Merge pull request #4 from NicolaSpadari/develop
Browse files Browse the repository at this point in the history
Update 1.1.0
  • Loading branch information
NicolaSpadari authored Jan 2, 2025
2 parents e7ba83f + 4a87ea5 commit 81da394
Show file tree
Hide file tree
Showing 54 changed files with 4,565 additions and 5,622 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 20.10.0
node-version: 23.5.0

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.12.1
version: 9.15.2

- name: install frontend dependencies
run: pnpm install
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules
.DS_Store
*.log*
.data
.nuxt
.nitro
.cache
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.10.0
23.5.0
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,
"eslint.useFlatConfig": true,

// Use eslint as default formatter
"editor.formatOnSave": false,
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img width="150" src="./src/public/logo.png" alt="logo">
<img width="150" src="./public/logo.png" alt="logo">
</p>
<h1 align="center">NUXTOR</h1>
<p align="center">
Expand All @@ -18,7 +18,7 @@ Build super fast desktop applications!
<br />

<div align="center">
<img src="./src/public/screenshot.png">
<img src="./public/screenshot.png">
</div>

<p align="center">Powered by Nuxt 3</p>
Expand All @@ -27,7 +27,7 @@ Build super fast desktop applications!

## Technologies run-down

- Nuxt 3
- Nuxt 3 (v4 ready!)
- Tauri 2
- UnoCSS
- Typescript
Expand All @@ -37,8 +37,9 @@ Build super fast desktop applications!
## Functionalities

- Run shell commands from the app
- Send custom notifications to the client (remember to turn on/grant notifications in your computer settings!)
- Send custom notifications to the client (remember to turn on/grant notifications in your computer settings)
- Display OS related informations
- Store and retrieve data locally
- Show tray icon
- Support all Nuxt functionalities (routing/layout/middleware/modules/etc...)

Expand Down Expand Up @@ -84,7 +85,7 @@ 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 as-is with the help of a custom module. If another Tauri plugin is added, then the module has to be updated to support auto imports under `src/modules/tauri.ts`
- 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`
- As per documentation, Nuxt SSR must be disabled in order for Tauri to act as the backend. Still, all Nuxt goodies will be functional.

## License
Expand Down
8 changes: 8 additions & 0 deletions app/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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"
});
5 changes: 2 additions & 3 deletions src/app.vue → app/app.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<Html min-h-screen>
<Body overflow-x-hidden bg-dark-800 text-white>
<Html class="scroll-smooth min-h-screen">
<Body class="font-text antialiased overflow-x-hidden bg-dark-800 text-white">
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
Expand All @@ -11,7 +11,6 @@
<style lang="scss">
html {
-webkit-tap-highlight-color: transparent;
scroll-behavior: smooth;
}
img {
-webkit-user-drag: none;
Expand Down
File renamed without changes
5 changes: 5 additions & 0 deletions app/components/Btn.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<button class="disabled:(cursor-not-allowed opacity-60) gap-1 rounded-md bg-emerald-500 px-3.5 py-2.5 text-sm text-white font-semibold shadow-sm transition-colors" hover="bg-emerald-600" focus-visible="outline-2 outline-emerald-600 outline-offset-2 outline">
<slot />
</button>
</template>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div pointer-events-none absolute inset-x-0 top="1/5" 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="pointer-events-none absolute inset-x-0 top=1/5 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>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div 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="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>
</template>

Expand Down
5 changes: 5 additions & 0 deletions app/components/Hyperlink.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<NuxtLink class="gap-1 rounded-md bg-emerald-500 px-3.5 py-2.5 text-sm text-white font-semibold shadow-sm transition-colors" hover="bg-emerald-600" focus-visible="outline-2 outline-emerald-600 outline-offset-2 outline">
<slot />
</NuxtLink>
</template>
24 changes: 24 additions & 0 deletions app/components/Layout/Tile.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<div class="grid grid-cols-1" lg="grid-cols-2">
<div clas="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">
{{ props.title }}
</h2>
<p class="mt-6 text-lg text-gray-300 leading-8">
{{ props.description }}
</p>
</div>
</div>
<div class="px-6 pb-10 pt-12" sm="pt-16" lg="px-8 pt-22">
<slot />
</div>
</div>
</template>

<script lang="ts" setup>
const props = defineProps<{
title: string
description: string
}>();
</script>
5 changes: 5 additions & 0 deletions app/components/NavLink.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<NuxtLink class="block py-2 text-white font-semibold leading-6" lg="inline text-sm py-0">
<slot />
</NuxtLink>
</template>
49 changes: 49 additions & 0 deletions app/components/Site/Navbar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<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>
</header>
</template>

<script lang="ts" setup>
const { showSidebar } = useSidebar();
const tauriVersion = await useTauriAppGetTauriVersion();
</script>

<style scoped>
.router-link-exact-active:not(.home){
@apply text-emerald-500;
}
</style>
26 changes: 13 additions & 13 deletions src/components/Site/Sidebar.vue → app/components/Site/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
enter-from-class="opacity-0" enter-active-class="ease-in-out duration-500" enter-to-class="opacity-100"
leave-from-class="opacity-100" leave-active-class="ease-in-out duration-500" leave-to-class="opacity-0"
>
<div v-if="showSidebar" relative z-20 lg="hidden" role="dialog" aria-modal="true">
<div fixed inset-0 overflow-hidden>
<div crate h-full flex flex-col overflow-y-auto bg="neutral-800/70" py-6 backdrop-blur-md>
<div flex items-center justify-between>
<NuxtLink to="/" p-1.5 m="-1.5">
<SvgoLogo :filled="true" :font-controlled="false" size-8 />
<div v-if="showSidebar" class="relative z-20" lg="hidden" role="dialog" aria-modal="true">
<div class="fixed inset-0 overflow-hidden">
<div crate class="bg-neutral-800/70 h-full flex flex-col overflow-y-auto py-6 backdrop-blur-md">
<div class="flex items-center justify-between">
<NuxtLink to="/" class="p-1.5 -m-1.5">
<SvgoLogo :filled="true" :font-controlled="false" class="size-8" />
</NuxtLink>
<button type="button" rounded-md p-2.5 text-neutral-300 m="2.5" @click="showSidebar = false">
<Icon name="heroicons-solid:x-mark" size-6 />
<button type="button" class="rounded-md p-2.5 text-neutral-300 m-2.5" @click="showSidebar = false">
<Icon name="heroicons-solid:x-mark" class="size-6" />
</button>
</div>
<div mt-6 flow-root>
<div my="-6" divide-y divide="gray-500/25">
<div py-6 space-y-2>
<div class="mt-6 flow-root">
<div class="-my-6 divide-y divide-gray-500/25">
<div class="py-6 space-y-2">
<NavLink to="/commands">
Commands
</NavLink>
Expand All @@ -30,8 +30,8 @@
404
</NavLink>
</div>
<div py-6>
<p px-3 text-base text-white font-semibold leading-7 mx="-3">
<div class="py-6">
<p class="px-3 text-base text-white font-semibold leading-7 -mx-3">
v{{ tauriVersion }}
</p>
</div>
Expand Down
17 changes: 17 additions & 0 deletions app/components/Tab/Row.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<template>
<div class="px-4 py-6" sm="grid grid-cols-3 gap-4 px-6">
<dt class="flex items-center text-sm text-light-200 font-medium">
{{ props.heading }}
</dt>
<dd class="flex items-center text-sm text-neutral-300 leading-6" sm="col-span-2 mt-0">
{{ props.body }}
</dd>
</div>
</template>

<script lang="ts" setup>
const props = defineProps<{
heading: string
body: string
}>();
</script>
File renamed without changes.
2 changes: 1 addition & 1 deletion src/layouts/blank.vue → app/layouts/blank.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<SiteNavbar sticky />
<SiteNavbar class="sticky" />
<SiteSidebar />

<slot />
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/default.vue → app/layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<SiteNavbar sticky />
<SiteNavbar class="sticky" />
<SiteSidebar />

<div crate>
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/home.vue → app/layouts/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<SiteNavbar class="fixed w-full" />
<SiteSidebar />

<div relative overflow-hidden px-6 lg="px-8">
<div class="relative overflow-hidden px-6" lg="px-8">
<DesignTopBlob />
<DesignBottomBlob />

Expand Down
File renamed without changes.
14 changes: 8 additions & 6 deletions src/modules/tauri.ts → app/modules/tauri.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { addImports, defineNuxtModule } from "nuxt/kit";
import * as tauriApp from "@tauri-apps/api/app";
import * as tauriShell from "@tauri-apps/plugin-shell";
import * as tauriOs from "@tauri-apps/plugin-os";
import * as tauriNotification from "@tauri-apps/plugin-notification";
import * as tauriFs from "@tauri-apps/plugin-fs";
import * as tauriNotification from "@tauri-apps/plugin-notification";
import * as tauriOs from "@tauri-apps/plugin-os";
import * as tauriShell from "@tauri-apps/plugin-shell";
import * as tauriStore from "@tauri-apps/plugin-store";
import { addImports, defineNuxtModule } from "nuxt/kit";

const capitalize = (name: string) => {
return name.charAt(0).toUpperCase() + name.slice(1);
Expand All @@ -14,13 +15,14 @@ const tauriModules = [
{ module: tauriShell, prefix: "Shell", importPath: "@tauri-apps/plugin-shell" },
{ module: tauriOs, prefix: "Os", importPath: "@tauri-apps/plugin-os" },
{ module: tauriNotification, prefix: "Notification", importPath: "@tauri-apps/plugin-notification" },
{ module: tauriFs, prefix: "Fs", importPath: "@tauri-apps/plugin-fs" }
{ module: tauriFs, prefix: "Fs", importPath: "@tauri-apps/plugin-fs" },
{ module: tauriStore, prefix: "Store", importPath: "@tauri-apps/plugin-store" }
];

export default defineNuxtModule<ModuleOptions>({
meta: {
name: "nuxt-tauri",
configKey: "nuxt-tauri"
configKey: "tauri"
},
defaults: {
prefix: "useTauri"
Expand Down
26 changes: 26 additions & 0 deletions app/pages/[...all].vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<div clas="grid place-items-center px-6 py-24" sm="py-32" lg="px-8">
<div class="text-center">
<p class="text-base text-emerald-500 font-semibold">
404
</p>
<h1 class="mt-4 text-3xl text-neutral-300 font-bold tracking-tight" sm="text-5xl">
Page not found
</h1>
<p class="mt-6 text-base text-neutral-400 leading-7">
Sorry, we couldn't find the page you're looking for.
</p>
<div class="mt-10 flex items-center justify-center gap-x-6">
<Hyperlink to="/" class="px-7">
Back
</Hyperlink>
</div>
</div>
</div>
</template>

<script lang="ts" setup>
definePageMeta({
layout: "blank"
});
</script>
Loading

0 comments on commit 81da394

Please sign in to comment.