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 "semiColons": false
}, },
"imports": { "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" "@std/json": "jsr:@std/json@^0.223.0"
}, },
"exclude": [ "exclude": [

4
mod.ts
View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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