diff --git a/docs/semver_ranges.md b/docs/semver_ranges.md new file mode 100644 index 0000000..aab3422 --- /dev/null +++ b/docs/semver_ranges.md @@ -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. diff --git a/docs/workflow.md b/docs/workflow.md new file mode 100644 index 0000000..d49f17d --- /dev/null +++ b/docs/workflow.md @@ -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<> $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' +``` diff --git a/readme.md b/readme.md index 1317b28..545f2cc 100644 --- a/readme.md +++ b/readme.md @@ -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<> $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' + ```