refactor(chore): ♻️ delete import map for local path due to workspace errors

This commit is contained in:
Julien Oculi 2024-06-19 16:47:07 +02:00
parent e4b2f335a5
commit 94632dbc07
14 changed files with 45 additions and 55 deletions

1
.env.example Normal file
View file

@ -0,0 +1 @@
DB_PATH = './db.sqlite'

View file

@ -14,13 +14,6 @@
"semiColons": false
},
"imports": {
"@/": "./",
"@models": "./src/models/mod.ts",
"@models/": "./src/models/src/",
"@api": "./src/api/server.ts",
"@api/": "./src/api/",
"@db": "./src/db/mod.ts",
"@db/": "./src/db/",
"@std/json": "jsr:@std/json@^0.223.0"
},
"exclude": [

4
mod.ts
View file

@ -1,2 +1,2 @@
export * from '@models'
export { Db } from '@db'
export * from './src/models/mod.ts'
export { Db } from './src/db/mod.ts'

View file

@ -6,8 +6,8 @@ import {
type Ressource,
Service,
User,
} from '@models'
import type { CredentialCategory } from '@models/credential.ts'
} from '../models/mod.ts'
import type { CredentialCategory } from '../models/src/credential.ts'
//!TODO link ressources (get, list)
//!TODO Purge unused ressources (delete)

View file

@ -1,11 +1,7 @@
export {
Ref,
type RefResolver,
type RefString,
} from '@/src/models/utils/ref.ts'
export { Credential } from '@models/credential.ts'
export { Group } from '@models/group.ts'
export { Machine } from '@models/machine.ts'
export type { Ressource } from '@models/ressource.ts'
export { Service } from '@models/service.ts'
export { User } from '@models/user.ts'
export { Ref, type RefResolver, type RefString } from './utils/ref.ts'
export { Credential } from './src/credential.ts'
export { Group } from './src/group.ts'
export { Machine } from './src/machine.ts'
export type { Ressource } from './src/ressource.ts'
export { Service } from './src/service.ts'
export { User } from './src/user.ts'

View file

@ -1,7 +1,7 @@
import type { Base64String, ToJson, UUID } from '@/types.ts'
import { Ressource } from '@models/ressource.ts'
import type { Ref } from '@models'
import { Avatar } from '@/src/models/utils/avatar.ts'
import type { Base64String, ToJson, UUID } from '../../../types.ts'
import { Ressource } from './ressource.ts'
import type { Ref } from '../utils/ref.ts'
import { Avatar } from '../utils/avatar.ts'
export class Credential<T extends CredentialCategory> extends Ressource {
static fromJSON<T extends CredentialCategory>(

View file

@ -1,7 +1,7 @@
import type { Posix, ToJson, UUID } from '@/types.ts'
import { Ressource } from '@models/ressource.ts'
import { Ref } from '@models'
import { Avatar } from '@/src/models/utils/avatar.ts'
import type { Posix, ToJson, UUID } from '../../../types.ts'
import { Ressource } from './ressource.ts'
import { Ref } from '../utils/ref.ts'
import { Avatar } from '../utils/avatar.ts'
export class Group extends Ressource {
static fromJSON(

View file

@ -1,8 +1,8 @@
import { Ref } from '@/src/models/utils/ref.ts'
import type { ToJson, UrlString } from '@/types.ts'
import type { Group } from '@models/group.ts'
import { Ressource } from '@models/ressource.ts'
import { Avatar } from '@/src/models/utils/avatar.ts'
import { Ref } from '../utils/ref.ts'
import type { ToJson, UrlString } from '../../../types.ts'
import type { Group } from './group.ts'
import { Ressource } from './ressource.ts'
import { Avatar } from '../utils/avatar.ts'
export class Machine extends Ressource {
static fromJSON(

View file

@ -1,6 +1,6 @@
import { Ref } from '@/src/models/utils/ref.ts'
import type { DateString, ToJson, UrlString, UUID } from '@/types.ts'
import { regex } from '@/utils.ts'
import { Ref } from '../utils/ref.ts'
import type { DateString, ToJson, UrlString, UUID } from '../../../types.ts'
import { regex } from '../../../utils.ts'
export class Ressource {
static fromJSON(

View file

@ -1,8 +1,8 @@
import { Ref } from '@/src/models/utils/ref.ts'
import type { ToJson, UrlString } from '@/types.ts'
import type { Group } from '@models/group.ts'
import { Ressource } from '@models/ressource.ts'
import { Avatar } from '@/src/models/utils/avatar.ts'
import { Ref } from '../utils/ref.ts'
import type { ToJson, UrlString } from '../../../types.ts'
import type { Group } from './group.ts'
import { Ressource } from './ressource.ts'
import { Avatar } from '../utils/avatar.ts'
export class Service extends Ressource {
static fromJSON(

View file

@ -1,10 +1,10 @@
import { Ref } from '@/src/models/utils/ref.ts'
import type { Login, MailAddress, Posix, ToJson } from '@/types.ts'
import { regex, toLogin } from '@/utils.ts'
import type { Credential, CredentialCategory } from '@models/credential.ts'
import type { Group } from '@models/group.ts'
import { Ressource } from '@models/ressource.ts'
import { Avatar } from '@/src/models/utils/avatar.ts'
import { Ref } from '../utils/ref.ts'
import type { Login, MailAddress, Posix, ToJson } from '../../../types.ts'
import { regex, toLogin } from '../../../utils.ts'
import type { Credential, CredentialCategory } from './credential.ts'
import type { Group } from './group.ts'
import { Ressource } from './ressource.ts'
import { Avatar } from '../utils/avatar.ts'
export class User extends Ressource {
static fromJSON(json: ToJson<User>): User {

View file

@ -1,4 +1,4 @@
import type { UrlString } from '@/types.ts'
import type { UrlString } from '../../../types.ts'
export class Avatar {
static fromEmoji(emoji: string): UrlString {

View file

@ -1,5 +1,5 @@
import type { Db } from '@/mod.ts'
import type { UUID } from '@/types.ts'
import type { Db } from '../../db/mod.ts'
import type { UUID } from '../../../types.ts'
import {
Credential,
Group,
@ -7,7 +7,7 @@ import {
type Ressource,
Service,
User,
} from '@models'
} from '../mod.ts'
export type RefString<T extends Ressource> =
| `@ref/${T['type']}#${UUID}`

View file

@ -1,4 +1,4 @@
import type { Login } from '@/types.ts'
import type { Login } from './types.ts'
export function toLogin({
firstname,