refactor: ♻️ update import map to simplify local imports paths
This commit is contained in:
parent
27faac00e3
commit
01e007939d
|
@ -1,8 +1,8 @@
|
||||||
import { asset } from '$fresh/runtime.ts'
|
import { asset } from '$fresh/runtime.ts'
|
||||||
import SearchBox from '../islands/SearchBox.tsx'
|
import AiChatBox from ':islands/AiChatBox.tsx'
|
||||||
import ThemePicker from '../islands/ThemePicker.tsx'
|
import MoreBox from ':islands/MoreBox.tsx'
|
||||||
import MoreBox from '../islands/MoreBox.tsx'
|
import SearchBox from ':islands/SearchBox.tsx'
|
||||||
import AiChatBox from '../islands/AiChatBox.tsx'
|
import ThemePicker from ':islands/ThemePicker.tsx'
|
||||||
|
|
||||||
export function Header() {
|
export function Header() {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import RegisterServiceWorker from '../islands/RegisterServiceWorker.tsx'
|
import RegisterServiceWorker from ':islands/RegisterServiceWorker.tsx'
|
||||||
|
|
||||||
export function ProgressiveWebApp() {
|
export function ProgressiveWebApp() {
|
||||||
return <RegisterServiceWorker />
|
return <RegisterServiceWorker />
|
||||||
|
|
|
@ -15,6 +15,9 @@
|
||||||
"lint": { "rules": { "tags": ["fresh", "recommended"] } },
|
"lint": { "rules": { "tags": ["fresh", "recommended"] } },
|
||||||
"exclude": ["**/_fresh/*", "packages/"],
|
"exclude": ["**/_fresh/*", "packages/"],
|
||||||
"imports": {
|
"imports": {
|
||||||
|
":components/": "./components/",
|
||||||
|
":islands/": "./islands/",
|
||||||
|
":src/": "./src/",
|
||||||
"$fresh/": "https://deno.land/x/fresh@1.6.8/",
|
"$fresh/": "https://deno.land/x/fresh@1.6.8/",
|
||||||
"$std/": "https://deno.land/std@0.208.0/",
|
"$std/": "https://deno.land/std@0.208.0/",
|
||||||
"@cohabit/cohamail/": "./packages/@cohabit__cohamail@0.2.1/",
|
"@cohabit/cohamail/": "./packages/@cohabit__cohamail@0.2.1/",
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { requestApi } from ':src/utils.ts'
|
||||||
import { startAuthentication } from '@simplewebauthn/browser'
|
import { startAuthentication } from '@simplewebauthn/browser'
|
||||||
import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types'
|
import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types'
|
||||||
import { Button, Input } from 'univoq'
|
import { Button, Input } from 'univoq'
|
||||||
|
@ -5,7 +6,6 @@ import type {
|
||||||
WebAuthnLoginFinishPayload,
|
WebAuthnLoginFinishPayload,
|
||||||
WebAuthnLoginStartPayload,
|
WebAuthnLoginStartPayload,
|
||||||
} from '../routes/api/webauthn/login/[step].ts'
|
} from '../routes/api/webauthn/login/[step].ts'
|
||||||
import { requestApi } from '../src/utils.ts'
|
|
||||||
|
|
||||||
export default function LoginForm() {
|
export default function LoginForm() {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { requestApi } from ':src/utils.ts'
|
||||||
import { startRegistration } from '@simplewebauthn/browser'
|
import { startRegistration } from '@simplewebauthn/browser'
|
||||||
import { PublicKeyCredentialCreationOptionsJSON } from '@simplewebauthn/types'
|
import { PublicKeyCredentialCreationOptionsJSON } from '@simplewebauthn/types'
|
||||||
import { Button, Input } from 'univoq'
|
import { Button, Input } from 'univoq'
|
||||||
|
@ -5,7 +6,6 @@ import type {
|
||||||
WebAuthnRegisterFinishPayload,
|
WebAuthnRegisterFinishPayload,
|
||||||
WebAuthnRegisterStartPayload,
|
WebAuthnRegisterStartPayload,
|
||||||
} from '../routes/api/webauthn/register/[step].ts'
|
} from '../routes/api/webauthn/register/[step].ts'
|
||||||
import { requestApi } from '../src/utils.ts'
|
|
||||||
|
|
||||||
function isWebAuthnSupported(): boolean {
|
function isWebAuthnSupported(): boolean {
|
||||||
return 'credentials' in navigator
|
return 'credentials' in navigator
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { requestApi } from '../src/utils.ts'
|
import { requestApi } from ':src/utils.ts'
|
||||||
|
|
||||||
export default function RegisterServiceWorker() {
|
export default function RegisterServiceWorker() {
|
||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { main } from '../src/serviceworker/mod.ts'
|
import { main } from ':src/serviceworker/mod.ts'
|
||||||
|
|
||||||
const IS_SW = 'onpushsubscriptionchange' in self
|
const IS_SW = 'onpushsubscriptionchange' in self
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { asset, Head, Partial } from '$fresh/runtime.ts'
|
import { asset, Head, Partial } from '$fresh/runtime.ts'
|
||||||
import { type PageProps } from '$fresh/server.ts'
|
import { type PageProps } from '$fresh/server.ts'
|
||||||
import { Footer } from '../components/Footer.tsx'
|
import { Footer } from ':components/Footer.tsx'
|
||||||
import { Header } from '../components/Header.tsx'
|
import { Header } from ':components/Header.tsx'
|
||||||
import { ProgressiveWebApp } from '../components/ProgressiveWebApp.tsx'
|
import { ProgressiveWebApp } from ':components/ProgressiveWebApp.tsx'
|
||||||
|
|
||||||
export default function App({ Component }: PageProps) {
|
export default function App({ Component }: PageProps) {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { FreshContext } from '$fresh/server.ts'
|
import { FreshContext } from '$fresh/server.ts'
|
||||||
|
import { SessionStore } from ':src/session/mod.ts'
|
||||||
import { getCookies, setCookie } from '@std/http/cookie'
|
import { getCookies, setCookie } from '@std/http/cookie'
|
||||||
import { SessionStore } from '../src/session/mod.ts'
|
|
||||||
|
|
||||||
export async function handler(request: Request, ctx: FreshContext) {
|
export async function handler(request: Request, ctx: FreshContext) {
|
||||||
// Update fresh context state with session
|
// Update fresh context state with session
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { FreshContext } from '$fresh/server.ts'
|
import { FreshContext } from '$fresh/server.ts'
|
||||||
import { SessionStore } from '../../src/session/mod.ts'
|
import { SessionStore } from ':src/session/mod.ts'
|
||||||
import { respondApi } from '../../src/utils.ts'
|
import { respondApi } from ':src/utils.ts'
|
||||||
|
|
||||||
export function handler(request: Request, ctx: FreshContext) {
|
export function handler(request: Request, ctx: FreshContext) {
|
||||||
// Check CSRF token
|
// Check CSRF token
|
||||||
|
|
|
@ -2,13 +2,13 @@ import 'npm:iterator-polyfill'
|
||||||
// Polyfill AsyncIterator
|
// Polyfill AsyncIterator
|
||||||
|
|
||||||
import { FreshContext } from '$fresh/server.ts'
|
import { FreshContext } from '$fresh/server.ts'
|
||||||
|
import { db } from ':src/db/mod.ts'
|
||||||
|
import { SessionHandlers, SessionStore } from ':src/session/mod.ts'
|
||||||
|
import { respondApi } from ':src/utils.ts'
|
||||||
import { Contact, type Mail, send } from '@cohabit/cohamail/mod.ts'
|
import { Contact, type Mail, send } from '@cohabit/cohamail/mod.ts'
|
||||||
import { magicLinkTemplate } from '@cohabit/cohamail/templates/mod.ts'
|
import { magicLinkTemplate } from '@cohabit/cohamail/templates/mod.ts'
|
||||||
import { SessionHandlers, SessionStore } from '../../../src/session/mod.ts'
|
|
||||||
import { respondApi } from '../../../src/utils.ts'
|
|
||||||
import { sleep } from '@jotsr/delayed'
|
|
||||||
import { User } from '@cohabit/ressources_manager/src/models/mod.ts'
|
import { User } from '@cohabit/ressources_manager/src/models/mod.ts'
|
||||||
import { db } from '../../../src/db/mod.ts'
|
import { sleep } from '@jotsr/delayed'
|
||||||
|
|
||||||
type MagicLinkInfos = {
|
type MagicLinkInfos = {
|
||||||
remoteId: string
|
remoteId: string
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
|
import { db } from ':src/db/mod.ts'
|
||||||
|
import type { SessionHandlers } from ':src/session/mod.ts'
|
||||||
|
import { respondApi } from ':src/utils.ts'
|
||||||
|
import { getRelyingParty } from ':src/webauthn/mod.ts'
|
||||||
|
import { Credential, Ref, User } from '@cohabit/ressources_manager/mod.ts'
|
||||||
|
import { Passkey } from '@cohabit/ressources_manager/src/models/src/credential.ts'
|
||||||
import {
|
import {
|
||||||
generateAuthenticationOptions,
|
generateAuthenticationOptions,
|
||||||
verifyAuthenticationResponse,
|
verifyAuthenticationResponse,
|
||||||
} from '@simplewebauthn/server'
|
} from '@simplewebauthn/server'
|
||||||
import { getRelyingParty } from '../../../../src/webauthn/mod.ts'
|
|
||||||
import {
|
import {
|
||||||
AuthenticationResponseJSON,
|
AuthenticationResponseJSON,
|
||||||
PublicKeyCredentialRequestOptionsJSON,
|
PublicKeyCredentialRequestOptionsJSON,
|
||||||
} from '@simplewebauthn/types'
|
} from '@simplewebauthn/types'
|
||||||
import { respondApi } from '../../../../src/utils.ts'
|
|
||||||
import type { SessionHandlers } from '../../../../src/session/mod.ts'
|
|
||||||
import { db } from '../../../../src/db/mod.ts'
|
|
||||||
import { Credential, Ref, User } from '@cohabit/ressources_manager/mod.ts'
|
|
||||||
import { Passkey } from '@cohabit/ressources_manager/src/models/src/credential.ts'
|
|
||||||
import { decodeBase64 } from '@std/encoding'
|
import { decodeBase64 } from '@std/encoding'
|
||||||
|
|
||||||
type Params = { step: 'start' | 'finish' }
|
type Params = { step: 'start' | 'finish' }
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { SessionHandlers } from ':src/session/mod.ts'
|
||||||
|
import { respondApi } from ':src/utils.ts'
|
||||||
import {
|
import {
|
||||||
generateRegistrationOptions,
|
generateRegistrationOptions,
|
||||||
verifyRegistrationResponse,
|
verifyRegistrationResponse,
|
||||||
|
@ -6,15 +8,13 @@ import type {
|
||||||
PublicKeyCredentialCreationOptionsJSON,
|
PublicKeyCredentialCreationOptionsJSON,
|
||||||
RegistrationResponseJSON,
|
RegistrationResponseJSON,
|
||||||
} from '@simplewebauthn/types'
|
} from '@simplewebauthn/types'
|
||||||
import { respondApi } from '../../../../src/utils.ts'
|
|
||||||
import { SessionHandlers } from '../../../../src/session/mod.ts'
|
|
||||||
|
|
||||||
//TODO improve workspace imports
|
//TODO improve workspace imports
|
||||||
import { Passkey } from '@cohabit/ressources_manager/src/models/src/credential.ts'
|
import { db } from ':src/db/mod.ts'
|
||||||
|
import { getRelyingParty } from ':src/webauthn/mod.ts'
|
||||||
import { Credential, Ref, User } from '@cohabit/ressources_manager/mod.ts'
|
import { Credential, Ref, User } from '@cohabit/ressources_manager/mod.ts'
|
||||||
import { getRelyingParty } from '../../../../src/webauthn/mod.ts'
|
import { Passkey } from '@cohabit/ressources_manager/src/models/src/credential.ts'
|
||||||
import { encodeBase64 } from '@std/encoding'
|
import { encodeBase64 } from '@std/encoding'
|
||||||
import { db } from '../../../../src/db/mod.ts'
|
|
||||||
|
|
||||||
type Params = { step: 'start' | 'finish' }
|
type Params = { step: 'start' | 'finish' }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Handlers } from '$fresh/server.ts'
|
import { Handlers } from '$fresh/server.ts'
|
||||||
import { respondApi } from '../../../src/utils.ts'
|
import { respondApi } from ':src/utils.ts'
|
||||||
|
|
||||||
export const handler: Handlers = {
|
export const handler: Handlers = {
|
||||||
async POST(request: Request) {
|
async POST(request: Request) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Handlers } from '$fresh/server.ts'
|
import { Handlers } from '$fresh/server.ts'
|
||||||
import { respondApi } from '../../../src/utils.ts'
|
import { respondApi } from ':src/utils.ts'
|
||||||
import { publicKey } from '../../../src/webpush/mod.ts'
|
import { publicKey } from ':src/webpush/mod.ts'
|
||||||
|
|
||||||
export const handler: Handlers = {
|
export const handler: Handlers = {
|
||||||
GET() {
|
GET() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { AutoGrid } from '../../components/AutoGrid.tsx'
|
import { AutoGrid } from ':components/AutoGrid.tsx'
|
||||||
import { BlogCard, blogMock } from '../../components/BlogCard.tsx'
|
import { BlogCard, blogMock } from ':components/BlogCard.tsx'
|
||||||
|
|
||||||
export default function Blog() {
|
export default function Blog() {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { Head } from '$fresh/runtime.ts'
|
import { Head } from '$fresh/runtime.ts'
|
||||||
import { AutoGrid } from '../components/AutoGrid.tsx'
|
import { AutoGrid } from ':components/AutoGrid.tsx'
|
||||||
import { BlogCard, blogMock } from '../components/BlogCard.tsx'
|
import { BlogCard, blogMock } from ':components/BlogCard.tsx'
|
||||||
import { CohabitInfoTable } from '../components/CohabitInfoTable.tsx'
|
import { CohabitInfoTable } from ':components/CohabitInfoTable.tsx'
|
||||||
import { Heros } from '../components/Heros.tsx'
|
import { Heros } from ':components/Heros.tsx'
|
||||||
import { MachineCard, machineMock } from '../components/MachineCard.tsx'
|
import { MachineCard, machineMock } from ':components/MachineCard.tsx'
|
||||||
import { MemberCard, memberMock } from '../components/MemberCard.tsx'
|
import { MemberCard, memberMock } from ':components/MemberCard.tsx'
|
||||||
import { ProjectCard, projectMock } from '../components/ProjectCard.tsx'
|
import { ProjectCard, projectMock } from ':components/ProjectCard.tsx'
|
||||||
import { SponsorCards } from '../components/SponsorCards.tsx'
|
import { SponsorCards } from ':components/SponsorCards.tsx'
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { PageProps } from '$fresh/server.ts'
|
import { PageProps } from '$fresh/server.ts'
|
||||||
import { MachineCard, machineMock } from '../../components/MachineCard.tsx'
|
import { MachineCard, machineMock } from ':components/MachineCard.tsx'
|
||||||
|
|
||||||
export default function Machine({ params }: PageProps) {
|
export default function Machine({ params }: PageProps) {
|
||||||
const machine = machineMock.at(Number(params.id))
|
const machine = machineMock.at(Number(params.id))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { AutoGrid } from '../../components/AutoGrid.tsx'
|
import { AutoGrid } from ':components/AutoGrid.tsx'
|
||||||
import { MachineCard, machineMock } from '../../components/MachineCard.tsx'
|
import { MachineCard, machineMock } from ':components/MachineCard.tsx'
|
||||||
|
|
||||||
export default function Machine() {
|
export default function Machine() {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { PageProps } from '$fresh/server.ts'
|
import { PageProps } from '$fresh/server.ts'
|
||||||
import { Markdown } from '../../../components/Markdown.tsx'
|
import { Markdown } from ':components/Markdown.tsx'
|
||||||
import { MemberCard, memberMock } from '../../../components/MemberCard.tsx'
|
import { MemberCard, memberMock } from ':components/MemberCard.tsx'
|
||||||
|
|
||||||
const db = [
|
const db = [
|
||||||
'julien.oculi',
|
'julien.oculi',
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { AutoGrid } from '../../components/AutoGrid.tsx'
|
import { AutoGrid } from ':components/AutoGrid.tsx'
|
||||||
import { MemberCard, memberMock } from '../../components/MemberCard.tsx'
|
import { MemberCard, memberMock } from ':components/MemberCard.tsx'
|
||||||
|
|
||||||
export default function Membres() {
|
export default function Membres() {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Button } from 'univoq'
|
import LoginForm from ':islands/LoginForm.tsx'
|
||||||
import LoginForm from '../../islands/LoginForm.tsx'
|
import PassKeyRegister from ':islands/PassKeyRegister.tsx'
|
||||||
import PassKeyRegister from '../../islands/PassKeyRegister.tsx'
|
import type { SessionPageProps } from ':src/session/mod.ts'
|
||||||
import type { SessionPageProps } from '../../src/session/mod.ts'
|
|
||||||
import type { User } from '@cohabit/ressources_manager/mod.ts'
|
import type { User } from '@cohabit/ressources_manager/mod.ts'
|
||||||
|
import { Button } from 'univoq'
|
||||||
|
|
||||||
export default function Profil({ state }: SessionPageProps) {
|
export default function Profil({ state }: SessionPageProps) {
|
||||||
const user = state.session?.get<User>('user')
|
const user = state.session?.get<User>('user')
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { PageProps } from '$fresh/server.ts'
|
import { PageProps } from '$fresh/server.ts'
|
||||||
import { ProjectCard, projectMock } from '../../components/ProjectCard.tsx'
|
import { ProjectCard, projectMock } from ':components/ProjectCard.tsx'
|
||||||
|
|
||||||
export default function Projets({ params }: PageProps) {
|
export default function Projets({ params }: PageProps) {
|
||||||
const Projets = projectMock.at(Number(params.id))
|
const Projets = projectMock.at(Number(params.id))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { AutoGrid } from '../../components/AutoGrid.tsx'
|
import { AutoGrid } from ':components/AutoGrid.tsx'
|
||||||
import { ProjectCard, projectMock } from '../../components/ProjectCard.tsx'
|
import { ProjectCard, projectMock } from ':components/ProjectCard.tsx'
|
||||||
|
|
||||||
export default function Project() {
|
export default function Project() {
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in a new issue