Skip to content

Commit

Permalink
Merge pull request #55 from eseiker/housekeeping
Browse files Browse the repository at this point in the history
Changes:
Merged web/deno.json with ~/deno.jsonc (to unify workspaces and entries)
Aligned imports
  • Loading branch information
eseiker committed Aug 16, 2023
2 parents 25d849d + 1d7575d commit ca76ebe
Show file tree
Hide file tree
Showing 47 changed files with 251 additions and 245 deletions.
2 changes: 1 addition & 1 deletion ControlMessage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { decode, encode } from "https://deno.land/x/bencodex@0.2.2/mod.ts";
import { decode, encode } from "bencodex";

export type ReloadControlMessage = { action: "reload" };

Expand Down
2 changes: 1 addition & 1 deletion EventMessage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { decode, encode } from "https://deno.land/x/bencodex@0.2.2/mod.ts";
import { decode, encode } from "bencodex";

export type EventMessage = {
address: Uint8Array;
Expand Down
5 changes: 3 additions & 2 deletions EventResponse.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { getAddress, toHex } from "npm:viem";
import { decodeEventLog } from "./decodeEventLog.ts";
import { Event, EventAbi } from "./generated/client/index.d.ts";

import { formatAbiItemPrototype } from "./abitype.ts";
import { decodeEventLog } from "./decodeEventLog.ts";
import type { Event, EventAbi } from "./generated/client/index.d.ts";

export const serializeEventResponse = (event: Event & { Abi: EventAbi }) => {
const { args } = decodeEventLog({
Expand Down
12 changes: 5 additions & 7 deletions abitype.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
Abi,
AbiConstructor,
AbiError,
Expand All @@ -8,12 +8,10 @@ import {
AbiFunction,
AbiParameter,
AbiReceive,
} from "https://esm.sh/abitype";
import { Join } from "https://esm.sh/abitype/dist/types/types.d.ts";
import { execTyped as execTypedImpl } from "https://esm.sh/abitype/dist/esm/regex.js";
import { execTyped as execTypedType } from "https://esm.sh/abitype/dist/types/regex.d.ts";

const execTyped = execTypedImpl as typeof execTypedType;
} from "abitype";
import type { Join } from "abitype/dist/types/types.d.ts";
// @deno-types="abitype/dist/types/regex.d.ts"
import { execTyped } from "abitype/dist/esm/regex.js";

/**
* Formats {@link AbiParameter} to human-readable ABI parameter prototype.
Expand Down
16 changes: 7 additions & 9 deletions api.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { Status } from "https://deno.land/std@0.188.0/http/mod.ts";
import { ConsoleHandler } from "https://deno.land/std@0.196.0/log/handlers.ts";
import {
getLogger,
setup as setupLog,
} from "https://deno.land/std@0.196.0/log/mod.ts";
import { Status } from "std/http/mod.ts";
import { ConsoleHandler } from "std/log/handlers.ts";
import { getLogger, setup as setupLog } from "std/log/mod.ts";

import { oakCors } from "https://deno.land/x/cors@v1.2.2/mod.ts";
import {
Application as OakApplication,
Context,
type Context,
isHttpError,
Router,
} from "https://deno.land/x/oak@v12.5.0/mod.ts";
} from "oak";

import { oakCors } from "https://deno.land/x/cors@v1.2.2/mod.ts";

import { Buffer } from "node:buffer";

Expand Down
17 changes: 7 additions & 10 deletions app.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { parse } from "https://deno.land/std@0.194.0/flags/mod.ts";
import * as path from "https://deno.land/std@0.194.0/path/mod.ts";
import { ConsoleHandler } from "https://deno.land/std@0.196.0/log/handlers.ts";
import {
getLogger,
setup as setupLog,
} from "https://deno.land/std@0.196.0/log/mod.ts";
import { parse } from "std/flags/mod.ts";
import * as path from "std/path/mod.ts";
import { ConsoleHandler } from "std/log/handlers.ts";
import { getLogger, setup as setupLog } from "std/log/mod.ts";

import { broker } from "https://deno.land/x/lop@0.0.0-alpha.2/mod.ts";
import { parseOptions } from "amqp/src/amqp_connect_options.ts";

import { parseOptions } from "https://deno.land/x/amqp@v0.23.1/src/amqp_connect_options.ts";
import { broker } from "https://deno.land/x/lop@0.0.0-alpha.2/mod.ts";

import { api } from "./api.ts";
import { dataproxy, generateDataproxy } from "./dataproxy.ts";
Expand All @@ -29,7 +26,7 @@ import { observer } from "./observer.ts";
import { getSchemaPath, shouldUseDataproxy } from "./prismaSchemaUtils.ts";
import {
block,
CleanupFunction,
type CleanupFunction,
runWithAmqp,
runWithChainDefinition,
runWithPrisma,
Expand Down
8 changes: 4 additions & 4 deletions control.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getLogger } from "https://deno.land/std@0.196.0/log/mod.ts";
import { getLogger } from "std/log/mod.ts";

import type { AmqpChannel } from "https://deno.land/x/amqp@v0.23.1/mod.ts";
import type { AmqpChannel } from "amqp/mod.ts";

import {
EmitterControlMessages,
ObserverControlMessages,
type EmitterControlMessages,
type ObserverControlMessages,
serializeControlMessage,
} from "./ControlMessage.ts";
import {
Expand Down
18 changes: 6 additions & 12 deletions dataproxy.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import * as path from "https://deno.land/std@0.193.0/path/mod.ts";
import { exists as fileExists } from "https://deno.land/std@0.195.0/fs/mod.ts";
import { ConsoleHandler } from "https://deno.land/std@0.196.0/log/handlers.ts";
import {
getLogger,
setup as setupLog,
} from "https://deno.land/std@0.196.0/log/mod.ts";
import * as path from "std/path/mod.ts";
import { exists as fileExists } from "std/fs/mod.ts";
import { ConsoleHandler } from "std/log/handlers.ts";
import { getLogger, setup as setupLog } from "std/log/mod.ts";

import { Application as OakApplication, isHttpError, proxy } from "oak";

import { getFreePort } from "https://deno.land/x/free_port@v1.2.0/mod.ts";
import {
Application as OakApplication,
isHttpError,
proxy,
} from "https://deno.land/x/oak@v12.5.0/mod.ts";

import {
combinedEnv,
Expand Down
3 changes: 1 addition & 2 deletions decodeEventLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ import type {
import type { Hex } from "https://esm.sh/viem/dist/types/types/misc.d.ts";
import type { Prettify } from "https://esm.sh/viem/dist/types/types/utils.d.ts";
import { getEventSelector } from "https://esm.sh/viem/dist/esm/utils/hash/getEventSelector.js";

import { decodeAbiParameters } from "https://esm.sh/viem/dist/esm/utils/abi/decodeAbiParameters.js";
import { DecodeAbiParametersReturnType } from "https://esm.sh/viem/dist/types/utils/abi/decodeAbiParameters.d.ts";
import type { DecodeAbiParametersReturnType } from "https://esm.sh/viem/dist/types/utils/abi/decodeAbiParameters.d.ts";
import { formatAbiItem } from "https://esm.sh/viem/dist/esm/utils/abi/formatAbiItem.js";

export type DecodeEventLogParameters<
Expand Down
28 changes: 26 additions & 2 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,31 @@
"prisma": "deno run --allow-read --allow-sys --allow-run --allow-write scripts/prisma-wrapper.ts",
"prisma-generate": "deno run --allow-read --allow-env --allow-sys --allow-run --allow-write scripts/prisma-generate.ts",
"prisma-studio": "deno run --allow-read --allow-env --allow-run scripts/prisma-studio.ts",
"serve": "deno run --allow-read --allow-write --allow-env generate-cert.ts && deno run --allow-read --allow-env --allow-run --allow-sys app.ts"
"serve": "deno run --allow-read --allow-write --allow-env generate-cert.ts && deno run --allow-read --allow-env --allow-run --allow-sys app.ts",
"serve-web": "deno run -A --unsafely-ignore-certificate-errors=localhost --watch=web/static/,web/routes/ web/dev.ts"
},
"lock": false
"lock": false,
"compilerOptions": {
"jsxImportSource": "preact",
"jsx": "react-jsx"
},
"imports": {
"~/": "./",
"web/": "./web/",
"std/": "https://deno.land/std@0.196.0/",
"abitype": "https://esm.sh/v130/abitype@0.9.0",
"abitype/": "https://esm.sh/v130/abitype@0.9.0/",
"amqp/": "https://deno.land/x/amqp@v0.23.1/",
"bencodex": "https://deno.land/x/bencodex@0.2.2/mod.ts",
"oak": "https://deno.land/x/oak@v12.5.0/mod.ts",
"fresh/": "https://deno.land/x/fresh@1.3.1/",
"fresh-session": "https://deno.land/x/fresh_session@0.2.2/mod.ts",
"preact": "https://esm.sh/v130/preact@10.15.1",
"preact/": "https://esm.sh/v130/preact@10.15.1/",
"preact-render-to-string": "https://esm.sh/v130/*preact-render-to-string@6.2.0",
"@preact/signals": "https://esm.sh/v130/*@preact/signals@1.1.3",
"@preact/signals-core": "https://esm.sh/v130/*@preact/signals-core@1.2.3",
"twind": "https://esm.sh/v130/twind@0.16.19",
"twind/": "https://esm.sh/v130/twind@0.16.19/"
}
}
13 changes: 5 additions & 8 deletions emitter.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { format as formatDate } from "https://deno.land/std@0.196.0/datetime/mod.ts";
import { ConsoleHandler } from "https://deno.land/std@0.196.0/log/handlers.ts";
import {
getLogger,
setup as setupLog,
} from "https://deno.land/std@0.196.0/log/mod.ts";
import { format as formatDate } from "std/datetime/mod.ts";
import { ConsoleHandler } from "std/log/handlers.ts";
import { getLogger, setup as setupLog } from "std/log/mod.ts";

import { AmqpConnection } from "https://deno.land/x/amqp@v0.23.1/mod.ts";
import type { AmqpConnection } from "amqp/mod.ts";

import { stringify as losslessJsonStringify } from "npm:lossless-json";
import {
Chain,
type Chain,
createPublicClient,
getAddress,
http as httpViemTransport,
Expand Down
2 changes: 1 addition & 1 deletion envUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { load } from "https://deno.land/std@0.194.0/dotenv/mod.ts";
import { load } from "std/dotenv/mod.ts";

export const combinedEnv = { ...(await load()), ...Deno.env.toObject() };
export const DatabaseUrlEnvKey = "DATABASE_URL";
Expand Down
11 changes: 4 additions & 7 deletions generate-cert.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { exists } from "https://deno.land/std@0.193.0/fs/mod.ts";
import * as path from "https://deno.land/std@0.193.0/path/mod.ts";
import { ConsoleHandler } from "https://deno.land/std@0.196.0/log/handlers.ts";
import {
getLogger,
setup as setupLog,
} from "https://deno.land/std@0.196.0/log/mod.ts";
import { exists } from "std/fs/mod.ts";
import * as path from "std/path/mod.ts";
import { ConsoleHandler } from "std/log/handlers.ts";
import { getLogger, setup as setupLog } from "std/log/mod.ts";

import { generate } from "https://deno.land/x/selfsignedeno@v2.1.1-deno/index.js";

Expand Down
14 changes: 4 additions & 10 deletions logUtils.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { format as formatDate } from "https://deno.land/std@0.196.0/datetime/mod.ts";
import {
LoggerConfig,
LogLevels,
LogRecord,
} from "https://deno.land/std@0.196.0/log/mod.ts";
import {
LevelName,
LogLevelNames,
} from "https://deno.land/std@0.196.0/log/levels.ts";
import { format as formatDate } from "std/datetime/mod.ts";
import { type LoggerConfig, LogLevels, type LogRecord } from "std/log/mod.ts";
import { type LevelName, LogLevelNames } from "std/log/levels.ts";

import { combinedEnv, LogLevelEnvKey } from "./envUtils.ts";

// outside facing component logger names
Expand Down
2 changes: 1 addition & 1 deletion moduleUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as path from "https://deno.land/std@0.194.0/path/mod.ts";
import * as path from "std/path/mod.ts";

// TODO: this const should be changed to point to the root source code directory whenever this
// file is moved.
Expand Down
17 changes: 7 additions & 10 deletions observer.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import { format as formatDate } from "https://deno.land/std@0.196.0/datetime/mod.ts";
import { ConsoleHandler } from "https://deno.land/std@0.196.0/log/handlers.ts";
import {
getLogger,
setup as setupLog,
} from "https://deno.land/std@0.196.0/log/mod.ts";
import { format as formatDate } from "std/datetime/mod.ts";
import { ConsoleHandler } from "std/log/handlers.ts";
import { getLogger, setup as setupLog } from "std/log/mod.ts";

import { AmqpConnection } from "https://deno.land/x/amqp@v0.23.1/mod.ts";
import type { AmqpConnection } from "amqp/mod.ts";
import type { AbiEvent } from "abitype";

import { Buffer } from "node:buffer";
import { AbiEvent } from "npm:abitype";
import {
Chain,
type Chain,
createPublicClient,
http as httpViemTransport,
Log as LogGeneric,
type Log as LogGeneric,
toBytes,
toHex,
} from "npm:viem";
Expand Down
4 changes: 2 additions & 2 deletions prismaSchemaUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parse } from "https://deno.land/std@0.194.0/flags/mod.ts";
import * as path from "https://deno.land/std@0.194.0/path/mod.ts";
import { parse } from "std/flags/mod.ts";
import * as path from "std/path/mod.ts";

import { baseDir } from "./moduleUtils.ts";

Expand Down
11 changes: 5 additions & 6 deletions runHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import {
AmqpConnection,
AmqpConnectOptions,
type AmqpConnection,
type AmqpConnectOptions,
connect as connectAmqp,
} from "https://deno.land/x/amqp@v0.23.1/mod.ts";
} from "amqp/mod.ts";
import { parseOptions } from "amqp/src/amqp_connect_options.ts";

import { parseOptions } from "https://deno.land/x/amqp@v0.23.1/src/amqp_connect_options.ts";

import { Chain } from "npm:viem";
import type { Chain } from "npm:viem";

import type Prisma from "./prisma-shim.ts";
import { PrismaClient } from "./prisma-shim.ts";
Expand Down
2 changes: 1 addition & 1 deletion sample/chainDefinitions/goerli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Chain } from "npm:viem";
import type { Chain } from "npm:viem";

export default {
id: 5,
Expand Down
6 changes: 3 additions & 3 deletions sample/contracts/deploy-sample-contract.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Account from "https://deno.land/x/web3@v0.11.1/packages/web3-eth-accounts/src/index.js";

import {
CallExecutionError,
Chain,
type Chain,
createPublicClient,
createWalletClient,
formatEther,
Expand All @@ -9,8 +11,6 @@ import {
} from "npm:viem";
import { privateKeyToAccount } from "npm:viem/accounts";

import Account from "https://deno.land/x/web3@v0.11.1/packages/web3-eth-accounts/src/index.js";

import {
getRelativeScriptPath,
importESOrJson,
Expand Down
5 changes: 3 additions & 2 deletions sample/seed-prisma.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { type AbiEvent, narrow } from "abitype";

import { Buffer } from "node:buffer";
import { AbiEvent, narrow } from "npm:abitype";
import { keccak256, toBytes } from "npm:viem";

import { PrismaClient } from "../prisma-shim.ts";
import { PrismaClient } from "~/prisma-shim.ts";

import { formatAbiItemPrototype } from "../abitype.ts";
import { combinedEnv, DatabaseUrlEnvKey } from "../envUtils.ts";
Expand Down
4 changes: 2 additions & 2 deletions scripts/prisma-wrapper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parse } from "https://deno.land/std@0.194.0/flags/mod.ts";
import * as path from "https://deno.land/std@0.194.0/path/mod.ts";
import { parse } from "std/flags/mod.ts";
import * as path from "std/path/mod.ts";

import {
clean as cleanSemver,
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-with-env.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { load } from "https://deno.land/std@0.194.0/dotenv/mod.ts";
import { load } from "std/dotenv/mod.ts";

if (Deno.args.length > 0) {
new Deno.Command(Deno.args[0], {
Expand Down
2 changes: 1 addition & 1 deletion scripts/signal-reload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { connect } from "https://deno.land/x/amqp@v0.23.1/mod.ts";
import { connect } from "amqp/mod.ts";

import {
ControlEmitterRoutingKey,
Expand Down
11 changes: 3 additions & 8 deletions testWebhookReceiver.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { ConsoleHandler } from "https://deno.land/std@0.196.0/log/handlers.ts";
import {
getLogger,
setup as setupLog,
} from "https://deno.land/std@0.196.0/log/mod.ts";
import { ConsoleHandler } from "std/log/handlers.ts";
import { getLogger, setup as setupLog } from "std/log/mod.ts";

import {
Application as OakApplication,
} from "https://deno.land/x/oak@v12.5.0/mod.ts";
import { Application as OakApplication } from "oak";

import { parse } from "npm:lossless-json";

Expand Down
3 changes: 0 additions & 3 deletions web/.vscode/settings.json

This file was deleted.

9 changes: 5 additions & 4 deletions web/argon2.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import {
type ArgonOptions,
ArgonWorker,
} from "https://deno.land/x/argon2ian@2.0.1/src/async.ts";
import {
decode as decodeBase64,
encode as encodeBase64,
} from "std/encoding/base64.ts";

import {
type ArgonOptions,
ArgonWorker,
} from "https://deno.land/x/argon2ian@2.0.1/src/async.ts";

const worker = new ArgonWorker();
const encoder = new TextEncoder();

Expand Down
Loading

0 comments on commit ca76ebe

Please sign in to comment.