Skip to content

Commit 52419c7

Browse files
authored
Merge pull request #246 from vim-denops/v7-pre
πŸŽ‰ For Denops v7
2 parents d649fd6 + ea2a59a commit 52419c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1075
-555
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/publish-on-tag@0.1.3

β€Ž.github/workflows/test.yml

Lines changed: 55 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
name: Test
22

33
on:
4-
schedule:
5-
- cron: "0 7 * * 0"
64
push:
75
branches:
86
- main
97
pull_request:
8+
paths:
9+
- "**.md"
10+
- "**.ts"
11+
- "deno.jsonc"
12+
- ".github/workflows/test.yml"
1013
workflow_dispatch:
1114

1215
defaults:
@@ -19,7 +22,7 @@ jobs:
1922
matrix:
2023
runner:
2124
- ubuntu-latest
22-
version:
25+
deno_version:
2326
- "1.x"
2427
runs-on: ${{ matrix.runner }}
2528
steps:
@@ -28,7 +31,7 @@ jobs:
2831
- uses: actions/checkout@v4
2932
- uses: denoland/setup-deno@v1.1.4
3033
with:
31-
deno-version: "${{ matrix.version }}"
34+
deno-version: "${{ matrix.deno_version }}"
3235
- uses: actions/cache@v4
3336
with:
3437
key: deno-${{ hashFiles('**/*') }}
@@ -49,57 +52,80 @@ jobs:
4952
- windows-latest
5053
- macos-latest
5154
- ubuntu-latest
52-
version:
53-
- "1.38.x"
55+
deno_version:
56+
- "1.45.x"
5457
- "1.x"
5558
host_version:
56-
- vim: "v9.0.2189"
57-
nvim: "v0.9.4"
59+
- vim: "v9.1.0448"
60+
nvim: "v0.10.0"
5861
runs-on: ${{ matrix.runner }}
5962
timeout-minutes: 15
6063
steps:
6164
- run: git config --global core.autocrlf false
6265
if: runner.os == 'Windows'
66+
6367
- uses: actions/checkout@v4
64-
- uses: actions/checkout@v4
65-
with:
66-
repository: "vim-denops/denops.vim"
67-
path: ".deps/denops.vim"
68+
6869
- uses: denoland/setup-deno@v1.1.4
6970
with:
70-
deno-version: "${{ matrix.version }}"
71+
deno-version: "${{ matrix.deno_version }}"
72+
73+
- name: Get denops
74+
run: |
75+
git clone https://github.com/vim-denops/denops.vim /tmp/denops.vim
76+
echo "DENOPS_TEST_DENOPS_PATH=/tmp/denops.vim" >> "$GITHUB_ENV"
77+
78+
- name: Try switching denops branch
79+
run: |
80+
git -C /tmp/denops.vim switch ${{ github.head_ref || github.ref_name }} || true
81+
git -C /tmp/denops.vim branch
82+
7183
- uses: rhysd/action-setup-vim@v1
7284
id: vim
7385
with:
7486
version: "${{ matrix.host_version.vim }}"
75-
- name: Check Vim
76-
run: |
77-
echo ${DENOPS_TEST_VIM}
78-
${DENOPS_TEST_VIM} --version
79-
env:
80-
DENOPS_TEST_VIM: ${{ steps.vim.outputs.executable }}
87+
8188
- uses: rhysd/action-setup-vim@v1
8289
id: nvim
8390
with:
8491
neovim: true
8592
version: "${{ matrix.host_version.nvim }}"
86-
- name: Check Neovim
93+
94+
- name: Export executables
8795
run: |
88-
echo ${DENOPS_TEST_NVIM}
89-
${DENOPS_TEST_NVIM} --version
90-
env:
91-
DENOPS_TEST_NVIM: ${{ steps.nvim.outputs.executable }}
96+
echo "DENOPS_TEST_VIM_EXECUTABLE=${{ steps.vim.outputs.executable }}" >> "$GITHUB_ENV"
97+
echo "DENOPS_TEST_NVIM_EXECUTABLE=${{ steps.nvim.outputs.executable }}" >> "$GITHUB_ENV"
98+
99+
- name: Check versions
100+
run: |
101+
deno --version
102+
${DENOPS_TEST_VIM_EXECUTABLE} --version
103+
${DENOPS_TEST_NVIM_EXECUTABLE} --version
104+
105+
- name: Perform pre-cache
106+
run: |
107+
deno cache ${DENOPS_TEST_DENOPS_PATH}/denops/@denops-private/mod.ts ./mod.ts
108+
92109
- name: Test
93110
run: deno task test:coverage
94-
env:
95-
DENOPS_TEST_DENOPS_PATH: ".deps/denops.vim"
96-
DENOPS_TEST_VIM_EXECUTABLE: ${{ steps.vim.outputs.executable }}
97-
DENOPS_TEST_NVIM_EXECUTABLE: ${{ steps.nvim.outputs.executable }}
98-
timeout-minutes: 5
111+
timeout-minutes: 15
112+
99113
- run: |
100114
deno task coverage --lcov > coverage.lcov
115+
101116
- uses: codecov/codecov-action@v4
102117
with:
103118
os: ${{ runner.os }}
104119
files: ./coverage.lcov
105120
token: ${{ secrets.CODECOV_TOKEN }}
121+
122+
jsr-publish:
123+
runs-on: ubuntu-latest
124+
steps:
125+
- uses: actions/checkout@v4
126+
- uses: denoland/setup-deno@v1
127+
with:
128+
deno-version: ${{ env.DENO_VERSION }}
129+
- name: Publish (dry-run)
130+
run: |
131+
deno publish --dry-run

β€Ž.scripts/gen-function/format.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Definition, Variant } from "./types.ts";
1+
import type { Definition, Variant } from "./types.ts";
22

3-
const denops = "https://deno.land/x/denops_core@v6.0.5/mod.ts";
3+
const denops = "@denops/core";
44

55
const translate: Record<string, string> = {
66
"*cmd": "cmd",

β€Ž.scripts/gen-function/gen-function.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
import {
2-
difference,
3-
intersection,
4-
} from "https://deno.land/x/set_operations@v1.1.1/mod.ts";
5-
import * as path from "https://deno.land/std@0.217.0/path/mod.ts";
1+
import * as path from "@std/path";
62
import { parse } from "./parse.ts";
73
import { format } from "./format.ts";
84
import { DOCS_OVERRIDES } from "./override.ts";
95
import { transform } from "./transform.ts";
106
import { downloadString } from "../utils.ts";
117

12-
const VIM_VERSION = "9.0.2189";
13-
const NVIM_VERSION = "0.9.4";
8+
const VIM_VERSION = "9.1.0399";
9+
const NVIM_VERSION = "0.9.5";
1410

1511
const commonGenerateModule = "../../function/_generated.ts";
1612
const vimGenerateModule = "../../function/vim/_generated.ts";
@@ -48,7 +44,7 @@ for (const vimHelpDownloadUrl of vimHelpDownloadUrls) {
4844
}
4945
const vimHelps = await Promise.all(vimHelpDownloadUrls.map(downloadString));
5046
const vimDefs = parse(vimHelps.join("\n"));
51-
const vimFnSet = difference(new Set(vimDefs.map((def) => def.fn)), manualFnSet);
47+
const vimFnSet = new Set(vimDefs.map((def) => def.fn)).difference(manualFnSet);
5248

5349
const nvimHelpDownloadUrls = [
5450
`https://raw.githubusercontent.com/neovim/neovim/v${NVIM_VERSION}/runtime/doc/api.txt`,
@@ -61,8 +57,7 @@ for (const nvimHelpDownloadUrl of nvimHelpDownloadUrls) {
6157
}
6258
const nvimHelps = await Promise.all(nvimHelpDownloadUrls.map(downloadString));
6359
const nvimDefs = parse(nvimHelps.join("\n"));
64-
const nvimFnSet = difference(
65-
new Set(nvimDefs.map((def) => def.fn)),
60+
const nvimFnSet = new Set(nvimDefs.map((def) => def.fn)).difference(
6661
manualFnSet,
6762
);
6863

@@ -74,9 +69,9 @@ const commonDefs = vimDefs
7469
: vimDef
7570
);
7671

77-
const commonFnSet = intersection(vimFnSet, nvimFnSet);
78-
const vimOnlyFnSet = difference(vimFnSet, nvimFnSet);
79-
const nvimOnlyFnSet = difference(nvimFnSet, vimFnSet);
72+
const commonFnSet = vimFnSet.intersection(nvimFnSet);
73+
const vimOnlyFnSet = vimFnSet.difference(nvimFnSet);
74+
const nvimOnlyFnSet = nvimFnSet.difference(vimFnSet);
8075

8176
const commonCode = format(
8277
commonDefs.filter((def) => commonFnSet.has(def.fn)),

β€Ž.scripts/gen-function/override.ts

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

33
/**
44
* Mapping between function name to `DocsType`.

β€Ž.scripts/gen-function/parse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Definition, Variant } from "./types.ts";
1+
import type { Definition, Variant } from "./types.ts";
22
import { createMarkdownFromHelp } from "../markdown.ts";
33
import { Counter, regexIndexOf } from "../utils.ts";
44

β€Ž.scripts/gen-option/format.ts

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

3-
const denops = "https://deno.land/x/denops_core@v6.0.5/mod.ts";
3+
const denops = "@denops/core";
44

55
const translate: Record<string, string> = {
66
"default": "defaultValue",

β€Ž.scripts/gen-option/gen-option.ts

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
import {
2-
difference,
3-
intersection,
4-
} from "https://deno.land/x/set_operations@v1.1.1/mod.ts";
5-
import * as path from "https://deno.land/std@0.217.0/path/mod.ts";
1+
import * as path from "@std/path";
62
import { parse } from "./parse.ts";
73
import { format } from "./format.ts";
84
import { DOCS_OVERRIDES } from "./override.ts";
95
import { transform } from "./transform.ts";
106
import { downloadString } from "../utils.ts";
117

12-
const VIM_VERSION = "9.0.2189";
13-
const NVIM_VERSION = "0.9.4";
8+
const VIM_VERSION = "9.1.0399";
9+
const NVIM_VERSION = "0.9.5";
1410

1511
const commonGenerateModule = "../../option/_generated.ts";
1612
const vimGenerateModule = "../../option/vim/_generated.ts";
@@ -41,8 +37,7 @@ for (const vimHelpDownloadUrl of vimHelpDownloadUrls) {
4137
}
4238
const vimHelps = await Promise.all(vimHelpDownloadUrls.map(downloadString));
4339
const vimDefs = vimHelps.map(parse).flat();
44-
const vimOptionSet = difference(
45-
new Set(vimDefs.map((def) => def.name)),
40+
const vimOptionSet = new Set(vimDefs.map((def) => def.name)).difference(
4641
manualOptionSet,
4742
);
4843

@@ -54,8 +49,7 @@ for (const nvimHelpDownloadUrl of nvimHelpDownloadUrls) {
5449
}
5550
const nvimHelps = await Promise.all(nvimHelpDownloadUrls.map(downloadString));
5651
const nvimDefs = nvimHelps.map(parse).flat();
57-
const nvimOptionSet = difference(
58-
new Set(nvimDefs.map((def) => def.name)),
52+
const nvimOptionSet = new Set(nvimDefs.map((def) => def.name)).difference(
5953
manualOptionSet,
6054
);
6155

@@ -67,9 +61,9 @@ const commonDefs = vimDefs
6761
: vimDef
6862
);
6963

70-
const commonOptionSet = intersection(vimOptionSet, nvimOptionSet);
71-
const vimOnlyOptionSet = difference(vimOptionSet, nvimOptionSet);
72-
const nvimOnlyOptionSet = difference(nvimOptionSet, vimOptionSet);
64+
const commonOptionSet = vimOptionSet.intersection(nvimOptionSet);
65+
const vimOnlyOptionSet = vimOptionSet.difference(nvimOptionSet);
66+
const nvimOnlyOptionSet = nvimOptionSet.difference(vimOptionSet);
7367

7468
const commonCode = format(
7569
commonDefs.filter((def) => commonOptionSet.has(def.name)),

β€Ž.scripts/gen-option/override.ts

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

33
/**
44
* Mapping between function name to `DocsType`.

β€Ž.scripts/markdown_test.ts

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

33
import { createMarkdownFromHelp } from "./markdown.ts";
44

β€Ž.scripts/transform.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
fromFileUrl,
3-
toFileUrl,
4-
} from "https://deno.land/std@0.217.0/path/mod.ts";
5-
import { intersection } from "https://deno.land/x/set_operations@v1.1.1/mod.ts";
1+
import { fromFileUrl, toFileUrl } from "@std/path";
62

73
interface ModuleInformation {
84
sourcePath: string;
@@ -79,7 +75,7 @@ export async function transform(
7975
const fnNames = new Set(fnJSDocs.keys());
8076
const informations = await findExportModules(rootSourcePath);
8177
for (const { sourcePath, sourceText, functions } of informations) {
82-
if (intersection(functions, fnNames).size > 0) {
78+
if (functions.intersection(fnNames).size > 0) {
8379
const transformed = replaceFunctionDocs(sourceText, fnJSDocs);
8480
await Deno.writeTextFile(sourcePath, transformed);
8581
}

β€Ž.scripts/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as streams from "https://deno.land/std@0.217.0/streams/mod.ts";
1+
import * as streams from "@std/streams";
22

33
/**
44
* Downloads a text file and returns the contents.

β€Ž.scripts/utils_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import {
33
assertInstanceOf,
44
assertRejects,
55
assertThrows,
6-
} from "https://deno.land/std@0.217.0/assert/mod.ts";
7-
import { stub } from "https://deno.land/std@0.217.0/testing/mock.ts";
6+
} from "@std/assert";
7+
import { stub } from "@std/testing/mock";
88

99
import {
1010
Counter,

β€ŽREADME.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
# 🐜 denops_std
22

3-
[![Vim 9.0.2189 or above](https://img.shields.io/badge/Vim-Support%209.0.2189-yellowgreen.svg?logo=vim)](https://github.com/vim/vim/tree/v9.0.2189)
4-
[![Neovim 0.9.4 or above](https://img.shields.io/badge/Neovim-Support%200.9.4-yellowgreen.svg?logo=neovim&logoColor=white)](https://github.com/neovim/neovim/tree/v0.9.4)
3+
[![JSR](https://jsr.io/badges/@denops/std)](https://jsr.io/@denops/std)
54
[![Test](https://github.com/vim-denops/deno-denops-std/actions/workflows/test.yml/badge.svg)](https://github.com/vim-denops/deno-denops-std/actions/workflows/test.yml)
65
[![codecov](https://codecov.io/github/vim-denops/deno-denops-std/branch/main/graph/badge.svg?token=RKAZMUQ3D9)](https://codecov.io/github/vim-denops/deno-denops-std)
7-
[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/denops_std/mod.ts)
8-
[![Documentation](https://img.shields.io/badge/denops-Documentation-yellow.svg)](https://vim-denops.github.io/denops-documentation/)
9-
[![deno land](http://img.shields.io/badge/available%20on-deno.land/x/denops__std-lightgrey.svg?logo=deno)](https://deno.land/x/denops_std)
106

117
Standard module for [denops.vim].
128

@@ -16,13 +12,13 @@ assumed to be called in a dedicated worker thread.
1612
By using this module, developers can write Vim/Neovim denops plugins like:
1713

1814
```typescript
19-
import type { Denops } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
20-
import * as batch from "https://deno.land/x/denops_std@$MODULE_VERSION/batch/mod.ts";
21-
import * as fn from "https://deno.land/x/denops_std@$MODULE_VERSION/function/mod.ts";
22-
import * as vars from "https://deno.land/x/denops_std@$MODULE_VERSION/variable/mod.ts";
23-
import * as helper from "https://deno.land/x/denops_std@$MODULE_VERSION/helper/mod.ts";
15+
import type { Denops } from "jsr:@denops/std";
16+
import * as batch from "jsr:@denops/std/batch";
17+
import * as fn from "jsr:@denops/std/function";
18+
import * as vars from "jsr:@denops/std/variable";
19+
import * as helper from "jsr:@denops/std/helper";
2420

25-
import { assert, is } from "https://deno.land/x/unknownutil@v3.14.1/mod.ts";
21+
import { assert, is } from "jsr:@core/unknownutil";
2622

2723
export function main(denops: Denops): void {
2824
denops.dispatcher = {

0 commit comments

Comments
Β (0)