Skip to content

Commit c5e1836

Browse files
committed
style: Apply deno fmt to fix formatting issues
- Fix trailing whitespace in markdown files - Ensure consistent line breaks - Format JSON code blocks properly
1 parent 79eec8d commit c5e1836

File tree

6 files changed

+53
-27
lines changed

6 files changed

+53
-27
lines changed

src/getting-started/README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Let's start by creating a simple plugin to learn how to develop Denops plugins.
88

99
## Create a Plugin
1010

11-
Create a directory named `denops-getting-started` in your home directory with the following structure:
11+
Create a directory named `denops-getting-started` in your home directory with
12+
the following structure:
1213

1314
```
1415
$HOME
@@ -33,10 +34,11 @@ First, create a root `deno.jsonc` file for development configuration:
3334
> [!TIP]
3435
>
3536
> The root `deno.jsonc` is for development purposes. It enables commands like
36-
> `deno fmt`, `deno lint`, and `deno test` to work from your project root.
37-
> You can add development-specific settings here without affecting runtime.
37+
> `deno fmt`, `deno lint`, and `deno test` to work from your project root. You
38+
> can add development-specific settings here without affecting runtime.
3839
39-
Then, create a `deno.jsonc` file inside `denops/denops-getting-started/` for runtime dependencies:
40+
Then, create a `deno.jsonc` file inside `denops/denops-getting-started/` for
41+
runtime dependencies:
4042

4143
```json,title=denops/denops-getting-started/deno.jsonc
4244
{
@@ -48,11 +50,12 @@ Then, create a `deno.jsonc` file inside `denops/denops-getting-started/` for run
4850

4951
> [!NOTE]
5052
>
51-
> Import map support (both `deno.json` imports and `import_map.json`) requires
53+
> Import map support (both `deno.json` imports and `import_map.json`) requires
5254
> Denops v8.0.0 or later. Denops supports multiple configuration formats:
55+
>
5356
> - `deno.json` and `deno.jsonc` (recommended)
5457
> - `import_map.json` and `import_map.jsonc` (also supported)
55-
>
58+
>
5659
> We use `deno.jsonc` in examples as it allows comments and requires less
5760
> verbose configuration than import maps.
5861
@@ -73,9 +76,11 @@ export const main: Entrypoint = (denops) => {
7376
> [!IMPORTANT]
7477
>
7578
> We separate development configuration from runtime dependencies:
76-
> - **Root `deno.jsonc`**: Contains workspace configuration for development tools
79+
>
80+
> - **Root `deno.jsonc`**: Contains workspace configuration for development
81+
> tools
7782
> - **Plugin `deno.jsonc`**: Contains import maps for runtime dependencies
78-
>
83+
>
7984
> This separation is crucial because the root `deno.jsonc` is only used during
8085
> development, while the plugin-specific `deno.jsonc` is what Denops uses at
8186
> runtime to resolve imports.

src/getting-started/explanation.md

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -242,19 +242,28 @@ auto-completion and type checking provided by LSP (Language Server Protocol).
242242
> Denops v8.0.0 or later. For older versions, use direct URL imports in your
243243
> TypeScript files.
244244
245-
While the examples above use direct URL imports, the recommended approach for Denops plugins is to separate development configuration from runtime dependencies:
246-
247-
- **Development configuration**: The root `deno.jsonc` with workspace settings enables development tools (`deno lint`, `deno fmt`, etc.) to work from the project root
248-
- **Runtime dependencies**: The plugin-specific `deno.jsonc` contains only the import map needed at runtime
249-
- **No conflicts**: Since each Denops plugin has a unique directory under `denops/`, their configuration files never conflict when installed
250-
- **Clean separation**: Development tools configuration stays in the repository root, while runtime dependencies are isolated per plugin
251-
- **Flexible format**: Both `deno.json` and `deno.jsonc` are supported, but `deno.jsonc` is recommended for its comment support
245+
While the examples above use direct URL imports, the recommended approach for
246+
Denops plugins is to separate development configuration from runtime
247+
dependencies:
248+
249+
- **Development configuration**: The root `deno.jsonc` with workspace settings
250+
enables development tools (`deno lint`, `deno fmt`, etc.) to work from the
251+
project root
252+
- **Runtime dependencies**: The plugin-specific `deno.jsonc` contains only the
253+
import map needed at runtime
254+
- **No conflicts**: Since each Denops plugin has a unique directory under
255+
`denops/`, their configuration files never conflict when installed
256+
- **Clean separation**: Development tools configuration stays in the repository
257+
root, while runtime dependencies are isolated per plugin
258+
- **Flexible format**: Both `deno.json` and `deno.jsonc` are supported, but
259+
`deno.jsonc` is recommended for its comment support
252260

253261
### Separation of Development and Runtime Configuration
254262

255263
The workspace pattern serves two distinct purposes:
256264

257-
1. **Development Time**: The root `deno.jsonc` enables development commands to work properly:
265+
1. **Development Time**: The root `deno.jsonc` enables development commands to
266+
work properly:
258267
```json
259268
{
260269
"workspace": [
@@ -271,7 +280,8 @@ The workspace pattern serves two distinct purposes:
271280
}
272281
```
273282

274-
2. **Runtime**: The plugin's `deno.jsonc` contains only what's needed for execution:
283+
2. **Runtime**: The plugin's `deno.jsonc` contains only what's needed for
284+
execution:
275285
```json
276286
{
277287
"imports": {
@@ -282,7 +292,9 @@ The workspace pattern serves two distinct purposes:
282292

283293
### Why This Separation Matters
284294

285-
When Vim/Neovim loads plugins, it merges all plugin directories into the runtime path. If runtime dependencies were in the root configuration file, they would conflict:
295+
When Vim/Neovim loads plugins, it merges all plugin directories into the runtime
296+
path. If runtime dependencies were in the root configuration file, they would
297+
conflict:
286298

287299
```
288300
# After installation, plugins are merged:
@@ -338,13 +350,15 @@ When Vim/Neovim loads plugins, it merges all plugin directories into the runtime
338350
```
339351

340352
This separation ensures:
353+
341354
- Development tools like `deno fmt` and `deno lint` work from your project root
342355
- Runtime dependencies are properly resolved when the plugin is installed
343356
- No conflicts occur between multiple installed Denops plugins
344357

345358
### Alternative: Using import_map.json(c)
346359

347-
While the examples above use `deno.jsonc`, Denops also supports `import_map.json(c)` files in the plugin directory:
360+
While the examples above use `deno.jsonc`, Denops also supports
361+
`import_map.json(c)` files in the plugin directory:
348362

349363
```
350364
denops/your-plugin-name/
@@ -354,12 +368,13 @@ denops/your-plugin-name/
354368

355369
However, there are important differences:
356370

357-
1. **Import Maps Standard** (import_map.json) requires both entries for submodules:
371+
1. **Import Maps Standard** (import_map.json) requires both entries for
372+
submodules:
358373
```json
359374
{
360375
"imports": {
361376
"@denops/std": "jsr:@denops/std@^7.0.0",
362-
"@denops/std/": "jsr:@denops/std@^7.0.0/" // Required for submodules
377+
"@denops/std/": "jsr:@denops/std@^7.0.0/" // Required for submodules
363378
}
364379
}
365380
```
@@ -368,14 +383,15 @@ However, there are important differences:
368383
```json
369384
{
370385
"imports": {
371-
"@denops/std": "jsr:@denops/std@^7.0.0" // Handles both cases
386+
"@denops/std": "jsr:@denops/std@^7.0.0" // Handles both cases
372387
}
373388
}
374389
```
375390

376391
> [!IMPORTANT]
377392
>
378393
> We recommend using `deno.jsonc` over `import_map.jsonc` because:
394+
>
379395
> - It requires less verbose configuration
380396
> - It's the standard Deno configuration format
381397
> - It supports additional configuration options beyond imports
@@ -422,7 +438,9 @@ import { Maze } from "maze_generator";
422438

423439
### Import Map Structure
424440

425-
The `deno.json` file in your Denops plugin directory should contain all the dependencies your plugin needs. This keeps dependency management isolated to each plugin while avoiding conflicts in the merged runtime directory.
441+
The `deno.json` file in your Denops plugin directory should contain all the
442+
dependencies your plugin needs. This keeps dependency management isolated to
443+
each plugin while avoiding conflicts in the merged runtime directory.
426444

427445
For example, if your plugin uses additional npm packages:
428446

src/tutorial/helloworld/adding-an-api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
In the previous section, we created a minimal Denops plugin. In this section, we
44
will enhance the plugin by adding an API.
55

6-
First, update your `denops/denops-helloworld/deno.jsonc` to include the unknownutil dependency:
6+
First, update your `denops/denops-helloworld/deno.jsonc` to include the
7+
unknownutil dependency:
78

89
```json,title=denops/denops-helloworld/deno.jsonc
910
{

src/tutorial/helloworld/creating-a-minimal-denops-plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ the corresponding file as a TypeScript module and calls the function named
1616
1717
[denops.vim]: https://github.com/vim-denops/denops.vim
1818

19-
Let's first create the workspace configuration and directory structure for
19+
Let's first create the workspace configuration and directory structure for
2020
`denops-helloworld`. The directory tree will be as follows:
2121

2222
```

src/tutorial/maze/creating-applicative-plugin.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ augroup denops_maze
2828
augroup END
2929
```
3030

31-
Then, update your `denops/denops-maze/deno.jsonc` to include the unknownutil dependency:
31+
Then, update your `denops/denops-maze/deno.jsonc` to include the unknownutil
32+
dependency:
3233

3334
```json,title=denops/denops-maze/deno.jsonc
3435
{

src/tutorial/maze/utilizing-third-party-library.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ Then, create the `denops/denops-maze/deno.jsonc` file for runtime dependencies:
6464
>
6565
> We include both `@denops/std` and `@denops/std/` in the import map. The first
6666
> one allows imports like `import type { Entrypoint } from "@denops/std"`, while
67-
> the second enables submodule imports like `import * as buffer from "@denops/std/buffer"`.
67+
> the second enables submodule imports like
68+
> `import * as buffer from "@denops/std/buffer"`.
6869
6970
The content of the `denops/denops-maze/main.ts` file will be:
7071

0 commit comments

Comments
 (0)