Skip to content

Commit

Permalink
feat: switch from got to ofetch (#63)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `addTorrent` functions can no longer be passed a file path. You must handle reading the file.
BREAKING CHANGE: no longer uses got - uses [ofetch](https://github.com/unjs/ofetch) which can work in environments like cloudflare workers and bun due to using fetch
BREAKING CHANGE: requires node 18
  • Loading branch information
scttcper authored Sep 24, 2023
1 parent 17fba3a commit 888f307
Show file tree
Hide file tree
Showing 13 changed files with 2,785 additions and 4,634 deletions.
46 changes: 0 additions & 46 deletions .circleci/config.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"node": true
},
"extends": ["@ctrl/eslint-config"],
"rules": {}
"rules": {
"no-bitwise": "off"
}
}
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest
services:
utorrent:
image: ekho/utorrent:latest
ports:
- "8080:8080"
- "6881:6881"
- "6881:6881/udp"
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- name: install dependencies
run: npm ci
- name: lint
run: npm run lint
- name: test
run: npm run test:ci
- name: coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
publish:
needs: build
runs-on: ubuntu-latest
if: github.ref_name == 'master'
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- run: npm ci
- name: release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# utorrent

[![npm](https://badgen.net/npm/v/@ctrl/utorrent)](https://www.npmjs.com/package/@ctrl/utorrent)
[![CircleCI](https://badgen.net/circleci/github/scttcper/utorrent)](https://circleci.com/gh/scttcper/utorrent)
[![coverage](https://badgen.net/codecov/c/github/scttcper/utorrent)](https://codecov.io/gh/scttcper/utorrent)

> TypeScript api wrapper for [utorrent](https://www.utorrent.com) using [got](https://github.com/sindresorhus/got)
Expand Down Expand Up @@ -87,3 +86,15 @@ console.log(res);
deluge - https://github.com/scttcper/deluge
transmission - https://github.com/scttcper/transmission
qbittorrent - https://github.com/scttcper/qbittorrent

### Start a test docker container

```
docker run \
--name utorrent \
-v ~/Documents/utorrentt:/data \
-p 8080:8080 \
-p 6881:6881 \
-p 6881:6881/udp \
ekho/utorrent:latest
```
Loading

0 comments on commit 888f307

Please sign in to comment.