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 @@ -46,3 +46,14 @@ jobs:
run: |
grep -rl Deno.test denops| xargs deno test --unstable -A
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 @@ -31,15 +31,15 @@ see "FAQ" section in [help](doc/dpp.txt).

## Install

**Note:** Dpp.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.

NOTE: To install plugins from remote, you need to install
[dpp-ext-installer](https://github.com/Shougo/dpp-ext-installer).

### 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
6 changes: 3 additions & 3 deletions autoload/dpp/denops.vim
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ function s:init() abort
return
endif

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

Expand Down Expand Up @@ -91,7 +91,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
30 changes: 9 additions & 21 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
{
"name": "@shougo/dpp-vim",
"version": "0.0.0",
"exports": {
"./config": "./denops/dpp/base/config.ts",
"./dpp": "./denops/dpp/base/dpp.ts",
"./ext": "./denops/dpp/base/ext.ts",
"./protocol": "./denops/dpp/base/protocol.ts",
"./types": "./denops/dpp/types.ts",
"./utils": "./denops/dpp/utils.ts"
},
"publish": {
"include": [
"denops/dpp/**/*.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/dpp"
]
}
23 changes: 9 additions & 14 deletions denops/dpp/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ import type { BaseExt } from "./base/ext.ts";
import type { BaseProtocol, Protocol } from "./base/protocol.ts";
import { Loader } from "./loader.ts";
import { extAction } from "./ext.ts";
import { isDenoCacheIssueError } from "./utils.ts";
import { importPlugin, isDenoCacheIssueError } from "./utils.ts";

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

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

export const main: Entrypoint = (denops: Denops) => {
const loader = new Loader();
Expand Down Expand Up @@ -100,13 +99,9 @@ export const main: Entrypoint = (denops: Denops) => {

await lock.lock(async () => {
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(configPath).href}#${performance.now()}`
);

const obj = new mod.Config();
const mod = await importPlugin(configPath);
// deno-lint-ignore no-explicit-any
const obj = new (mod as any).Config();

//console.log(`${Date.now() - startTime} ms`);
const configReturn = await obj.config({
Expand Down
2 changes: 1 addition & 1 deletion denops/dpp/base/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ContextBuilder } from "../types.ts";
import type { Plugin } from "../types.ts";
import type { Dpp } from "./dpp.ts";

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

export type ConfigArguments = {
contextBuilder: ContextBuilder;
Expand Down
2 changes: 1 addition & 1 deletion denops/dpp/base/dpp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
import type { BaseExt } from "./ext.ts";
import type { Protocol } from "./protocol.ts";

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

export interface Dpp {
extAction(
Expand Down
2 changes: 1 addition & 1 deletion denops/dpp/base/ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
} from "../types.ts";
import type { Protocol } from "./protocol.ts";

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

export type OnInitArguments<Params extends BaseParams> = {
denops: Denops;
Expand Down
2 changes: 1 addition & 1 deletion denops/dpp/base/protocol.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { BaseParams, Plugin, ProtocolOptions } from "../types.ts";

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

export type OnInitArguments<Params extends BaseParams> = {
denops: Denops;
Expand Down
2 changes: 1 addition & 1 deletion denops/dpp/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
25 changes: 25 additions & 0 deletions denops/dpp/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@shougo/dpp-vim",
"exports": {
"./config": "./base/config.ts",
"./dpp": "./base/dpp.ts",
"./ext": "./base/ext.ts",
"./protocol": "./base/protocol.ts",
"./types": "./types.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/assert": "jsr:@std/assert@~1.0.7",
"@std/async": "jsr:@std/async@~1.0.7",
"@std/path": "jsr:@std/path@~1.1.0"
}
}
26 changes: 9 additions & 17 deletions denops/dpp/dpp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ import {
safeStat,
} from "./utils.ts";

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";
import type { Denops } from "@denops/std";
import * as fn from "@denops/std/function";
import * as vars from "@denops/std/variable";

import { dirname } from "jsr:@std/path@~1.1.0/dirname";
import { extname } from "jsr:@std/path@~1.1.0/extname";
import { join } from "jsr:@std/path@~1.1.0/join";
import { assertEquals } from "jsr:@std/assert@~1.0.2/equals";
import { is } from "jsr:@core/unknownutil@~4.3.0/is";
import { dirname } from "@std/path/dirname";
import { extname } from "@std/path/extname";
import { join } from "@std/path/join";
import { assertEquals } from "@std/assert/equals";
import { is } from "@core/unknownutil/is";

export class DppImpl implements Dpp {
#loader: Loader;
Expand Down Expand Up @@ -163,19 +163,11 @@ export class DppImpl implements Dpp {

if (basePlugin.hooks_file) {
for (const hooksFile of convert2List(basePlugin.hooks_file)) {
const hooksFilePath = await denops.call(
"dpp#util#_expand",
hooksFile,
) as string;
const hooksFileLines = (await Deno.readTextFile(hooksFilePath)).split(
/\r?\n/,
);

basePlugin = {
...basePlugin,
...parseHooksFile(
options.hooksFileMarker,
hooksFileLines,
await readHooksFile(denops, hooksFile),
),
};
}
Expand Down
4 changes: 2 additions & 2 deletions denops/dpp/ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { type BaseProtocol, defaultProtocolOptions } from "./base/protocol.ts";
import type { Protocol } from "./base/protocol.ts";
import { printError } from "./utils.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 async function getProtocols(
denops: Denops,
Expand Down
Loading