WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
File tree Expand file tree Collapse file tree 4 files changed +24
-1
lines changed
Expand file tree Collapse file tree 4 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,18 @@ module.exports = (ipc) =>
246246 } )
247247 } )
248248
249+ // open the inspector when in devmode
250+ // (except if we're opening the pear://runtime app to avoid loop)
251+ const PEAR_RUNTIME_KEY = constants . ALIASES . runtime . toString ( 'hex' )
252+
253+ if ( flags . dev && key !== PEAR_RUNTIME_KEY ) {
254+ const inspectorKey = ( await ipc . inspect ( ) ) . toString ( 'hex' )
255+ daemon ( constants . RUNTIME , [
256+ 'run' ,
257+ `pear://${ PEAR_RUNTIME_KEY } /dev?${ inspectorKey } `
258+ ] )
259+ }
260+
249261 return new Promise ( ( resolve ) => global . Pear . teardown ( resolve , Infinity ) )
250262 }
251263
Original file line number Diff line number Diff line change 22import Runtime from 'pear-electron'
33import Bridge from 'pear-bridge'
44import updates from 'pear-updates'
5+ import bareInspector from 'bare-inspector'
6+ import { Inspector } from 'pear-inspect'
7+
58
69updates ( ( update ) => {
710 console . log ( 'Application update available:' , update )
@@ -14,6 +17,10 @@ const runtime = new Runtime()
1417const pipe = await runtime . start ( { bridge } )
1518pipe . on ( 'close' , ( ) => Pear . exit ( ) )
1619
20+ const inspector = new Inspector ( { inspector : bareInspector } )
21+ const inspectorKey = await inspector . enable ( ) // Pass the public key to the Session
22+ console . log ( `Add this key to Pear Runtime: ${ inspectorKey . toString ( 'hex' ) } ` )
23+
1724pipe . on ( 'data' , ( data ) => {
1825 const cmd = Buffer . from ( data ) . toString ( )
1926 if ( cmd === 'hello from ui' ) pipe . write ( 'sweet bidirectionality' )
Original file line number Diff line number Diff line change 1818 }
1919 },
2020 "devDependencies" : {
21+ "bare-inspector" : " ^5.0.0" ,
2122 "brittle" : " ^3.0.0" ,
23+ "pear-inspect" : " ^1.2.5" ,
2224 "pear-interface" : " ^1.0.0"
2325 },
2426 "dependencies" : {
2527 "pear-bridge" : " ^1.2.1" ,
26- "pear-electron" : " ^1.7.20 " ,
28+ "pear-electron" : " ^1.7.25 " ,
2729 "pear-messages" : " ^1.0.3" ,
2830 "pear-pipe" : " ^1.0.1" ,
2931 "pear-updates" : " ^1.0.1"
You can’t perform that action at this time.
0 commit comments