chore: apply prettier

This commit is contained in:
Sonny
2024-05-26 20:08:43 +02:00
committed by Sonny
parent 202f70b010
commit 55cd973b1a
29 changed files with 36 additions and 43 deletions

View File

@@ -1,4 +1,4 @@
import { defineConfig } from '@adonisjs/core/app' import { defineConfig } from '@adonisjs/core/app';
export default defineConfig({ export default defineConfig({
/* /*
@@ -44,7 +44,7 @@ export default defineConfig({
() => import('@adonisjs/inertia/inertia_provider'), () => import('@adonisjs/inertia/inertia_provider'),
() => import('@adonisjs/ally/ally_provider'), () => import('@adonisjs/ally/ally_provider'),
() => import('@izzyjs/route/izzy_provider'), () => import('@izzyjs/route/izzy_provider'),
() => import('#providers/route_provider') () => import('#providers/route_provider'),
], ],
/* /*
@@ -107,4 +107,4 @@ export default defineConfig({
onBuildStarting: [() => import('@adonisjs/vite/build_hook')], onBuildStarting: [() => import('@adonisjs/vite/build_hook')],
onDevServerStarted: [() => import('@izzyjs/route/dev_hook')], onDevServerStarted: [() => import('@izzyjs/route/dev_hook')],
}, },
}) });

View File

@@ -1,8 +1,8 @@
import FaviconNotFoundException from '#exceptions/favicon_not_found_exception'; import FaviconNotFoundException from '#exceptions/favicon_not_found_exception';
import { cache } from '#lib/cache';
import type { HttpContext } from '@adonisjs/core/http'; import type { HttpContext } from '@adonisjs/core/http';
import logger from '@adonisjs/core/services/logger'; import logger from '@adonisjs/core/services/logger';
import { parse } from 'node-html-parser'; import { parse } from 'node-html-parser';
import { cache } from '../lib/cache.js';
interface Favicon { interface Favicon {
buffer: Buffer; buffer: Buffer;
@@ -11,7 +11,6 @@ interface Favicon {
size: number; size: number;
} }
// TODO: refactor this controller (adapted from the previous version of MyLinks)
export default class FaviconsController { export default class FaviconsController {
private userAgent = private userAgent =
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0'; 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0';

View File

@@ -3,7 +3,7 @@ import Link from '#models/link';
import User from '#models/user'; import User from '#models/user';
import { belongsTo, column, hasMany } from '@adonisjs/lucid/orm'; import { belongsTo, column, hasMany } from '@adonisjs/lucid/orm';
import type { BelongsTo, HasMany } from '@adonisjs/lucid/types/relations'; import type { BelongsTo, HasMany } from '@adonisjs/lucid/types/relations';
import { Visibility } from '../enums/visibility.js'; import { Visibility } from '#enums/visibility';
export default class Collection extends AppBaseModel { export default class Collection extends AppBaseModel {
@column() @column()

View File

@@ -1,5 +1,5 @@
import { Visibility } from '#enums/visibility';
import vine, { SimpleMessagesProvider } from '@vinejs/vine'; import vine, { SimpleMessagesProvider } from '@vinejs/vine';
import { Visibility } from '../enums/visibility.js';
const params = vine.object({ const params = vine.object({
id: vine.number(), id: vine.number(),

View File

@@ -1,6 +1,6 @@
import { defaultTableFields } from '#database/default_table_fields'; import { defaultTableFields } from '#database/default_table_fields';
import { Visibility } from '#enums/visibility';
import { BaseSchema } from '@adonisjs/lucid/schema'; import { BaseSchema } from '@adonisjs/lucid/schema';
import { Visibility } from '../../app/enums/visibility.js';
export default class CreateCollectionTable extends BaseSchema { export default class CreateCollectionTable extends BaseSchema {
static tableName = 'collections'; static tableName = 'collections';

View File

@@ -1,8 +1,8 @@
import { Visibility } from '#enums/visibility';
import Collection from '#models/collection'; import Collection from '#models/collection';
import User from '#models/user'; import User from '#models/user';
import { BaseSeeder } from '@adonisjs/lucid/seeders'; import { BaseSeeder } from '@adonisjs/lucid/seeders';
import { faker } from '@faker-js/faker'; import { faker } from '@faker-js/faker';
import { Visibility } from '../../app/enums/visibility.js';
export default class extends BaseSeeder { export default class extends BaseSeeder {
static environment = ['development', 'testing']; static environment = ['development', 'testing'];

View File

@@ -10,4 +10,4 @@
"MaintenanceDB": "my-links" "MaintenanceDB": "my-links"
} }
} }
} }

View File

@@ -1,3 +1,4 @@
import { Visibility } from '#enums/visibility';
import type Collection from '#models/collection'; import type Collection from '#models/collection';
import { FormEvent } from 'react'; import { FormEvent } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@@ -5,7 +6,6 @@ import Checkbox from '~/components/common/form/checkbox';
import TextBox from '~/components/common/form/textbox'; import TextBox from '~/components/common/form/textbox';
import BackToDashboard from '~/components/common/navigation/back_to_dashboard'; import BackToDashboard from '~/components/common/navigation/back_to_dashboard';
import FormLayout from '~/components/layouts/form_layout'; import FormLayout from '~/components/layouts/form_layout';
import { Visibility } from '../../../app/enums/visibility';
export type FormCollectionData = { export type FormCollectionData = {
name: string; name: string;

View File

@@ -2,7 +2,7 @@ import styled from '@emotion/styled';
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import Footer from '~/components/footer/footer'; import Footer from '~/components/footer/footer';
import TransitionLayout from '~/components/layouts/_transition_layout'; import TransitionLayout from '~/components/layouts/_transition_layout';
import Navbar from '../navbar/navbar'; import Navbar from '~/components/navbar/navbar';
import BaseLayout from './_base_layout'; import BaseLayout from './_base_layout';
const ContentLayoutStyle = styled(TransitionLayout)(({ theme }) => ({ const ContentLayoutStyle = styled(TransitionLayout)(({ theme }) => ({

View File

@@ -1,3 +1,4 @@
import PATHS from '#constants/paths';
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { Link } from '@inertiajs/react'; import { Link } from '@inertiajs/react';
import { route } from '@izzyjs/route/client'; import { route } from '@izzyjs/route/client';
@@ -13,7 +14,6 @@ import RoundedImage from '~/components/common/rounded_image';
import UnstyledList from '~/components/common/unstyled/unstyled_list'; import UnstyledList from '~/components/common/unstyled/unstyled_list';
import ModalSettings from '~/components/settings/modal'; import ModalSettings from '~/components/settings/modal';
import useUser from '~/hooks/use_user'; import useUser from '~/hooks/use_user';
import PATHS from '../../../app/constants/paths';
type NavbarListDirection = { type NavbarListDirection = {
right?: boolean; right?: boolean;

View File

@@ -1,6 +1,6 @@
import { Visibility } from '#enums/visibility';
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { IoEarthOutline } from 'react-icons/io5'; import { IoEarthOutline } from 'react-icons/io5';
import { Visibility } from '../../../app/enums/visibility';
const VisibilityStyle = styled.span(({ theme }) => ({ const VisibilityStyle = styled.span(({ theme }) => ({
fontWeight: 300, fontWeight: 300,

View File

@@ -29,4 +29,4 @@
}, },
"look-title": "Take a look", "look-title": "Take a look",
"website-screenshot-alt": "A screenshot of MyLinks" "website-screenshot-alt": "A screenshot of MyLinks"
} }

View File

@@ -55,4 +55,4 @@
"footer": { "footer": {
"made_by": "Made with ❤\uFE0F by" "made_by": "Made with ❤\uFE0F by"
} }
} }

View File

@@ -2,4 +2,4 @@
"select-collection": "Please select a collection", "select-collection": "Please select a collection",
"or-create-one": "or create one", "or-create-one": "or create one",
"no-link": "No link for <b>{{name}}</b>" "no-link": "No link for <b>{{name}}</b>"
} }

View File

@@ -7,4 +7,4 @@
"changes": "We reserve the right to update these Terms and Conditions of Use. We encourage you to regularly check this page to stay informed of any changes.", "changes": "We reserve the right to update these Terms and Conditions of Use. We encourage you to regularly check this page to stay informed of any changes.",
"thanks": "Thank you for using MyLinks!" "thanks": "Thank you for using MyLinks!"
} }
} }

View File

@@ -3,4 +3,4 @@
"informative-text": "Authentication required to use MyLinks", "informative-text": "Authentication required to use MyLinks",
"continue-with": "Continue with {{provider}}", "continue-with": "Continue with {{provider}}",
"accept-terms": "By continuing, you accept the" "accept-terms": "By continuing, you accept the"
} }

View File

@@ -11,13 +11,7 @@
"user": { "user": {
"title": "1.2 User Data", "title": "1.2 User Data",
"description": "To create personalized collections and links and associate them with their author, we collect the following information:", "description": "To create personalized collections and links and associate them with their author, we collect the following information:",
"fields": [ "fields": ["Google ID", "Lastname", "Firstname", "Email", "Avatar"]
"Google ID",
"Lastname",
"Firstname",
"Email",
"Avatar"
]
} }
}, },
"data_use": { "data_use": {
@@ -40,4 +34,4 @@
"title": "5. GDPR Compliance", "title": "5. GDPR Compliance",
"description": "MyLinks complies with the General Data Protection Regulation (GDPR) of the European Union." "description": "MyLinks complies with the General Data Protection Regulation (GDPR) of the European Union."
} }
} }

View File

@@ -51,4 +51,4 @@
"title": "6. Termination", "title": "6. Termination",
"description": "MyLinks reserves the right to terminate or suspend your access to the service, with or without notice, in case of violation of these Terms and Conditions of Use." "description": "MyLinks reserves the right to terminate or suspend your access to the service, with or without notice, in case of violation of these Terms and Conditions of Use."
} }
} }

View File

@@ -29,4 +29,4 @@
}, },
"look-title": "Jetez un coup d'oeil", "look-title": "Jetez un coup d'oeil",
"website-screenshot-alt": "Une capture d'écran de MyLinks" "website-screenshot-alt": "Une capture d'écran de MyLinks"
} }

View File

@@ -55,4 +55,4 @@
"footer": { "footer": {
"made_by": "Fait avec ❤\uFE0F par" "made_by": "Fait avec ❤\uFE0F par"
} }
} }

View File

@@ -2,4 +2,4 @@
"select-collection": "Veuillez sélectionner une collection", "select-collection": "Veuillez sélectionner une collection",
"or-create-one": "ou en créer une", "or-create-one": "ou en créer une",
"no-link": "Aucun lien pour <b>{{name}}</b>" "no-link": "Aucun lien pour <b>{{name}}</b>"
} }

View File

@@ -7,4 +7,4 @@
"changes": "Nous nous réservons le droit de mettre à jour ces Conditions Générales d'Utilisation. Nous vous encourageons à consulter régulièrement cette page pour rester informé des changements éventuels.", "changes": "Nous nous réservons le droit de mettre à jour ces Conditions Générales d'Utilisation. Nous vous encourageons à consulter régulièrement cette page pour rester informé des changements éventuels.",
"thanks": "Merci d'utiliser MyLinks !" "thanks": "Merci d'utiliser MyLinks !"
} }
} }

View File

@@ -3,4 +3,4 @@
"informative-text": "Authentification requise pour utiliser MyLinks", "informative-text": "Authentification requise pour utiliser MyLinks",
"continue-with": "Continuer avec {{provider}}", "continue-with": "Continuer avec {{provider}}",
"accept-terms": "En poursuivant, vous acceptez les" "accept-terms": "En poursuivant, vous acceptez les"
} }

View File

@@ -40,4 +40,4 @@
"title": "5. Conformité au RGPD", "title": "5. Conformité au RGPD",
"description": "MyLinks est conforme au Règlement Général sur la Protection des Données (RGPD) de l'Union européenne." "description": "MyLinks est conforme au Règlement Général sur la Protection des Données (RGPD) de l'Union européenne."
} }
} }

View File

@@ -51,4 +51,4 @@
"title": "6. Résiliation", "title": "6. Résiliation",
"description": "MyLinks se réserve le droit de résilier ou de suspendre votre accès au service, avec ou sans préavis, en cas de violation de ces Conditions Générales d'Utilisation." "description": "MyLinks se réserve le droit de résilier ou de suspendre votre accès au service, avec ou sans préavis, en cas de violation de ces Conditions Générales d'Utilisation."
} }
} }

View File

@@ -1,3 +1,4 @@
import { Visibility } from '#enums/visibility';
import { useForm } from '@inertiajs/react'; import { useForm } from '@inertiajs/react';
import { route } from '@izzyjs/route/client'; import { route } from '@izzyjs/route/client';
import { useMemo } from 'react'; import { useMemo } from 'react';
@@ -5,7 +6,6 @@ import { useTranslation } from 'react-i18next';
import FormCollection, { import FormCollection, {
FormCollectionData, FormCollectionData,
} from '~/components/form/form_collection'; } from '~/components/form/form_collection';
import { Visibility } from '../../../app/enums/visibility';
export default function CreateCollectionPage({ export default function CreateCollectionPage({
disableHomeLink, disableHomeLink,

View File

@@ -14,7 +14,8 @@
"isolatedModules": true, "isolatedModules": true,
"noEmit": true, "noEmit": true,
"paths": { "paths": {
"~/*": ["./*"] "~/*": ["./*"],
"@/*": ["../*"]
}, },
"types": ["vite/client", "@emotion/styled", "@emotion/react"] "types": ["vite/client", "@emotion/styled", "@emotion/react"]
}, },

View File

@@ -19,6 +19,7 @@
"#exceptions/*": "./app/exceptions/*.js", "#exceptions/*": "./app/exceptions/*.js",
"#models/*": "./app/models/*.js", "#models/*": "./app/models/*.js",
"#constants/*": "./app/constants/*.js", "#constants/*": "./app/constants/*.js",
"#enums/*": "./app/enums/*.js",
"#mails/*": "./app/mails/*.js", "#mails/*": "./app/mails/*.js",
"#services/*": "./app/services/*.js", "#services/*": "./app/services/*.js",
"#listeners/*": "./app/listeners/*.js", "#listeners/*": "./app/listeners/*.js",
@@ -31,7 +32,8 @@
"#database/*": "./database/*.js", "#database/*": "./database/*.js",
"#tests/*": "./tests/*.js", "#tests/*": "./tests/*.js",
"#start/*": "./start/*.js", "#start/*": "./start/*.js",
"#config/*": "./config/*.js" "#config/*": "./config/*.js",
"#lib/*": "./app/lib/*.js"
}, },
"devDependencies": { "devDependencies": {
"@adonisjs/assembler": "^7.6.1", "@adonisjs/assembler": "^7.6.1",

View File

@@ -3,10 +3,7 @@
"short_name": "MyLinks", "short_name": "MyLinks",
"description": "MyLinks is a free and open source software, that lets you manage your favorite links in an intuitive interface", "description": "MyLinks is a free and open source software, that lets you manage your favorite links in an intuitive interface",
"launch_handler": { "launch_handler": {
"client_mode": [ "client_mode": ["focus-existing", "auto"]
"focus-existing",
"auto"
]
}, },
"icons": [ "icons": [
{ {
@@ -21,4 +18,4 @@
"start_url": "/", "start_url": "/",
"display": "standalone", "display": "standalone",
"orientation": "portrait" "orientation": "portrait"
} }