Skip to content

Commit d349aaf

Browse files
committed
import maps not supported
1 parent 091cf93 commit d349aaf

12 files changed

+19
-40
lines changed

deno.jsonc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"tasks": {
33
"lock": "deno cache --lock=deno.lock --lock-write deps/mod.ts",
4-
"dev": "deno run --import-map=import_map.json --allow-read --allow-env --allow-net --watch mod.ts",
4+
"dev": "deno run --allow-read --allow-env --allow-net --watch mod.ts",
55
"dev:link": "deno run --import-map=link.json --allow-read --allow-env --allow-net --watch mod.ts"
66
}
77
}

deps/grove.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "https://deno.land/x/grove@0.1.0/mod.ts";
1+
export * from "https://deno.land/x/grove@0.2.0/mod.ts";

import_map.json

-5
This file was deleted.

link.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"imports": {
3-
"#grove/": "../grove/"
3+
"https://deno.land/x/grove@0.2.0/": "../grove/"
44
}
55
}

src/context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IContext, IState } from "#grove/mod.ts";
1+
import { IContext, IState } from "../deps/grove.ts";
22
import { Services } from "./services/mod.ts";
33
import { Managers } from "./managers/mod.ts";
44

src/controllers/error.controller.ts

+8-19
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { Controller } from "#grove/mod.ts";
1+
import { Controller, ILoggingService } from "../../deps/grove.ts";
22
import { Application, Context, Status } from "../../deps/oak.ts";
33
import { State } from "../context.ts";
4-
import { AnalyticsService } from "../services/mod.ts";
54

65
export class ErrorController extends Controller<State> {
7-
constructor(private readonly analytics: AnalyticsService) {
6+
constructor(private readonly logging: ILoggingService) {
87
super();
98
}
109

@@ -17,26 +16,16 @@ export class ErrorController extends Controller<State> {
1716
try {
1817
await next();
1918
} catch (err) {
20-
const { name, message, stack, ...rest } = err;
19+
const { message } = err;
2120
const status = err.status ?? Status.InternalServerError;
2221
ctx.response.status = status;
2322
ctx.response.body = { ok: false, message };
2423
ctx.response.headers.set("Content-Type", "application/json");
25-
console.log({ name, message, stack, ...rest });
26-
this.analytics.send({
27-
event: "request",
28-
action: "error",
29-
data: {
30-
status: ctx.response.status,
31-
error: {
32-
name,
33-
message,
34-
stack,
35-
status,
36-
...rest,
37-
},
38-
},
39-
});
24+
this.logging.error(
25+
"request_error",
26+
message,
27+
err,
28+
);
4029
}
4130
}
4231
}

src/controllers/mod.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
HealthController,
33
IsHtmlController,
44
LogController,
5-
} from "#grove/mod.ts";
5+
} from "../../deps/grove.ts";
66
import { Application } from "../../deps/oak.ts";
77
import { Context, State } from "../context.ts";
88
import { ErrorController } from "./error.controller.ts";
@@ -19,7 +19,6 @@ export async function initControllers(
1919
services: {
2020
env,
2121
github,
22-
analytics,
2322
logging,
2423
},
2524
managers: {
@@ -30,8 +29,7 @@ export async function initControllers(
3029

3130
// This can be any guid, it needs to be configured here as well as in the github app and in the marketplace
3231
const webhookPath = readString(env, "GITHUB_WEBHOOK_PATH", "/webhook");
33-
34-
const error = new ErrorController(analytics);
32+
const error = new ErrorController(logging);
3533
const health = new HealthController();
3634
const log = new LogController(logging);
3735
const isHtml = new IsHtmlController();
@@ -40,7 +38,6 @@ export async function initControllers(
4038
installations,
4139
interactions,
4240
github,
43-
analytics,
4441
webhookPath,
4542
);
4643
const notfound = new NotFoundController();

src/controllers/notfound.controller.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Controller } from "#grove/mod.ts";
1+
import { Controller } from "../../deps/grove.ts";
22
import { Application, Context } from "../../deps/oak.ts";
33
import { State } from "../context.ts";
44
import { NotFoundError } from "../errors/mod.ts";

src/controllers/webhook.controller.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
Router,
66
Status,
77
} from "../../deps/oak.ts";
8-
import { Controller, ILoggingService } from "#grove/mod.ts";
8+
import { Controller, ILoggingService } from "../../deps/grove.ts";
99
import { State } from "../context.ts";
1010
import { ModelState } from "../data/state.ts";
1111
import { ISerializable } from "../util/serializable.ts";
@@ -317,7 +317,6 @@ export class WebhookController extends Controller<State> {
317317
repository: {
318318
id: repositoryId,
319319
full_name: repositoryName,
320-
owner: { login: repositoryOwner },
321320
},
322321
pull_request: {
323322
id: pullRequestId,
@@ -347,7 +346,6 @@ export class WebhookController extends Controller<State> {
347346
installationId,
348347
userLogin,
349348
repositoryName,
350-
repositoryOwner,
351349
commit,
352350
karma,
353351
});

src/mod.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Context } from "./context.ts";
22
import { initServices } from "./services/mod.ts";
33
import { initManagers } from "./managers/mod.ts";
44
import { initControllers } from "./controllers/mod.ts";
5-
import { Grove } from "#grove/mod.ts";
5+
import { Grove } from "../deps/grove.ts";
66

77
async function initContext(): Promise<Context> {
88
const services = await initServices();

src/services/mod.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
ConsoleLoggingService,
55
ILoggingService,
66
IServices,
7-
} from "#grove/mod.ts";
7+
} from "../../deps/grove.ts";
88
import { dotenv } from "../../deps/dotenv.ts";
99
import { GithubService } from "./github.service.ts";
1010
import { MongoService } from "./mongo.service.ts";

src/services/mongo.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ILoggingService } from "#grove/mod.ts";
1+
import { ILoggingService } from "../../deps/grove.ts";
22
import {
33
Collection,
44
Database,

0 commit comments

Comments
 (0)