Skip to content

Commit

Permalink
feat: switch from got to ofetch (#103)
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 2bf834c commit c20cf55
Show file tree
Hide file tree
Showing 12 changed files with 2,792 additions and 4,547 deletions.
54 changes: 0 additions & 54 deletions .circleci/config.yml

This file was deleted.

61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest
services:
transmission:
image: lscr.io/linuxserver/transmission:latest
env:
PUID: 1000
PGID: 1000
TZ: Etc/UTC
ports:
- "9091:9091"
- "51413:51413"
- "51413:51413/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
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# transmission [![npm](https://img.shields.io/npm/v/@ctrl/transmission.svg?maxAge=3600)](https://www.npmjs.com/package/@ctrl/transmission) [![CircleCI](https://circleci.com/gh/scttcper/transmission.svg?style=svg)](https://circleci.com/gh/scttcper/transmission) [![coverage status](https://codecov.io/gh/scttcper/transmission/branch/master/graph/badge.svg)](https://codecov.io/gh/scttcper/transmission)
# transmission [![npm](https://img.shields.io/npm/v/@ctrl/transmission.svg?maxAge=3600)](https://www.npmjs.com/package/@ctrl/transmission) [![coverage status](https://codecov.io/gh/scttcper/transmission/branch/master/graph/badge.svg)](https://codecov.io/gh/scttcper/transmission)

> TypeScript api wrapper for [transmission](https://transmissionbt.com/) using [got](https://github.com/sindresorhus/got)
Expand Down Expand Up @@ -77,3 +77,21 @@ All of the following npm modules provide the same normalized functions along wit
deluge - https://github.com/scttcper/deluge
qbittorrent - https://github.com/scttcper/qbittorrent
utorrent - https://github.com/scttcper/utorrent

### Start a test docker container

```
docker run -d \
--name=transmission \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
-p 9091:9091 \
-p 51413:51413 \
-p 51413:51413/udp \
-v ~/Documents/transmission/config:/config \
-v ~/Documents/transmission/downloads:/downloads \
-v ~/Documents/transmission/watch:/watch \
--restart unless-stopped \
lscr.io/linuxserver/transmission:latest
```
Loading

0 comments on commit c20cf55

Please sign in to comment.