Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Mar 14, 2024
1 parent a7c2b2f commit 323c475
Show file tree
Hide file tree
Showing 46 changed files with 195 additions and 116 deletions.
8 changes: 4 additions & 4 deletions codegen/__snapshots__/class.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ export const snapshot = {};

snapshot[`generateClasses() 1`] = `
"// deno-lint-ignore-file ban-unused-ignore
import { Temporal } from \\"npm:@js-temporal/polyfill@^0.4.4\\";
import jsonld from \\"npm:jsonld@8.3.2\\";
import { Temporal } from \\"@js-temporal/polyfill\\";
import jsonld from \\"jsonld\\";
import { LanguageTag, parseLanguageTag }
from \\"npm:@phensley/language-tag@1.8.0\\";
import { exportSPKI, importSPKI } from \\"npm:jose@5.2.2\\";
from \\"@phensley/language-tag\\";
import { exportSPKI, importSPKI } from \\"jose\\";
import { DocumentLoader, fetchDocumentLoader }
from \\"../runtime/docloader.ts\\";
import { LanguageString } from \\"../runtime/langstr.ts\\";
Expand Down
6 changes: 3 additions & 3 deletions codegen/class.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assertEquals } from "jsr:@std/assert@^0.218.2";
import { dirname, join } from "jsr:@std/path@^0.218.2";
import { assertSnapshot } from "jsr:@std/testing@^0.218.2/snapshot";
import { assertEquals } from "@std/assert";
import { dirname, join } from "@std/path";
import { assertSnapshot } from "@std/testing/snapshot";
import { generateClasses, sortTopologically } from "./class.ts";
import { loadSchemaFiles } from "./schema.ts";

Expand Down
8 changes: 4 additions & 4 deletions codegen/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ export async function* generateClasses(
): AsyncIterable<string> {
runtimePath = runtimePath.replace(/\/+$/, "");
yield "// deno-lint-ignore-file ban-unused-ignore\n";
yield 'import { Temporal } from "npm:@js-temporal/polyfill@^0.4.4";\n';
yield 'import jsonld from "npm:jsonld@8.3.2";\n';
yield 'import { Temporal } from "@js-temporal/polyfill";\n';
yield 'import jsonld from "jsonld";\n';
yield `import { LanguageTag, parseLanguageTag }
from "npm:@phensley/language-tag@1.8.0";\n`;
yield `import { exportSPKI, importSPKI } from "npm:jose@5.2.2";\n`;
from "@phensley/language-tag";\n`;
yield `import { exportSPKI, importSPKI } from "jose";\n`;
yield `import { DocumentLoader, fetchDocumentLoader }
from "${runtimePath}/docloader.ts";\n`;
yield `import { LanguageString } from "${runtimePath}/langstr.ts";\n`;
Expand Down
2 changes: 1 addition & 1 deletion codegen/field.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { encodeBase58 } from "jsr:@std/encoding@^0.218.2/base58";
import { encodeBase58 } from "@std/encoding/base58";
import { PropertySchema, TypeSchema } from "./schema.ts";
import { areAllScalarTypes, getTypeNames } from "./type.ts";

Expand Down
4 changes: 2 additions & 2 deletions codegen/fs.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { join } from "jsr:@std/path@^0.218.2";
import { assertEquals } from "jsr:@std/assert@^0.218.2";
import { assertEquals } from "@std/assert";
import { join } from "@std/path";
import { toSet } from "https://deno.land/x/[email protected]/mod.ts";
import { readDirRecursive } from "./fs.ts";

Expand Down
2 changes: 1 addition & 1 deletion codegen/fs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { join } from "jsr:@std/path@^0.218.2";
import { join } from "@std/path";

/**
* Recursively read a directory, yielding the paths of all files. File paths
Expand Down
2 changes: 1 addition & 1 deletion codegen/property.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toPascalCase } from "jsr:@std/text@^0.218.2";
import { toPascalCase } from "@std/text";
import { getFieldName } from "./field.ts";
import { PropertySchema, TypeSchema } from "./schema.ts";
import { areAllScalarTypes, getTypeNames } from "./type.ts";
Expand Down
11 changes: 4 additions & 7 deletions codegen/schema.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { join } from "jsr:@std/path@^0.218.2";
import * as url from "jsr:@std/url@^0.218.2";
import { parse } from "jsr:@std/yaml@^0.218.2";
import {
Schema as JsonSchema,
Validator,
} from "npm:@cfworker/[email protected]";
import { Schema as JsonSchema, Validator } from "@cfworker/json-schema";
import { join } from "@std/path";
import * as url from "@std/url";
import { parse } from "@std/yaml";
import { readDirRecursive } from "./fs.ts";

/**
Expand Down
23 changes: 23 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,29 @@
"./vocab": "./vocab/mod.ts",
"./webfinger": "./webfinger/mod.ts"
},
"imports": {
"@cfworker/json-schema": "npm:@cfworker/json-schema@^1.12.8",
"@js-temporal/polyfill": "npm:@js-temporal/polyfill@^0.4.4",
"@phensley/language-tag": "npm:@phensley/language-tag@^1.8.0",
"@std/assert": "jsr:@std/assert@^0.219.1",
"@std/bytes": "jsr:@std/bytes@^0.219.1",
"@std/collections": "jsr:@std/collections@^0.219.1",
"@std/encoding": "jsr:@std/encoding@^0.219.1",
"@std/encoding/base64": "jsr:@std/encoding@^0.219.1/base64",
"@std/http": "jsr:@std/http@^0.219.1",
"@std/json": "jsr:@std/json@^0.219.1",
"@std/path": "jsr:@std/path@^0.219.1",
"@std/semver": "jsr:@std/semver@^0.219.1",
"@std/testing": "jsr:@std/testing@^0.219.1",
"@std/text": "jsr:@std/text@^0.219.1",
"@std/url": "jsr:@std/url@^0.219.1",
"@std/yaml": "jsr:@std/yaml@^0.219.1",
"fast-check": "npm:fast-check@^3.16.0",
"jose": "npm:jose@^5.2.3",
"jsonld": "npm:jsonld@^8.3.2",
"uri-template-router": "npm:uri-template-router@^0.0.16",
"url-template": "npm:url-template@^3.1.1"
},
"include": [
"vocab/vocab.ts"
],
Expand Down
32 changes: 9 additions & 23 deletions examples/blog/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
"lock": false,
"tasks": {
"fedify-codegen": "cat ../../vocab/vocab.ts > /dev/null || (deno run --allow-read --allow-write --check ../../codegen/main.ts ../../vocab/ ../runtime/ > ../../vocab/vocab.ts && deno fmt ../../vocab/vocab.ts && deno cache ../../vocab/vocab.ts && deno check ../../vocab/vocab.ts)",
"check": "deno task fedify-codegen && deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx",
"cli": "deno task fedify-codegen && echo \"import '\\$fresh/src/dev/cli.ts'\" | deno run --unstable -A -",
"manifest": "deno task fedify-codegen && deno task cli manifest $(pwd)",
"start": "deno task fedify-codegen && deno run -A --watch=static/,routes/ --unstable-kv dev.ts",
"build": "deno task fedify-codegen && deno run -A dev.ts build",
"preview": "deno task fedify-codegen && deno run -A main.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",
"update": "deno run -A -r https://fresh.deno.dev/update ."
},
"lint": {
Expand All @@ -21,23 +23,7 @@
"exclude": [
"**/_fresh/*"
],
"imports": {
"$fresh/": "https://deno.land/x/[email protected]/",
"preact": "https://esm.sh/[email protected]",
"preact/": "https://esm.sh/[email protected]/",
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
"$std/": "https://deno.land/[email protected]/",
"fedify": "../../mod.ts",
"fedify/federation": "../../federation/mod.ts",
"fedify/httpsig": "../../httpsig/mod.ts",
"fedify/runtime": "../../runtime/mod.ts",
"fedify/vocab": "../../vocab/mod.ts",
"fedify/webfinger": "../../webfinger/mod.ts",
"uuidv7": "npm:[email protected]",
"markdown-it": "npm:[email protected]",
"scrypt": "https://deno.land/x/[email protected]/mod.ts"
},
"importMap": "./import_map.g.json",
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "preact"
Expand Down
2 changes: 1 addition & 1 deletion examples/blog/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import dev from "$fresh/dev.ts";
import config from "./fresh.config.ts";

import "$std/dotenv/load.ts";
import "@std/dotenv/load";

await dev(import.meta.url, "./main.ts", config);
10 changes: 5 additions & 5 deletions examples/blog/federation/mod.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Temporal } from "npm:@js-temporal/polyfill@^0.4.4";
import { parse } from "jsr:@std/semver@^0.218.2";
import { dirname, join } from "jsr:@std/path@^0.218.2";
import { Federation } from "fedify/federation";
import { Temporal } from "@js-temporal/polyfill";
import { parse } from "@std/semver";
import { dirname, join } from "@std/path";
import { Federation } from "@fedify/fedify/federation";
import {
Accept,
Activity,
Expand All @@ -14,7 +14,7 @@ import {
Note,
Person,
Undo,
} from "fedify/vocab";
} from "@fedify/fedify/vocab";
import { getBlog } from "../models/blog.ts";
import { addComment, Comment, getComments } from "../models/comment.ts";
import {
Expand Down
14 changes: 14 additions & 0 deletions examples/blog/generate_import_map.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const fedifyImportMap = JSON.parse(
await Deno.readTextFile(`${import.meta.dirname}/../../deno.json`),
).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",
);
41 changes: 41 additions & 0 deletions examples/blog/import_map.g.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"imports": {
"@cfworker/json-schema": "npm:@cfworker/json-schema@^1.12.8",
"@js-temporal/polyfill": "npm:@js-temporal/polyfill@^0.4.4",
"@phensley/language-tag": "npm:@phensley/language-tag@^1.8.0",
"@std/assert": "jsr:@std/assert@^0.219.1",
"@std/bytes": "jsr:@std/bytes@^0.219.1",
"@std/collections": "jsr:@std/collections@^0.219.1",
"@std/encoding": "jsr:@std/encoding@^0.219.1",
"@std/encoding/base64": "jsr:@std/encoding@^0.219.1/base64",
"@std/http": "jsr:@std/http@^0.219.1",
"@std/json": "jsr:@std/json@^0.219.1",
"@std/path": "jsr:@std/path@^0.219.1",
"@std/semver": "jsr:@std/semver@^0.219.1",
"@std/testing": "jsr:@std/testing@^0.219.1",
"@std/text": "jsr:@std/text@^0.219.1",
"@std/url": "jsr:@std/url@^0.219.1",
"@std/yaml": "jsr:@std/yaml@^0.219.1",
"fast-check": "npm:fast-check@^3.16.0",
"jose": "npm:jose@^5.2.3",
"jsonld": "npm:jsonld@^8.3.2",
"uri-template-router": "npm:uri-template-router@^0.0.16",
"url-template": "npm:url-template@^3.1.1",
"$fresh/": "https://deno.land/x/[email protected]/",
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
"@std/dotenv/load": "jsr:@std/dotenv@^0.219.1/load",
"@fedify/fedify": "../../mod.ts",
"@fedify/fedify/federation": "../../federation/mod.ts",
"@fedify/fedify/httpsig": "../../httpsig/mod.ts",
"@fedify/fedify/runtime": "../../runtime/mod.ts",
"@fedify/fedify/vocab": "../../vocab/mod.ts",
"@fedify/fedify/webfinger": "../../webfinger/mod.ts",
"markdown-it": "npm:markdown-it@^14.0.0",
"preact": "https://esm.sh/[email protected]",
"preact/": "https://esm.sh/[email protected]/",
"scrypt": "https://deno.land/x/[email protected]/mod.ts",
"sanitize-html": "npm:sanitize-html@^2.12.1",
"uuidv7": "npm:uuidv7@^0.6.3"
}
}
23 changes: 23 additions & 0 deletions examples/blog/import_map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"imports": {
"$fresh/": "https://deno.land/x/[email protected]/",
"@js-temporal/polyfill": "npm:@js-temporal/polyfill@^0.4.4",
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
"@std/dotenv/load": "jsr:@std/dotenv@^0.219.1/load",
"@std/path": "jsr:@std/path@^0.219.1",
"@std/semver": "jsr:@std/semver@^0.219.1",
"@fedify/fedify": "../../mod.ts",
"@fedify/fedify/federation": "../../federation/mod.ts",
"@fedify/fedify/httpsig": "../../httpsig/mod.ts",
"@fedify/fedify/runtime": "../../runtime/mod.ts",
"@fedify/fedify/vocab": "../../vocab/mod.ts",
"@fedify/fedify/webfinger": "../../webfinger/mod.ts",
"markdown-it": "npm:markdown-it@^14.0.0",
"preact": "https://esm.sh/[email protected]",
"preact/": "https://esm.sh/[email protected]/",
"scrypt": "https://deno.land/x/[email protected]/mod.ts",
"sanitize-html": "npm:sanitize-html@^2.12.1",
"uuidv7": "npm:uuidv7@^0.6.3"
}
}
2 changes: 1 addition & 1 deletion examples/blog/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />

import "$std/dotenv/load.ts";
import "@std/dotenv/load";

import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";
Expand Down
8 changes: 6 additions & 2 deletions examples/blog/models/blog.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/// <reference lib="deno.unstable" />
import { Temporal } from "npm:@js-temporal/polyfill@^0.4.4";
import { exportJwk, generateCryptoKeyPair, importJwk } from "fedify/httpsig";
import { Temporal } from "@js-temporal/polyfill";
import {
exportJwk,
generateCryptoKeyPair,
importJwk,
} from "@fedify/fedify/httpsig";
import { hash, verify } from "scrypt";
import { openKv } from "./kv.ts";

Expand Down
4 changes: 2 additions & 2 deletions examples/blog/models/comment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sanitizeHtml from "npm:sanitize-html";
import { Temporal } from "npm:@js-temporal/polyfill@^0.4.4";
import sanitizeHtml from "sanitize-html";
import { Temporal } from "@js-temporal/polyfill";
import { openKv } from "./kv.ts";

export interface Comment {
Expand Down
2 changes: 1 addition & 1 deletion examples/blog/models/follower.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ActorTypeName,
Endpoints,
getActorClassByTypeName,
} from "fedify/vocab";
} from "@fedify/fedify/vocab";
import { openKv } from "./kv.ts";

export interface Follower {
Expand Down
6 changes: 3 additions & 3 deletions examples/blog/models/post.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Temporal } from "npm:@js-temporal/polyfill@^0.4.4";
import { RequestContext } from "fedify/federation";
import { Article, Collection, CollectionPage } from "fedify/vocab";
import { Temporal } from "@js-temporal/polyfill";
import { RequestContext } from "@fedify/fedify/federation";
import { Article, Collection, CollectionPage } from "@fedify/fedify/vocab";
import markdownIt from "markdown-it";
import { uuidv7 } from "uuidv7";
import { Blog } from "./blog.ts";
Expand Down
2 changes: 1 addition & 1 deletion examples/blog/routes/posts/[uuid].tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Handler, PageProps } from "$fresh/server.ts";
import { Head } from "$fresh/runtime.ts";
import { respondWithObjectIfAcceptable } from "fedify/federation";
import { respondWithObjectIfAcceptable } from "@fedify/fedify/federation";
import Comment from "../../components/Comment.tsx";
import Post from "../../components/Post.tsx";
import { federation } from "../../federation/mod.ts";
Expand Down
4 changes: 2 additions & 2 deletions examples/blog/routes/posts/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Temporal } from "npm:@js-temporal/polyfill@^0.4.4";
import { Temporal } from "@js-temporal/polyfill";
import { Handlers, PageProps } from "$fresh/server.ts";
import { Create } from "fedify/vocab";
import { Create } from "@fedify/fedify/vocab";
import { PostFormProps } from "../../components/PostForm.tsx";
import PostList from "../../components/PostList.tsx";
import { federation } from "../../federation/mod.ts";
Expand Down
4 changes: 2 additions & 2 deletions federation/handler.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { assert, assertEquals, assertFalse } from "jsr:@std/assert@^0.218.2";
import { assert, assertEquals, assertFalse } from "@std/assert";
import { createRequestContext } from "../testing/context.ts";
import { mockDocumentLoader } from "../testing/docloader.ts";
import { Activity, Create, Note, Person } from "../vocab/vocab.ts";
import {
ActorDispatcher,
Expand All @@ -14,7 +15,6 @@ import {
respondWithObject,
respondWithObjectIfAcceptable,
} from "./handler.ts";
import { mockDocumentLoader } from "../testing/docloader.ts";

Deno.test("acceptsJsonLd()", () => {
assert(acceptsJsonLd(
Expand Down
2 changes: 1 addition & 1 deletion federation/handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { accepts } from "jsr:@std/http@^0.218.2";
import { accepts } from "@std/http";
import { doesActorOwnKey, verify } from "../httpsig/mod.ts";
import { DocumentLoader } from "../runtime/docloader.ts";
import {
Expand Down
2 changes: 1 addition & 1 deletion federation/middleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
assertRejects,
assertStrictEquals,
assertThrows,
} from "jsr:@std/assert@^0.218.2";
} from "@std/assert";
import { FetchError } from "../runtime/docloader.ts";
import { privateKey2, publicKey2 } from "../testing/keys.ts";
import { Create, Person } from "../vocab/vocab.ts";
Expand Down
2 changes: 1 addition & 1 deletion federation/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Temporal } from "npm:@js-temporal/polyfill@^0.4.4";
import { Temporal } from "@js-temporal/polyfill";
import { exportJwk, importJwk, validateCryptoKey } from "../httpsig/key.ts";
import { handleNodeInfo, handleNodeInfoJrd } from "../nodeinfo/handler.ts";
import {
Expand Down
2 changes: 1 addition & 1 deletion federation/router.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals, assertThrows } from "jsr:@std/assert@^0.218.2";
import { assertEquals, assertThrows } from "@std/assert";
import { Router, RouterError } from "./router.ts";

function setUp(): Router {
Expand Down
4 changes: 2 additions & 2 deletions federation/router.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Router as InnerRouter } from "npm:uri-template-router@0.0.16";
import { parseTemplate, type Template } from "npm:url-template@3.1.1";
import { Router as InnerRouter } from "uri-template-router";
import { parseTemplate, type Template } from "url-template";

/**
* URL router and constructor based on URI Template
Expand Down
4 changes: 2 additions & 2 deletions federation/send.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as mf from "https://deno.land/x/[email protected]/mod.ts";
import {
assertEquals,
assertNotEquals,
assertRejects,
assertStrictEquals,
} from "jsr:@std/assert@^0.218.2";
} from "@std/assert";
import * as mf from "https://deno.land/x/[email protected]/mod.ts";
import { doesActorOwnKey, verify } from "../httpsig/mod.ts";
import { mockDocumentLoader } from "../testing/docloader.ts";
import { privateKey2, publicKey2 } from "../testing/keys.ts";
Expand Down
Loading

0 comments on commit 323c475

Please sign in to comment.