Skip to content

Commit a218432

Browse files
authored
Merge pull request #14 from lambdalisue/update
Update
2 parents 9078a01 + b714ae5 commit a218432

File tree

7 files changed

+72
-42
lines changed

7 files changed

+72
-42
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
runner:
3636
- ubuntu-latest
3737
version:
38-
- "1.14.0"
38+
- "1.17.1"
3939
- "1.x"
4040
runs-on: ${{ matrix.runner }}
4141
steps:

.github/workflows/udd.yml

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,37 @@ jobs:
1212
- uses: denoland/setup-deno@v1
1313
with:
1414
deno-version: "1.x"
15-
- run: |
16-
make tools
17-
make update
15+
- name: Update dependencies
16+
run: |
17+
make deps > ../output.txt
18+
env:
19+
NO_COLOR: 1
20+
- name: Read ../output.txt
21+
id: log
22+
uses: juliangruber/read-file-action@v1
23+
with:
24+
path: ../output.txt
25+
- name: Commit changes
26+
run: |
27+
git config user.name '${{ github.actor }}'
28+
git config user.email '${{ github.actor }}@users.noreply.github.com'
29+
git commit -a -F- <<EOM
30+
:package: Update Deno dependencies
31+
32+
Update dependencies by udd:
33+
34+
${{ steps.log.outputs.content }}
35+
36+
EOM
1837
- uses: peter-evans/create-pull-request@v3
1938
with:
20-
commit-message: ":package: Update deno dependencies"
21-
title: ":package: Update deno dependencies"
39+
title: ":package: Update Deno dependencies"
2240
body: |
23-
Automated updates by [deno-udd](https://github.com/hayd/deno-udd)
24-
and [create-pull-request](https://github.com/peter-evans/create-pull-request)
25-
GitHub action
26-
branch: update-deno-dependencies
27-
author: GitHub <noreply@github.com>
41+
The output of `make update` is
42+
43+
```
44+
${{ steps.log.outputs.content }}
45+
```
46+
labels: automation
47+
branch: automation/update-dependencies
2848
delete-branch: true

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/.tools
1+
/.deno

Makefile

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
TOOLS := ${CURDIR}/.tools
1+
TARGETS := $$(find . \( -name '*.ts' -or -name '*.md' \) -not -path './.deno/*')
22

33
.DEFAULT_GOAL := help
44

@@ -7,27 +7,23 @@ help:
77
perl -ne 'print if /^\w+.*##/;' | \
88
perl -pe 's/(.*):.*##\s*/sprintf("%-20s",$$1)/eg;'
99

10-
tools: FORCE ## Install development tools
11-
@mkdir -p ${TOOLS}
12-
@deno install -A -f -n udd --root ${TOOLS} https://deno.land/x/udd@0.4.0/main.ts
13-
1410
fmt: FORCE ## Format code
15-
@deno fmt --ignore=.deno
11+
@deno fmt --config deno.jsonc
1612

1713
fmt-check: FORCE ## Format check
18-
@deno fmt --check --ignore=.deno
14+
@deno fmt --check --config deno.jsonc
1915

2016
lint: FORCE ## Lint code
21-
@deno lint --ignore=.deno
17+
@deno lint --config deno.jsonc
2218

2319
type-check: FORCE ## Type check
24-
@deno test --unstable --no-run $$(find . -name '*.ts' -not -name '.deno')
20+
@deno test --unstable --no-run ${TARGETS}
2521

2622
test: FORCE ## Test
27-
@deno test --unstable -A --jobs
23+
@deno test --unstable -A --no-check --jobs
2824

29-
update: FORCE ## Update dependencies
30-
@${TOOLS}/bin/udd $$(find . -name '*.ts' -not -name '.deno')
25+
deps: FORCE ## Update dependencies
26+
@deno run -A https://deno.land/x/udd@0.7.2/main.ts ${TARGETS}
3127
@make fmt
3228

3329
FORCE:

deno.jsonc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"lint": {
3+
"files": {
4+
"exclude": [".deno"]
5+
}
6+
},
7+
"fmt": {
8+
"files": {
9+
"exclude": [".deno"]
10+
}
11+
}
12+
}

denops/guise/editor.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { Denops } from "https://deno.land/x/denops_std@v2.1.3/mod.ts";
2-
import * as autocmd from "https://deno.land/x/denops_std@v2.1.3/autocmd/mod.ts";
3-
import * as anonymous from "https://deno.land/x/denops_std@v2.1.3/anonymous/mod.ts";
4-
import * as batch from "https://deno.land/x/denops_std@v2.1.3/batch/mod.ts";
5-
import * as fn from "https://deno.land/x/denops_std@v2.1.3/function/mod.ts";
6-
import * as vars from "https://deno.land/x/denops_std@v2.1.3/variable/mod.ts";
7-
import * as option from "https://deno.land/x/denops_std@v2.1.3/option/mod.ts";
8-
import { deferred } from "https://deno.land/std@0.111.0/async/mod.ts";
1+
import type { Denops } from "https://deno.land/x/denops_std@v3.1.4/mod.ts";
2+
import * as autocmd from "https://deno.land/x/denops_std@v3.1.4/autocmd/mod.ts";
3+
import * as anonymous from "https://deno.land/x/denops_std@v3.1.4/anonymous/mod.ts";
4+
import * as batch from "https://deno.land/x/denops_std@v3.1.4/batch/mod.ts";
5+
import * as fn from "https://deno.land/x/denops_std@v3.1.4/function/mod.ts";
6+
import * as vars from "https://deno.land/x/denops_std@v3.1.4/variable/mod.ts";
7+
import * as option from "https://deno.land/x/denops_std@v3.1.4/option/mod.ts";
8+
import { deferred } from "https://deno.land/std@0.128.0/async/mod.ts";
99

1010
/**
1111
* Open a scratch buffer in a new tab page and return immediately.
@@ -18,8 +18,10 @@ export async function open(denops: Denops): Promise<void> {
1818
* Open a `filename` buffer in a new tab page and wait the buffer is closed.
1919
*/
2020
export async function edit(denops: Denops, filename: string): Promise<void> {
21-
let opener = await vars.g.get(denops, "guise_edit_opener", "tab drop");
22-
await denops.cmd(`silent noswapfile ${opener} \`=filename\` | edit`, { filename });
21+
const opener = await vars.g.get(denops, "guise_edit_opener", "tab drop");
22+
await denops.cmd(`silent noswapfile ${opener} \`=filename\` | edit`, {
23+
filename,
24+
});
2325
const [winid, bufnr] = await batch.gather(denops, async (denops) => {
2426
await fn.win_getid(denops);
2527
await fn.bufnr(denops);

denops/guise/main.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import type { Denops } from "https://deno.land/x/denops_std@v2.1.3/mod.ts";
2-
import * as batch from "https://deno.land/x/denops_std@v2.1.3/batch/mod.ts";
3-
import * as helper from "https://deno.land/x/denops_std@v2.1.3/helper/mod.ts";
4-
import * as vars from "https://deno.land/x/denops_std@v2.1.3/variable/mod.ts";
5-
import * as unknownutil from "https://deno.land/x/unknownutil@v1.1.4/mod.ts";
1+
import type { Denops } from "https://deno.land/x/denops_std@v3.1.4/mod.ts";
2+
import * as batch from "https://deno.land/x/denops_std@v3.1.4/batch/mod.ts";
3+
import * as helper from "https://deno.land/x/denops_std@v3.1.4/helper/mod.ts";
4+
import * as vars from "https://deno.land/x/denops_std@v3.1.4/variable/mod.ts";
5+
import * as unknownutil from "https://deno.land/x/unknownutil@v2.0.0/mod.ts";
66
import {
77
Session as VimSession,
88
} from "https://deno.land/x/vim_channel_command@v1.0.0/mod.ts";
@@ -80,16 +80,16 @@ function getDispatcher(denops: Denops): Dispatcher {
8080
},
8181

8282
edit(filename: unknown) {
83-
unknownutil.ensureString(filename);
83+
unknownutil.assertString(filename);
8484
return editor.edit(denops, filename);
8585
},
8686

8787
error(
8888
exception: unknown,
8989
throwpoint: unknown,
9090
) {
91-
unknownutil.ensureString(exception);
92-
unknownutil.ensureString(throwpoint);
91+
unknownutil.assertString(exception);
92+
unknownutil.assertString(throwpoint);
9393
const message = [exception, throwpoint].join("\n");
9494
return helper.echo(denops, message);
9595
},

0 commit comments

Comments
 (0)