denoland / denoland/deploy-cli

`deno deploy` adds an extra trailing blank line to `deno.jsonc` on every run

Open
#138 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2
Forks
5
PR merge metrics
No merged PRs in 30d

Description

# `deno deploy` adds an extra trailing blank line to `deno.jsonc` on every run

## Description

Running `deno deploy` modifies `deno.jsonc` by appending an extra blank line at the end of the file.

Every subsequent deployment adds one more blank line, so the trailing blank lines keep accumulating.

The deployment itself succeeds.

## Steps to reproduce

1. Create a `deno.jsonc` whose file ending contains only the normal final newline.

2. Run:

```bash
deno deploy --prod
```

3. Check `deno.jsonc`.

An additional blank line has been appended to the end of the file.

4. Run the same command again:

```bash
deno deploy --prod
```

Another blank line is appended.

This happens on every deployment.

## Expected behavior

`deno deploy` should not modify `deno.jsonc` when no configuration changes are required.

At minimum, it should preserve the existing trailing newline / blank-line formatting.

## Actual behavior

Each invocation adds one additional trailing blank line:

```text
First deploy: +1 blank line
Second deploy: +1 blank line
Third deploy: +1 blank line
...
```

This creates an unnecessary Git diff and causes the file to accumulate blank lines over time.

## Environment

```bash
deno --version
```

Output:

```text
deno 2.9.5 (stable, release, aarch64-apple-darwin)
v8 15.0.245.2-rusty
typescript 6.0.3
```

## Additional context

This appears related to the configuration rewrite behavior of `deno deploy`.

A similar issue involving unnecessary rewriting/formatting of the deploy section was reported here:

denoland/deno#32524

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with a minimal deno.jsonc and repeated `deno deploy --prod` runs, then inspect the resulting diff. Trace the configuration rewrite behavior referenced in the issue and compare it with denoland/deno#32524. Done means deployments that require no configuration changes leave deno.jsonc unchanged and preserve its existing trailing formatting.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.