Skip to content

Commit 5fdbdc8

Browse files
authored
Merge pull request #33 from Shougo/import-map
Add import map support
2 parents 7a54db9 + 745c3d5 commit 5fdbdc8

File tree

18 files changed

+243
-124
lines changed

18 files changed

+243
-124
lines changed

.github/workflows/deno.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: deno
22

33
env:
4-
DENO_VERSION: 1.x
4+
DENO_VERSION: 2.x
55
DENOPS_PATH: "./"
66

77
on:
@@ -46,3 +46,14 @@ jobs:
4646
run: |
4747
grep -rl Deno.test denops| xargs deno test --unstable -A
4848
timeout-minutes: 5
49+
50+
deno-test-publish:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: denoland/setup-deno@main
55+
with:
56+
deno-version: ${{ env.DENO_VERSION }}
57+
58+
- name: Test Publish
59+
run: deno task test:publish

.github/workflows/jsr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: jsr
22

33
env:
4-
DENO_VERSION: 1.x
4+
DENO_VERSION: 2.x
55

66
on:
77
push:
@@ -19,9 +19,9 @@ jobs:
1919
- uses: actions/checkout@v4
2020
with:
2121
fetch-depth: 0
22-
- uses: denoland/setup-deno@v1
22+
- uses: denoland/setup-deno@v2
2323
with:
2424
deno-version: ${{ env.DENO_VERSION }}
2525
- name: Publish
2626
run: |
27-
deno run -A jsr:@david/publish-on-tag@0.1.3
27+
deno run -A jsr:@david/publish-on-tag@0.2.0

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ see "FAQ" section in [help](doc/dpp.txt).
3131

3232
## Install
3333

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

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

4040
### Requirements
4141

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

4444
- <https://deno.land/>
4545
- <https://github.com/vim-denops/denops.vim>

autoload/dpp/denops.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ function s:init() abort
4141
return
4242
endif
4343

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

@@ -91,7 +91,7 @@ function s:notify(method, args) abort
9191
endif
9292
endfunction
9393

94-
const s:root_dir = '<sfile>:h:h:h'->expand()
94+
const s:root_dir = '<script>:h:h:h'->expand()
9595
const s:sep = has('win32') ? '\' : '/'
9696
function s:register() abort
9797
call denops#plugin#load(

deno.jsonc

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
{
2-
"name": "@shougo/dpp-vim",
3-
"version": "0.0.0",
4-
"exports": {
5-
"./config": "./denops/dpp/base/config.ts",
6-
"./dpp": "./denops/dpp/base/dpp.ts",
7-
"./ext": "./denops/dpp/base/ext.ts",
8-
"./protocol": "./denops/dpp/base/protocol.ts",
9-
"./types": "./denops/dpp/types.ts",
10-
"./utils": "./denops/dpp/utils.ts"
11-
},
12-
"publish": {
13-
"include": [
14-
"denops/dpp/**/*.ts"
15-
]
16-
},
17-
"imports": {
18-
},
19-
"lock": false,
202
"tasks": {
3+
"cache": "deno install --reload",
214
"check": "deno check denops/**/*.ts",
5+
"fmt": "deno fmt denops",
226
"lint": "deno lint denops",
237
"lint-fix": "deno lint --fix denops",
24-
"fmt": "deno fmt denops",
258
"test": "deno test -A --doc --parallel --shuffle denops/**/*.ts",
26-
"upgrade": "deno run -A jsr:@molt/cli **/*.ts --write"
27-
}
9+
"test:publish": "deno publish --dry-run --allow-dirty --set-version 0.0.0",
10+
"update": "deno outdated --recursive",
11+
"upgrade": "deno outdated --recursive --update"
12+
},
13+
"workspace": [
14+
"./denops/dpp"
15+
]
2816
}

denops/dpp/app.ts

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ import type { BaseExt } from "./base/ext.ts";
1111
import type { BaseProtocol, Protocol } from "./base/protocol.ts";
1212
import { Loader } from "./loader.ts";
1313
import { extAction } from "./ext.ts";
14-
import { isDenoCacheIssueError } from "./utils.ts";
14+
import { importPlugin, isDenoCacheIssueError } from "./utils.ts";
1515

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

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

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

101100
await lock.lock(async () => {
102101
try {
103-
// NOTE: Import module with fragment so that reload works properly.
104-
// https://github.com/vim-denops/denops.vim/issues/227
105-
const mod = await import(
106-
`${toFileUrl(configPath).href}#${performance.now()}`
107-
);
108-
109-
const obj = new mod.Config();
102+
const mod = await importPlugin(configPath);
103+
// deno-lint-ignore no-explicit-any
104+
const obj = new (mod as any).Config();
110105

111106
//console.log(`${Date.now() - startTime} ms`);
112107
const configReturn = await obj.config({

denops/dpp/base/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { ContextBuilder } from "../types.ts";
22
import type { Plugin } from "../types.ts";
33
import type { Dpp } from "./dpp.ts";
44

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

77
export type ConfigArguments = {
88
contextBuilder: ContextBuilder;

denops/dpp/base/dpp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type {
1010
import type { BaseExt } from "./ext.ts";
1111
import type { Protocol } from "./protocol.ts";
1212

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

1515
export interface Dpp {
1616
extAction(

denops/dpp/base/ext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type {
88
} from "../types.ts";
99
import type { Protocol } from "./protocol.ts";
1010

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

1313
export type OnInitArguments<Params extends BaseParams> = {
1414
denops: Denops;

denops/dpp/base/protocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { BaseParams, Plugin, ProtocolOptions } from "../types.ts";
22

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

55
export type OnInitArguments<Params extends BaseParams> = {
66
denops: Denops;

0 commit comments

Comments
 (0)