jscommunity / json-rpc-peer Goto Github PK
View Code? Open in Web Editor NEWJSON-RPC 2 transport-agnostic library
JSON-RPC 2 transport-agnostic library
Branch | Build failing π¨ |
---|---|
Dependency | cross-env |
Current Version | 3.2.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As cross-env is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
When calling exec(message) I need to pass user information that was extracted from the ws header when it was connected. I think there should be a way to pass an optional object as a second parameter to exec() which will be added as a sub-object to the message object passed to onMessage(message)
we need an end()
method of Peer because it's a writable stream
Branch | Build failing π¨ |
---|---|
Dependency | json-rpc-protocol |
Current Version | 0.11.0 |
Type | dependency |
This version is covered by your current version range and after updating it in your project the build failed.
As json-rpc-protocol is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you itβs very likely also breaking them.
I recommend you give this issue a very high priority. Iβm sure you can resolve this πͺ
The new version differs by 4 commits .
3a01938
0.11.1
fa91780
chore(package): update all dependencies
3615354
feat(format/error): support errors with toJsonRpcError() method (#20)
504b9d9
chore(package): update babel-eslint to version 7.0.0 (#19)
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
Currently, we are using a very large negative number as the rpc id, and each time increase by one.
There's another way to generate unique id by using cuid: http://npmjs.com/package/cuid
Personally, I'm using cuid a lot, so I'd like to suggest we use cuid to generate our Peer rpc id too.
If you agree to use cuid, I'll make it in my pull request.
We should deal with the id not exist problem when the server returns a json rpc response with an id that the client does not know. currently, we will get a un-catched promise rejection.
I meet this error today, it seems might relate to a version breaking change of Babel runtime.
This problem will not exist any more after we converted to TypeScript.
11:21:27 INFO PuppetManager install(wechaty-puppet-padchat@^0.8.1) done
{ Error: Cannot find module '@babel/runtime/core-js/object/create'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/ubuntu/workspace/node_modules/json-rpc-peer/dist/index.js:12:38)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/padchat-rpc.ts:4:1)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/padchat-manager.ts:28:1)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/puppet-padchat.ts:80:1)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/index.ts:19:1)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Promise.resolve.then (/home/ubuntu/workspace/src/puppet-manager.ts:79:26) code: 'MODULE_NOT_FOUND' }
11:21:27 ERR Wechaty start() exception: Cannot find module '@babel/runtime/core-js/object/create'
Bot error: { Error: Cannot find module '@babel/runtime/core-js/object/create'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/ubuntu/workspace/node_modules/json-rpc-peer/dist/index.js:12:38)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/padchat-rpc.ts:4:1)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/padchat-manager.ts:28:1)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/puppet-padchat.ts:80:1)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/index.ts:19:1)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Promise.resolve.then (/home/ubuntu/workspace/src/puppet-manager.ts:79:26) code: 'MODULE_NOT_FOUND' }
11:21:27 INFO Wechaty <padchat> stop() v#git[1668086] is stoping ...
11:21:27 SILL StateSwitch <Wechaty> off() is false
11:21:27 SILL StateSwitch <WechatyReady> off() is true
11:21:27 VERB StateSwitch <WechatyReady> off(true) <- (true)
11:21:27 SILL StateSwitch <Wechaty> off() is false
11:21:27 VERB StateSwitch <Wechaty> off(pending) <- (false)
11:21:27 VERB MemoryCard <> save() file: /home/ubuntu/workspace/default.memory-card.json
11:21:27 WARN Wechaty stop() puppet.stop() exception: static puppet not found for Wechaty, please see issue #1217: https://github.com/Chatie/wechaty/issues/1217
11:21:27 SILL StateSwitch <Wechaty> off() is pending
11:21:27 VERB StateSwitch <Wechaty> off(true) <- (pending)
zixia:~/workspace (master) $ ^C
zixia:~/workspace (master) $ vi src/npm ls ^C
zixia:~/workspace (master) $ npm ls @babel/runtime
[email protected] /home/ubuntu/workspace
βββ¬ [email protected]
βββ¬ [email protected]
βββ @babel/[email protected]
Currently, we can only call failPendingRequests()
to make all the pending requests fail.
Sometimes it's better to set a timeout value and let the request failed automatically when it runs time out.
The simplest modification should be to add a timeout
argument to failPendingRequests(timeout: number)
, which can be called period and clean the timeout-ed requests.
A better way to implement it might integrate the timeout with the Peer class.
For example:
interface PeerOptions {
timeout: number
}
class Peer {
constructor(public options: PeerOptions) {
}
// request will be rejected if it did not get any response from the server after timeout milliseconds.
}
Branch | Build failing π¨ |
---|---|
Dependency | cross-env |
Current Version | 3.1.4 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As cross-env is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
<a name"3.2.0">
The new version differs by 4 commits .
dad00c4
feat(revamp): revamp the entire lib (backward compatible) (#63)
e33a85c
docs(README): Add doc for cross-var. (#58)
5e590ec
docs(README): added how to use cross-env to run npm sub-scripts (#53)
afdb2de
docs(README): mention BashΒ onΒ Windows (#49)
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
I think we should also convert the code base of this module from JavaScript to TypeScript too because we had already done JsonRpcProtocol: JsCommunity/json-rpc-protocol#30
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.