Skip to content

Commit 47b810d

Browse files
fed135Frederic Charette
andauthored
v6.0.0 (#35)
* Update client.ts * Update client.ts * changed build option, version bumps * fixed socket remote, logs, build module config, added node 16 target * removed node 12 support * updated tests, added engines check, changelog bump * hotfix test command order * added missing tests * fixed linting, build order * made broken import linter warning Co-authored-by: Frederic Charette <fred@Frederics-MacBook-Pro.local>
1 parent bda2296 commit 47b810d

File tree

31 files changed

+207
-81
lines changed

31 files changed

+207
-81
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"error",
3232
{ "vars": "all", "args": "after-used", "ignoreRestSiblings": false }
3333
],
34-
"import/no-extraneous-dependencies": 0
34+
"import/no-extraneous-dependencies": 0,
35+
"import/no-unresolved": 1
3536
},
3637
"env": {
3738
"browser": true,

.github/workflows/master-status.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [12.x]
15+
node-version: [14.x, 16.x]
1616

1717
steps:
1818
- uses: actions/checkout@v1
@@ -23,9 +23,9 @@ jobs:
2323
- name: npm install, build, and test
2424
run: |
2525
yarn
26+
yarn run build
2627
yarn run lint
2728
yarn run test
28-
yarn run build
2929
yarn run bench
3030
env:
3131
CI: true

.github/workflows/pr-validation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [10.x, 12.x]
15+
node-version: [14.x, 16.x]
1616

1717
steps:
1818
- uses: actions/checkout@v1
@@ -23,9 +23,9 @@ jobs:
2323
- name: npm install, build, and test
2424
run: |
2525
yarn
26+
yarn run build
2627
yarn run lint
2728
yarn run test
28-
yarn run build
2929
yarn run bench
3030
env:
3131
CI: true

CHANGELOG.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,38 @@
11
# Changelog
22

3-
## [v5.0.0] - 2020-06-23
3+
## [v6.0.0] - 2021-04-26
44

55
commit: [#](https://github.com/kalm/kalm.js/commits)
66

7-
## Breaking changes
7+
### Breaking changes
8+
9+
- Client.remote is now a const instead of a function (breaking change)
10+
- Client.local is now a const instead of a function (breaking change)
11+
- Engines config in package.json now only allows node >=14
12+
13+
### Added
14+
15+
- Client reference in subscribe callback is now fully featured instead of a shallow config object.
16+
- Bumped `ws` version
17+
- Added integration tests
18+
19+
### Bug fixes
20+
21+
- Fixed importing when using typescript (breaking change)
22+
- Fixed socket remote info
23+
- Fixed multiple types, including opening `port` value to be a string
24+
25+
## [v5.0.0] - 2020-06-23
26+
27+
commit: [#](https://github.com/kalm/kalm.js/commit/527a245e4855f6ab7678ef4fe1ee9e7cd2ff3cb8)
28+
29+
### Breaking changes
830
- Changed default packet framing to be a pure json object
931
- Removed custom framing
1032
- Added packet message cap
1133
- Fixed multiplexing
1234

13-
## Added
35+
### Added
1436
- Added more error messages
1537
- Added tests for transport packages
1638
- Added CHANGELOG and LICENSE to all packages
@@ -19,7 +41,7 @@ commit: [#](https://github.com/kalm/kalm.js/commits)
1941

2042
commit: [731491d](https://github.com/kalm/kalm.js/commit/731491d7b98f3116e0491905c99f9ece29d24d65)
2143

22-
## Added
44+
### Added
2345
- Added more error messages
2446
- Added tests for transport packages
2547
- Added CHANGELOG and LICENSE to all packages

examples/typescript/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {connect, routines} from 'kalm';
2-
import * as ws from '@kalm/ws';
2+
import ws from '@kalm/ws';
33

44
const client = connect({
55
transport: ws(),

examples/typescript/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {listen, routines} from 'kalm';
2-
import * as ws from '@kalm/ws';
2+
import ws from '@kalm/ws';
33

44
const provider = listen({
55
transport: ws(),

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "kalm",
33
"private": true,
4-
"version": "5.0.0",
4+
"version": "6.0.0",
55
"description": "The socket optimizer",
66
"main": "packages/kalm/bin/kalm.js",
77
"scripts": {
8-
"lint": "eslint **/*.ts **/*.spec.ts",
8+
"lint": "eslint packages/**/*.ts packages/**/*.spec.ts tests/**/*.spec.ts",
99
"lint:fix": "yarn lint --fix",
1010
"test": "yarn workspaces run test && yarn run test:integration",
1111
"test:integration": "jest ./tests/integration --forceExit",
@@ -51,18 +51,18 @@
5151
}
5252
},
5353
"devDependencies": {
54-
"@types/jest": "^25.1.0",
55-
"@types/node": "^13.9.0",
56-
"@typescript-eslint/eslint-plugin": "^2.24.0",
57-
"@typescript-eslint/parser": "^2.24.0",
58-
"eslint": "^6.8.0",
59-
"eslint-config-airbnb-base": "^14.1.0",
60-
"eslint-plugin-import": "^2.20.0",
61-
"husky": "^4.2.0",
62-
"jest": "^25.1.0",
63-
"socket.io": "^2.3.0",
64-
"socket.io-client": "^2.3.0",
65-
"ts-jest": "^25.2.0",
66-
"typescript": "^3.8.0"
54+
"@types/jest": "^26.0.0",
55+
"@types/node": "^14.14.0",
56+
"@typescript-eslint/eslint-plugin": "^4.22.0",
57+
"@typescript-eslint/parser": "^4.22.0",
58+
"eslint": "^7.24.0",
59+
"eslint-config-airbnb-base": "^14.2.0",
60+
"eslint-plugin-import": "^2.22.0",
61+
"husky": "^6.0.0",
62+
"jest": "^26.6.0",
63+
"socket.io": "^4.0.0",
64+
"socket.io-client": "^4.0.0",
65+
"ts-jest": "^26.5.0",
66+
"typescript": "^4.2.0"
6767
}
6868
}

packages/ipc/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kalm/ipc",
3-
"version": "5.0.0",
3+
"version": "6.0.0",
44
"description": "IPC transport for Kalm",
55
"main": "bin/ipc.js",
66
"scripts": {
@@ -9,6 +9,9 @@
99
"test": "jest ./tests",
1010
"prepublish": "cp ../../LICENSE ./LICENSE && cp ../../CHANGELOG.md ./CHANGELOG.md"
1111
},
12+
"engines": {
13+
"node": ">=14"
14+
},
1215
"funding": {
1316
"type": "Open Collective",
1417
"url": "https://opencollective.com/kalm"

packages/ipc/src/ipc.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import net from 'net';
55
/* Methods -------------------------------------------------------------------*/
66

77
interface IPCSocket extends net.Socket {
8+
server: {
9+
_connectionKey: string
10+
}
811
_server: {
912
_pipeName: string
1013
}
@@ -25,8 +28,8 @@ function ipc({ socketTimeout = 30000, path = '/tmp/app.socket-' }: IPCConfig = {
2528

2629
function remote(handle: IPCSocket): Remote {
2730
return {
28-
host: handle && handle._server && handle._server._pipeName || null,
29-
port: handle && handle._handle && handle._handle.fd || null,
31+
host: handle?._server?._pipeName || handle?.server?._connectionKey || null,
32+
port: handle?._handle?.fd || null,
3033
};
3134
}
3235

packages/ipc/types.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable */
2+
13
declare module '@kalm/ipc' {
24
interface IPCConfig {
35
socketTimeout?: number

0 commit comments

Comments
 (0)