Skip to content

Commit

Permalink
Merge pull request #7 from vim-denops/style-change
Browse files Browse the repository at this point in the history
Style change
  • Loading branch information
lambdalisue authored May 14, 2024
2 parents 9513372 + e13dae3 commit dae4ca5
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 14 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
name: test

on:
schedule:
- cron: "0 7 * * 0"
push:
paths:
- "**.md"
- "**.ts"
- ".github/workflows/test.yml"
- "deno.jsonc"
branches:
- main
pull_request:
paths:
- "**.md"
- "**.ts"
- ".github/workflows/test.yml"
- "deno.jsonc"
workflow_dispatch:

jobs:
check:
strategy:
matrix:
runner:
- ubuntu-latest
version:
deno_version:
- "1.x"
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: "${{ matrix.version }}"
deno-version: "${{ matrix.deno_version }}"
- name: Lint check
run: deno lint
- name: Format check
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🪐 denops_core

[![jsr](https://img.shields.io/jsr/v/%40denops/core?logo=javascript&logoColor=white)](https://jsr.io/@denops/core)
[![JSR](https://jsr.io/badges/@denops/core)](https://jsr.io/@denops/core)
[![denoland](https://img.shields.io/github/v/release/vim-denops/deno-denops-core?logo=deno&label=denoland)](https://deno.land/x/denops_core)
[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/denops_core/mod.ts)
[![test](https://github.com/vim-denops/deno-denops/workflows/test/badge.svg)](https://github.com/vim-denops/deno-denops/actions?query=workflow%3Atest)
Expand Down
12 changes: 9 additions & 3 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
"version": "0.0.0",
"exports": "./mod.ts",
"tasks": {
"test": "deno test -A --parallel --shuffle --doc --coverage=.coverage",
"check": "deno check ./**/*.ts",
"coverage": "deno coverage .coverage"
"check": "deno check **/*.ts",
"test": "deno test -A --parallel --shuffle --doc",
"test:coverage": "deno task test --coverage=.coverage",
"coverage": "deno coverage .coverage",
"update": "deno run --allow-env --allow-read --allow-write=. --allow-run=git,deno --allow-net=jsr.io,registry.npmjs.org jsr:@molt/cli ./*.ts",
"update:commit": "deno task -q update --commit --pre-commit=fmt,lint"
},
"imports": {
"https://deno.land/x/denops_core@$MODULE_VERSION/": "./"
}
}
15 changes: 15 additions & 0 deletions denops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,18 @@ export interface Denops {
*/
dispatch(name: string, fn: string, ...args: unknown[]): Promise<unknown>;
}

/**
* Denops's entrypoint definition.
*
* Use this type to ensure the `main` function is properly implemented like
*
* ```ts
* import type { Entrypoint } from "https://deno.land/x/denops_core@$MODULE_VERSION/mod.ts";
*
* export const main: Entrypoint = (denops) => {
* // ...
* }
* ```
*/
export type Entrypoint = (denops: Denops) => void | Promise<void>;
8 changes: 7 additions & 1 deletion mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@
*/

export { BatchError } from "./denops.ts";
export type { Context, Denops, Dispatcher, Meta } from "./denops.ts";
export type {
Context,
Denops,
Dispatcher,
Entrypoint,
Meta,
} from "./denops.ts";

0 comments on commit dae4ca5

Please sign in to comment.