Skip to content

Commit

Permalink
Merge pull request #153 from Shougo/v7-pre
Browse files Browse the repository at this point in the history
Migrate to JSR
  • Loading branch information
Shougo authored Jul 28, 2024
2 parents fb7eccd + ee03325 commit e6afce3
Show file tree
Hide file tree
Showing 18 changed files with 103 additions and 60 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/jsr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: jsr

env:
DENO_VERSION: 1.x

on:
push:
tags:
- "v*"

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VERSION }}
- name: Publish
run: |
deno run -A jsr:@david/publish-on-tag@0.1.3
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ whether you have this.

### Requirements

Ddc.vim requires both Deno 1.42+ and denops.vim.
Please install both Deno 1.45+ and "denops.vim" v7.0+.

- <https://deno.land/>
- <https://github.com/vim-denops/denops.vim>
Expand Down
19 changes: 19 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
{
"name": "@shougo/ddc-vim",
"version": "0.0.0",
"exports": {
"./config": "./denops/ddc/base/config.ts",
"./filter": "./denops/ddc/base/filter.ts",
"./source": "./denops/ddc/base/source.ts",
"./types": "./denops/ddc/types.ts",
"./ui": "./denops/ddc/base/ui.ts",
"./utils": "./denops/ddc/utils.ts"
},
"publish": {
"include": [
"denops/ddc/**/*.ts",
"denops/ddc/**/*.js"
]
},
"imports": {
},
"lock": false,
"tasks": {
"check": "deno check denops/**/*.ts",
"lint": "deno lint denops",
"lint-fix": "deno lint --fix denops",
"fmt": "deno fmt denops",
"test": "deno test -A --doc --parallel --shuffle denops/**/*.ts",
"upgrade": "deno run -A jsr:@molt/cli **/*.ts --no-resolve --write"
Expand Down
12 changes: 8 additions & 4 deletions denops/@ddu-sources/ddc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { Context, Item } from "https://deno.land/x/ddu_vim@v4.1.1/types.ts";
import { BaseSource } from "https://deno.land/x/ddu_vim@v4.1.1/base/source.ts";
import { Denops, vars } from "https://deno.land/x/ddu_vim@v4.1.1/deps.ts";
import { DdcItem } from "../ddc/types.ts";
import type {
Context,
Denops,
Item,
} from "jsr:@shougo/ddu-vim@5.0.0-pre8/types";
import { BaseSource } from "jsr:@shougo/ddu-vim@5.0.0-pre8/source";
import type { DdcItem } from "../ddc/types.ts";
import { vars } from "../ddc/deps.ts";

type Params = Record<string, never>;

Expand Down
8 changes: 4 additions & 4 deletions denops/ddc/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Ddc } from "./ddc.ts";
import { ContextBuilder, ContextCallbacks } from "./context.ts";
import {
import { ContextBuilder, type ContextCallbacks } from "./context.ts";
import type {
DdcEvent,
DdcExtType,
DdcItem,
Expand All @@ -11,9 +11,9 @@ import {
UserOptions,
} from "./types.ts";
import {
Denops,
type Denops,
ensure,
Entrypoint,
type Entrypoint,
is,
Lock,
toFileUrl,
Expand Down
6 changes: 3 additions & 3 deletions denops/ddc/base/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ContextBuilder } from "../context.ts";
import { DdcExtType } from "../types.ts";
import { Denops } from "../deps.ts";
import type { ContextBuilder } from "../context.ts";
import type { DdcExtType } from "../types.ts";
import type { Denops } from "../deps.ts";

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

export type BaseFilterParams = Record<string, unknown>;

Expand Down
6 changes: 3 additions & 3 deletions denops/ddc/base/source.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
Context,
DdcEvent,
DdcGatherItems,
Expand All @@ -9,9 +9,9 @@ import {
Previewer,
SourceOptions,
} from "../types.ts";
import { Denops } from "../deps.ts";
import type { Denops } from "../deps.ts";
import { convertKeywordPattern } from "../utils.ts";
import { Loader } from "../loader.ts";
import type { Loader } from "../loader.ts";

export type BaseSourceParams = Record<string, unknown>;

Expand Down
4 changes: 2 additions & 2 deletions denops/ddc/base/ui.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Context, DdcItem, DdcOptions, UiOptions } from "../types.ts";
import { Denops } from "../deps.ts";
import type { Context, DdcItem, DdcOptions, UiOptions } from "../types.ts";
import type { Denops } from "../deps.ts";

export type BaseUiParams = Record<string, unknown>;

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

class DdcCallbackCancelError extends Error {
constructor(message?: string) {
Expand Down
4 changes: 2 additions & 2 deletions denops/ddc/context.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {
assertEquals,
collect,
Denops,
type Denops,
ensure,
fn,
is,
op,
vars,
vimOp,
} from "./deps.ts";
import {
import type {
BaseFilterParams,
BaseSourceParams,
BaseUiParams,
Expand Down
6 changes: 3 additions & 3 deletions denops/ddc/ddc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import {
assertEquals,
autocmd,
batch,
Denops,
type Denops,
equal,
fn,
op,
vars,
} from "./deps.ts";
import {
import type {
BaseUi,
BaseUiParams,
CallbackContext,
Expand All @@ -23,7 +23,7 @@ import {
UserSource,
} from "./types.ts";
import { defaultDummy } from "./context.ts";
import { Loader } from "./loader.ts";
import type { Loader } from "./loader.ts";
import { defaultUiOptions } from "./base/ui.ts";
import { defaultSourceOptions } from "./base/source.ts";
import {
Expand Down
25 changes: 8 additions & 17 deletions denops/ddc/deps.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
export type {
Denops,
Entrypoint,
} from "https://deno.land/x/denops_std@v6.5.1/mod.ts";
export {
echo,
execute,
} from "https://deno.land/x/denops_std@v6.5.1/helper/mod.ts";
export {
batch,
collect,
} from "https://deno.land/x/denops_std@v6.5.1/batch/mod.ts";
export * as op from "https://deno.land/x/denops_std@v6.5.1/option/mod.ts";
export * as vimOp from "https://deno.land/x/denops_std@v6.5.1/option/vim/mod.ts";
export * as fn from "https://deno.land/x/denops_std@v6.5.1/function/mod.ts";
export * as vars from "https://deno.land/x/denops_std@v6.5.1/variable/mod.ts";
export * as autocmd from "https://deno.land/x/denops_std@v6.5.1/autocmd/mod.ts";
export type { Denops, Entrypoint } from "jsr:@denops/std@7.0.0";
export { echo, execute } from "jsr:@denops/std@7.0.0/helper";
export { batch, collect } from "jsr:@denops/std@7.0.0/batch";
export * as op from "jsr:@denops/std@7.0.0/option";
export * as vimOp from "jsr:@denops/std@7.0.0/option/vim";
export * as fn from "jsr:@denops/std@7.0.0/function";
export * as vars from "jsr:@denops/std@7.0.0/variable";
export * as autocmd from "jsr:@denops/std@7.0.0/autocmd";

export * from "jsr:@std/encoding@1.0.1/base64";
export { assertEquals, equal } from "jsr:@std/assert@1.0.1";
Expand Down
8 changes: 4 additions & 4 deletions denops/ddc/ext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { deadline, Denops } from "./deps.ts";
import {
import { deadline, type Denops } from "./deps.ts";
import type {
BaseFilter,
BaseFilterParams,
BaseSource,
Expand Down Expand Up @@ -32,8 +32,8 @@ import {
mergeUiOptions,
mergeUiParams,
} from "./context.ts";
import { Loader } from "./loader.ts";
import { Ddc } from "./ddc.ts";
import type { Loader } from "./loader.ts";
import type { Ddc } from "./ddc.ts";
import { isDdcCallbackCancelError } from "./callback.ts";
import { defaultUiOptions } from "./base/ui.ts";
import { defaultSourceOptions } from "./base/source.ts";
Expand Down
14 changes: 7 additions & 7 deletions denops/ddc/loader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
BaseFilter,
BaseFilterParams,
BaseSource,
Expand All @@ -12,7 +12,7 @@ import {
} from "./types.ts";
import {
basename,
Denops,
type Denops,
fn,
is,
Lock,
Expand Down Expand Up @@ -113,19 +113,19 @@ export class Loader {
});
}

getAliasNames(type: DdcExtType) {
getAliasNames(type: DdcExtType): string[] {
return Object.keys(this.#aliases[type]);
}
getAlias(type: DdcExtType, name: string) {
getAlias(type: DdcExtType, name: string): string {
return this.#aliases[type][name];
}
getUi(name: UiName) {
getUi(name: UiName): BaseUi<BaseUiParams> {
return this.#uis[name];
}
getSource(name: SourceName) {
getSource(name: SourceName): BaseSource<BaseSourceParams> {
return this.#sources[name];
}
getFilter(name: FilterName) {
getFilter(name: FilterName): BaseFilter<BaseUiParams> {
return this.#filters[name];
}

Expand Down
9 changes: 5 additions & 4 deletions denops/ddc/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { autocmd } from "./deps.ts";
import { BaseUiParams } from "./base/ui.ts";
import { BaseSourceParams } from "./base/source.ts";
import { BaseFilterParams } from "./base/filter.ts";
import type { autocmd } from "./deps.ts";
import type { BaseUiParams } from "./base/ui.ts";
import type { BaseSourceParams } from "./base/source.ts";
import type { BaseFilterParams } from "./base/filter.ts";

export { BaseConfig } from "./base/config.ts";
export { BaseUi } from "./base/ui.ts";
Expand All @@ -10,6 +10,7 @@ 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 { ContextBuilder } from "./context.ts";

Expand Down
2 changes: 1 addition & 1 deletion denops/ddc/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals, Denops, op } from "./deps.ts";
import { assertEquals, type Denops, op } from "./deps.ts";

export async function convertKeywordPattern(
denops: Denops,
Expand Down
4 changes: 2 additions & 2 deletions doc/ddc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ INSTALL *ddc-install*
NOTE: Ddc.vim requires Neovim (0.8.0+) or Vim 9.0.1276+ (latest is
recommended).

Please install both Deno 1.42+ and "denops.vim".
Please install both Deno 1.45+ and "denops.vim" v7.0+.

https://deno.land/
https://github.com/vim-denops/denops.vim
Expand Down Expand Up @@ -907,7 +907,7 @@ TYPES *ddc-types*

Please see the TypeScript definition.

https://deno.land/x/ddc_vim/types.ts?doc
https://jsr.io/@shougo/ddc-vim@6.0.0-pre6/doc


==============================================================================
Expand Down

0 comments on commit e6afce3

Please sign in to comment.