refactor: ♻️ replace http imports by jsr/npm imports

This commit is contained in:
Julien Oculi 2024-07-02 17:17:21 +02:00
parent 10f36ff4d3
commit a75de86d68
5 changed files with 11 additions and 12 deletions

View file

@ -1,5 +1,5 @@
import { SignalLike } from '$fresh/src/types.ts' import { SignalLike } from '$fresh/src/types.ts'
import { render, RenderOptions } from 'gfm' import { render, RenderOptions } from '@deno/gfm'
export type MarkdownTheme = 'light' | 'dark' | 'auto' export type MarkdownTheme = 'light' | 'dark' | 'auto'
export function Markdown( export function Markdown(

View file

@ -36,10 +36,11 @@
":src/": "./src/", ":src/": "./src/",
"@cohabit/cohamail/": "./packages/@cohabit__cohamail@0.2.1/", "@cohabit/cohamail/": "./packages/@cohabit__cohamail@0.2.1/",
"@cohabit/ressources_manager/": "./packages/@cohabit__ressources_manager@0.1.3/", "@cohabit/ressources_manager/": "./packages/@cohabit__ressources_manager@0.1.3/",
"@deno/gfm": "jsr:@deno/gfm@^0.8.2",
"@jotsr/delayed": "jsr:@jotsr/delayed@^2.1.1", "@jotsr/delayed": "jsr:@jotsr/delayed@^2.1.1",
"@jotsr/smart-css-bundler": "jsr:@jotsr/smart-css-bundler@^0.3.0", "@jotsr/smart-css-bundler": "jsr:@jotsr/smart-css-bundler@^0.3.0",
"@preact/signals": "https://esm.sh/*@preact/signals@1.2.2", "@preact/signals": "npm:@preact/signals@^1.2.3",
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.5.1", "@preact/signals-core": "npm:@preact/signals-core@^1.6.1",
"@simplewebauthn/browser": "npm:@simplewebauthn/browser@^10.0.0", "@simplewebauthn/browser": "npm:@simplewebauthn/browser@^10.0.0",
"@simplewebauthn/server": "npm:@simplewebauthn/server@^10.0.0", "@simplewebauthn/server": "npm:@simplewebauthn/server@^10.0.0",
"@simplewebauthn/types": "npm:@simplewebauthn/types@^10.0.0", "@simplewebauthn/types": "npm:@simplewebauthn/types@^10.0.0",
@ -49,9 +50,7 @@
"@std/json": "jsr:@std/json@^0.224.1", "@std/json": "jsr:@std/json@^0.224.1",
"@std/streams": "jsr:@std/streams@^0.224.5", "@std/streams": "jsr:@std/streams@^0.224.5",
"@univoq/": "https://deno.land/x/univoq@0.2.0/", "@univoq/": "https://deno.land/x/univoq@0.2.0/",
"gfm": "https://deno.land/x/gfm@0.6.0/mod.ts", "preact": "npm:preact@^10.22.1",
"preact": "https://esm.sh/preact@10.19.6",
"preact/": "https://esm.sh/preact@10.19.6/",
"univoq": "https://deno.land/x/univoq@0.2.0/mod.ts", "univoq": "https://deno.land/x/univoq@0.2.0/mod.ts",
"web-push": "npm:web-push@^3.6.7" "web-push": "npm:web-push@^3.6.7"
}, },

View file

@ -1,8 +1,8 @@
import { Signal, signal, useSignal } from '@preact/signals'
import { useEffect, useRef } from 'preact/hooks'
import { JSX } from 'preact'
import { JsonParseStream } from '$std/json/mod.ts' import { JsonParseStream } from '$std/json/mod.ts'
import { CSS, render as renderMd } from 'gfm' import { CSS, render as renderMd } from '@deno/gfm'
import { Signal, signal, useSignal } from '@preact/signals'
import { JSX } from 'preact'
import { useEffect, useRef } from 'preact/hooks'
const systemHistory = signal<BotMessage[]>([{ const systemHistory = signal<BotMessage[]>([{
role: 'system', role: 'system',

View file

@ -78,7 +78,7 @@ function updateFromList(
index: number, index: number,
): Promise<JSX.Element> { ): Promise<JSX.Element> {
const { promise, resolve } = Promise.withResolvers<JSX.Element>() const { promise, resolve } = Promise.withResolvers<JSX.Element>()
list.subscribe((value) => { list.subscribe((value: JSX.Element[]) => {
const selected = value.at(index) const selected = value.at(index)
if (selected) { if (selected) {
resolve(selected) resolve(selected)

View file

@ -1,5 +1,5 @@
import { Handlers } from '$fresh/server.ts' import { Handlers } from '$fresh/server.ts'
import { CSS, KATEX_CSS } from 'gfm' import { CSS, KATEX_CSS } from '@deno/gfm'
export const handler: Handlers = { export const handler: Handlers = {
GET() { GET() {