Skip to content

Commit 562781b

Browse files
authored
Merge pull request #451 from vim-denops/use-import-map-in-denops-itself
Use import map in denops itself
2 parents 29e830d + af037ea commit 562781b

Some content is hidden

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

69 files changed

+230
-250
lines changed

autoload/denops/_internal/server/proc.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const s:SCRIPT = denops#_internal#path#script(['@denops-private', 'cli.ts'])
2+
const s:CONFIG = denops#_internal#path#script(['@denops-private', 'deno.jsonc'])
23

34
let s:job = v:null
45
let s:stopped_on_purpose = 0
@@ -47,6 +48,8 @@ function! s:start(options) abort
4748
let l:args = [g:denops#server#deno, 'run']
4849
let l:args += g:denops#server#deno_args
4950
let l:args += [
51+
\ '--config',
52+
\ s:CONFIG,
5053
\ s:SCRIPT,
5154
\ '--quiet',
5255
\ '--identity',

deno.jsonc

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
11
{
2+
"workspace": [
3+
"denops/@denops-private"
4+
],
25
"tasks": {
36
"check": "deno check **/*.ts",
47
"check:doc": "deno test --doc --no-run",
58
"test": "LANG=C deno test -A --parallel --shuffle",
69
"test:coverage": "deno task test --coverage=.coverage",
7-
"coverage": "deno coverage --exclude=\"test[.]ts(#.*)?$\" .coverage",
8-
// NOTE: `--ignore @std/internal` is required to preserve test fixture.
9-
"update": "deno run --allow-env --allow-read --allow-write --allow-run=git,deno --allow-net=jsr.io,registry.npmjs.org jsr:@molt/cli --no-lock --ignore @std/internal **/*.ts",
10-
"update:write": "deno task -q update --write",
11-
"update:commit": "deno task -q update --commit --prefix :package: --pre-commit=fmt,lint",
10+
"coverage": "deno coverage --exclude=\"test[.]ts(#.*)?$\" --exclude=\"/tests/\" --exclude=\"import_map_importer\" .coverage",
11+
"update": "deno outdated --update --latest --recursive",
12+
"update:interactive": "deno task update -- --interactive",
1213
"apply:supported-versions": "deno run --allow-read --allow-write .scripts/apply_supported_versions.ts"
1314
},
1415
"exclude": [
1516
".coverage/",
1617
"tests/denops/testdata/no_check/",
1718
"tests/denops/testdata/with_import_map/"
1819
],
19-
// NOTE: Import maps should only be used from test modules.
2020
"imports": {
2121
"/denops-private/": "./denops/@denops-private/",
2222
"/denops-testdata/": "./tests/denops/testdata/",
23-
"/denops-testutil/": "./tests/denops/testutil/"
23+
"/denops-testutil/": "./tests/denops/testutil/",
24+
"@core/asyncutil": "jsr:@core/asyncutil@^1.1.1",
25+
"@core/streamutil": "jsr:@core/streamutil@^1.0.0",
26+
"@denops/core": "jsr:@denops/core@^7.0.0",
27+
"@milly/streams": "jsr:@milly/streams@^1.0.0",
28+
"@nick/dispose": "jsr:@nick/dispose@^1.1.0",
29+
"@std/assert": "jsr:@std/assert@^1.0.1",
30+
"@std/async": "jsr:@std/async@^1.0.1",
31+
"@std/path": "jsr:@std/path@^1.0.2",
32+
"@std/testing": "jsr:@std/testing@^1.0.0",
33+
"sinon": "npm:sinon@^21.0.0"
2434
}
2535
}

denops/@denops-private/cli.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {
22
readableStreamFromWorker,
33
writableStreamFromWorker,
4-
} from "jsr:@lambdalisue/workerio@^4.0.1";
5-
import { deadline } from "jsr:@std/async@^1.0.1/deadline";
6-
import { parseArgs } from "jsr:@std/cli@^1.0.1/parse-args";
7-
import { asyncSignal } from "jsr:@milly/async-signal@^1.0.0";
4+
} from "@lambdalisue/workerio";
5+
import { deadline } from "@std/async/deadline";
6+
import { parseArgs } from "@std/cli/parse-args";
7+
import { asyncSignal } from "@milly/async-signal";
88

99
const WORKER_SCRIPT = import.meta.resolve("./worker.ts");
1010
const WORKER_CLOSE_TIMEOUT_MS = 5000;

denops/@denops-private/cli_test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// NOTE: Use sinon to stub the getter property.
22
// @deno-types="npm:@types/sinon@^17.0.3"
3-
import sinon from "npm:sinon@^21.0.0";
3+
import sinon from "sinon";
44

55
import {
66
assertEquals,
77
assertMatch,
88
assertNotMatch,
99
assertStringIncludes,
10-
} from "jsr:@std/assert@^1.0.1";
10+
} from "@std/assert";
1111
import {
1212
assertSpyCallArgs,
1313
assertSpyCalls,
@@ -16,10 +16,10 @@ import {
1616
spy,
1717
type Stub,
1818
stub,
19-
} from "jsr:@std/testing@^1.0.0/mock";
20-
import { FakeTime } from "jsr:@std/testing@^1.0.0/time";
21-
import { delay } from "jsr:@std/async@^1.0.1/delay";
22-
import { flushPromises, peekPromiseState } from "jsr:@core/asyncutil@^1.1.1";
19+
} from "@std/testing/mock";
20+
import { FakeTime } from "@std/testing/time";
21+
import { delay } from "@std/async/delay";
22+
import { flushPromises, peekPromiseState } from "@core/asyncutil";
2323
import {
2424
createFakeTcpConn,
2525
createFakeTcpListener,

denops/@denops-private/deno.jsonc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"imports": {
3+
"@core/asyncutil": "jsr:@core/asyncutil@^1.1.1",
4+
"@core/errorutil": "jsr:@core/errorutil@^1.2.1",
5+
"@core/unknownutil": "jsr:@core/unknownutil@^4.0.0",
6+
"@denops/core": "jsr:@denops/core@^7.0.0",
7+
"@denops/vim-channel-command": "jsr:@denops/vim-channel-command@^4.0.2",
8+
"@lambdalisue/import-map-importer": "jsr:@lambdalisue/import-map-importer@^0.4.0",
9+
"@lambdalisue/messagepack": "jsr:@lambdalisue/messagepack@^1.0.1",
10+
"@lambdalisue/messagepack-rpc": "jsr:@lambdalisue/messagepack-rpc@^2.4.1",
11+
"@lambdalisue/workerio": "jsr:@lambdalisue/workerio@^4.0.1",
12+
"@milly/async-signal": "jsr:@milly/async-signal@^1.0.0",
13+
"@nick/dispose": "jsr:@nick/dispose@^1.1.0",
14+
"@std/async": "jsr:@std/async@^1.0.1",
15+
"@std/cli": "jsr:@std/cli@^1.0.1",
16+
"@std/path": "jsr:@std/path@^1.0.2",
17+
"@std/semver": "jsr:@std/semver@^1.0.1"
18+
}
19+
}

denops/@denops-private/denops.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import {
44
type Denops,
55
type Dispatcher,
66
type Meta,
7-
} from "jsr:@denops/core@^7.0.0";
8-
import { ensure } from "jsr:@core/unknownutil@^4.0.0/ensure";
9-
import { isTupleOf } from "jsr:@core/unknownutil@^4.0.0/is/tuple-of";
10-
import { isArray } from "jsr:@core/unknownutil@^4.0.0/is/array";
11-
import { isString } from "jsr:@core/unknownutil@^4.0.0/is/string";
7+
} from "@denops/core";
8+
import { ensure } from "@core/unknownutil/ensure";
9+
import { isTupleOf } from "@core/unknownutil/is/tuple-of";
10+
import { isArray } from "@core/unknownutil/is/array";
11+
import { isString } from "@core/unknownutil/is/string";
1212
import type { Host as HostOrigin } from "./host.ts";
1313
import type { Service as ServiceOrigin } from "./service.ts";
1414

denops/@denops-private/denops_test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BatchError, type Meta } from "jsr:@denops/core@^7.0.0";
1+
import { BatchError, type Meta } from "@denops/core";
22
import {
33
assert,
44
assertEquals,
@@ -7,14 +7,14 @@ import {
77
assertRejects,
88
assertStrictEquals,
99
unimplemented,
10-
} from "jsr:@std/assert@^1.0.1";
10+
} from "@std/assert";
1111
import {
1212
assertSpyCallArgs,
1313
assertSpyCalls,
1414
resolvesNext,
1515
stub,
16-
} from "jsr:@std/testing@^1.0.0/mock";
17-
import { flushPromises, peekPromiseState } from "jsr:@core/asyncutil@^1.1.1";
16+
} from "@std/testing/mock";
17+
import { flushPromises, peekPromiseState } from "@core/asyncutil";
1818
import { DenopsImpl, type Host, type Service } from "./denops.ts";
1919

2020
type BatchReturn = [results: unknown[], errmsg: string];

denops/@denops-private/error.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { isString } from "jsr:@core/unknownutil@^4.0.0/is/string";
1+
import { isString } from "@core/unknownutil/is/string";
22
import {
33
fromErrorObject,
44
isErrorObject,
55
toErrorObject,
66
tryOr,
7-
} from "jsr:@core/errorutil@^1.2.1";
7+
} from "@core/errorutil";
88

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

denops/@denops-private/error_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { assert, assertEquals, assertInstanceOf } from "jsr:@std/assert@^1.0.1";
2-
import { isString } from "jsr:@core/unknownutil@^4.0.0/is/string";
1+
import { assert, assertEquals, assertInstanceOf } from "@std/assert";
2+
import { isString } from "@core/unknownutil/is/string";
33
import { errorDeserializer, errorSerializer } from "./error.ts";
44

55
Deno.test("errorSerializer", async (t) => {

denops/@denops-private/host.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import type { Predicate } from "jsr:@core/unknownutil@^4.0.0/type";
2-
import { ensure } from "jsr:@core/unknownutil@^4.0.0/ensure";
3-
import { asOptional } from "jsr:@core/unknownutil@^4.0.0/as/optional";
4-
import { isArray } from "jsr:@core/unknownutil@^4.0.0/is/array";
5-
import { isParametersOf } from "jsr:@core/unknownutil@^4.0.0/is/parameters-of";
6-
import { isString } from "jsr:@core/unknownutil@^4.0.0/is/string";
7-
import { isUnknown } from "jsr:@core/unknownutil@^4.0.0/is/unknown";
1+
import type { Predicate } from "@core/unknownutil/type";
2+
import { ensure } from "@core/unknownutil/ensure";
3+
import { asOptional } from "@core/unknownutil/as/optional";
4+
import { isArray } from "@core/unknownutil/is/array";
5+
import { isParametersOf } from "@core/unknownutil/is/parameters-of";
6+
import { isString } from "@core/unknownutil/is/string";
7+
import { isUnknown } from "@core/unknownutil/is/unknown";
88

99
/**
1010
* Host (Vim/Neovim) which is visible from Service

0 commit comments

Comments
 (0)