Skip to content
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
13 changes: 12 additions & 1 deletion .github/workflows/deno.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: deno

env:
DENO_VERSION: 1.x
DENO_VERSION: 2.x
DENOPS_PATH: "./"

on:
Expand Down Expand Up @@ -43,3 +43,14 @@ jobs:
- name: Test
run: deno task test
timeout-minutes: 5

deno-test-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@main
with:
deno-version: ${{ env.DENO_VERSION }}

- name: Test Publish
run: deno task test:publish
6 changes: 3 additions & 3 deletions .github/workflows/jsr.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: jsr

env:
DENO_VERSION: 1.x
DENO_VERSION: 2.x

on:
push:
Expand All @@ -19,9 +19,9 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: denoland/setup-deno@v1
- uses: denoland/setup-deno@v2
with:
deno-version: ${{ env.DENO_VERSION }}
- name: Publish
run: |
deno run -A jsr:@david/publish-on-tag@0.1.3
deno run -A jsr:@david/publish-on-tag@0.2.0
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ see "FAQ" section in [help](doc/ddt.txt).

## Install

**Note:** ddt.vim requires Vim 9.1.0448 or Neovim 0.10.0+. See
**NOTE:** It requires Vim 9.1.0448+ or Neovim 0.10.0+. See
[requirements](#requirements) if you aren't sure whether you have this.

### Requirements

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

- <https://deno.land/>
- <https://github.com/vim-denops/denops.vim>
Expand Down
2 changes: 1 addition & 1 deletion autoload/ddt/custom.vim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function ddt#custom#load_config(path) abort
return
endif

return s:notify('loadConfig', [a:path])
return ddt#denops#_request('loadConfig', [a:path])
endfunction

function s:normalize_key_or_dict(key_or_dict, value) abort
Expand Down
8 changes: 4 additions & 4 deletions autoload/ddt/denops.vim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function ddt#denops#_request(method, args) abort
if denops#server#status() !=# 'running'
" Lazy call request
execute printf('autocmd User DenopsPluginPost:ddt call '
\ .. 's:notify("%s", %s)', a:method, a:args->string())
\ .. 'denops#request("ddt", "%s", %s)', a:method, a:args->string())
return {}
endif

Expand Down Expand Up @@ -41,8 +41,8 @@ function s:init() abort
return
endif

if !has('patch-9.1.0448') && !has('nvim-0.10')
call ddt#util#_error('ddt.vim requires Vim 9.1.0448+ or Neovim 0.10+.')
if !has('patch-9.1.1646') && !has('nvim-0.11')
call ddt#util#_error('ddt.vim requires Vim 9.1.1646+ or Neovim 0.11+.')
return 1
endif

Expand Down Expand Up @@ -80,7 +80,7 @@ function s:notify(method, args) abort
endif
endfunction

const s:root_dir = '<sfile>:h:h:h'->expand()
const s:root_dir = '<script>:h:h:h'->expand()
const s:sep = has('win32') ? '\' : '/'
function s:register() abort
call denops#plugin#load(
Expand Down
27 changes: 9 additions & 18 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
{
"name": "@shougo/ddt-vim",
"version": "0.0.0",
"exports": {
"./config": "./denops/ddt/base/config.ts",
"./types": "./denops/ddt/types.ts",
"./ui": "./denops/ddt/base/ui.ts",
"./utils": "./denops/ddt/utils.ts"
},
"publish": {
"include": [
"denops/ddt/**/*.ts"
]
},
"imports": {
},
"lock": false,
"tasks": {
"cache": "deno install --reload",
"check": "deno check denops/**/*.ts",
"fmt": "deno fmt denops",
"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 --write"
}
"test:publish": "deno publish --dry-run --allow-dirty --set-version 0.0.0",
"update": "deno outdated --recursive",
"upgrade": "deno outdated --recursive --update"
},
"workspace": [
"./denops/ddt"
]
}
2 changes: 1 addition & 1 deletion denops/@ddu-kinds/ddt_tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import { BaseKind } from "jsr:@shougo/ddu-vim@~10.3.0/kind";
import { printError, safeStat } from "jsr:@shougo/ddu-vim@~10.3.0/utils";

import type { Denops } from "jsr:@denops/core@~7.0.0";
import type { Denops } from "jsr:@denops/std@~7.6.0";
import * as fn from "jsr:@denops/std@~7.6.0/function";
import * as vars from "jsr:@denops/std@~7.6.0/variable";

Expand Down
2 changes: 1 addition & 1 deletion denops/@ddu-sources/ddt_shell_history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { BaseSource } from "jsr:@shougo/ddu-vim@~10.3.0/source";
import { safeStat } from "../ddt/utils.ts";

import type { Denops } from "jsr:@denops/core@~7.0.0";
import type { Denops } from "jsr:@denops/std@~7.6.0";
import * as fn from "jsr:@denops/std@~7.6.0/function";

type Params = {
Expand Down
2 changes: 1 addition & 1 deletion denops/@ddu-sources/ddt_tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Item } from "jsr:@shougo/ddu-vim@~10.3.0/types";
import { BaseSource } from "jsr:@shougo/ddu-vim@~10.3.0/source";
import type { ActionData } from "../@ddu-kinds/ddt_tab.ts";

import type { Denops } from "jsr:@denops/core@~7.0.0";
import type { Denops } from "jsr:@denops/std@~7.6.0";
import * as fn from "jsr:@denops/std@~7.6.0/function";

type Params = Record<string, never>;
Expand Down
20 changes: 8 additions & 12 deletions denops/ddt/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ import type {
import { ContextBuilderImpl } from "./context.ts";
import { Ddt } from "./ddt.ts";
import { Loader } from "./loader.ts";
import { isDenoCacheIssueError } from "./utils.ts";
import { importPlugin, isDenoCacheIssueError } from "./utils.ts";
import type { BaseUi } from "./base/ui.ts";

import type { Denops, Entrypoint } from "jsr:@denops/std@~7.6.0";
import type { Denops, Entrypoint } from "@denops/std";

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

export const main: Entrypoint = (denops: Denops) => {
const loaders: Record<string, Loader> = {};
Expand Down Expand Up @@ -104,12 +103,9 @@ export const main: Entrypoint = (denops: Denops) => {
const path = ensure(arg1, is.String) as string;

try {
// NOTE: Import module with fragment so that reload works properly.
// https://github.com/vim-denops/denops.vim/issues/227
const mod = await import(
`${toFileUrl(path).href}#${performance.now()}`
);
const obj = new mod.Config();
const mod = await importPlugin(path);
// deno-lint-ignore no-explicit-any
const obj = new (mod as any).Config();
await obj.config({ denops, contextBuilder });
} catch (e) {
if (isDenoCacheIssueError(e)) {
Expand Down
2 changes: 1 addition & 1 deletion denops/ddt/base/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ContextBuilder } from "../types.ts";
import type { Denops } from "jsr:@denops/std@~7.6.0";
import type { Denops } from "@denops/std";

export type ConfigArguments = {
denops: Denops;
Expand Down
2 changes: 1 addition & 1 deletion denops/ddt/base/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
UiOptions,
} from "../types.ts";

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

export type UiAction<Params extends BaseParams, ReturnType = unknown> = {
description: string;
Expand Down
2 changes: 1 addition & 1 deletion denops/ddt/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
} from "./types.ts";
import { printError } from "./utils.ts";

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

// where
// T: Object
Expand Down
4 changes: 2 additions & 2 deletions denops/ddt/ddt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
} from "./context.ts";
import { getUi, uiAction } from "./ext.ts";

import type { Denops } from "jsr:@denops/std@~7.6.0";
import * as fn from "jsr:@denops/std@~7.6.0/function";
import type { Denops } from "@denops/std";
import * as fn from "@denops/std/function";

export class Ddt {
#loader: Loader;
Expand Down
22 changes: 22 additions & 0 deletions denops/ddt/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "@shougo/ddt-vim",
"exports": {
"./config": "./base/config.ts",
"./types": "./types.ts",
"./ui": "./base/ui.ts",
"./utils": "./utils.ts"
},
"publish": {
"include": [
"**/*.ts"
]
},
"imports": {
"@core/asyncutil": "jsr:@core/asyncutil@~1.2.0",
"@core/unknownutil": "jsr:@core/unknownutil@~4.3.0",
"@denops/std": "jsr:@denops/std@~8.0.0",
"@lambdalisue/import-map-importer": "jsr:@lambdalisue/import-map-importer@~0.5.1",
"@std/async": "jsr:@std/async@~1.0.7",
"@std/path": "jsr:@std/path@~1.1.0"
}
}
2 changes: 1 addition & 1 deletion denops/ddt/ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type { BaseUi } from "./base/ui.ts";
import type { Loader } from "./loader.ts";
import { printError } from "./utils.ts";

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

export async function getUi(
denops: Denops,
Expand Down
Loading