Skip to content

Commit

Permalink
Merge branch 'main' into feat-gcs-locker
Browse files Browse the repository at this point in the history
* main: (59 commits)
  Replace demo folder with StackBlitz (tus#704)
  @tus/gcs-store: correctly pass content type (tus#702)
  @tus/s3-store: fix zero byte files (tus#700)
  Update package-lock.json
  [ci] release (tus#696)
  fix: handling consistent cancellation across stream and locks (tus#699)
  @tus/s3-store: Change private modifier into protected (tus#698)
  Create funding-manifest-urls
  Bump @aws-sdk/client-s3 from 3.703.0 to 3.717.0 (tus#695)
  Bump mocha from 10.4.0 to 11.0.1 (tus#693)
  Bump @biomejs/biome from 1.9.2 to 1.9.4 (tus#694)
  [ci] release (tus#690)
  Bump @aws-sdk/client-s3 from 3.701.0 to 3.703.0 (tus#685)
  @tus/s3-store: fix part number increment (tus#689)
  Revert "Bump rimraf from 3.0.2 to 6.0.1 (tus#681)"
  Bump @aws-sdk/client-s3 from 3.682.0 to 3.701.0 (tus#683)
  Bump @changesets/cli from 2.27.9 to 2.27.10 (tus#682)
  Bump rimraf from 3.0.2 to 6.0.1 (tus#681)
  Bump @types/node from 20.11.5 to 22.10.1 (tus#679)
  Ignore JSON for Biome formatting
  ...
  • Loading branch information
Murderlon committed Jan 20, 2025
2 parents 0ce3a90 + 3b5718b commit dec6d39
Show file tree
Hide file tree
Showing 89 changed files with 3,599 additions and 5,072 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["demo", "test"]
"ignore": ["test"]
}
5 changes: 5 additions & 0 deletions .changeset/gold-adults-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tus/s3-store": patch
---

Fix zero byte files only storing a .info file. Now correctly stores an empty file.
5 changes: 5 additions & 0 deletions .changeset/proud-terms-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tus/gcs-store": patch
---

Correctly pass the content type from upload.metadata to GCS.
5 changes: 0 additions & 5 deletions .eslintrc.js

This file was deleted.

4 changes: 0 additions & 4 deletions .github/contributing.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Contributing

`tus-node-server` is a mono-repository managed by [Turborepo](https://turbo.build/repo).
This means running `npm run build` in the root will build all packages in parallel. The
same goes for `lint` and `format`.

## Changesets

We use [changesets](https://github.com/changesets/changesets) to manage versioning,
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: main
name: CI
on:
push:
branches: [main]
pull_request_target:
types: [opened, synchronize, reopened]
paths-ignore:
- '**.md'
- "**.md"
- ".changeset/**"
pull_request:
types: [opened, synchronize, reopened]
paths:
Expand All @@ -15,15 +16,8 @@ concurrency: ${{ github.workflow }}--${{ github.ref }}

jobs:
main:
name: ${{matrix.node}}
name: Node.js LTS
runs-on: ubuntu-latest
strategy:
# We do not want to run CRUD tests in parallel
max-parallel: 1
matrix:
node:
- lts/hydrogen
- node

steps:
- name: Checkout sources
Expand All @@ -39,14 +33,17 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{matrix.node-version}}
node-version: lts/*

- name: Install dependencies
run: npm ci --no-fund --no-audit

- name: Build
run: npm run build

- name: Check formatting
run: npm run format:check

- name: Run linters
run: npm run lint

Expand All @@ -56,4 +53,7 @@ jobs:
AWS_BUCKET: ${{secrets.AWS_BUCKET}}
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AZURE_ACCOUNT_ID: ${{secrets.AZURE_ACCOUNT_ID}}
AZURE_ACCOUNT_KEY: ${{secrets.AZURE_ACCOUNT_KEY}}
AZURE_CONTAINER_NAME: ${{secrets.AZURE_CONTAINER_NAME}}
AWS_REGION: ${{secrets.AWS_REGION}}
11 changes: 0 additions & 11 deletions .prettierrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .well-known/funding-manifest-urls
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://tus.io/funding.json
47 changes: 13 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ easily be added to tus-node-server
- [Quick start](#quick-start)
- [Packages](#packages)
- [Extensions](#extensions)
- [Demos](#demos)
- [Types](#types)
- [Compatibility](#compatibility)
- [Contribute](#contribute)
Expand All @@ -49,6 +48,9 @@ integrate it into your existing one. There are also other mature servers, like

A standalone server which stores files on disk.

> [!TIP]
> Try it yourself in [StackBlitz](https://stackblitz.com/edit/stackblitz-starters-zg6mgnuf?file=index.js)
```js
const {Server} = require('@tus/server')
const {FileStore} = require('@tus/file-store')
Expand Down Expand Up @@ -100,45 +102,21 @@ fastify.listen(3000, (err) => {
- [`@tus/file-store`][]. Store files on disk.
- [`@tus/s3-store`][]. Store files on AWS S3.
- [`@tus/gcs-store`][]. Store files on Google Cloud Storage.
- [`@tus/azure-store`][]. Store files on Azure.

## Extensions

The tus protocol supports optional [extensions][]. Below is a table of the supported
extensions.

| Extension | [`file-store`][`@tus/file-store`] | [`s3-store`][`@tus/s3-store`] | [`gcs-store`][`@tus/gcs-store`] |
| ------------------------ | --------------------------------- | ----------------------------- | ------------------------------- |
| [Creation][] ||||
| [Creation With Upload][] ||||
| [Expiration][] ||||
| [Checksum][] ||||
| [Termination][] ||||
| [Concatenation][] ||||

## Demos

Start the demo server using Local File Storage

```bash
npm run build && npm run demo
```

Start up the demo server using AWS S3. The environment variables `AWS_BUCKET`,
`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_REGION` need to be present.

```bash
npm run build && npm run demo:s3
```

Start up the demo server using Google Cloud Storage. A `keyfile.json` needs to be present
in the root of the repository.

```bash
npm run build && npm run demo:gcs
```

Then navigate to the demo ([localhost:1080](http://localhost:1080)) which uses
[`tus-js-client`](https://github.com/tus/tus-js-client).
| Extension | [`file-store`][`@tus/file-store`] | [`s3-store`][`@tus/s3-store`] | [`gcs-store`][`@tus/gcs-store`] | [`azure-store`][`@tus/azure-store`] |
| ------------------------ | --------------------------------- | ----------------------------- | ------------------------------- | ----------------------------------- |
| [Creation][] |||||
| [Creation With Upload][] |||||
| [Expiration][] |||||
| [Checksum][] |||||
| [Termination][] |||||
| [Concatenation][] |||||

## Types

Expand All @@ -163,6 +141,7 @@ See
[`@tus/file-store`]: https://github.com/tus/tus-node-server/tree/main/packages/file-store
[`@tus/s3-store`]: https://github.com/tus/tus-node-server/tree/main/packages/s3-store
[`@tus/gcs-store`]: https://github.com/tus/tus-node-server/tree/main/packages/gcs-store
[`@tus/azure-store`]: https://github.com/tus/tus-node-server/tree/main/packages/azure-store
[extensions]: https://tus.io/protocols/resumable-upload.html#protocol-extensions
[creation]: https://tus.io/protocols/resumable-upload.html#creation
[creation with upload]:
Expand Down
42 changes: 42 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"ignore": ["./**/dist/**/*"]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noParameterAssign": "off"
}
}
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 90
},
"json": {
"linter": {
"enabled": false
},
"formatter": {
"enabled": false
}
},
"javascript": {
"formatter": {
"trailingCommas": "es5",
"semicolons": "asNeeded",
"bracketSpacing": false,
"quoteStyle": "single"
}
}
}
20 changes: 0 additions & 20 deletions demo/package.json

This file was deleted.

117 changes: 0 additions & 117 deletions demo/server.js

This file was deleted.

Loading

0 comments on commit dec6d39

Please sign in to comment.