Skip to content

Commit 9385b45

Browse files
authored
Merge pull request #20 from vim-denops/v2-pre
Support Denops v7 and publish package on JSR
2 parents 4aa43df + 62224e5 commit 9385b45

File tree

17 files changed

+99
-91
lines changed

17 files changed

+99
-91
lines changed

.github/workflows/jsr.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: jsr
2+
3+
env:
4+
DENO_VERSION: 1.x
5+
6+
on:
7+
push:
8+
tags:
9+
- "v*"
10+
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
jobs:
16+
publish:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- uses: denoland/setup-deno@v1
23+
with:
24+
deno-version: ${{ env.DENO_VERSION }}
25+
- name: Publish
26+
run: |
27+
deno run -A jsr:@david/[email protected]

.github/workflows/test.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ jobs:
5252
- macos-latest
5353
- ubuntu-latest
5454
deno_version:
55-
- "1.38.x"
55+
- "1.43.x"
5656
- "1.x"
5757
host_version:
58-
- vim: "v9.0.2189"
59-
nvim: "v0.9.4"
58+
- vim: "v9.1.0399"
59+
nvim: "v0.9.5"
6060

6161
runs-on: ${{ matrix.runner }}
6262

@@ -113,3 +113,14 @@ jobs:
113113
os: ${{ runner.os }}
114114
files: ./coverage.lcov
115115
token: ${{ secrets.CODECOV_TOKEN }}
116+
117+
jsr-publish:
118+
runs-on: ubuntu-latest
119+
steps:
120+
- uses: actions/checkout@v4
121+
- uses: denoland/setup-deno@v1
122+
with:
123+
deno-version: "1.x"
124+
- name: Publish (dry-run)
125+
run: |
126+
deno publish --dry-run

.github/workflows/update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
git config user.name github-actions[bot]
1919
git config user.email github-actions[bot]@users.noreply.github.com
2020
- name: Update dependencies and commit changes
21-
run: deno task -q upgrade:commit --summary ../title.txt --report ../body.md
21+
run: deno task -q update:commit --summary ../title.txt --report ../body.md
2222
- name: Check result
2323
id: result
2424
uses: andstor/file-existence-action@v2

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# 📝 denops_test
22

3+
[![JSR](https://jsr.io/badges/@denops/test)](https://jsr.io/@denops/test)
34
[![Test](https://github.com/vim-denops/deno-denops-test/actions/workflows/test.yml/badge.svg)](https://github.com/vim-denops/deno-denops-test/actions/workflows/test.yml)
4-
[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/denops_test/mod.ts)
5-
[![deno land](http://img.shields.io/badge/available%20on-deno.land/x/denops__test-lightgrey.svg?logo=deno)](https://deno.land/x/denops_test)
65
[![codecov](https://codecov.io/github/vim-denops/deno-denops-test/branch/main/graph/badge.svg?token=X9O5XB4O1S)](https://codecov.io/github/vim-denops/deno-denops-test)
76

87
A [Deno] module designed for testing [denops.vim]. This module is intended to be
@@ -31,12 +30,8 @@ If you want to test denops plugins with a real Vim and/or Neovim process, use
3130
the `test` function to define a test case, as shown below:
3231

3332
```typescript
34-
import {
35-
assert,
36-
assertEquals,
37-
assertFalse,
38-
} from "https://deno.land/[email protected]/assert/mod.ts";
39-
import { test } from "https://deno.land/x/denops_test@$MODULE_VERSION/mod.ts";
33+
import { assert, assertEquals, assertFalse } from "jsr:@std/assert";
34+
import { test } from "jsr:@denops/test";
4035

4136
test("vim", "Start Vim to test denops features", async (denops) => {
4237
assertFalse(await denops.call("has", "nvim"));
@@ -72,8 +67,8 @@ the `DenopsStub` class to create a stub instance of the `Denops` interface, as
7267
shown below:
7368

7469
```typescript
75-
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts";
76-
import { DenopsStub } from "https://deno.land/x/denops_test@$MODULE_VERSION/mod.ts";
70+
import { assertEquals } from "jsr:@std/assert";
71+
import { DenopsStub } from "jsr:@denops/test";
7772

7873
Deno.test("denops.call", async () => {
7974
const denops = new DenopsStub({
@@ -158,6 +153,10 @@ jobs:
158153
run: deno test -A
159154
```
160155
156+
## For developers
157+
158+
This library may be called from denops itself so import map is not available.
159+
161160
## License
162161
163162
The code follows the MIT license, as stated in [LICENSE](./LICENSE).

conf.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { resolve } from "https://deno.land/std@0.210.0/path/mod.ts";
1+
import { resolve } from "jsr:@std/path@0.225.0/resolve";
22

33
let conf: Config | undefined;
44

deno.jsonc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
{
2+
"name": "@denops/test",
3+
"version": "0.0.0",
4+
"exports": {
5+
".": "./mod.ts",
6+
"./stub": "./stub.ts",
7+
"./tester": "./tester.ts",
8+
"./with": "./with.ts"
9+
},
210
"tasks": {
311
"check": "deno check **/*.ts",
412
"test": "deno test -A --doc --parallel --shuffle",
513
"test:coverage": "deno task test --coverage=.coverage",
614
"coverage": "deno coverage .coverage",
7-
"upgrade": "deno run -q -A https://deno.land/x/[email protected]/cli.ts ./**/*.ts",
8-
"upgrade:commit": "deno task -q upgrade --commit --prefix :package: --pre-commit=fmt"
15+
"update": "deno run --allow-env --allow-read --allow-write=. --allow-run=git,deno --allow-net=jsr.io,registry.npmjs.org jsr:@molt/cli ./*.ts",
16+
"update:commit": "deno task -q update --commit --pre-commit=fmt,lint"
917
},
1018
"imports": {
11-
"https://deno.land/x/denops_test@$MODULE_VERSION/": "./"
19+
"jsr:@denops/test": "./mod.ts"
1220
}
1321
}

denops.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
import type {
2-
Context,
3-
Denops,
4-
Dispatcher,
5-
Meta,
6-
} from "https://deno.land/x/[email protected]/mod.ts";
7-
import { Client } from "https://deno.land/x/[email protected]/mod.ts";
1+
import type { Context, Denops, Dispatcher, Meta } from "jsr:@denops/[email protected]";
2+
import type { Client } from "jsr:@lambdalisue/[email protected]";
83

94
export class DenopsImpl implements Denops {
105
readonly name: string;

error.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { is } from "https://deno.land/x/unknownutil@v3.11.0/mod.ts";
1+
import { is } from "jsr:@core/unknownutil@3.18.0";
22
import {
33
fromErrorObject,
44
isErrorObject,
55
toErrorObject,
66
tryOr,
7-
} from "https://deno.land/x/errorutil@v0.1.1/mod.ts";
7+
} from "jsr:@lambdalisue/errorutil@1.0.0";
88

99
export function errorSerializer(err: unknown): unknown {
1010
if (err instanceof Error) {

mod.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
* assert,
2828
* assertEquals,
2929
* assertFalse,
30-
* } from "https://deno.land/[email protected]/assert/mod.ts";
31-
* import { test } from "https://deno.land/x/denops_test@$MODULE_VERSION/mod.ts";
30+
* } from "jsr:@std/assert";
31+
* import { test } from "jsr:@denops/test";
3232
*
3333
* test(
3434
* "vim",
@@ -68,8 +68,8 @@
6868
* shown below:
6969
*
7070
* ```typescript
71-
* import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts";
72-
* import { DenopsStub } from "https://deno.land/x/denops_test@$MODULE_VERSION/mod.ts";
71+
* import { assertEquals } from "jsr:@std/assert";
72+
* import { DenopsStub } from "jsr:@denops/test";
7373
*
7474
* Deno.test("denops.call", async () => {
7575
* const denops = new DenopsStub({

plugin.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
import type { Denops } from "https://deno.land/x/[email protected]/mod.ts";
2-
import {
3-
assert,
4-
ensure,
5-
is,
6-
} from "https://deno.land/x/[email protected]/mod.ts";
7-
import {
8-
Client,
9-
Session,
10-
} from "https://deno.land/x/[email protected]/mod.ts";
1+
import type { Denops } from "jsr:@denops/[email protected]";
2+
import { assert, ensure, is } from "jsr:@core/[email protected]";
3+
import { Client, Session } from "jsr:@lambdalisue/[email protected]";
114
import { errorDeserializer, errorSerializer } from "./error.ts";
125

136
export async function main(denops: Denops): Promise<void> {

0 commit comments

Comments
 (0)