diff --git a/import_map.json b/import_map.json index 2f9fe3e..f081301 100644 --- a/import_map.json +++ b/import_map.json @@ -1,12 +1,12 @@ { "imports": { - "$src/": "./src/", + "$/": "./src/", "$deps": "./deps.ts", "$types": "./src/types.ts", "$front/": "./demo/", "$fresh/": "https://deno.land/x/fresh@1.1.3/", - "preact": "https://esm.sh/preact@10.11.0", - "preact/": "https://esm.sh/preact@10.11.0/", + "preact": "https://cdn.skypack.dev/preact", + "preact/": "https://cdn.skypack.dev/preact/", "preact-render-to-string": "https://esm.sh/*preact-render-to-string@5.2.4", "@preact/signals": "https://esm.sh/*@preact/signals@1.0.3", "@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.0.1" diff --git a/src/controllers/docs.controller.ts b/src/controllers/docs.controller.ts index 962eabe..79f2ff3 100644 --- a/src/controllers/docs.controller.ts +++ b/src/controllers/docs.controller.ts @@ -1,5 +1,5 @@ import { Context, renderToString } from '$deps' -import { Docs } from '$src/components/Docs.tsx' +import { Docs } from '$/components/Docs.tsx' // deno-lint-ignore no-explicit-any function render(jsx: any, props?: any) { diff --git a/src/controllers/jobs.controller.ts b/src/controllers/jobs.controller.ts index 8db06e7..67d781a 100644 --- a/src/controllers/jobs.controller.ts +++ b/src/controllers/jobs.controller.ts @@ -1,6 +1,6 @@ import { Context } from '$deps' -import jobs from '$src/data/jobs.json' assert { 'type': 'json' } -import { ResponseDto } from '$src/dto/Response.dto.ts' +import jobs from '$/data/jobs.json' assert { 'type': 'json' } +import { ResponseDto } from '$/dto/Response.dto.ts' import { IJob } from '$types' export function getJobs(ctx: Context): void { diff --git a/src/routes/index.ts b/src/routes/index.ts index d20d703..edaaeb0 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -1,6 +1,6 @@ import { Router } from '$deps' -import { getJobs } from '$src/controllers/jobs.controller.ts' -import { getDocs } from '$src/controllers/docs.controller.ts' +import { getJobs } from '$/controllers/jobs.controller.ts' +import { getDocs } from '$/controllers/docs.controller.ts' const router = new Router() diff --git a/src/scraping/jobs.ts b/src/scraping/jobs.ts index 6cf7248..4621c4f 100644 --- a/src/scraping/jobs.ts +++ b/src/scraping/jobs.ts @@ -1,6 +1,6 @@ import { Cheerio, CheerioAPI, Element } from '$deps' -import { ConfigService } from '$src/services/Config.service.ts' -import { ScraperService } from '$src/services/Scraper.service.ts' +import { ConfigService } from '$/services/Config.service.ts' +import { ScraperService } from '$/services/Scraper.service.ts' import type { IJob, TJobDetails, TJobPartial } from '$types' export async function scrapeJobs(): Promise { diff --git a/src/services/Server.service.ts b/src/services/Server.service.ts index d00c7f3..d5a2b46 100644 --- a/src/services/Server.service.ts +++ b/src/services/Server.service.ts @@ -1,5 +1,5 @@ import { Application, CORS } from '$deps' -import { routes } from '$src/routes/index.ts' +import { routes } from '$/routes/index.ts' import { ConfigService } from './Config.service.ts' export class ServerService { diff --git a/src/types.ts b/src/types.ts index 34a6653..b61cfbd 100644 --- a/src/types.ts +++ b/src/types.ts @@ -19,4 +19,4 @@ export type TJobDetails = { postulations: number } -export type TResponseAPI = import('$src/dto/Response.dto.ts').ResponseDto +export type TResponseAPI = import('$/dto/Response.dto.ts').ResponseDto diff --git a/test/main_test.ts b/test/main_test.ts index 66bee8c..5aeca8c 100644 --- a/test/main_test.ts +++ b/test/main_test.ts @@ -1,6 +1,6 @@ import { superoak } from '$deps' -import { ServerService } from '$src/services/Server.service.ts' -import jobs from '$src/data/jobs.json' assert { 'type': 'json' } +import { ServerService } from '$/services/Server.service.ts' +import jobs from '$/data/jobs.json' assert { 'type': 'json' } const server = new ServerService() diff --git a/tools/prepare-husky.ts b/tools/prepare-husky.ts index 81fb87f..1e7406a 100644 --- a/tools/prepare-husky.ts +++ b/tools/prepare-husky.ts @@ -2,4 +2,4 @@ import { install, set } from '$deps'; install(); -set('.husky/pre-commit', 'deno task update-lock && deno fmt && deno lint'); +set('.husky/pre-commit', 'deno task update-lock && deno fmt && deno lint && deno task test');