Skip to content

Commit

Permalink
build: use oao (#281)
Browse files Browse the repository at this point in the history
* build: preparing to move from lerna

* test: jest-haste-map collision warning

* docs: format

* build: remove lerna

* ci: remove travis

* ci: test on nodejs 14

* docs: remove travis

* docs: update badges

* docs: update badges

* build: update configs
  • Loading branch information
kukhariev authored Nov 20, 2020
1 parent e8b7820 commit 6fed5e3
Show file tree
Hide file tree
Showing 21 changed files with 505 additions and 3,424 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
name: CI

on: [push]

'on':
- push
jobs:
run:
name: Test on node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
name: 'Test on node ${{ matrix.node }} and ${{ matrix.os }}'
runs-on: '${{ matrix.os }}'
strategy:
matrix:
node: [10.x, 12.x]
os: [ubuntu-latest, windows-latest]
node:
- 10.x
- 14.x
os:
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node }}
- name: 'Use Node.js ${{ matrix.node }}'
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node}}
node-version: '${{ matrix.node}}'
- name: install
run: |
yarn
env:
CI: true
- name: build
run: npm run build
run: yarn
env:
CI: true
- name: lint
run: |
npm run lint
run: npm run lint
- name: test
run: npm test
env:
CI: true
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

45 changes: 25 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,46 @@
# node-uploadx

[![npm version][npm-image]][npm-url] [![Travis status][travis-image]][travis-url] [![Build status][gha-image]][gha-url]
[![npm version][npm-image]][npm-url] [![Build status][gha-image]][gha-url]
[![commits since latest release][comm-image]][comm-url] [![Snyk Vulnerabilities][snyk-image]][snyk-url]

> Node.js resumable upload middleware.
> Server-side part of [ngx-uploadx](https://github.com/kukhariev/ngx-uploadx)
## Install
## 🌩 Installation

All-In-One:

```sh
npm install node-uploadx
```

Optionally, to support
Separate modules can also be used to save disk space and for faster installation process.:

- AWS S3 Storage:
- core module:

```sh
npm install aws-sdk
```
```sh
npm install @uploadx/core
```

- Google Cloud Storage:
- _Google Cloud Storage_ support:

```sh
npm install google-auth-library
```
```sh
npm install @uploadx/gcs
```

Full installation:
- _AWS S3_ support:

```sh
npm install node-uploadx -f
```
```sh
npm install @uploadx/s3
```

## Usage
## Usage

Express example:

```js
const express = require('express');
const { uploadx } = require('node-uploadx');
const { uploadx } = require('@uploadx/core');

const app = express();
const opts = {
Expand Down Expand Up @@ -76,7 +79,7 @@ const server = http

Please navigate to the [examples](examples) for more.

### Options
### 🛠 Options

Available options are:

Expand Down Expand Up @@ -111,7 +114,9 @@ Pull requests are welcome!

[npm-image]: https://img.shields.io/npm/v/node-uploadx.svg
[npm-url]: https://www.npmjs.com/package/node-uploadx
[travis-image]: https://img.shields.io/travis/kukhariev/node-uploadx/master.svg
[travis-url]: https://travis-ci.org/kukhariev/node-uploadx
[gha-image]: https://github.com/kukhariev/node-uploadx/workflows/CI/badge.svg
[gha-url]: https://github.com/kukhariev/node-uploadx
[comm-image]: https://img.shields.io/github/commits-since/kukhariev/node-uploadx/latest
[comm-url]: https://github.com/kukhariev/node-uploadx/releases/latest
[snyk-image]: https://img.shields.io/snyk/vulnerabilities/npm/node-uploadx
[snyk-url]: https://snyk.io/test/github/kukhariev/node-uploadx?targetFile=package.json
2 changes: 1 addition & 1 deletion examples/express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { DiskFile, DiskStorage, Multipart, OnComplete, Uploadx } from 'node-uplo
const app = express();

const auth: express.Handler = (req, res, next) => {
(req as any)['user'] = { id: '92be348f-172d-5f69-840d-100f79e4d1ef' };
req['user'] = { id: '92be348f-172d-5f69-840d-100f79e4d1ef' };
next();
};

Expand Down
8 changes: 5 additions & 3 deletions examples/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "node-uploadx-examples",
"name": "examples",
"version": "4.2.0-alpha.1",
"private": "true",
"private": true,
"scripts": {
"demo:basic": "tsnd express-basic",
"demo:express": "tsnd express",
Expand All @@ -15,8 +15,10 @@
"dependencies": {
"@uploadx/core": "^4.2.0-alpha.1",
"dotenv": "8.2.0",
"express": "4.17.1",
"fastify": "2.15.3",
"node-uploadx": "^4.2.0-alpha.1",
"ts-node-dev": "1.0.0"
}
},
"devDependencies": {}
}
3 changes: 2 additions & 1 deletion examples/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"extends": "../tsconfig.base.json",
"compilerOptions": {
"noEmit": true
}
},
"include": ["../packages/*"]
}
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testRegex: '.*\\.spec\\.ts$',
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' })
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
modulePathIgnorePatterns: ['<rootDir>/package.json']
};
11 changes: 0 additions & 11 deletions lerna.json

This file was deleted.

59 changes: 29 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-uploadx-src",
"version": "4.0.0-monorepo",
"name": "node-uploadx",
"version": "4.2.0-alpha.1",
"description": "Node.js resumable upload middleware",
"keywords": [
"resumable",
Expand All @@ -21,7 +21,9 @@
},
"license": "MIT",
"engines": {
"node": ">=10.10.0"
"node": ">=10.10.0",
"npm": "use yarn instead",
"yarn": ">= 1.22.0"
},
"scripts": {
"build": "yarn tsc --build packages",
Expand All @@ -31,36 +33,33 @@
"postbuild_": "tsnd scripts/post-build.ts",
"prettier": "prettier --write \"**/*.{json,md}\"",
"test": "jest",
"test:watch": "jest --watchAll"
"test:watch": "jest --watchAll",
"postinstall": "husky install"
},
"dependencies": {},
"devDependencies": {
"@types/bytes": "3.1.0",
"@types/debug": "4.1.5",
"@types/express": "4.17.8",
"@types/jest": "26.0.15",
"@types/multiparty": "0.0.32",
"@types/node": "10.17.44",
"@types/node-fetch": "2.5.7",
"@types/rimraf": "3.0.0",
"@types/supertest": "2.0.10",
"@typescript-eslint/eslint-plugin": "4.6.0",
"@typescript-eslint/parser": "4.6.0",
"eslint": "7.12.1",
"eslint-config-prettier": "6.15.0",
"eslint-plugin-prettier": "3.1.4",
"eslint-plugin-promise": "4.2.1",
"express": "4.17.1",
"husky": "4.3.0",
"jest": "26.6.1",
"lerna": "^3.22.1",
"lint-staged": "10.5.1",
"node-mocks-http": "1.9.0",
"prettier": "2.1.2",
"rimraf": "3.0.2",
"supertest": "6.0.0",
"ts-jest": "26.4.3",
"ts-node-dev": "1.0.0",
"@types/express": "^4.17.8",
"@types/jest": "^26.0.15",
"@types/node": "^10.17.45",
"@types/rimraf": "^3.0.0",
"@types/supertest": "^2.0.10",
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"eslint": "^7.13.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"express": "^4.17.1",
"husky": "^5.0.0",
"jest": "^26.6.3",
"lint-staged": "^10.5.1",
"node-mocks-http": "^1.9.0",
"oao": "^2.0.0",
"prettier": "^2.1.2",
"rimraf": "^3.0.2",
"supertest": "^6.0.0",
"ts-jest": "^26.4.4",
"ts-node-dev": "^1.0.0",
"tsconfig-paths": "^3.9.0",
"typescript": "4.0.5"
},
Expand Down
11 changes: 7 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{
"name": "@uploadx/core",
"version": "4.2.0-alpha.1",
"description": "Node.js resumable upload middleware base",
"description": "Node.js resumable upload middleware",
"keywords": [
"resumable",
"upload",
"uploadx",
"express",
"middleware",
"s3",
"gcloud"
"middleware"
],
"author": {
"name": "Oleg Kukhariev",
Expand Down Expand Up @@ -37,6 +35,11 @@
"debug": "^4.2.0",
"multiparty": "^4.2.2"
},
"devDependencies": {
"@types/bytes": "^3.1.0",
"@types/debug": "^4.1.5",
"@types/multiparty": "^0.0.32"
},
"publishConfig": {
"access": "public"
}
Expand Down
5 changes: 4 additions & 1 deletion packages/gcs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@
"google-auth-library": "^6.1.3",
"node-fetch": "^2.6.1"
},
"devDependencies": {
"@types/node-fetch": "^2.5.7"
},
"peerDependencies": {
"@uploadx/core": "^4.2.0-alpha.0"
"@uploadx/core": "^4.2.0-alpha.1"
},
"publishConfig": {
"access": "public"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions packages/s3/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"name": "@uploadx/s3",
"version": "4.2.0-alpha.1",
"description": "Uploadx S3 storage",
"description": "Uploadx S3 module",
"keywords": [
"resumable",
"upload",
"uploadx",
"express",
"fastify",
"middleware",
"s3"
],
Expand Down Expand Up @@ -36,7 +35,7 @@
"aws-sdk": "^2.782.0"
},
"peerDependencies": {
"@uploadx/core": "^4.2.0-alpha.0"
"@uploadx/core": "^4.2.0-alpha.1"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
{ "path": "./core" },
{ "path": "./gcs" },
{ "path": "./s3" },
{ "path": "./uploadx" }
{ "path": "./node-uploadx"}
]
}
5 changes: 3 additions & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"@uploadx/core": ["packages/core/src"],
"@uploadx/gcs": ["packages/gcs/src"],
"@uploadx/s3": ["packages/s3/src"],
"node-uploadx": ["packages/uploadx/src"]
"node-uploadx": ["packages/node-uploadx/src"]
}
}
},
"exclude": ["node_modules", "lib"]
}
Loading

0 comments on commit 6fed5e3

Please sign in to comment.