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

refactor: extract dependencies to deps/ #34

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 4 additions & 0 deletions deps/rimbu.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from "https://deno.land/x/[email protected]/stream/mod.ts"
export * from "https://deno.land/x/[email protected]/graph/mod.ts"
export * from "https://deno.land/x/[email protected]/hashed/mod.ts"
export type * from "https://deno.land/x/[email protected]/graph/custom/common/link.ts"
1 change: 1 addition & 0 deletions deps/ts_morph_common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "https://deno.land/x/[email protected]/common/mod.ts"
2 changes: 1 addition & 1 deletion doc/components.page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stream } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { Stream } from "../deps/rimbu.ts"
import { escapeHtml } from "https://deno.land/x/[email protected]/mod.ts"
import { exampleSrc } from "../graph/_example_project.ts"
import outdent from "https://deno.land/x/[email protected]/mod.ts"
Expand Down
2 changes: 1 addition & 1 deletion doc/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
SourceFile,
} from "https://deno.land/x/[email protected]/mod.ts"

import { Stream } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { Stream } from "../deps/rimbu.ts"
import {
getAllDecls,
getGraph,
Expand Down
4 changes: 1 addition & 3 deletions doc/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { relative } from "https://deno.land/[email protected]/path/relative.ts"
import { dirname } from "https://deno.land/[email protected]/path/dirname.ts"
import { Stream } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { HashSet } from "https://deno.land/x/[email protected]/hashed/mod.ts"

import { HashSet, Stream } from "../deps/rimbu.ts"
import { Project } from "../deps/ts_morph.ts"

import { colors, hashRGB } from "../render/colors.ts"
Expand Down
2 changes: 1 addition & 1 deletion graph/_example_project.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stream } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { Stream } from "../deps/rimbu.ts"
import { inMemoryProject } from "./_project.ts"
import outdent from "https://deno.land/x/[email protected]/mod.ts"

Expand Down
2 changes: 1 addition & 1 deletion graph/_format.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Reducer, Stream } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { Reducer, Stream } from "../deps/rimbu.ts"
import { encodeVSCodeURI, prettyPrintURI } from "./vscode_uri.ts"

import type { Declaration, DeclDeps } from "./decl_deps.ts"
Expand Down
2 changes: 1 addition & 1 deletion graph/_project.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Reducer, Stream } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { Reducer, Stream } from "../deps/rimbu.ts"
import { Project, SourceFile } from "../deps/ts_morph.ts"
import { denoCompilerOptions } from "../utils/project.ts"

Expand Down
2 changes: 1 addition & 1 deletion graph/decl_deps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stream } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { Stream } from "../deps/rimbu.ts"
import {
type ClassDeclaration,
type FunctionDeclaration,
Expand Down
2 changes: 1 addition & 1 deletion graph/decl_deps_bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
getDeclDeps,
getTopDecl,
} from "./decl_deps.ts"
import { Stream } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { Stream } from "../deps/rimbu.ts"
import { getAllDecls } from "./decls.ts"

/**
Expand Down
2 changes: 1 addition & 1 deletion graph/decl_deps_test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { inMemoryProject, withSrc } from "./_project.ts"
import { exampleSrc } from "./_example_project.ts"
import { assertEquals, assertSnapshot } from "../test_deps.ts"
import { Stream } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { Stream } from "../deps/rimbu.ts"
import { getAllDecls } from "./decls.ts"
import { asRecord, declDepsSerializer, serializeNoColor } from "./_format.ts"
import { snapshotTest } from "./_snapshot.ts"
Expand Down
5 changes: 1 addition & 4 deletions graph/decls.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
Stream,
StreamSource,
} from "https://deno.land/x/[email protected]/stream/mod.ts"
import { Stream, StreamSource } from "../deps/rimbu.ts"
import { SourceFile } from "../deps/ts_morph.ts"
import { Declaration } from "./decl_deps.ts"

Expand Down
2 changes: 1 addition & 1 deletion graph/fs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RealFileSystemHost } from "https://deno.land/x/[email protected]/common/mod.ts"
import { RealFileSystemHost } from "../deps/ts_morph_common.ts"

/**
* Intercepts and skips file & directory lookup to speed up the process
Expand Down
4 changes: 1 addition & 3 deletions graph/graph.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import type { GraphElement } from "https://deno.land/x/[email protected]/graph/custom/common/link.ts"
import { ArrowGraphHashed } from "https://deno.land/x/[email protected]/graph/mod.ts"
import { Stream } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { ArrowGraphHashed, type GraphElement, Stream } from "../deps/rimbu.ts"
import { type Declaration, type DeclDeps, getDeclDeps } from "./decl_deps.ts"
import { encodeVSCodeURI, type VSCodeURI } from "./vscode_uri.ts"

Expand Down
4 changes: 1 addition & 3 deletions graph/graph_descendants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import type { ArrowGraph } from "https://deno.land/x/[email protected]/graph/mod.ts"
import { HashMap, HashSet } from "https://deno.land/x/[email protected]/hashed/mod.ts"
import { Reducer } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { type ArrowGraph, HashMap, HashSet, Reducer } from "../deps/rimbu.ts"

export const getConnectionsTo = <T>(graph: ArrowGraph<T>, node: T) =>
graph.getConnectionStreamTo(node).map(([src]) => src)
Expand Down
2 changes: 1 addition & 1 deletion graph/graph_descendants_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ArrowGraphHashed } from "https://deno.land/x/[email protected]/graph/mod.ts"
import { ArrowGraphHashed } from "../deps/rimbu.ts"

import { assertEquals } from "../test_deps.ts"
import { graphDescendants } from "./graph_descendants.ts"
Expand Down
2 changes: 1 addition & 1 deletion graph/graph_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Reducer, Stream } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { Reducer, Stream } from "../deps/rimbu.ts"
import { exampleSrc } from "./_example_project.ts"
import { inMemoryProject, withSrc } from "./_project.ts"
import { declDepsToGraph, Graph } from "./graph.ts"
Expand Down
2 changes: 1 addition & 1 deletion graph/top_decl_deps_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stream } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { Stream } from "../deps/rimbu.ts"
import { assertSnapshot } from "../test_deps.ts"
import { exampleSrc } from "./_example_project.ts"
import { inMemoryProject, withSrc } from "./_project.ts"
Expand Down
2 changes: 1 addition & 1 deletion graph/vscode_uri_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stream } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { Stream } from "../deps/rimbu.ts"
import { assertEquals } from "../test_deps.ts"
import { declExampleText, exampleSrc } from "./_example_project.ts"
import { inMemoryProject, withSrc } from "./_project.ts"
Expand Down
10 changes: 6 additions & 4 deletions render/data.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import type { GraphElement } from "https://deno.land/x/[email protected]/graph/custom/common/link.ts"
import type { GraphData } from "https://esm.sh/[email protected]"
import type { Opaque } from "https://raw.githubusercontent.com/sindresorhus/type-fest/main/source/opaque.d.ts"

import { ArrowGraphHashed } from "https://deno.land/x/[email protected]/graph/mod.ts"
import { Stream } from "https://deno.land/x/[email protected]/stream/mod.ts"
import { HashSet } from "https://deno.land/x/[email protected]/hashed/mod.ts"
import {
ArrowGraphHashed,
type GraphElement,
HashSet,
Stream,
} from "../deps/rimbu.ts"

import { colors, hashRGB } from "./colors.ts"
import { type LabelOption, mkToLabel } from "./label.ts"
Expand Down
2 changes: 1 addition & 1 deletion utils/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
type CompilerOptions,
type ProjectOptions,
ts,
} from "https://deno.land/x/ts_morph@21.0.1/mod.ts"
} from "../deps/ts_morph.ts"
import { FilteredFSHost } from "../graph/fs.ts"

const ignore = /http|npm:|node_modules|\.jsx?|\.d\.ts/
Expand Down
5 changes: 1 addition & 4 deletions utils/resolution_host.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
ResolutionHostFactory,
ts,
} from "https://deno.land/x/[email protected]/mod.ts"
import { ResolutionHostFactory, ts } from "../deps/ts_morph.ts"

export const deno: ResolutionHostFactory = (
moduleResolutionHost,
Expand Down