diff --git a/deno.jsonc b/deno.jsonc index 60af6de..234ed21 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -1,6 +1,5 @@ { "lock": "./deno.lock", - "importMap": "./import_map.json", "tasks": { "udd": "deno run -r --allow-read=. --allow-write=. --allow-net https://deno.land/x/udd/main.ts deps.ts && deno task lock", "lock": "deno cache --lock-write deps.ts", @@ -12,6 +11,9 @@ "cf:serve": "deno run -A tasks/cf/dailies/serve/main.ts", "dnt": "deno run -A tasks/dnt/main.ts" }, + "imports": { + "lc-dailies/": "./" + }, "fmt": { "exclude": ["./npm"] }, diff --git a/import_map.json b/import_map.json deleted file mode 100644 index a3145c5..0000000 --- a/import_map.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "imports": { - "lc-dailies/": "./" - } -} diff --git a/lib/leaderboard/scores.ts b/lib/leaderboard/scores.ts index 1b7e47f..20c1a87 100644 --- a/lib/leaderboard/scores.ts +++ b/lib/leaderboard/scores.ts @@ -1,5 +1,4 @@ -import { DAY } from "lc-dailies/deps.ts"; -import type * as api from "lc-dailies/lib/api/mod.ts"; +import type * as api from "lc-dailies/lib/api/types.ts"; /** * CalculateScoresOptions is the options for calculateScores. @@ -128,7 +127,7 @@ export function makeDefaultCalculateScoresOptions( submissions, possibleHighestScore: 100, possibleLowestScore: 50, - duration: DAY, + duration: 1_000 * 60 * 60 * 24, // 1 day. modifyScore: defaultModifyScore, }; } diff --git a/tasks/dnt/main.ts b/tasks/dnt/main.ts index 62d281f..b2a9fde 100644 --- a/tasks/dnt/main.ts +++ b/tasks/dnt/main.ts @@ -6,15 +6,10 @@ import { build, emptyDir } from "https://deno.land/x/dnt@0.38.1/mod.ts"; await emptyDir("./npm"); await build({ - entryPoints: [ - "./lib/api/types.ts", - "./lib/leaderboard/mod.ts", - ], + entryPoints: ["./lib/api/types.ts"], outDir: "./npm", + importMap: "./deno.jsonc", test: false, - typeCheck: false, - filterDiagnostic: () => false, - importMap: "./import_map.json", // see JS docs for overview and more options shims: { deno: true }, package: { @@ -31,8 +26,9 @@ await build({ url: "https://github.com/acmcsufoss/lc-dailies/issues", }, }, + postBuild() { + // post build steps + Deno.copyFileSync("LICENSE", "npm/LICENSE"); + Deno.copyFileSync("README.md", "npm/README.md"); + }, }); - -// post build steps -Deno.copyFileSync("LICENSE", "npm/LICENSE"); -Deno.copyFileSync("README.md", "npm/README.md");