1
0
Fork 0
mirror of https://github.com/classchartsapi/classcharts-api-js.git synced 2026-05-14 11:58:13 +00:00

chore: move deno dev deps to deps file && use import map

This commit is contained in:
James Cook 2023-09-16 20:14:18 +01:00
parent c5e7b3f24e
commit a022c8a8ad
8 changed files with 20 additions and 16 deletions

View file

@ -2,5 +2,8 @@
"tasks": { "tasks": {
"npm": "deno run -A scripts/build_npm.ts" "npm": "deno run -A scripts/build_npm.ts"
}, },
"exclude": ["npm"] "exclude": ["npm"],
"imports": {
"~/": "./"
}
} }

5
deps_dev.ts Normal file
View file

@ -0,0 +1,5 @@
export {
assertEquals,
assertExists,
assertRejects,
} from "https://deno.land/std@0.200.0/assert/mod.ts";

View file

@ -13,6 +13,7 @@ await build({
path: "./src/types.ts", path: "./src/types.ts",
}], }],
outDir: "./npm", outDir: "./npm",
importMap: "./deno.jsonc",
shims: { shims: {
deno: true, deno: true,
}, },

View file

@ -16,7 +16,7 @@ import type {
HomeworksResponse, HomeworksResponse,
LessonsResponse, LessonsResponse,
} from "../types.ts"; } from "../types.ts";
import { PING_INTERVAL } from "../utils/consts.ts"; import { PING_INTERVAL } from "~/src/utils/consts.ts";
/** /**
* Shared client for both parent and student. This is not exported and should not be used directly * Shared client for both parent and student. This is not exported and should not be used directly

View file

@ -1,8 +1,8 @@
import type { GetPupilsResponse } from "../types.ts"; import type { GetPupilsResponse } from "../types.ts";
import { BaseClient } from "./baseClient.ts"; import { BaseClient } from "~/src/core/baseClient.ts";
import { API_BASE_PARENT, BASE_URL } from "../utils/consts.ts"; import { API_BASE_PARENT, BASE_URL } from "~/src/utils/consts.ts";
import { parseCookies } from "../utils/utils.ts"; import { parseCookies } from "~/src/utils/utils.ts";
/** /**
* Parent Client * Parent Client
*/ */

View file

@ -1,6 +1,6 @@
import { API_BASE_STUDENT, BASE_URL } from "../utils/consts.ts"; import { API_BASE_STUDENT, BASE_URL } from "~/src/utils/consts.ts";
import { BaseClient } from "./baseClient.ts"; import { BaseClient } from "~/src/core/baseClient.ts";
import { parseCookies } from "../utils/utils.ts"; import { parseCookies } from "~/src/utils/utils.ts";
/** /**
* Student Client * Student Client

View file

@ -1,6 +1,5 @@
import { assertRejects } from "https://deno.land/std@0.200.0/assert/mod.ts"; import { assertRejects } from "~/deps_dev.ts";
import { StudentClient } from "~/src/core/studentClient.ts";
import { StudentClient } from "./studentClient.ts";
Deno.test("Throws when no student code is provided", async () => { Deno.test("Throws when no student code is provided", async () => {
const client = new StudentClient(""); const client = new StudentClient("");

View file

@ -1,8 +1,4 @@
import { import { assertEquals, assertExists } from "~/deps_dev.ts";
assertEquals,
assertExists,
} from "https://deno.land/std@0.200.0/assert/mod.ts";
import { parseCookies } from "./utils.ts"; import { parseCookies } from "./utils.ts";
Deno.test("Parses simple cookie", () => { Deno.test("Parses simple cookie", () => {
const cookie = const cookie =