Skip to content

Commit 2a551e7

Browse files
authored
Upgrade deps (#23)
* Update deps * Add deno.jsonc * Use SEPARATOR
1 parent 7233513 commit 2a551e7

File tree

3 files changed

+35
-20
lines changed

3 files changed

+35
-20
lines changed

deno.jsonc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"lock": false,
3+
"tasks": {
4+
"check": "deno check denops/**/*.ts",
5+
"lint": "deno lint denops",
6+
"fmt": "deno fmt denops",
7+
"test": "deno test -A --doc --parallel --shuffle denops/**/*.ts",
8+
"upgrade": "deno run -A jsr:@molt/cli **/*.ts --no-resolve --write"
9+
}
10+
}

denops/@ddc-file/deps.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
export type {
22
Context,
33
Item,
4-
} from "https://deno.land/x/ddc_vim@v4.1.0/types.ts";
5-
export { BaseSource } from "https://deno.land/x/ddc_vim@v4.1.0/types.ts";
6-
export type { Denops } from "https://deno.land/x/ddc_vim@v4.1.0/deps.ts";
7-
export { fn, vars } from "https://deno.land/x/ddc_vim@v4.1.0/deps.ts";
4+
} from "https://deno.land/x/ddc_vim@v5.0.0/types.ts";
5+
export { BaseSource } from "https://deno.land/x/ddc_vim@v5.0.0/types.ts";
6+
export type { Denops } from "https://deno.land/x/ddc_vim@v5.0.0/deps.ts";
7+
export { fn, vars } from "https://deno.land/x/ddc_vim@v5.0.0/deps.ts";
88
export type {
99
GatherArguments,
1010
GetCompletePositionArguments,
11-
} from "https://deno.land/x/ddc_vim@v4.1.0/base/source.ts";
12-
export * as path from "https://deno.land/std@0.205.0/path/mod.ts";
13-
export * as io from "https://deno.land/std@0.205.0/io/mod.ts";
14-
export * as fs from "https://deno.land/std@0.205.0/fs/mod.ts";
15-
export * as asserts from "https://deno.land/std@0.205.0/testing/asserts.ts";
11+
} from "https://deno.land/x/ddc_vim@v5.0.0/base/source.ts";
12+
13+
export * as path from "jsr:@std/path@0.224.0";
14+
export * as fs from "jsr:@std/fs@0.224.0";
15+
export * as asserts from "jsr:@std/assert@0.225.1";
16+
1617
export {
1718
asyncIteratorFrom as fromA,
1819
iteratorFrom as from,

denops/@ddc-sources/file.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,21 @@ export class Source extends BaseSource<Params> {
105105
// e.g. '/home/ubuntu/config' for inputFileFull = '~/config'
106106
const inputFileFullExpanded = await (async () => {
107107
const home = homeDir();
108-
const last = inputFileFull.endsWith(path.sep) ? path.sep : "";
108+
const last = inputFileFull.endsWith(path.SEPARATOR) ? path.SEPARATOR : "";
109109
{
110-
const pat = `~${path.sep}`;
110+
const pat = `~${path.SEPARATOR}`;
111111
if (home && inputFileFull.startsWith(pat)) {
112112
return path.join(home, inputFileFull.slice(pat.length)) + last;
113113
}
114114
}
115115
{
116-
const pat = `$HOME${path.sep}`;
116+
const pat = `$HOME${path.SEPARATOR}`;
117117
if (home && inputFileFull.startsWith(pat)) {
118118
return path.join(home, inputFileFull.slice(pat.length)) + last;
119119
}
120120
}
121121
{
122-
const pat = `%USERPROFILE%${path.sep}`;
122+
const pat = `%USERPROFILE%${path.SEPARATOR}`;
123123
if (
124124
home && inputFileFull.toUpperCase().startsWith(pat)
125125
) {
@@ -128,7 +128,9 @@ export class Source extends BaseSource<Params> {
128128
}
129129
{
130130
const pat = new RegExp(
131-
`^(?:\\$(?:env:)?(\\w+)|%(\\w+)%)${path.sep === "/" ? "/" : "\\\\"}`,
131+
`^(?:\\$(?:env:)?(\\w+)|%(\\w+)%)${
132+
path.SEPARATOR === "/" ? "/" : "\\\\"
133+
}`,
132134
"i",
133135
);
134136
const m = inputFileFull.match(pat);
@@ -147,7 +149,7 @@ export class Source extends BaseSource<Params> {
147149

148150
// e.g. '/home/ubuntu/config' for inputFileFull = '~/config/'
149151
// e.g. '/home/ubuntu' for inputFileFull = '~/config'
150-
const inputDirName = inputFileFullExpanded.endsWith(path.sep)
152+
const inputDirName = inputFileFullExpanded.endsWith(path.SEPARATOR)
151153
? inputFileFullExpanded
152154
: path.dirname(inputFileFullExpanded);
153155

@@ -253,7 +255,9 @@ export class Source extends BaseSource<Params> {
253255
}))
254256
.map(async (point) => ({
255257
point,
256-
ex: await existsDir(point.dir.replaceAll(path.sep, univPath.sep)),
258+
ex: await existsDir(
259+
point.dir.replaceAll(path.SEPARATOR, univPath.SEPARATOR),
260+
),
257261
})),
258262
);
259263

@@ -264,7 +268,7 @@ export class Source extends BaseSource<Params> {
264268
.map(
265269
async ({ dir, menu, max }) =>
266270
await wrapA(
267-
Deno.readDir(dir.replaceAll(path.sep, univPath.sep))
271+
Deno.readDir(dir.replaceAll(path.SEPARATOR, univPath.SEPARATOR))
268272
[Symbol.asyncIterator](),
269273
)
270274
.take(p.takeFileNum)
@@ -277,12 +281,12 @@ export class Source extends BaseSource<Params> {
277281
}))
278282
.map(({ name, isDirectory, isSymlink }): Item => ({
279283
word: name.slice(inputFileBasePrefix.length) +
280-
(p.trailingSlash && isDirectory ? path.sep : ""),
284+
(p.trailingSlash && isDirectory ? path.SEPARATOR : ""),
281285
abbr: name.slice(inputFileBasePrefix.length) +
282-
(p.trailingSlashAbbr && isDirectory ? path.sep : ""),
286+
(p.trailingSlashAbbr && isDirectory ? path.SEPARATOR : ""),
283287
menu: p.disableMenu
284288
? undefined
285-
: (menu !== "" && isInputAbs ? path.sep : "") + menu,
289+
: (menu !== "" && isInputAbs ? path.SEPARATOR : "") + menu,
286290
kind: isSymlink
287291
? p.followSymlinks
288292
? isDirectory ? p.displaySymDir : p.displaySymFile

0 commit comments

Comments
 (0)