Skip to content

Commit

Permalink
build: use import map for ts imports
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 committed Nov 15, 2023
1 parent 596a577 commit 070b61a
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 88 deletions.
3 changes: 2 additions & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"include": ["scripts", "doc", "*.md"],
"semiColons": false,
"lineWidth": 100
}
},
"importMap": "import_map.json"
}
225 changes: 143 additions & 82 deletions deno.lock

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions import_map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"imports": {
"$std/": "https://deno.land/[email protected]/",
"$asynciter/": "https://deno.land/x/[email protected]/",
"$zod/": "https://deno.land/x/[email protected]/",
"$catjazz/": "https://deno.land/x/[email protected]/",
"$ts-reset/": "https://raw.githubusercontent.com/total-typescript/ts-reset/b2df073b6b0fcb9f9599408d88cf559344c10586/src/",
"$outdent/": "https://deno.land/x/[email protected]/"
},
"scopes": {
"$ts-reset/": {
"utils.d.ts": "https://raw.githubusercontent.com/total-typescript/ts-reset/b2df073b6b0fcb9f9599408d88cf559344c10586/src/entrypoints/utils.d.ts"
}
}
}
6 changes: 3 additions & 3 deletions scripts/front_matter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Converts first heading into frontmatter.
*/

import * as frontmatter from "https://deno.land/std@0.201.0/front_matter/yaml.ts"
import { walk } from "https://deno.land/std@0.201.0/fs/walk.ts"
import { asynciter } from "https://deno.land/x/asynciter@0.0.18/mod.ts"
import * as frontmatter from "$std/front_matter/yaml.ts"
import { walk } from "$std/fs/walk.ts"
import { asynciter } from "$asynciter/mod.ts"

export const consumeFirstHeading = (lines: string[]): { heading: string; lines: string[] } => {
// consume all empty lines with regex
Expand Down
2 changes: 1 addition & 1 deletion scripts/front_matter_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "https://deno.land/std@0.201.0/assert/assert_equals.ts"
import { assertEquals } from "$std/assert/assert_equals.ts"
import { consumeFirstHeading, toFrontmatter } from "./front_matter.ts"

const input = /*md*/ `
Expand Down
2 changes: 1 addition & 1 deletion scripts/gen_cli_docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Generates markdown documentation for the game executable.
*/
import { chunk } from "https://deno.land/std@0.201.0/collections/chunk.ts"
import { chunk } from "$std/collections/chunk.ts"

export type Flag = { option: string; desc: string }
export type Section = { title: string; flags: Flag[] }
Expand Down

0 comments on commit 070b61a

Please sign in to comment.