Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to JSR #28

Merged
merged 14 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/jsr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: jsr

env:
DENO_VERSION: 1.x

on:
push:
tags:
- "v*"

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VERSION }}
- name: Publish
run: |
deno run -A jsr:@david/publish-on-tag@0.1.3

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ NOTE: To install plugins from remote, you need to install

### Requirements

Dpp.vim requires both Deno 1.42+ and denops.vim.
Please install both Deno 1.45+ and "denops.vim" v7.0+.

- <https://deno.land/>
- <https://github.com/vim-denops/denops.vim>
Expand Down
17 changes: 17 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
{
"name": "@shougo/dpp-vim",
"version": "0.0.0",
"exports": {
"./config": "./denops/dpp/base/config.ts",
"./ext": "./denops/dpp/base/ext.ts",
"./protocol": "./denops/dpp/base/protocol.ts",
"./types": "./denops/dpp/types.ts",
"./utils": "./denops/dpp/utils.ts"
},
"publish": {
"include": [
"denops/dpp/**/*.ts"
]
},
"imports": {
},
"lock": false,
"tasks": {
"check": "deno check denops/**/*.ts",
"lint": "deno lint denops",
"lint-fix": "deno lint --fix denops",
"fmt": "deno fmt denops",
"test": "deno test -A --doc --parallel --shuffle denops/**/*.ts",
"upgrade": "deno run -A jsr:@molt/cli **/*.ts --no-resolve --write"
Expand Down
15 changes: 8 additions & 7 deletions denops/@ddu-sources/dpp.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import {
ActionArguments,
ActionFlags,
type ActionArguments,
type ActionFlags,
BaseSource,
Item,
} from "https://deno.land/x/ddu_vim@v4.2.0/types.ts";
import { Denops, vars } from "https://deno.land/x/ddu_vim@v4.2.0/deps.ts";
import { ActionData } from "https://deno.land/x/ddu_kind_file@v0.7.1/file.ts";
import { Plugin } from "../dpp/types.ts";
type Item,
} from "jsr:@shougo/ddu-vim@5.0.0-pre8/types";
import type { ActionData } from "jsr:@shougo/ddu-kind-file@0.8.0-pre1";

import type { Denops, Plugin } from "../dpp/types.ts";
import { vars } from "../dpp/deps.ts";

type Params = {
names: string[];
Expand Down
11 changes: 9 additions & 2 deletions denops/dpp/app.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { Denops, ensure, Entrypoint, is, toFileUrl, vars } from "./deps.ts";
import {
type Denops,
ensure,
type Entrypoint,
is,
toFileUrl,
vars,
} from "./deps.ts";
import { ContextBuilder } from "./context.ts";
import { Dpp } from "./dpp.ts";
import { DppOptions } from "./types.ts";
import type { DppOptions } from "./types.ts";
import { Loader } from "./loader.ts";
import { extAction } from "./ext.ts";

Expand Down
6 changes: 3 additions & 3 deletions denops/dpp/base/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ContextBuilder } from "../context.ts";
import { Denops } from "../deps.ts";
import { Dpp, Plugin } from "../types.ts";
import type { ContextBuilder } from "../context.ts";
import type { Denops } from "../deps.ts";
import type { Dpp, Plugin } from "../types.ts";

export type ConfigArguments = {
basePath: string;
Expand Down
6 changes: 3 additions & 3 deletions denops/dpp/base/ext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Denops } from "../deps.ts";
import { Actions, ExtOptions } from "../types.ts";
import type { Denops } from "../deps.ts";
import type { Actions, ExtOptions } from "../types.ts";

export type BaseExtParams = Record<string, unknown>;

Expand All @@ -20,7 +20,7 @@ export abstract class BaseExt<Params extends BaseExtParams> {

abstract params(): Params;

actions: Actions<Params> = {};
abstract actions: Actions<Params>;
}

export function defaultExtOptions(): ExtOptions {
Expand Down
4 changes: 2 additions & 2 deletions denops/dpp/base/protocol.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Denops } from "../deps.ts";
import { Plugin, ProtocolOptions } from "../types.ts";
import type { Denops } from "../deps.ts";
import type { Plugin, ProtocolOptions } from "../types.ts";

export type BaseProtocolParams = Record<string, unknown>;

Expand Down
4 changes: 2 additions & 2 deletions denops/dpp/context.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Denops } from "./deps.ts";
import {
import type { Denops } from "./deps.ts";
import type {
BaseExtParams,
BaseProtocolParams,
Context,
Expand Down
27 changes: 9 additions & 18 deletions denops/dpp/deps.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
export type {
Denops,
Entrypoint,
} from "https://deno.land/x/denops_std@v6.5.1/mod.ts";
export {
echo,
execute,
} from "https://deno.land/x/denops_std@v6.5.1/helper/mod.ts";
export {
batch,
collect,
} from "https://deno.land/x/denops_std@v6.5.1/batch/mod.ts";
export * as op from "https://deno.land/x/denops_std@v6.5.1/option/mod.ts";
export * as fn from "https://deno.land/x/denops_std@v6.5.1/function/mod.ts";
export * as vars from "https://deno.land/x/denops_std@v6.5.1/variable/mod.ts";
export * as autocmd from "https://deno.land/x/denops_std@v6.5.1/autocmd/mod.ts";
export type { Denops, Entrypoint } from "jsr:@denops/std@7.0.0";
export { echo, execute } from "jsr:@denops/std@7.0.0/helper";
export { batch, collect } from "jsr:@denops/std@7.0.0/batch";
export * as op from "jsr:@denops/std@7.0.0/option";
export * as fn from "jsr:@denops/std@7.0.0/function";
export * as vars from "jsr:@denops/std@7.0.0/variable";
export * as autocmd from "jsr:@denops/std@7.0.0/autocmd";

export { assertEquals, assertInstanceOf, equal } from "jsr:@std/assert@1.0.0";
export { assertEquals, assertInstanceOf, equal } from "jsr:@std/assert@1.0.1";
export {
basename,
dirname,
Expand All @@ -24,7 +15,7 @@ export {
parse,
SEPARATOR as pathsep,
toFileUrl,
} from "jsr:@std/path@1.0.1";
} from "jsr:@std/path@1.0.2";

export { Lock } from "jsr:@lambdalisue/async@2.1.1";
export { ensure, is } from "jsr:@core/unknownutil@3.18.1";
8 changes: 4 additions & 4 deletions denops/dpp/dpp.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
assertEquals,
Denops,
type Denops,
dirname,
extname,
fn,
is,
join,
vars,
} from "./deps.ts";
import {
import type {
ActionName,
Context,
DppOptions,
Expand All @@ -17,8 +17,8 @@ import {
Protocol,
ProtocolName,
} from "./types.ts";
import { Loader } from "./loader.ts";
import { ConfigReturn } from "./base/config.ts";
import type { Loader } from "./loader.ts";
import type { ConfigReturn } from "./base/config.ts";
import { extAction, getProtocols } from "./ext.ts";
import {
convert2List,
Expand Down
6 changes: 3 additions & 3 deletions denops/dpp/ext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Denops, fn } from "./deps.ts";
import {
import { type Denops, fn } from "./deps.ts";
import type {
ActionName,
BaseExt,
BaseExtParams,
Expand All @@ -21,7 +21,7 @@ import {
mergeProtocolOptions,
mergeProtocolParams,
} from "./context.ts";
import { Loader } from "./loader.ts";
import type { Loader } from "./loader.ts";
import { defaultExtOptions } from "./base/ext.ts";
import { defaultProtocolOptions } from "./base/protocol.ts";
import { printError } from "./utils.ts";
Expand Down
12 changes: 10 additions & 2 deletions denops/dpp/loader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
BaseExt,
BaseExtParams,
BaseProtocol,
Expand All @@ -7,7 +7,15 @@ import {
ExtName,
ProtocolName,
} from "./types.ts";
import { basename, Denops, fn, Lock, op, parse, toFileUrl } from "./deps.ts";
import {
basename,
type Denops,
fn,
Lock,
op,
parse,
toFileUrl,
} from "./deps.ts";

type Mod = {
// deno-lint-ignore no-explicit-any
Expand Down
7 changes: 4 additions & 3 deletions denops/dpp/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BaseExtParams } from "./base/ext.ts";
import { BaseProtocol, BaseProtocolParams } from "./base/protocol.ts";
import { Denops } from "./deps.ts";
import type { BaseExtParams } from "./base/ext.ts";
import type { BaseProtocol, BaseProtocolParams } from "./base/protocol.ts";
import type { Denops } from "./deps.ts";

export { BaseConfig } from "./base/config.ts";
export type {
Expand All @@ -16,6 +16,7 @@ export type { BaseProtocolParams, Command } from "./base/protocol.ts";
export { ContextBuilder } from "./context.ts";

export { Dpp } from "./dpp.ts";
export type { Denops } from "./deps.ts";

export type DppExtType = "ext" | "protocol";

Expand Down
6 changes: 3 additions & 3 deletions denops/dpp/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assertEquals, Denops, is, join } from "./deps.ts";
import { Plugin } from "./types.ts";
import { assertEquals, type Denops, is, join } from "./deps.ts";
import type { Plugin } from "./types.ts";

export async function printError(
denops: Denops,
Expand All @@ -22,7 +22,7 @@ export function convert2List<T>(expr: T | T[] | undefined): T[] {
return !expr ? [] : is.Array(expr) ? expr : [expr];
}

export async function isDirectory(path: string | undefined) {
export async function isDirectory(path: string | undefined): Promise<boolean> {
if (!path) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion doc/dpp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ INSTALL *dpp-install*
NOTE: dpp.vim requires Neovim (0.10.0+) or Vim 9.0.1276+ (latest is
recommended).

Please install both Deno 1.42+ and "denops.vim".
Please install both Deno 1.45+ and "denops.vim" v7.0+.

https://deno.land/
https://github.com/vim-denops/denops.vim
Expand Down