Merge pull request #13 from coolaj86/chore-fmt

chore: add fmt to github actions
This commit is contained in:
Timothy Jaeryang Baek 2023-10-21 23:58:55 -05:00 committed by GitHub
commit f689bdf2cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 93 additions and 64 deletions

25
.github/workflows/node.js.yaml vendored Normal file
View file

@ -0,0 +1,25 @@
name: Node.js CI
on:
push:
branches: ['main']
pull_request:
jobs:
build:
name: 'Fmt, Lint, & Build'
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: node --version
- run: npm clean-install
- run: npm run fmt
#- run: npm run lint
#- run: npm run lint:types
- run: npm run build

View file

@ -8,8 +8,12 @@
"preview": "vite preview", "preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .", "lint": "npm run eslint",
"format": "prettier --plugin-search-dir . --write ." "lint:types": "npm run check",
"fmt": "npm run prettier:svelte && npm run prettier",
"eslint": "npx -p eslint@8 -- eslint .",
"prettier:svelte": "npx -p prettier@2 -- prettier --plugin-search-dir . --write .",
"prettier": "npx -p prettier@2 -- prettier --write '**/*.{js,css,md,html,json}'"
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/adapter-auto": "^2.0.0",

View file

@ -1,6 +1,6 @@
export default { export default {
plugins: { plugins: {
tailwindcss: {}, tailwindcss: {},
autoprefixer: {}, autoprefixer: {}
}, }
} };

View file

@ -1,33 +1,33 @@
<script> <script>
import Spinner from './Spinner.svelte'; import Spinner from './Spinner.svelte';
export let show = false; export let show = false;
export let content = ''; export let content = '';
export let opacity = 1; export let opacity = 1;
</script> </script>
<div class="relative"> <div class="relative">
{#if show} {#if show}
<div class="absolute w-full h-full flex"> <div class="absolute w-full h-full flex">
<div <div
class="absolute rounded" class="absolute rounded"
style="inset: -10px; opacity: {opacity}; backdrop-filter: blur(5px);" style="inset: -10px; opacity: {opacity}; backdrop-filter: blur(5px);"
/> />
<div class="flex w-full flex-col justify-center"> <div class="flex w-full flex-col justify-center">
<div class=" py-3"> <div class=" py-3">
<Spinner className="ml-2" /> <Spinner className="ml-2" />
</div> </div>
{#if content !== ''} {#if content !== ''}
<div class="text-center text-gray-100 text-xs font-medium z-50"> <div class="text-center text-gray-100 text-xs font-medium z-50">
{content} {content}
</div> </div>
{/if} {/if}
</div> </div>
</div> </div>
{/if} {/if}
<slot /> <slot />
</div> </div>

View file

@ -1,24 +1,24 @@
<script lang="ts"> <script lang="ts">
export let className: string = 'text-white'; export let className: string = 'text-white';
export let theme: 'blue' | 'white' | 'black' = 'white'; export let theme: 'blue' | 'white' | 'black' = 'white';
</script> </script>
<div class="flex justify-center text-center {className}"> <div class="flex justify-center text-center {className}">
<svg <svg
class="animate-spin -ml-1 mr-3 h-5 w-5 {theme === 'blue' class="animate-spin -ml-1 mr-3 h-5 w-5 {theme === 'blue'
? 'text-sky-600' ? 'text-sky-600'
: theme === 'white' : theme === 'white'
? 'text-white' ? 'text-white'
: 'text-gray-600'} " : 'text-gray-600'} "
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
fill="none" fill="none"
viewBox="0 0 24 24" viewBox="0 0 24 24"
> >
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4" /> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4" />
<path <path
class="opacity-75" class="opacity-75"
fill="currentColor" fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
/> />
</svg> </svg>
</div> </div>