Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove @types/node from dependencies #7

Merged
merged 5 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .autod.conf.js

This file was deleted.

43 changes: 9 additions & 34 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,17 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 2 * * *'

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node-version: [8, 10, 12]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Checkout Git Source
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm i -g npminstall && npminstall

- name: Continuous Integration
run: npm run ci

- name: Code Coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
Job:
name: Node.js
uses: node-modules/github-actions/.github/workflows/node-test.yml@master
with:
os: 'ubuntu-latest, macos-latest, windows-latest'
version: '8, 10, 12, 14, 16, 18, 20, 22'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Release

on:
push:
branches: [ master ]

jobs:
release:
name: Node.js
uses: node-modules/github-actions/.github/workflows/node-release.yml@master
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018-present node-modules and other contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@
[connection](https://github.com/node-modules/connection) socket wrapper

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![CI](https://github.com/node-modules/connection/actions/workflows/nodejs.yml/badge.svg?branch=master)](https://github.com/node-modules/connection/actions/workflows/nodejs.yml)
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/connection.svg?style=flat-square
[npm-url]: https://npmjs.org/package/connection
[travis-image]: https://img.shields.io/travis/node-modules/connection.svg?style=flat-square
[travis-url]: https://travis-ci.org/node-modules/connection
[codecov-image]: https://codecov.io/gh/node-modules/connection/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/node-modules/connection
[david-image]: https://img.shields.io/david/node-modules/connection.svg?style=flat-square
[david-url]: https://david-dm.org/node-modules/connection
[snyk-image]: https://snyk.io/test/npm/connection/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/connection
[download-image]: https://img.shields.io/npm/dm/connection.svg?style=flat-square
Expand Down Expand Up @@ -60,7 +55,6 @@ conn.writeRequest({
methodArgSigs: [ 'java.lang.String' ],
requestProps: null,
});

```

### Server Socket
Expand Down Expand Up @@ -90,6 +84,7 @@ server.on('connection', sock => {
[More example](./example)

### API

- oneway() - one way call
- async writeRequest(req) - write request and wait response
- async writeResponse(req, res) - write response
Expand Down Expand Up @@ -151,3 +146,19 @@ interface Protocol {
decode(options: any): Decoder;
}
```

## License

[MIT](LICENSE)

<!-- GITCONTRIBUTOR_START -->

## Contributors

|[<img src="https://avatars.githubusercontent.com/u/6897780?v=4" width="100px;"/><br/><sub><b>killagu</b></sub>](https://github.com/killagu)<br/>|[<img src="https://avatars.githubusercontent.com/u/1207064?v=4" width="100px;"/><br/><sub><b>gxcsoccer</b></sub>](https://github.com/gxcsoccer)<br/>|[<img src="https://avatars.githubusercontent.com/u/360661?v=4" width="100px;"/><br/><sub><b>popomore</b></sub>](https://github.com/popomore)<br/>|[<img src="https://avatars.githubusercontent.com/u/17469139?v=4" width="100px;"/><br/><sub><b>weijiafu14</b></sub>](https://github.com/weijiafu14)<br/>|
| :---: | :---: | :---: | :---: |


This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Wed Jun 19 2024 17:29:25 GMT+0800`.

<!-- GITCONTRIBUTOR_END -->
16 changes: 0 additions & 16 deletions appveyor.yml

This file was deleted.

1 change: 0 additions & 1 deletion lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const assert = require('assert');
const Base = require('sdk-base');
const pump = require('pump');
// const awaitEvent = require('await-event');
const awaitFirst = require('await-first');

const utils = require('./utils');
Expand Down
53 changes: 23 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
{
"name": "connection",
"version": "1.4.0",
"description": "wrap for socket",
"dependencies": {
"@types/node": "^14.11.8",
"await-event": "^2.1.0",
"await-first": "^1.0.0",
"pump": "^3.0.0",
"sdk-base": "^3.5.1"
"engines": {
"node": ">= 8.0.0"
},
"description": "wrap for socket",
"files": [
"lib",
"index.js",
"index.d.ts"
],
"dependencies": {
"await-first": "^1.0.0",
"pump": "^3.0.0",
"sdk-base": "^3.5.1"
},
"devDependencies": {
"@types/node": "20",
"await-event": "^2.1.0",
"egg-bin": "^4.7.1",
"eslint": "^5.2.0",
"eslint-config-egg": "^7.0.0",
"git-contributor": "^2.1.5",
"mm": "^2.2.2",
"sofa-bolt-node": "^1.1.1"
},
"scripts": {
"autod": "autod",
"lint": "eslint . --ext .js",
"cov": "TEST_TIMEOUT=1000 egg-bin cov",
"cov": "egg-bin cov",
"test": "npm run lint && npm run test-local",
"test-local": "TEST_TIMEOUT=1000 egg-bin test",
"pkgfiles": "egg-bin pkgfiles --check",
"ci": "npm run autod -- --check && npm run pkgfiles && npm run lint && npm run cov",
"contributors": "contributors -f plain -o AUTHORS"
"test-local": "egg-bin test",
"ci": "npm run lint && npm run cov",
"contributor": "git-contributor"
},
"repository": {
"type": "git",
Expand All @@ -38,21 +47,5 @@
"bugs": {
"url": "https://github.com/node-modules/connection/issues"
},
"homepage": "https://github.com/node-modules/connection#readme",
"devDependencies": {
"autod": "^3.0.1",
"contributors": "^0.5.1",
"egg-bin": "^4.7.1",
"egg-ci": "^1.8.0",
"eslint": "^5.2.0",
"eslint-config-egg": "^7.0.0",
"mm": "^2.2.2",
"sofa-bolt-node": "^1.1.1"
},
"engines": {
"node": ">= 8.0.0"
},
"ci": {
"version": "8, 10, 12"
}
"homepage": "https://github.com/node-modules/connection#readme"
}
6 changes: 3 additions & 3 deletions test/connection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ describe('test/connection.test.js', () => {
assert(serverConn._decoder.destroyed === true);
assert(!clientError);
assert(serverError);
assert(serverError.message.startsWith('mock error'));
assert(/(mock error|premature close)/.test(serverError.message));
assert(clientClosed === true);
assert(serverClosed === true);
});
Expand Down Expand Up @@ -414,7 +414,7 @@ describe('test/connection.test.js', () => {
error = e;
} finally {
assert(error);
assert(error.message === 'mock error, 127.0.0.1:12200');
assert(/(mock error|premature close)/.test(error.message));
}
await serverConn.await('close');
assert(clientConn._closed === true);
Expand All @@ -427,7 +427,7 @@ describe('test/connection.test.js', () => {
assert(serverConn._decoder.destroyed === true);
assert(clientError);
assert(!serverError);
assert(clientError.message === 'mock error, 127.0.0.1:12200');
assert(/(mock error|premature close)/.test(clientError.message));
assert(clientClosed === true);
assert(serverClosed === true);
});
Expand Down
Loading