File tree Expand file tree Collapse file tree 8 files changed +154
-0
lines changed Expand file tree Collapse file tree 8 files changed +154
-0
lines changed Original file line number Diff line number Diff line change 6
6
"scripts" : {
7
7
"dev" : " cd shells/dev && webpack-dev-server --inline --hot --no-info" ,
8
8
"dev:chrome" : " cd shells/chrome && webpack --watch --hide-modules" ,
9
+ "dev:electron" : " cd shells/electron && webpack --watch --hide-modules" ,
9
10
"dev:safari" : " cd shells/safari && webpack --watch --hide-modules" ,
10
11
"lint" : " eslint src --ext=js,vue && eslint shells/chrome/src && eslint shells/dev/src && eslint shells/safari/src" ,
11
12
"build" : " cd shells/chrome && cross-env NODE_ENV=production webpack --progress --hide-modules" ,
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < title > Vue Developer Tools</ title >
6
+ < style >
7
+ body {
8
+ display : flex;
9
+ flex-direction : column;
10
+ position : absolute;
11
+ top : 0 ;
12
+ left : 0 ;
13
+ right : 0 ;
14
+ bottom : 0 ;
15
+ margin : 0 ;
16
+ padding : 0 ;
17
+ }
18
+ </ style >
19
+ </ head >
20
+ < body >
21
+ < div id ="app "> </ div >
22
+ < script src ="build/devtools.js "> </ script >
23
+ </ body >
24
+ </ html >
Original file line number Diff line number Diff line change
1
+ const { app, BrowserWindow } = require ( 'electron' )
2
+
3
+ let mainWindow = null
4
+
5
+ app . on ( 'window-all-closed' , ( ) => app . quit ( ) )
6
+ app . on ( 'ready' , ( ) => {
7
+ mainWindow = new BrowserWindow ( { width : 800 , height : 600 } )
8
+
9
+ mainWindow . loadURL ( 'file://' + __dirname + '/app.html' )
10
+
11
+ mainWindow . on ( 'closed' , ( ) => mainWindow = null )
12
+ } )
Original file line number Diff line number Diff line change
1
+ const electron = require ( 'electron' )
2
+ const spawn = require ( 'cross-spawn' )
3
+
4
+ const result = spawn . sync (
5
+ electron ,
6
+ [ require . resolve ( './app' ) ] ,
7
+ )
8
+
9
+ process . exit ( result . status )
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " vue-devtools" ,
3
+ "version" : " 0.0.1" ,
4
+ "description" : " StandAlone vue-devtools" ,
5
+ "bin" : {
6
+ "vue-devtools" : " ./bin.js"
7
+ },
8
+ "scripts" : {
9
+ "start" : " node bin.js"
10
+ },
11
+ "author" : " " ,
12
+ "license" : " MIT" ,
13
+ "dependencies" : {
14
+ "cross-spawn" : " ^5.1.0" ,
15
+ "electron" : " ^1.8.1"
16
+ }
17
+ }
Original file line number Diff line number Diff line change
1
+ import { initBackend } from 'src/backend'
2
+ import Bridge from 'src/bridge'
3
+
4
+ const bridge = new Bridge ( {
5
+ listen ( fn ) {
6
+ window . addEventListener ( 'message' , evt => fn ( evt . data ) )
7
+ } ,
8
+ send ( data ) {
9
+ console . log ( 'backend -> devtools' , data )
10
+ window . parent . postMessage ( data , '*' )
11
+ }
12
+ } )
13
+
14
+ initBackend ( bridge )
Original file line number Diff line number Diff line change
1
+ import { initDevTools } from 'src/devtools'
2
+ import Bridge from 'src/bridge'
3
+
4
+ initDevTools ( {
5
+ connect ( callback ) {
6
+ console . log ( 'connect has been called' )
7
+
8
+ const wall = {
9
+ listen ( fn ) {
10
+ console . log ( 'wall.listen has been called' )
11
+ } ,
12
+ send ( data ) {
13
+ console . log ( 'wall.send has been called' , data )
14
+ }
15
+ }
16
+ const bridge = new Bridge ( wall )
17
+
18
+ callback ( bridge )
19
+ } ,
20
+ onReload ( fn ) {
21
+ console . log ( 'onReload has been called' )
22
+ }
23
+ } )
Original file line number Diff line number Diff line change
1
+ var path = require ( 'path' )
2
+ var webpack = require ( 'webpack' )
3
+ var alias = require ( '../alias' )
4
+ var FriendlyErrorsPlugin = require ( 'friendly-errors-webpack-plugin' )
5
+
6
+ var bubleOptions = {
7
+ target : { chrome : 52 , firefox : 48 } ,
8
+ objectAssign : 'Object.assign'
9
+ }
10
+
11
+ module . exports = {
12
+ entry : {
13
+ devtools : './src/devtools.js' ,
14
+ backend : './src/backend.js' ,
15
+ } ,
16
+ output : {
17
+ path : __dirname + '/build' ,
18
+ publicPath : '/build/' ,
19
+ filename : '[name].js' ,
20
+ } ,
21
+ resolve : {
22
+ alias
23
+ } ,
24
+ module : {
25
+ rules : [
26
+ {
27
+ test : / \. j s $ / ,
28
+ loader : 'buble-loader' ,
29
+ exclude : / n o d e _ m o d u l e s | v u e \/ d i s t | v u e x \/ d i s t / ,
30
+ options : bubleOptions
31
+ } ,
32
+ {
33
+ test : / \. v u e $ / ,
34
+ loader : 'vue-loader' ,
35
+ options : {
36
+ preserveWhitespace : false ,
37
+ buble : bubleOptions
38
+ }
39
+ } ,
40
+ {
41
+ test : / \. ( p n g | w o f f 2 ) $ / ,
42
+ loader : 'url-loader?limit=0'
43
+ }
44
+ ]
45
+ } ,
46
+ performance : {
47
+ hints : false
48
+ } ,
49
+ devtool : '#cheap-module-source-map' ,
50
+ devServer : {
51
+ quiet : true
52
+ } ,
53
+ plugins : process . env . VUE_DEVTOOL_TEST ? [ ] :[ new FriendlyErrorsPlugin ( ) ]
54
+ }
You can’t perform that action at this time.
0 commit comments