Skip to content

Commit

Permalink
eslint, sonarcloud, node 16
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikzogg committed May 13, 2023
1 parent 341503e commit 636c430
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 43 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@chubbyts/chubbyts-eslint/dist/eslintrc').default;
29 changes: 6 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,15 @@ name: CI
on:
push:
pull_request:
branches:
- master
schedule:
- cron: '0 0 * * *'

jobs:
node14:
name: Node 14
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: checkout node
uses: actions/setup-node@v3
with:
node-version: '14'
- run: npm install
- run: npm run cs
- run: npm test -- --coverage --no-cache
- run: npm run infection
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
node16:
name: Node 16
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3
Expand All @@ -34,14 +20,10 @@ jobs:
with:
node-version: '16'
- run: npm install
- run: npm run cs
- run: npm test -- --coverage --no-cache
- run: npm run infection
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
- run: npm test
node18:
name: Node 18
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3
Expand All @@ -50,6 +32,7 @@ jobs:
with:
node-version: '18'
- run: npm install
- run: npm run lint
- run: npm run cs
- run: npm test -- --coverage --no-cache
- run: npm run infection
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ Http Request/Response with middleware and handler, [PSR-15][2] inspired.

## Requirements

* node: 14
* [chubbyts/chubbyts-http-types][3]: ^1.0.0
* [qs][4]: ^6.11.0
* node: 16
* [chubbyts/chubbyts-http-types][3]: ^1.1.0
* [qs][4]: ^6.11.1

## Installation

Through [NPM](https://www.npmjs.com) as [@chubbyts/chubbyts-http][1].

```ts
npm i @chubbyts/chubbyts-http@^1.0.2
npm i @chubbyts/chubbyts-http@^1.1.0
```

## Copyright
Expand Down
26 changes: 15 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chubbyts/chubbyts-http",
"version": "1.0.2",
"version": "1.1.0",
"description": "Http Request/Response with middleware and handler, PSR-15 inspired.",
"keywords": [
"chubbyts",
Expand All @@ -17,6 +17,8 @@
"scripts": {
"cs-fix": "prettier --write src tests",
"cs": "prettier --check src tests",
"lint-fix": "eslint src tests --fix",
"lint": "eslint src tests",
"test": "jest",
"infection": "stryker run",
"build": "rm -Rf dist && tsc",
Expand Down Expand Up @@ -44,22 +46,24 @@
"dist"
],
"engines": {
"node": ">=14"
"node": ">=16"
},
"dependencies": {
"@chubbyts/chubbyts-http-types": "^1.0.0",
"qs": "^6.11.0"
"@chubbyts/chubbyts-eslint": "^1.1.1",
"@chubbyts/chubbyts-http-types": "^1.1.0",
"qs": "^6.11.1"
},
"devDependencies": {
"@stryker-mutator/core": "^6.4.1",
"@stryker-mutator/jest-runner": "^6.4.1",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.3",
"@chubbyts/chubbyts-eslint": "^1.1.1",
"@stryker-mutator/core": "^6.4.2",
"@stryker-mutator/jest-runner": "^6.4.2",
"@types/jest": "^29.5.1",
"@types/node": "^20.1.3",
"@types/qs": "^6.9.7",
"jest": "^29.5.0",
"prettier": "^2.8.4",
"ts-jest": "^29.0.5",
"typescript": "^4.9.5"
"prettier": "^2.8.8",
"ts-jest": "^29.1.0",
"typescript": "^5.0.4"
},
"publishConfig": {
"access": "public"
Expand Down
7 changes: 4 additions & 3 deletions src/message-factory.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { createReadStream, existsSync } from 'fs';
import { Duplex, PassThrough, Stream } from 'stream';
import { Method, Query, Request, Response, ServerRequest, Uri } from '@chubbyts/chubbyts-http-types/dist/message';
import {
import type { Duplex, Stream } from 'stream';
import { PassThrough } from 'stream';
import type { Method, Query, Request, Response, ServerRequest, Uri } from '@chubbyts/chubbyts-http-types/dist/message';
import type {
RequestFactory,
ResponseFactory,
ServerRequestFactory,
Expand Down
5 changes: 3 additions & 2 deletions tests/message-factory.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { describe, expect, test } from '@jest/globals';
import { randomBytes } from 'crypto';
import { createReadStream, unlinkSync, writeFileSync } from 'fs';
import { tmpdir } from 'os';
import { PassThrough, Stream } from 'stream';
import { describe, expect, test } from '@jest/globals';
import { Method } from '@chubbyts/chubbyts-http-types/dist/message';
import {
createUriFactory,
createStreamFactory,
Expand All @@ -13,10 +14,10 @@ import {
createResponseFactory,
statusCodeMap,
} from '../src/message-factory';
import { Method } from '@chubbyts/chubbyts-http-types/dist/message';

const readStream = async (stream: Stream) => {
return new Promise((resolve, reject) => {
// eslint-disable-next-line functional/no-let
let data = '';

stream.on('data', (chunk) => (data += chunk));
Expand Down

0 comments on commit 636c430

Please sign in to comment.