Skip to content

Commit

Permalink
Merge pull request #4 from vincent99/main
Browse files Browse the repository at this point in the history
Style all the things
  • Loading branch information
tylerslaton authored Mar 21, 2024
2 parents 55524ac + d00433b commit 8cf4bf8
Show file tree
Hide file tree
Showing 50 changed files with 4,392 additions and 2,331 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v3

- name: Login to ghcr.io
uses: docker/login-action@v1
Expand All @@ -26,7 +26,7 @@ jobs:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}

- name: Deploy
if: github.ref == 'refs/heads/main'
env:
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
deploy_url: ${{ secrets.RENDER_DEPLOY_PARSER_HOOK_URL }}
run: |
curl "$deploy_url"
build_push_indexer:
runs-on: ubuntu-latest
steps:
Expand Down
59 changes: 59 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"eslint.experimental.useFlatConfig": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.detectIndentation": false,
"editor.insertSpaces": true,
"editor.quickSuggestions": {
"strings": true
},
"editor.tabSize": 2,
"eslint.format.enable": true,
"eslint.run": "onSave",
"eslint.validate": [
"vue",
"html",
"javascript",
"typescript"
],
"files.associations": {
"*.css": "tailwindcss"
},
"files.exclude": {
".ackrc": true,
".dockerignore": true,
".drone.yml": true,
".editorconfig": true,
".eslintcache": true,
".eslintignore": true,
".eslintrc.js": true,
".gitignore": true,
".nuxt*": true,
".nyc_output": true,
"babel.config.js": true,
"coverage": true,
"jsconfig.json": true,
"LICENSE": true,
"yarn-error.log": true
},
"javascript.preferences.importModuleSpecifier": "non-relative",
"prettier.enable": false,
"tailwindCSS.classAttributes": [
"class",
"className",
"ui"
],
"tailwindCSS.experimental.classRegex": [
[
"ui:\\s*{([^)]*)\\s*}",
"[\"'`]([^\"'`]*).*?[\"'`]"
],
[
"/\\*ui\\*/\\s*{([^;]*)}",
":\\s*[\"'`]([^\"'`]*).*?[\"'`]"
]
],
"tailwindCSS.experimental.configFile": "tailwind.config.ts",
"typescript.preferences.importModuleSpecifier": "non-relative"
}
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
db:
image: postgres:16.2
ports:
- "5432:5432"
- "3001:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand All @@ -28,7 +28,7 @@ services:
context: ./parser
target: dev
ports:
- "8080:8080"
- "3002:8080"
volumes:
- ./parser:/app
indexer:
Expand Down
130 changes: 130 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import antfu from '@antfu/eslint-config'

export default antfu({
stylistic: {
indent: 2,
quotes: 'single',
semi: false,
},

typescript: true,
vue: true,

rules: {
'array-bracket-spacing': 'error',
'arrow-parens': ['error', 'always'],
'arrow-spacing': ['error', { before: true, after: true }],
'block-spacing': ['error', 'always'],
'brace-style': ['error', '1tbs', { allowSingleLine: false }],
'comma-dangle': ['error', 'only-multiline'],
'comma-spacing': 'error',
'curly': ['error', 'all'],
'func-call-spacing': ['error', 'never'],
'implicit-arrow-linebreak': 'error',
'keyword-spacing': 'error',
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'multiline-ternary': ['error', 'never'],
'n/prefer-global/process': 'off',
'newline-per-chained-call': ['error', { ignoreChainWithDepth: 4 }],
'no-caller': 'error',
'no-cond-assign': ['error', 'except-parens'],
'no-console': ['error', { allow: ['debug', 'info', 'error'] }],
'no-debugger': 'error',
'no-eq-null': 'error',
'no-eval': 'error',
'no-trailing-spaces': 'error',
'no-unused-vars': 'error',
'no-whitespace-before-property': 'error',
'object-curly-spacing': ['error', 'always'],
'object-property-newline': 'off',
'object-shorthand': 'error',
'padded-blocks': ['error', 'never'],
'prefer-arrow-callback': 'error',
'prefer-template': 'error',
'quote-props': ['error', 'consistent-as-needed'],
'react/display-name': 'off',
'react/no-unknown-property': 'off',
'rest-spread-spacing': 'error',
'space-before-function-paren': 'off',
'space-in-parens': 'off',
'space-infix-ops': 'error',
'spaced-comment': 'error',
'switch-colon-spacing': 'error',
'template-curly-spacing': ['error', 'always'],
'yield-star-spacing': ['error', 'both'],

'style/arrow-parens': ['error', 'always'],
'style/brace-style': ['error', '1tbs', { allowSingleLine: false }],
'style/type-annotation-spacing': 'off',
'style/template-curly-spacing': ['error', 'always'],
'style/no-multi-spaces': 'off',

'style/key-spacing': ['error', {
multiLine: {
beforeColon: false,
afterColon: true,
},

align: {
beforeColon: false,
afterColon: true,
mode: 'minimum',
on: 'value',
},
}],

'style/object-curly-newline': ['error', {
ObjectExpression: {
multiline: true,
minProperties: 4,
},
ObjectPattern: {
multiline: true,
minProperties: 4,
},
ImportDeclaration: {
multiline: true,
minProperties: 5,
},
ExportDeclaration: {
multiline: true,
minProperties: 3,
},
}],

'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: '*',
next: 'return',
},
{
blankLine: 'always',
prev: 'function',
next: 'function',
},
{
blankLine: 'always',
prev: ['const', 'let', 'var'],
next: '*',
},
{
blankLine: 'any',
prev: ['const', 'let', 'var'],
next: ['const', 'let', 'var'],
},
],

'quotes': [
'error',
'single',
{
avoidEscape: true,
allowTemplateLiterals: true,
},
],

'vue/component-options-name-casing': ['error', 'kebab-case'],
},
})
29 changes: 24 additions & 5 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
srcDir: 'src',
devtools: { enabled: true },
css: ['@/assets/css/main.css'],
components: true,
css: ['@/assets/css/main.scss'],
colorMode: { classSuffix: '' },
devtools: { enabled: true },
devServer: {
port: 3000,
https: {
cert: 'src/server/tls/localhost.crt',
key: 'src/server/tls/localhost.key',
},
},
modules: [
'@nuxt/ui',
'@nuxtjs/tailwindcss'
'@nuxtjs/tailwindcss',
],
runtimeConfig: {
databaseUrl: '', // NUXT_DATABASE_URL
parserUrl: '', // NUXT_PARSER_URL
parserUrl: '', // NUXT_PARSER_URL
githubToken: '', // NUXT_GITHUB_TOKEN
},
srcDir: 'src',
vite: {
build: {
manifest: true,
ssrManifest: true,
sourcemap: true,
rollupOptions: { output: { sourcemap: true } },
},

css: { devSourcemap: true },
},
})
28 changes: 16 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "tools",
"name": "@gptscript-ai/tools",
"private": true,
"type": "module",
"scripts": {
"up": "docker compose up --build",
"down": "docker compose down",
"build": "nuxt build",
"dev": "nuxt dev",
"dev:migrate": "npx prisma migrate deploy && yarn dev",
"dev": "nuxt dev --host",
"dev:migrate": "npx prisma migrate deploy && yarn dev --host",
"lint": "eslint --max-warnings 0 .",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
Expand All @@ -19,20 +20,23 @@
"dependencies": {
"@octokit/core": "^6.0.1",
"@prisma/client": "^5.11.0",
"nuxt": "^3.10.3",
"sequelize": "^6.37.1",
"vue": "^3.4.19",
"vue-router": "^4.3.0"
"sequelize": "^6.37.1"
},
"devDependencies": {
"@antfu/eslint-config": "2.8.3",
"@heroicons/vue": "^2.1.1",
"@nuxt/devtools": "1.0.8",
"@nuxt/ui": "^2.14.2",
"@nuxtjs/color-mode": "^3.3.2",
"@tailwindcss/typography": "^0.5.10",
"@types/markdown-it": "^13.0.7",
"@types/pg": "^8.11.2",
"autoprefixer": "^10.4.18",
"postcss": "^8.4.35",
"postcss-custom-properties": "^13.3.6",
"eslint": "^8.57.0",
"nuxt": "^3.10.3",
"prisma": "^5.11.0",
"tailwindcss": "^3.4.1"
"sass": "^1.71.1",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3",
"vue": "^3.4.19",
"vue-router": "^4.3.0"
}
}
2 changes: 1 addition & 1 deletion src/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export default defineAppConfig({
primary: 'green',
gray: 'stone',
},
})
})
28 changes: 23 additions & 5 deletions src/app.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
<script lang="ts" setup>
useHead({
title: 'GPTScript Tools',
meta: [
{ charset: 'utf-8' },
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
{ name: 'format-detection', content: 'telephone=no' },
{ name: 'viewport', content: `width=device-width` },
],
})
</script>

<template>
<div>
<Navigation class="fixed w-full top-0 z-50"/>
<NuxtPage />
<UNotifications />
<div>
<div class="grid grid-rows-[60px,1fr] fixed top-0 right-0 bottom-0 left-0">
<Navigation class="h-[60px]" />
<div class="overflow-auto border-t-2 border-transparent">
<div class="p-5 lg:p-10 max-w-full w-full mx-auto lg:max-w-5xl">
<NuxtPage />
</div>
</div>
</div>
</template>
<UNotifications />
</div>
</template>:1
3 changes: 0 additions & 3 deletions src/assets/css/main.css

This file was deleted.

7 changes: 7 additions & 0 deletions src/assets/css/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import "./poppins/poppins";

HTML, BODY {
height: 100%;
overflow: hidden;
font-family: Poppins, sans-serif;
}
Loading

0 comments on commit 8cf4bf8

Please sign in to comment.