Skip to content

Commit

Permalink
docs: improve readability (#17)
Browse files Browse the repository at this point in the history
* docs: improve readability

* fmt
  • Loading branch information
boywithkeyboard authored Sep 13, 2023
1 parent d33938f commit ecb5e8e
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 52 deletions.
8 changes: 8 additions & 0 deletions docs/semver_ranges.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### Version ranges

**deaddeno/update** uses
[std@0.190.0](https://deno.land/std@0.190.0/semver/mod.ts) to determine the
latest version. Therefore, you should read the JSDoc documentation
[here](https://github.com/denoland/deno_std/blob/0.190.0/semver/mod.ts) or
[here](https://deno.land/std@0.190.0/semver/mod.ts) to learn more about what
version ranges the script supports.
47 changes: 47 additions & 0 deletions docs/workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
### Workflow

```yml
name: update

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
update:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Run update
run: |
deno run -A mod.ts -c
CHANGELOG=$(cat updates_changelog.md)
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
rm updates_changelog.md
- name: Create pull request
uses: peter-evans/create-pull-request@v5
with:
title: 'refactor: update deps'
author: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>'
committer: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>'
commit-message: 'refactor: update deps'
body: '${{ env.CHANGELOG }}'
labels: 'deps'
delete-branch: true
branch: 'refactor/deps'
```
85 changes: 33 additions & 52 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,60 +15,41 @@ deno run -Ar https://deno.land/x/update/mod.ts ./deno.json
- `--breaking` / `-b` : allow breaking updates (major releases)
- `--unstable` / `-u` : allow unstable updates (prereleases)
- `--changelog` / `-c` : create changelog (updates_changelog.md)
- `--dry-run` / `--readonly` : don't modify any files
- `--dry-run` / `--readonly` : don't apply updates

#### Labels:
### Symbols

- ⚠️ **breaking** - This update might break your code.
- 🚧 **unstable** - This is a prerelease and might therefore come with unwanted
issues.
- 🤞 **early** - This module doesn't strictly adhere to semver yet, so this
version might break your code.
- ⚠️ **breaking**
\
This update might break your code.
- 🚧 **unstable**
\
This is a prerelease and might therefore come with unwanted issues.
- 🤞 **early**
\
This module doesn't strictly adhere to semver yet, so this version might break
your code.

### Workflow

```yml
name: update

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
update:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Run update
run: |
deno run -A mod.ts -c
CHANGELOG=$(cat updates_changelog.md)
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
rm updates_changelog.md
- name: Create pull request
uses: peter-evans/create-pull-request@v5
with:
title: 'refactor: update deps'
author: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>'
committer: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>'
commit-message: 'refactor: update deps'
body: '${{ env.CHANGELOG }}'
labels: 'deps'
delete-branch: true
branch: 'refactor/deps'
```
[View example](https://github.com/deaddeno/update/blob/dev/docs/workflow.md)

### Advanced usage

- #### Pin a dependency

To ignore a particular import, you can append `#pin` to the url.

```ts
import * as semver from 'https://deno.land/std@0.200.0/semver/mod.ts#pin'
```

- #### Specify a version range

To override the default behavior, you can append a
[SemVer range](https://github.com/deaddeno/update/blob/dev/docs/semver_ranges.md)
to the url.

```ts
import cheetah from 'https://deno.land/x/cheetah@v1.5.0/mod.ts#~v1.5'
```

0 comments on commit ecb5e8e

Please sign in to comment.