Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: use import map for ts imports #3674

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading