Skip to content

Commit 6ada79d

Browse files
committed
💥 Use JSR imports intead of URL imports
1 parent b72b872 commit 6ada79d

Some content is hidden

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

96 files changed

+415
-417
lines changed

.scripts/gen-function/format.ts

+2-2
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/[email protected]/mod.ts";
3+
const denops = "@denops/core";
44

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

.scripts/gen-function/gen-function.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import {
2-
difference,
3-
intersection,
4-
} from "https://deno.land/x/[email protected]/mod.ts";
5-
import * as path from "https://deno.land/[email protected]/path/mod.ts";
1+
import { difference, intersection } from "@lambdalisue/set-operations";
2+
import * as path from "@std/path";
63
import { parse } from "./parse.ts";
74
import { format } from "./format.ts";
85
import { DOCS_OVERRIDES } from "./override.ts";

.scripts/gen-function/override.ts

+1-1
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

+1-1
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

+1-1
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/[email protected]/mod.ts";
3+
const denops = "@denops/core";
44

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

.scripts/gen-option/gen-option.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import {
2-
difference,
3-
intersection,
4-
} from "https://deno.land/x/[email protected]/mod.ts";
5-
import * as path from "https://deno.land/[email protected]/path/mod.ts";
1+
import { difference, intersection } from "@lambdalisue/set-operations";
2+
import * as path from "@std/path";
63
import { parse } from "./parse.ts";
74
import { format } from "./format.ts";
85
import { DOCS_OVERRIDES } from "./override.ts";

.scripts/gen-option/override.ts

+1-1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts";
1+
import { assertEquals } from "@std/assert";
22

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

.scripts/transform.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import {
2-
fromFileUrl,
3-
toFileUrl,
4-
} from "https://deno.land/[email protected]/path/mod.ts";
5-
import { intersection } from "https://deno.land/x/[email protected]/mod.ts";
1+
import { fromFileUrl, toFileUrl } from "@std/path";
2+
import { intersection } from "@lambdalisue/set-operations";
63

74
interface ModuleInformation {
85
sourcePath: string;

.scripts/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as streams from "https://deno.land/[email protected]/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

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

99
import {
1010
Counter,

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ assumed to be called in a dedicated worker thread.
1616
By using this module, developers can write Vim/Neovim denops plugins like:
1717

1818
```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";
19+
import type { Denops } from "jsr:@denops/std";
20+
import * as batch from "jsr:@denops/std/batch";
21+
import * as fn from "jsr:@denops/std/function";
22+
import * as vars from "jsr:@denops/std/variable";
23+
import * as helper from "jsr:@denops/std/helper";
2424

25-
import { assert, is } from "https://deno.land/x/[email protected]/mod.ts";
25+
import { assert, is } from "jsr:@core/unknownutil";
2626

2727
export function main(denops: Denops): void {
2828
denops.dispatcher = {

argument/flags.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const shortPattern = /^-([a-zA-Z0-9])(.*)/;
99
* Parse string array to extract flags (-f/--flag).
1010
*
1111
* ```typescript
12-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
13-
* import { parseFlags } from "https://deno.land/x/denops_std@$MODULE_VERSION/argument/mod.ts";
12+
* import type { Entrypoint } from "jsr:@denops/std";
13+
* import { parseFlags } from "jsr:@denops/std/argument";
1414
*
1515
* export const main: Entrypoint = async (denops) => {
1616
* const args = [
@@ -66,8 +66,8 @@ export function parseFlags(args: string[]): [Flags, string[]] {
6666
* Validate if `flags` has unknown attributes.
6767
*
6868
* ```typescript
69-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
70-
* import { parse, validateFlags } from "https://deno.land/x/denops_std@$MODULE_VERSION/argument/mod.ts";
69+
* import type { Entrypoint } from "jsr:@denops/std";
70+
* import { parse, validateFlags } from "jsr:@denops/std/argument";
7171
*
7272
* export const main: Entrypoint = async (denops) => {
7373
* const args = [
@@ -102,8 +102,8 @@ export function validateFlags(flags: Flags, knownAttributes: string[]): void {
102102
* Format `key` and `value` to construct string array.
103103
*
104104
* ```typescript
105-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
106-
* import { formatFlag } from "https://deno.land/x/denops_std@$MODULE_VERSION/argument/mod.ts";
105+
* import type { Entrypoint } from "jsr:@denops/std";
106+
* import { formatFlag } from "jsr:@denops/std/argument";
107107
*
108108
* export const main: Entrypoint = async (denops) => {
109109
* console.log(formatFlag("f", ""));
@@ -133,8 +133,8 @@ export function formatFlag(
133133
* Format `flags` to construct string array.
134134
*
135135
* ```typescript
136-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
137-
* import { formatFlags, parse } from "https://deno.land/x/denops_std@$MODULE_VERSION/argument/mod.ts";
136+
* import type { Entrypoint } from "jsr:@denops/std";
137+
* import { formatFlags, parse } from "jsr:@denops/std/argument";
138138
*
139139
* export const main: Entrypoint = async (denops) => {
140140
* const args = [

argument/flags_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts";
1+
import { assertEquals } from "@std/assert";
22
import { parseFlags } from "./flags.ts";
33

44
Deno.test("parseFlags", () => {

argument/mod.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
* Then, developers can use this module to parse, validate, or format the arguments.
1818
*
1919
* ```typescript
20-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
20+
* import type { Entrypoint } from "jsr:@denops/std";
2121
* import {
2222
* builtinOpts,
2323
* formatFlags,
2424
* formatOpts,
2525
* parse,
2626
* validateFlags,
2727
* validateOpts,
28-
* } from "https://deno.land/x/denops_std@$MODULE_VERSION/argument/mod.ts";
28+
* } from "jsr:@denops/std/argument";
2929
*
3030
* export const main: Entrypoint = async (denops) => {
3131
* denops.dispatcher = {
@@ -63,15 +63,15 @@
6363
*
6464
* @module
6565
*/
66-
import { Opts, parseOpts } from "./opts.ts";
67-
import { Flags, parseFlags } from "./flags.ts";
66+
import { type Opts, parseOpts } from "./opts.ts";
67+
import { type Flags, parseFlags } from "./flags.ts";
6868

6969
/**
7070
* Parse string array to extract opts, flags.
7171
*
7272
* ```typescript
73-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
74-
* import { parse } from "https://deno.land/x/denops_std@$MODULE_VERSION/argument/mod.ts";
73+
* import type { Entrypoint } from "jsr:@denops/std";
74+
* import { parse } from "jsr:@denops/std/argument";
7575
*
7676
* export const main: Entrypoint = async (denops) => {
7777
* const args = [

argument/mod_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts";
1+
import { assertEquals } from "@std/assert";
22
import { parse } from "./mod.ts";
33

44
Deno.test("parse", () => {

argument/opts.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const optPattern = /^\+\+([a-zA-Z0-9-]+)(?:=(.*))?/;
2424
* Parse string array to extract opts (++opt).
2525
*
2626
* ```typescript
27-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
28-
* import { parseOpts } from "https://deno.land/x/denops_std@$MODULE_VERSION/argument/mod.ts";
27+
* import type { Entrypoint } from "jsr:@denops/std";
28+
* import { parseOpts } from "jsr:@denops/std/argument";
2929
*
3030
* export const main: Entrypoint = async (denops) => {
3131
* const args = [
@@ -77,8 +77,8 @@ export function parseOpts(args: string[]): [Opts, string[]] {
7777
* Validate if `opts` has unknown attributes.
7878
*
7979
* ```typescript
80-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
81-
* import { builtinOpts, parse, validateOpts } from "https://deno.land/x/denops_std@$MODULE_VERSION/argument/mod.ts";
80+
* import type { Entrypoint } from "jsr:@denops/std";
81+
* import { builtinOpts, parse, validateOpts } from "jsr:@denops/std/argument";
8282
*
8383
* export const main: Entrypoint = async (denops) => {
8484
* const args = [
@@ -112,8 +112,8 @@ export function validateOpts(opts: Opts, knownAttributes: string[]): void {
112112
* Format `key` and `value` to construct string array.
113113
*
114114
* ```typescript
115-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
116-
* import { formatOpt } from "https://deno.land/x/denops_std@$MODULE_VERSION/argument/mod.ts";
115+
* import type { Entrypoint } from "jsr:@denops/std";
116+
* import { formatOpt } from "jsr:@denops/std/argument";
117117
*
118118
* export const main: Entrypoint = async (denops) => {
119119
* console.log(formatOpt("enc", "sjis"));
@@ -132,8 +132,8 @@ export function formatOpt(key: string, value: string | undefined): string[] {
132132
* Format `opts` to construct string array.
133133
*
134134
* ```typescript
135-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
136-
* import { formatOpts, parse } from "https://deno.land/x/denops_std@$MODULE_VERSION/argument/mod.ts";
135+
* import type { Entrypoint } from "jsr:@denops/std";
136+
* import { formatOpts, parse } from "jsr:@denops/std/argument";
137137
*
138138
* export const main: Entrypoint = async (denops) => {
139139
* const args = [

argument/opts_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts";
1+
import { assertEquals } from "@std/assert";
22
import { parseOpts } from "./opts.ts";
33

44
Deno.test("parseOpts", () => {

autocmd/_utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AutocmdEvent, DefineOptions, RemoveOptions } from "./types.ts";
1+
import type { AutocmdEvent, DefineOptions, RemoveOptions } from "./types.ts";
22

33
export function buildDefineExpr(
44
event: AutocmdEvent | AutocmdEvent[],

autocmd/common.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { Denops } from "../mod.ts";
2-
import {
1+
import type { Denops } from "@denops/core";
2+
import type {
33
AutocmdEvent,
44
DefineOptions,
55
EmitOptions,
@@ -12,8 +12,8 @@ import { buildDefineExpr, buildRemoveExpr } from "./_utils.ts";
1212
* Define an autocmd
1313
*
1414
* ```typescript
15-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
16-
* import * as autocmd from "https://deno.land/x/denops_std@$MODULE_VERSION/autocmd/mod.ts";
15+
* import type { Entrypoint } from "jsr:@denops/std";
16+
* import * as autocmd from "jsr:@denops/std/autocmd";
1717
*
1818
* export const main: Entrypoint = async (denops) => {
1919
* // Define new autocmd for BufEnter
@@ -54,8 +54,8 @@ export async function define(
5454
* Remove an autocmd
5555
*
5656
* ```typescript
57-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
58-
* import * as autocmd from "https://deno.land/x/denops_std@$MODULE_VERSION/autocmd/mod.ts";
57+
* import type { Entrypoint } from "jsr:@denops/std";
58+
* import * as autocmd from "jsr:@denops/std/autocmd";
5959
*
6060
* export const main: Entrypoint = async (denops) => {
6161
* // Remove BufEnter autocmd
@@ -88,8 +88,8 @@ export async function remove(
8888
* List defined autocmds
8989
*
9090
* ```typescript
91-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
92-
* import * as autocmd from "https://deno.land/x/denops_std@$MODULE_VERSION/autocmd/mod.ts";
91+
* import type { Entrypoint } from "jsr:@denops/std";
92+
* import * as autocmd from "jsr:@denops/std/autocmd";
9393
*
9494
* export const main: Entrypoint = async (denops) => {
9595
* // List all autocmd
@@ -138,8 +138,8 @@ export async function list(
138138
* Emit an autocmd in a buffer
139139
*
140140
* ```typescript
141-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
142-
* import * as autocmd from "https://deno.land/x/denops_std@$MODULE_VERSION/autocmd/mod.ts";
141+
* import type { Entrypoint } from "jsr:@denops/std";
142+
* import * as autocmd from "jsr:@denops/std/autocmd";
143143
*
144144
* export const main: Entrypoint = async (denops) => {
145145
* // Emit an autocmd in a current buffer
@@ -182,8 +182,8 @@ export async function emit(
182182
* Emit an autocmd in all buffers
183183
*
184184
* ```typescript
185-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
186-
* import * as autocmd from "https://deno.land/x/denops_std@$MODULE_VERSION/autocmd/mod.ts";
185+
* import type { Entrypoint } from "jsr:@denops/std";
186+
* import * as autocmd from "jsr:@denops/std/autocmd";
187187
*
188188
* export const main: Entrypoint = async (denops) => {
189189
* // Emit an autocmd in all buffers

autocmd/common_test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts";
2-
import { test } from "https://deno.land/x/[email protected]/mod.ts";
1+
import { assertEquals } from "@std/assert";
2+
import { test } from "@denops/test";
33
import { globals } from "../variable/mod.ts";
44
import { define, emit, emitAll, list, remove } from "./common.ts";
55

autocmd/group.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { Denops } from "../mod.ts";
1+
import type { Denops } from "@denops/core";
22
import { execute } from "../helper/execute.ts";
3-
import { AutocmdEvent, DefineOptions, RemoveOptions } from "./types.ts";
3+
import type { AutocmdEvent, DefineOptions, RemoveOptions } from "./types.ts";
44
import { buildDefineExpr, buildRemoveExpr } from "./_utils.ts";
55

66
export type GroupDefineOptions = Omit<DefineOptions, "group">;
@@ -10,8 +10,8 @@ export type GroupRemoveOptions = Omit<RemoveOptions, "group">;
1010
* Create an autocmd group and define/remove autocmds in that group.
1111
*
1212
* ```typescript
13-
* import type { Entrypoint } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
14-
* import { group } from "https://deno.land/x/denops_std@$MODULE_VERSION/autocmd/mod.ts";
13+
* import type { Entrypoint } from "jsr:@denops/std";
14+
* import { group } from "jsr:@denops/std/autocmd";
1515
*
1616
* export const main: Entrypoint = async (denops) => {
1717
* await group(denops, "my-autocmd", (helper) => {

autocmd/group_test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts";
2-
import { test } from "https://deno.land/x/[email protected]/mod.ts";
1+
import { assertEquals } from "@std/assert";
2+
import { test } from "@denops/test";
33
import { globals } from "../variable/mod.ts";
44
import { group } from "./group.ts";
55

0 commit comments

Comments
 (0)