Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrdtr committed Jan 10, 2024
0 parents commit 8e553cf
Show file tree
Hide file tree
Showing 89 changed files with 15,971 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
- push
- pull_request

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm lint
40 changes: 40 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Prerelease

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-*'

permissions:
contents: write

jobs:
release:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm lint

- name: Build & Prerelease
run: GH_TOKEN=${{ secrets.github_token }} pnpm build --prerelease
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

permissions:
contents: write

jobs:
release:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm lint

- name: Build & Release
run: GH_TOKEN=${{ secrets.github_token }} pnpm build --release
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
!.env.example

.husky
app.db
/artifacts
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node-linker=hoisted
public-hoist-pattern=*
shamefully-hoist=true
57 changes: 57 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,
// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,
// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "format/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],
// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"toml"
],
// @nuxt/ui related intellisense config
"files.associations": {
"*.css": "tailwindcss"
},
"editor.quickSuggestions": {
"strings": true
},
"tailwindCSS.experimental.configFile": "tailwind.config.ts",
"tailwindCSS.experimental.classRegex": [
["ui:\\s*{([^)]*)\\s*}", "[\"'`]([^\"'`]*).*?[\"'`]"],
["/\\*ui\\*/\\s*{([^;]*)}", ":\\s*[\"'`]([^\"'`]*).*?[\"'`]"]
],
"tailwindCSS.classAttributes": [
"class",
"className",
"ngClass",
"ui"
]
}
10 changes: 10 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default defineAppConfig({
ui: {
primary: 'teal',
gray: 'zinc',
notifications: {
// Show toasts at the top right of the screen
position: 'top-0 bottom-auto',
},
},
})
43 changes: 43 additions & 0 deletions app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<script setup lang="ts">
const mobileSidebarVisible = useState('mobile-sidebar-visible', () => false)
const activeView = useActiveView()
</script>

<template>
<div class="w-screen h-dvh flex flex-col overflow-hidden">
<Sidebar />

<!-- sidebar overlay -->
<div
v-if="mobileSidebarVisible"
class="z-[9] w-screen h-dvh fixed inset-0 md:hidden"
@click="mobileSidebarVisible = false"
/>

<div
class="flex-1 flex flex-col transition-all duration-300 ml-0 md:ml-64 lg:ml-72 bg-gray-100 dark:bg-gray-900"
:class="mobileSidebarVisible ? 'scale-95' : ''"
>
<!-- small screen topbar -->
<div class="w-full flex md:hidden px-4 py-2 items-center justify-between border-b border-gray-200/50 dark:border-gray-800/50">
<UButton
square
variant="link"
color="gray"
size="xl"
:padded="false"
icon="i-heroicons-bars-3"
class="-ml-0.5"
@click="mobileSidebarVisible = true"
/>
</div>
<!-- main content -->
<div class="w-full h-full flex-1 flex-col" :class="activeView === 'terminal' ? 'flex' : 'hidden'">
<TerminalView />
</div>
</div>

<UNotifications />
<ConfirmationDialog />
</div>
</template>
44 changes: 44 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { execSync } from 'node:child_process'
import { cpSync } from 'node:fs'

const web = process.argv.includes('--web')
const release = process.argv.includes('--release')
const prerelease = process.argv.includes('--prerelease')
if (release && prerelease) {
console.error('Cannot have both --release and --prerelease')
process.exit(1)
}

function run(cmd) {
try {
execSync(cmd, { stdio: 'inherit' })
}
catch (error) {
console.error(error)
process.exit(1)
}
}

if (!web) {
// Install app dependencies for Electron Builder
run('electron-builder install-app-deps')
}

// Run Nuxt.js build
run('nuxt build')

// Copy migrations to output directory
const migrationsPath = 'db/migrations'
const outputMigrationsPath = '.output/server/db/migrations'
try {
cpSync(migrationsPath, outputMigrationsPath, { recursive: true })
}
catch (error) {
console.error(error)
process.exit(1)
}

if (!web) {
// Package (and Publish)
run(`${prerelease ? 'EP_PRE_RELEASE=true ' : ''}electron-builder${release || prerelease ? ' --publish always' : ''}`)
}
Binary file added build/icons/1024x1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/icon.icns
Binary file not shown.
Binary file added build/icons/icon.ico
Binary file not shown.
10 changes: 10 additions & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { UserConfig } from '@commitlint/types'

const Configuration: UserConfig = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'chore', 'style', 'refactor', 'ci', 'test', 'revert', 'perf', 'build']],
},
}

module.exports = Configuration
50 changes: 50 additions & 0 deletions components/color-mode-toggle.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<script setup lang="ts">
import { UButton } from '#components'
type ButtonProps = InstanceType<typeof UButton>['$props']
const props = defineProps<{
// https://ui.nuxt.com/elements/button#props
ui?: ButtonProps['ui']
size?: ButtonProps['size']
type?: ButtonProps['type']
color?: ButtonProps['color']
variant?: ButtonProps['variant']
// icon?: ButtonProps['icon'] // Omitted
label?: ButtonProps['label']
loadingIcon?: ButtonProps['loadingIcon']
leadingIcon?: ButtonProps['leadingIcon']
trailingIcon?: ButtonProps['trailingIcon']
disabled?: ButtonProps['disabled']
truncate?: ButtonProps['truncate']
block?: ButtonProps['block']
square?: ButtonProps['square']
loading?: ButtonProps['loading']
padded?: ButtonProps['padded']
trailing?: ButtonProps['trailing']
leading?: ButtonProps['leading']
// Additional
class?: ButtonProps['class']
}>()
const colorMode = useColorMode()
const isDark = computed({
get: () => colorMode.value === 'dark',
set: () =>
(colorMode.preference = colorMode.value === 'dark' ? 'light' : 'dark'),
})
</script>

<template>
<ClientOnly>
<UButton
v-bind="{ ...props }"
aria-label="Theme"
:icon="isDark ? 'i-heroicons-moon' : 'i-heroicons-sun'"
@click="isDark = !isDark"
/>

<template #fallback>
<div class="w-8 h-8" />
</template>
</ClientOnly>
</template>
Loading

0 comments on commit 8e553cf

Please sign in to comment.