Skip to content

Commit

Permalink
Deno 1.30 upgrade (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
karelklima authored Mar 10, 2023
1 parent c467488 commit 0e0c6de
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 44 deletions.
14 changes: 5 additions & 9 deletions .vscode/import_map.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"imports": {
"$fresh/": "https://deno.land/x/[email protected].0/",
"preact": "https://esm.sh/preact@10.10.6",
"preact/": "https://esm.sh/preact@10.10.6/",
"preact-render-to-string": "https://esm.sh/*[email protected].3/",
"$fresh/": "https://deno.land/x/[email protected].4/",
"preact": "https://esm.sh/preact@10.11.0",
"preact/": "https://esm.sh/preact@10.11.0/",
"preact-render-to-string": "https://esm.sh/*[email protected].4",
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
"twind": "https://esm.sh/[email protected]",
"twind/": "https://esm.sh/[email protected]/",
"$std/": "https://deno.land/[email protected]/",

"react": "https://esm.sh/[email protected]/compat",
"react-dom": "https://esm.sh/[email protected]/compat",
Expand All @@ -20,9 +19,6 @@
"ldkit/sparql": "../sparql.ts",
"ldkit/rdf": "../rdf.ts",

"n3": "https://esm.sh/n3",

"https://esm.sh/v94/[email protected]/deno/web-streams-ponyfill.js": "https://esm.sh/v77/[email protected]/deno/web-streams-ponyfill.js",
"https://esm.sh/v94/@types/[email protected]/rdf-js": "https://esm.sh/v94/[email protected]"
"n3": "https://esm.sh/n3"
}
}
5 changes: 3 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
"fmt:fix": "deno fmt library/ specs/ www/ docs/",
"fmt:check": "deno fmt --check library/ specs/ www/ docs/",
"lint": "deno lint library/ specs/ www/ docs/",
"test": "deno test --allow-env --allow-net ./specs",
"test": "deno test --allow-env --allow-net --allow-read ./specs",
"dnt": "deno run -A --importmap ./scripts/dnt_import_map.json ./scripts/dnt.ts"
},
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "preact"
}
},
"lock": false
}
4 changes: 2 additions & 2 deletions library/asynciterator.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { AsyncIterator } from "https://esm.sh/asynciterator@3.7.0";
import { AsyncIterator } from "npm:asynciterator@3.8.0";

export {
ArrayIterator,
type AsyncIterator,
MappingIterator,
} from "https://esm.sh/asynciterator@3.7.0";
} from "npm:asynciterator@3.8.0";

type TreeNode<T> = {
[property: string]: T[] | TreeNode<T>;
Expand Down
11 changes: 4 additions & 7 deletions library/rdf.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import type * as RDF from "https://esm.sh/[email protected]";
import type * as RDF from "npm:[email protected]";

export type { RDF };

export { fromRdf, toRdf } from "https://esm.sh/[email protected].0";
export { fromRdf, toRdf } from "npm:[email protected].1";

import {
DataFactory,
DefaultGraph,
} from "https://esm.sh/[email protected]";
import { DataFactory, DefaultGraph } from "npm:[email protected]";
export { DataFactory, DefaultGraph };

import type {
IDataSource,
IQueryContextCommon,
} from "https://esm.sh/@comunica/types@2.4.0";
} from "npm:@comunica/types@2.6.8";

export type LDkitContext = {
graph?: string;
Expand Down
2 changes: 1 addition & 1 deletion library/schema/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import xsd from "../namespaces/xsd.ts";
//import { string } from "yargs";

import type {
Property,
PropertyPrototype,
Expand Down
2 changes: 1 addition & 1 deletion scripts/dnt.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { build, emptyDir } from "https://deno.land/x/dnt@0.30.0/mod.ts";
import { build, emptyDir } from "https://deno.land/x/dnt@0.33.1/mod.ts";

await emptyDir("./npm");

Expand Down
2 changes: 0 additions & 2 deletions scripts/dnt_import_map.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"imports": {
"https://esm.sh/v94/[email protected]/deno/web-streams-ponyfill.js": "https://esm.sh/v77/[email protected]/deno/web-streams-ponyfill.js",
"https://esm.sh/v94/@types/[email protected]/rdf-js": "https://esm.sh/v94/[email protected]"
}
}
4 changes: 1 addition & 3 deletions specs/lens.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert, assertEquals, equal } from "./test_deps.ts";
import { assert, assertEquals, Comunica, equal } from "./test_deps.ts";

import {
createStore,
Expand All @@ -12,8 +12,6 @@ import { createLens } from "../library/lens/mod.ts";
import { rdf, xsd } from "../library/namespaces/mod.ts";
import { DataFactory } from "../library/rdf.ts";

import { QueryEngine as Comunica } from "https://esm.sh/@comunica/[email protected]";

const assertContainsEqual = (haystack: unknown[], needle: unknown) => {
let found = false;
for (const item of haystack) {
Expand Down
9 changes: 7 additions & 2 deletions specs/test_deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ export {
assertStrictEquals,
assertThrows,
equal,
} from "https://deno.land/std@0.153.0/testing/asserts.ts";
} from "https://deno.land/std@0.179.0/testing/asserts.ts";

export { assert as assertTypeSafe } from "https://esm.sh/[email protected]";
export { assert as assertTypeSafe } from "npm:[email protected]";

export { QueryEngine as Comunica } from "npm:@comunica/[email protected]";

// @deno-types="npm:@types/n3"
export * as N3 from "npm:[email protected]";
12 changes: 5 additions & 7 deletions specs/test_utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Parser, Store } from "https://esm.sh/[email protected]";
import { N3 } from "./test_deps.ts";

import {
type Context,
Expand All @@ -14,8 +14,6 @@ const X_NAMESPACE = "http://x/";

const dataFactory = new DataFactory();

// export const x = (s: string) => `${X_NAMESPACE}${s}`;

export const x = new Proxy(
{},
{
Expand Down Expand Up @@ -73,7 +71,7 @@ export const ttl = (turtle: string) => {

const escapedTurtle = escapePseudoVariables(prefixedTurtle);
const df = DF();
const escapedQuads = new Parser({
const escapedQuads = new N3.Parser({
factory: df,
}).parse(escapedTurtle);
const quads = escapedQuads.map(convertPseudoVariables);
Expand All @@ -86,16 +84,16 @@ export const createGraph = (turtle: string) => {
};

export const createStore = () =>
new Store(undefined, {
new N3.Store(undefined, {
factory: DF(),
});

export const createStoreContext = (store: Store, context?: Context) => ({
export const createStoreContext = (store: N3.Store, context?: Context) => ({
...context,
sources: [store],
} as Context);

export const emptyStore = (store: Store) => {
export const emptyStore = (store: N3.Store) => {
const stream = store.removeMatches(null, null, null, null);
return new Promise((resolve) => {
stream.on("end", resolve);
Expand Down
11 changes: 5 additions & 6 deletions www/import_map.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"imports": {
"$fresh/": "https://deno.land/x/[email protected].1/",
"preact": "https://esm.sh/preact@10.10.6",
"preact/": "https://esm.sh/preact@10.10.6/",
"preact-render-to-string": "https://esm.sh/*[email protected].3/",
"$fresh/": "https://deno.land/x/[email protected].4/",
"preact": "https://esm.sh/preact@10.11.0",
"preact/": "https://esm.sh/preact@10.11.0/",
"preact-render-to-string": "https://esm.sh/*[email protected].4",
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
"twind": "https://esm.sh/[email protected]",
"twind/": "https://esm.sh/[email protected]/",
"$std/": "https://deno.land/[email protected]/"
"twind/": "https://esm.sh/[email protected]/"
}
}
2 changes: 0 additions & 2 deletions www/utils/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ import "https://esm.sh/[email protected]/components/prism-jsx.js?no-check";
import "https://esm.sh/[email protected]/components/prism-typescript.js?no-check";
import "https://esm.sh/[email protected]/components/prism-tsx.js?no-check";
import "https://esm.sh/[email protected]/components/prism-diff.js?no-check";

export { extract as frontMatter } from "$std/encoding/front_matter.ts";

0 comments on commit 0e0c6de

Please sign in to comment.