Unverified Commit fc6aaa03 authored by Hong Minhee's avatar Hong Minhee
Browse files

Use a JSR version of Fedify for the blog example

parent c3086f56
Loading
Loading
Loading
Loading
+24 −10
Original line number Diff line number Diff line
{
  "lock": false,
  "tasks": {
    "fedify-codegen": "cat ../../src/vocab/vocab.ts > /dev/null || (deno run --allow-read --allow-write --check ../../src/codegen/main.ts ../../src/vocab/ ../runtime/ > ../../src/vocab/vocab.ts && deno fmt ../../src/vocab/vocab.ts && deno cache ../../src/vocab/vocab.ts && deno check ../../src/vocab/vocab.ts)",
    "generate-import-map": "deno run --allow-read --allow-write generate_import_map.ts",
    "codegen": "deno task fedify-codegen && deno task generate-import-map",
    "check": "deno task codegen && deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx",
    "cli": "deno task codegen && echo \"import '\\$fresh/src/dev/cli.ts'\" | deno run --unstable -A -",
    "manifest": "deno task codegen && deno task cli manifest $(pwd)",
    "start": "deno task codegen && deno run -A --watch=static/,routes/ --unstable-kv dev.ts",
    "build": "deno task codegen && deno run -A dev.ts build",
    "preview": "deno task codegen && deno run -A main.ts",
    "check": "deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx",
    "cli": "echo \"import '\\$fresh/src/dev/cli.ts'\" | deno run --unstable -A -",
    "manifest": "deno task cli manifest $(pwd)",
    "start": "deno run -A --watch=static/,routes/ --unstable-kv dev.ts",
    "build": "deno run -A dev.ts build",
    "preview": "deno run -A main.ts",
    "update": "deno run -A -r https://fresh.deno.dev/update ."
  },
  "lint": {
@@ -23,7 +20,24 @@
  "exclude": [
    "**/_fresh/*"
  ],
  "importMap": "./import_map.g.json",
  "imports": {
    "$fresh/": "https://deno.land/x/fresh@1.6.8/",
    "@preact/signals": "https://esm.sh/*@preact/signals@1.2.2",
    "@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.5.1",
    "@std/dotenv/load": "jsr:@std/dotenv@^0.224.0/load",
    "@std/encoding/hex": "jsr:@std/encoding@^0.224.3/hex",
    "@std/path": "jsr:@std/path@^0.225.2",
    "@std/semver": "jsr:@std/semver@^0.224.3",
    "@fedify/fedify": "jsr:@fedify/fedify@1.0.0-dev.414+f75c19cf",
    "@hongminhee/x-forwarded-fetch": "jsr:@hongminhee/x-forwarded-fetch@^0.2.0",
    "@logtape/logtape": "jsr:@logtape/logtape@^0.6.2",
    "markdown-it": "npm:markdown-it@^14.1.0",
    "preact": "https://esm.sh/preact@10.19.6",
    "preact/": "https://esm.sh/preact@10.19.6/",
    "scrypt": "jsr:@denorg/scrypt@4.4.4",
    "sanitize-html": "npm:sanitize-html@^2.13.0",
    "uuidv7": "npm:uuidv7@^1.0.0"
  },
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "preact"
+0 −13
Original line number Diff line number Diff line
import fedifyManifest from "../../src/deno.json" with { type: "json" };

const fedifyImportMap = fedifyManifest.imports;
const blogImportMap = JSON.parse(
  await Deno.readTextFile(`${import.meta.dirname}/import_map.json`),
).imports;

const importMap = { ...fedifyImportMap, ...blogImportMap };

await Deno.writeTextFile(
  `${import.meta.dirname}/import_map.g.json`,
  JSON.stringify({ imports: importMap }, null, 2) + "\n",
);

examples/blog/import_map.g.json

deleted100644 → 0
+0 −56
Original line number Diff line number Diff line
{
  "imports": {
    "@cfworker/json-schema": "npm:@cfworker/json-schema@^2.0.1",
    "@david/which-runtime": "jsr:@david/which-runtime@^0.2.0",
    "@deno/dnt": "jsr:@deno/dnt@0.41.2",
    "@fedify/fedify": "../../src.mod.ts",
    "@fedify/fedify/federation": "../../src/federation/mod.ts",
    "@fedify/fedify/nodeinfo": "../../src/nodeinfo/mod.ts",
    "@fedify/fedify/runtime": "../../src/runtime/mod.ts",
    "@fedify/fedify/sig": "../../src/sig/mod.ts",
    "@fedify/fedify/vocab": "../../src/vocab/mod.ts",
    "@fedify/fedify/webfinger": "../../src/webfinger/mod.ts",
    "@fedify/fedify/x/denokv": "../../src/x/denokv.ts",
    "@fedify/fedify/x/fresh": "../../src/x/fresh.ts",
    "@fedify/fedify/x/hono": "./x/hono.ts",
    "@hongminhee/aitertools": "jsr:@hongminhee/aitertools@^0.6.0",
    "@hugoalh/http-header-link": "jsr:@hugoalh/http-header-link@^1.0.2",
    "@logtape/logtape": "jsr:@logtape/logtape@^0.6.2",
    "@phensley/language-tag": "npm:@phensley/language-tag@^1.9.0",
    "@std/assert": "jsr:@std/assert@^0.226.0",
    "@std/async": "jsr:@std/async@^1.0.5",
    "@std/bytes": "jsr:@std/bytes@^1.0.2",
    "@std/collections": "jsr:@std/collections@^1.0.6",
    "@std/encoding": "jsr:@std/encoding@^1.0.5",
    "@std/fs": "jsr:@std/fs@^1.0.3",
    "@std/http": "jsr:@std/http@^1.0.6",
    "@std/path": "jsr:@std/path@^0.225.2",
    "@std/semver": "jsr:@std/semver@^0.224.3",
    "@std/testing": "jsr:@std/testing@^0.224.0",
    "@std/text": "jsr:@std/text@^1.0.6",
    "@std/url": "jsr:@std/url@^0.225.1",
    "@std/yaml": "jsr:@std/yaml@^0.224.3",
    "asn1js": "npm:asn1js@^3.0.5",
    "fast-check": "npm:fast-check@^3.22.0",
    "json-canon": "npm:json-canon@^1.0.1",
    "jsonld": "npm:jsonld@^8.3.2",
    "mock_fetch": "jsr:@hongminhee/deno-mock-fetch@^0.3.2",
    "multibase": "npm:multibase@^4.0.6",
    "multicodec": "npm:multicodec@^3.2.1",
    "pkijs": "npm:pkijs@^3.2.4",
    "uri-template-router": "npm:uri-template-router@^0.0.16",
    "url-template": "npm:url-template@^3.1.1",
    "$fresh/": "https://deno.land/x/fresh@1.6.8/",
    "@preact/signals": "https://esm.sh/*@preact/signals@1.2.3",
    "@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.6.1",
    "@std/dotenv/load": "jsr:@std/dotenv@^0.224.0/load",
    "@std/encoding/hex": "jsr:@std/encoding@^0.224.3/hex",
    "@hongminhee/x-forwarded-fetch": "jsr:@hongminhee/x-forwarded-fetch@^0.2.0",
    "markdown-it": "npm:markdown-it@^14.1.0",
    "preact": "https://esm.sh/preact@10.22.0",
    "preact/": "https://esm.sh/preact@10.22.0/",
    "scrypt": "jsr:@denorg/scrypt@4.4.4",
    "sanitize-html": "npm:sanitize-html@^2.13.0",
    "uuidv7": "npm:uuidv7@^1.0.0"
  }
}

examples/blog/import_map.json

deleted100644 → 0
+0 −28
Original line number Diff line number Diff line
{
  "imports": {
    "$fresh/": "https://deno.land/x/fresh@1.6.8/",
    "@preact/signals": "https://esm.sh/*@preact/signals@1.2.3",
    "@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.6.1",
    "@std/dotenv/load": "jsr:@std/dotenv@^0.224.0/load",
    "@std/encoding/hex": "jsr:@std/encoding@^0.224.3/hex",
    "@std/path": "jsr:@std/path@^0.225.2",
    "@std/semver": "jsr:@std/semver@^0.224.3",
    "@fedify/fedify": "../../src.mod.ts",
    "@fedify/fedify/federation": "../../src/federation/mod.ts",
    "@fedify/fedify/nodeinfo": "../../src/nodeinfo/mod.ts",
    "@fedify/fedify/runtime": "../../src/runtime/mod.ts",
    "@fedify/fedify/sig": "../../src/sig/mod.ts",
    "@fedify/fedify/vocab": "../../src/vocab/mod.ts",
    "@fedify/fedify/webfinger": "../../src/webfinger/mod.ts",
    "@fedify/fedify/x/fresh": "../../src/x/fresh.ts",
    "@fedify/fedify/x/denokv": "../../src/x/denokv.ts",
    "@hongminhee/x-forwarded-fetch": "jsr:@hongminhee/x-forwarded-fetch@^0.2.0",
    "@logtape/logtape": "jsr:@logtape/logtape@^0.6.2",
    "markdown-it": "npm:markdown-it@^14.1.0",
    "preact": "https://esm.sh/preact@10.22.0",
    "preact/": "https://esm.sh/preact@10.22.0/",
    "scrypt": "jsr:@denorg/scrypt@4.4.4",
    "sanitize-html": "npm:sanitize-html@^2.13.0",
    "uuidv7": "npm:uuidv7@^1.0.0"
  }
}