Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

Commit

Permalink
chore: reformat with new prettier settings (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrisse authored May 1, 2024
1 parent b5aa668 commit 2bfad2d
Show file tree
Hide file tree
Showing 71 changed files with 4,187 additions and 4,247 deletions.
62 changes: 31 additions & 31 deletions src/leapfrogai_ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
/** @type { import("eslint").Linter.Config } */
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
env: {
browser: true,
es2017: true,
node: true
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
],
rules: {
'no-undef': 'off'
}
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
env: {
browser: true,
es2017: true,
node: true
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
],
rules: {
'no-undef': 'off'
}
};
14 changes: 7 additions & 7 deletions src/leapfrogai_ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"useTabs": true,
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
"useTabs": false,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
6 changes: 3 additions & 3 deletions src/leapfrogai_ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ Under a realm in Keycloak that is not the master realm (if using UDS, its "uds")
1. Create a new client (the client ID you use will be used in the env variables below)
2. Turn on "Client Authentication"
3. For "Valid redirect URLs", you need to put:
1. `http://localhost:5173/auth/callback` (or the URL for the frontend app callback)
2. `http://127.0.0.1:54321/auth/v1/callback` (or the URL for the Supabase callback, for locally running Supabase, DO NOT USE LOCALHOST, use 127.0.0.1)
3. Put the same two URLs in for "Web Origins"
1. `http://localhost:5173/auth/callback` (or the URL for the frontend app callback)
2. `http://127.0.0.1:54321/auth/v1/callback` (or the URL for the Supabase callback, for locally running Supabase, DO NOT USE LOCALHOST, use 127.0.0.1)
3. Put the same two URLs in for "Web Origins"
4. Copy the Client Secret under the Clients -> Credentials tab and use in the env variables below
5. You can create users under the "Users" tab and either have them verify their email (if you setup SMTP), or manually mark them as verified.

Expand Down
158 changes: 79 additions & 79 deletions src/leapfrogai_ui/package.json
Original file line number Diff line number Diff line change
@@ -1,81 +1,81 @@
{
"name": "leapfrogai-ui",
"version": "0.0.1",
"engines": {
"node": ">=18.1.0"
},
"private": true,
"scripts": {
"dev": "npm run supabase:start && vite dev",
"build": "vite build",
"preview": "vite preview",
"test": "npm run test:integration && npm run test:unit",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "concurrently 'prettier --check .' 'eslint .'",
"format": "prettier --write . && eslint . --fix",
"test:integration": "playwright test",
"test:integration:ui": "playwright test --ui",
"test:unit": "vitest run",
"test:unit:watch": "vitest",
"prepare": "husky",
"supabase:start": "supabase start && docker exec -u 0 supabase_auth_supabase /bin/sh -c \"echo '100.115.154.78 keycloak.admin.uds.dev' >> /etc/hosts\"",
"supabase:stop": "supabase stop",
"supabase:reset": "supabase db reset",
"supbase:migrate": "supbase migration up"
},
"devDependencies": {
"@commitlint/cli": "^19.1.0",
"@commitlint/config-conventional": "^19.1.0",
"@faker-js/faker": "^8.4.1",
"@playwright/test": "^1.28.1",
"@sveltejs/adapter-auto": "^3.2.0",
"@sveltejs/adapter-node": "^5.0.1",
"@sveltejs/kit": "^2.5.7",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/svelte": "^5.1.0",
"@types/eslint": "^8.56.0",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.7.1",
"carbon-components-svelte": "^0.85.0",
"carbon-icons-svelte": "^12.6.0",
"carbon-preprocess-svelte": "^0.11.0",
"dotenv": "^16.4.5",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.35.1",
"husky": "^9.0.11",
"jsdom": "^24.0.0",
"otpauth": "^9.2.2",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"sass": "^1.71.1",
"svelte": "^4.2.15",
"svelte-check": "^3.6.9",
"tslib": "^2.4.1",
"typescript": "^5.4.2",
"vite": "^5.2.10",
"vitest": "^1.2.0"
},
"type": "module",
"dependencies": {
"@carbon/layout": "^11.20.0",
"@carbon/themes": "^11.32.0",
"@carbon/type": "^11.26.0",
"@supabase/auth-ui-shared": "^0.1.8",
"@supabase/auth-ui-svelte": "^0.2.9",
"@supabase/ssr": "^0.1.0",
"@supabase/supabase-js": "^2.39.8",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"@testing-library/user-event": "^14.5.2",
"ai": "^3.0.13",
"concurrently": "^8.2.2",
"fuse.js": "^7.0.0",
"msw": "^2.2.14",
"openai": "^4.38.5",
"playwright": "^1.42.1",
"uuid": "^9.0.1",
"yup": "^1.4.0"
}
"name": "leapfrogai-ui",
"version": "0.0.1",
"engines": {
"node": ">=18.1.0"
},
"private": true,
"scripts": {
"dev": "npm run supabase:start && vite dev",
"build": "vite build",
"preview": "vite preview",
"test": "npm run test:integration && npm run test:unit",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "concurrently 'prettier --check .' 'eslint .'",
"format": "prettier --write . && eslint . --fix",
"test:integration": "playwright test",
"test:integration:ui": "playwright test --ui",
"test:unit": "vitest run",
"test:unit:watch": "vitest",
"prepare": "husky",
"supabase:start": "supabase start && docker exec -u 0 supabase_auth_supabase /bin/sh -c \"echo '100.115.154.78 keycloak.admin.uds.dev' >> /etc/hosts\"",
"supabase:stop": "supabase stop",
"supabase:reset": "supabase db reset",
"supbase:migrate": "supbase migration up"
},
"devDependencies": {
"@commitlint/cli": "^19.1.0",
"@commitlint/config-conventional": "^19.1.0",
"@faker-js/faker": "^8.4.1",
"@playwright/test": "^1.28.1",
"@sveltejs/adapter-auto": "^3.2.0",
"@sveltejs/adapter-node": "^5.0.1",
"@sveltejs/kit": "^2.5.7",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/svelte": "^5.1.0",
"@types/eslint": "^8.56.0",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.7.1",
"carbon-components-svelte": "^0.85.0",
"carbon-icons-svelte": "^12.6.0",
"carbon-preprocess-svelte": "^0.11.0",
"dotenv": "^16.4.5",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.35.1",
"husky": "^9.0.11",
"jsdom": "^24.0.0",
"otpauth": "^9.2.2",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"sass": "^1.71.1",
"svelte": "^4.2.15",
"svelte-check": "^3.6.9",
"tslib": "^2.4.1",
"typescript": "^5.4.2",
"vite": "^5.2.10",
"vitest": "^1.2.0"
},
"type": "module",
"dependencies": {
"@carbon/layout": "^11.20.0",
"@carbon/themes": "^11.32.0",
"@carbon/type": "^11.26.0",
"@supabase/auth-ui-shared": "^0.1.8",
"@supabase/auth-ui-svelte": "^0.2.9",
"@supabase/ssr": "^0.1.0",
"@supabase/supabase-js": "^2.39.8",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"@testing-library/user-event": "^14.5.2",
"ai": "^3.0.13",
"concurrently": "^8.2.2",
"fuse.js": "^7.0.0",
"msw": "^2.2.14",
"openai": "^4.38.5",
"playwright": "^1.42.1",
"uuid": "^9.0.1",
"yup": "^1.4.0"
}
}
86 changes: 43 additions & 43 deletions src/leapfrogai_ui/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,49 @@ import dotenv from 'dotenv';
dotenv.config();

const config: PlaywrightTestConfig = {
projects: [
{ name: 'setup', testMatch: /.*\.setup\.ts/ },
{ name: 'clear_db', testMatch: /.*\clear_db\.ts/ },
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
// Use prepared auth state.
storageState: 'playwright/.auth/user.json'
},
dependencies: ['clear_db', 'setup']
},
{
name: 'firefox',
use: {
...devices['Desktop Firefox'],
// Use prepared auth state.
storageState: 'playwright/.auth/user.json'
},
dependencies: ['clear_db', 'setup']
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'], storageState: 'playwright/.auth/user.json' },
dependencies: ['clear_db', 'setup']
},
{
name: 'Edge',
use: {
...devices['Desktop Edge'],
channel: 'msedge',
storageState: 'playwright/.auth/user.json'
},
dependencies: ['clear_db', 'setup']
}
],
webServer: {
command: 'npm run build && npm run preview',
port: 4173,
stderr: 'pipe'
},
testDir: 'tests',
testMatch: /(.+\.)?(test|spec)\.[jt]s/
projects: [
{ name: 'setup', testMatch: /.*\.setup\.ts/ },
{ name: 'clear_db', testMatch: /.*\clear_db\.ts/ },
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
// Use prepared auth state.
storageState: 'playwright/.auth/user.json'
},
dependencies: ['clear_db', 'setup']
},
{
name: 'firefox',
use: {
...devices['Desktop Firefox'],
// Use prepared auth state.
storageState: 'playwright/.auth/user.json'
},
dependencies: ['clear_db', 'setup']
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'], storageState: 'playwright/.auth/user.json' },
dependencies: ['clear_db', 'setup']
},
{
name: 'Edge',
use: {
...devices['Desktop Edge'],
channel: 'msedge',
storageState: 'playwright/.auth/user.json'
},
dependencies: ['clear_db', 'setup']
}
],
webServer: {
command: 'npm run build && npm run preview',
port: 4173,
stderr: 'pipe'
},
testDir: 'tests',
testMatch: /(.+\.)?(test|spec)\.[jt]s/
};

export default config;
32 changes: 16 additions & 16 deletions src/leapfrogai_ui/src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
import { SupabaseClient, Session } from '@supabase/supabase-js';

declare global {
namespace App {
// interface Error {}
interface Locals {
supabase: SupabaseClient;
getSession(): Promise<Session | null>;
}
interface PageData {
title?: string | null;
session: Session | null;
// TODO - add profile type
// profile?: any;
conversations?: Conversation[];
}
// interface PageState {}
// interface Platform {}
}
namespace App {
// interface Error {}
interface Locals {
supabase: SupabaseClient;
getSession(): Promise<Session | null>;
}
interface PageData {
title?: string | null;
session: Session | null;
// TODO - add profile type
// profile?: any;
conversations?: Conversation[];
}
// interface PageState {}
// interface Platform {}
}
}

export {};
Loading

0 comments on commit 2bfad2d

Please sign in to comment.