Skip to content

Commit

Permalink
Remove deps.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Aug 27, 2024
1 parent 20b05f6 commit 2329828
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 68 deletions.
3 changes: 2 additions & 1 deletion denops/@ddu-sources/ddc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { Context, Denops, Item } from "jsr:@shougo/ddu-vim@5.0.0/types";
import { BaseSource } from "jsr:@shougo/ddu-vim@5.0.0/source";
import type { DdcItem } from "../ddc/types.ts";
import { vars } from "../ddc/deps.ts";

import * as vars from "jsr:@denops/std@~7.1.0/variable";

type Params = Record<string, never>;

Expand Down
17 changes: 8 additions & 9 deletions denops/ddc/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@ import type {
Previewer,
UserOptions,
} from "./types.ts";
import {
type Denops,
ensure,
type Entrypoint,
is,
Lock,
toFileUrl,
vars,
} from "./deps.ts";
import { Loader } from "./loader.ts";
import { isDenoCacheIssueError } from "./utils.ts";
import { createCallbackContext } from "./callback.ts";
import { getPreviewer, onCompleteDone, onEvent } from "./ext.ts";

import type { Denops, Entrypoint } from "jsr:@denops/std@~7.1.0";
import * as vars from "jsr:@denops/std@~7.1.0/variable";

import { ensure } from "jsr:@core/unknownutil@~4.3.0/ensure";
import { is } from "jsr:@core/unknownutil@~4.3.0/is";
import { Lock } from "jsr:@core/asyncutil@~1.1.1/lock";
import { toFileUrl } from "jsr:@std/path@~1.0.2/to-file-url";

export const main: Entrypoint = (denops: Denops) => {
const loader = new Loader();
const ddc = new Ddc(loader);
Expand Down
3 changes: 2 additions & 1 deletion denops/ddc/base/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ContextBuilder } from "../context.ts";
import type { DdcExtType } from "../types.ts";
import type { Denops } from "../deps.ts";

import type { Denops } from "jsr:@denops/std@~7.1.0";

export type ConfigArguments = {
denops: Denops;
Expand Down
3 changes: 2 additions & 1 deletion denops/ddc/base/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import type {
OnCallback,
SourceOptions,
} from "../types.ts";
import type { Denops } from "../deps.ts";

import type { Denops } from "jsr:@denops/std@~7.1.0";

export type BaseFilterParams = Record<string, unknown>;

Expand Down
3 changes: 2 additions & 1 deletion denops/ddc/base/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import type {
Previewer,
SourceOptions,
} from "../types.ts";
import type { Denops } from "../deps.ts";
import { convertKeywordPattern } from "../utils.ts";
import type { Loader } from "../loader.ts";

import type { Denops } from "jsr:@denops/std@~7.1.0";

export type BaseSourceParams = Record<string, unknown>;

export type OnInitArguments<Params extends BaseSourceParams> = {
Expand Down
3 changes: 2 additions & 1 deletion denops/ddc/base/ui.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Context, DdcItem, DdcOptions, UiOptions } from "../types.ts";
import type { Denops } from "../deps.ts";

import type { Denops } from "jsr:@denops/std@~7.1.0";

export type BaseUiParams = Record<string, unknown>;

Expand Down
4 changes: 3 additions & 1 deletion denops/ddc/callback.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { assertEquals, spy } from "./deps.ts";
import type { CallbackContext } from "./types.ts";

import { assertEquals } from "jsr:@std/assert@~1.0.2/equals";
import { spy } from "jsr:@std/testing@~1.0.0/mock";

class DdcCallbackCancelError extends Error {
constructor(message?: string) {
super(message);
Expand Down
22 changes: 11 additions & 11 deletions denops/ddc/context.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
import {
assertEquals,
collect,
type Denops,
ensure,
fn,
is,
op,
vars,
vimOp,
} from "./deps.ts";
import type {
BaseFilterParams,
BaseSourceParams,
Expand All @@ -24,6 +13,17 @@ import type {
import { defaultSourceOptions } from "./base/source.ts";
import { printError } from "./utils.ts";

import type { Denops } from "jsr:@denops/std@~7.1.0";
import * as op from "jsr:@denops/std@~7.1.0/option";
import * as vimOp from "jsr:@denops/std@~7.1.0/option/vim";
import * as fn from "jsr:@denops/std@~7.1.0/function";
import * as vars from "jsr:@denops/std@~7.1.0/variable";
import { collect } from "jsr:@denops/std@~7.1.0/batch";
import { ensure } from "jsr:@core/unknownutil@~4.3.0/ensure";
import { is } from "jsr:@core/unknownutil@~4.3.0/is";

import { assertEquals } from "jsr:@std/assert@~1.0.2/equals";

// where
// T: Object
// partialMerge: PartialMerge
Expand Down
20 changes: 10 additions & 10 deletions denops/ddc/ddc.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
import {
assertEquals,
autocmd,
batch,
type Denops,
equal,
fn,
op,
vars,
} from "./deps.ts";
import type {
BaseUi,
BaseUiParams,
Expand Down Expand Up @@ -36,6 +26,16 @@ import {
getUi,
} from "./ext.ts";

import type { Denops } from "jsr:@denops/std@~7.1.0";
import * as autocmd from "jsr:@denops/std@~7.1.0/autocmd";
import * as op from "jsr:@denops/std@~7.1.0/option";
import * as fn from "jsr:@denops/std@~7.1.0/function";
import * as vars from "jsr:@denops/std@~7.1.0/variable";
import { batch } from "jsr:@denops/std@~7.1.0/batch";

import { assertEquals } from "jsr:@std/assert@~1.0.2/equals";
import { equal } from "jsr:@std/assert@~1.0.2/equal";

type DdcResult = {
items: Item[];
completePos: number;
Expand Down
17 changes: 0 additions & 17 deletions denops/ddc/deps.ts
Original file line number Diff line number Diff line change
@@ -1,17 +0,0 @@
export type { Denops, Entrypoint } from "jsr:@denops/std@~7.1.0";
export { echo, execute } from "jsr:@denops/std@~7.1.0/helper";
export { batch, collect } from "jsr:@denops/std@~7.1.0/batch";
export * as op from "jsr:@denops/std@~7.1.0/option";
export * as vimOp from "jsr:@denops/std@~7.1.0/option/vim";
export * as fn from "jsr:@denops/std@~7.1.0/function";
export * as vars from "jsr:@denops/std@~7.1.0/variable";
export * as autocmd from "jsr:@denops/std@~7.1.0/autocmd";

export * from "jsr:@std/encoding@~1.0.1/base64";
export { assertEquals, equal } from "jsr:@std/assert@~1.0.1";
export { basename, parse, toFileUrl } from "jsr:@std/path@~1.0.2";
export { deadline } from "jsr:@std/async@~1.0.1";
export { spy } from "jsr:@std/testing@~1.0.0/mock";

export { ensure, is } from "jsr:@core/unknownutil@~4.3.0";
export { Lock } from "jsr:@lambdalisue/async@~2.1.1";
5 changes: 4 additions & 1 deletion denops/ddc/ext.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { deadline, type Denops } from "./deps.ts";
import type {
BaseFilter,
BaseFilterParams,
Expand Down Expand Up @@ -40,6 +39,10 @@ import { defaultSourceOptions } from "./base/source.ts";
import { defaultFilterOptions } from "./base/filter.ts";
import { printError } from "./utils.ts";

import type { Denops } from "jsr:@denops/std@~7.1.0";

import { deadline } from "jsr:@std/async@~1.0.1/deadline";

export async function getUi(
denops: Denops,
loader: Loader,
Expand Down
20 changes: 10 additions & 10 deletions denops/ddc/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ import type {
SourceName,
UiName,
} from "./types.ts";
import {
basename,
type Denops,
fn,
is,
Lock,
op,
parse,
toFileUrl,
} from "./deps.ts";
import { isDenoCacheIssueError } from "./utils.ts";
import { mods } from "./_mods.js";

import type { Denops } from "jsr:@denops/std@~7.1.0";
import * as op from "jsr:@denops/std@~7.1.0/option";
import * as fn from "jsr:@denops/std@~7.1.0/function";
import { basename } from "jsr:@std/path@~1.0.2/basename";
import { parse } from "jsr:@std/path@~1.0.2/parse";
import { is } from "jsr:@core/unknownutil@~4.3.0/is";

import { Lock } from "jsr:@core/asyncutil@~1.1.1/lock";
import { toFileUrl } from "jsr:@std/path@~1.0.2/to-file-url";

export class Loader {
#uis: Record<UiName, BaseUi<BaseUiParams>> = {};
#sources: Record<SourceName, BaseSource<BaseSourceParams>> = {};
Expand Down
6 changes: 3 additions & 3 deletions denops/ddc/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { autocmd } from "./deps.ts";
import type { AutocmdEvent } from "jsr:@denops/std@~7.1.0/autocmd";
import type { BaseUiParams } from "./base/ui.ts";
import type { BaseSourceParams } from "./base/source.ts";
import type { BaseFilterParams } from "./base/filter.ts";
Expand All @@ -10,14 +10,14 @@ export { BaseSource } from "./base/source.ts";
export type { BaseSourceParams } from "./base/source.ts";
export { BaseFilter } from "./base/filter.ts";
export type { BaseFilterParams } from "./base/filter.ts";
export type { Denops } from "./deps.ts";
export type { Denops } from "jsr:@denops/std@~7.1.0";

export { ContextBuilder } from "./context.ts";

export type DdcExtType = "ui" | "source" | "filter";

export type DdcEvent =
| autocmd.AutocmdEvent
| AutocmdEvent
| "Initialize"
| "Manual"
| "Update";
Expand Down
5 changes: 4 additions & 1 deletion denops/ddc/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { assertEquals, type Denops, op } from "./deps.ts";
import type { Denops } from "jsr:@denops/std@~7.1.0";
import * as op from "jsr:@denops/std@~7.1.0/option";

import { assertEquals } from "jsr:@std/assert@~1.0.2/equals";

export async function convertKeywordPattern(
denops: Denops,
Expand Down

0 comments on commit 2329828

Please sign in to comment.