Skip to content

Commit 5955259

Browse files
committed
Merge branch 'dev' into add-router-tab
2 parents c64b462 + c5de65f commit 5955259

File tree

158 files changed

+14266
-3640
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+14266
-3640
lines changed

.browserslistrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Chrome >= 52
2+
Firefox >= 48

.circleci/config.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
# specify the version you desire here
6+
- image: circleci/node:8.10-browsers
7+
8+
working_directory: ~/repo
9+
10+
steps:
11+
- checkout
12+
13+
# Download and cache dependencies
14+
- restore_cache:
15+
keys:
16+
- v2-dependencies-{{ checksum "yarn.lock" }}
17+
# fallback to using the latest cache if no exact match is found
18+
- v2-dependencies-
19+
20+
- run: yarn install
21+
22+
- save_cache:
23+
paths:
24+
- node_modules
25+
- ~/.cache/yarn
26+
- ~/.cache/Cypress
27+
key: v2-dependencies-{{ checksum "yarn.lock" }}
28+
29+
# run tests!
30+
- run: yarn test
31+
32+
- store_artifacts:
33+
path: cypress/videos
34+
- store_artifacts:
35+
path: cypress/screenshots

.eslintrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
'root': true,
3+
'env': {
4+
'browser': true
5+
},
6+
'extends': [
7+
'standard',
8+
'plugin:vue/recommended'
9+
],
10+
'globals': {
11+
'bridge': true,
12+
'chrome': true,
13+
'localStorage': true,
14+
'HTMLDocument': true
15+
},
16+
'rules': {
17+
'vue/html-closing-bracket-newline': ['error', {
18+
'singleline': 'never',
19+
'multiline': 'always'
20+
}]
21+
}
22+
}

.github/ISSUE_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!--
2+
IMPORTANT: Please use the following link to create a new issue:
3+
4+
https://new-issue.vuejs.org/?repo=vuejs/vue-devtools
5+
6+
If your issue was not created using the app above, it will be closed immediately.
7+
-->

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ node_modules
22
.DS_Store
33
build
44
*.zip
5+
*.xpi
56
tests_output
67
selenium-debug.log
78
TODOs.md
8-
.vscode
9+
.idea
10+
.web-extension-id
11+
yarn-error.log

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014-2016 Evan You
3+
Copyright (c) 2014-present Evan You
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,23 @@
66

77
2. To make it work for pages opened via `file://` protocol, you need to check "Allow access to file URLs" for this extension in Chrome's extension management panel.
88

9-
<p align="center"><img width="600px" src="https://raw.githubusercontent.com/vuejs/vue-devtools/master/media/screenshot.png" alt="demo"></p>
9+
<p align="center"><img width="720px" src="https://raw.githubusercontent.com/vuejs/vue-devtools/master/media/screenshot-shadow.png" alt="screenshot"></p>
1010

1111
Works with [vuex](https://github.com/vuejs/vuex) for time-travel debugging:
1212

1313
<p align="center"><img width="600px" src="https://raw.githubusercontent.com/vuejs/vue-devtools/master/media/demo.gif" alt="demo"></p>
1414

1515
### Installation
1616

17-
Currently only a Chrome devtools extension is available.
17+
- [Get the Chrome Extension](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd) ([beta](https://chrome.google.com/webstore/detail/vuejs-devtools/ljjemllljcmogpfapbkkighbhhppjdbg))
1818

19-
[Get it on the Chrome Web Store](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd).
19+
- [Get the Firefox Addon](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/) ([beta](https://github.com/vuejs/vue-devtools/releases))
2020

21-
[Workaround for Firefox](https://github.com/vuejs/vue-devtools/blob/master/docs/workaround-for-firefox.md)
21+
- [Get standalone Electron app (works with any environment!)](https://github.com/vuejs/vue-devtools/blob/master/shells/electron/README.md)
22+
23+
#### Open component in editor
24+
25+
To enable this feature, follow [this guide](./docs/open-in-editor.md).
2226

2327
### Manual Installation
2428

@@ -36,7 +40,45 @@ Currently only a Chrome devtools extension is available.
3640
1. Clone this repo
3741
2. `npm install`
3842
3. `npm run dev`
39-
4. A plain shell with a test app will be available at `localhost:8080`.
43+
4. A plain shell with a test app will be available at `localhost:8100`.
44+
45+
### Testing as Firefox addon
46+
47+
1. Install `web-ext`
48+
49+
~~~~
50+
$ npm install --global web-ext
51+
~~~~
52+
53+
Or, for Yarn:
54+
55+
~~~~
56+
$ yarn global add web-ext
57+
~~~~
58+
59+
Also, make sure `PATH` is set up. Something like this in `~/.bash_profile`:
60+
61+
~~~~
62+
$ PATH=$PATH:$(yarn global bin)
63+
~~~~
64+
65+
2. Build and run in Firefox
66+
67+
~~~~
68+
$ npm run build
69+
$ npm run run:firefox
70+
~~~~
71+
72+
When using Yarn, just replace `npm` with `yarn`.
73+
74+
75+
### Common problems and how to fix
76+
77+
1. Fixing "Download the Vue Devtools for a better development experience" console message when working locally over `file://` protocol:
78+
1.1 - Google Chrome: Right click on vue-devtools icon and click "Manage Extensions" then search for vue-devtools on the extensions list. Check the "Allow access to file URLs" box.
79+
80+
2. How to use the devtools in IE/Edge/Safari or any other browser? [Get the standalone Electron app (works with any environment!)](https://github.com/vuejs/vue-devtools/blob/master/shells/electron/README.md)
81+
4082

4183
### License
4284

cypress.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"viewportWidth": 1280,
3+
"viewportHeight": 800,
4+
"chromeWebSecurity": false
5+
}

cypress/.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
'plugins': [
3+
'cypress'
4+
],
5+
'env': {
6+
'mocha': true,
7+
'cypress/globals': true
8+
},
9+
'rules': {
10+
'strict': 'off'
11+
}
12+
}

cypress/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/screenshots
2+
/videos

cypress/fixtures/example.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}

cypress/integration/components-tab.js

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import { suite } from '../utils/suite'
2+
3+
const baseInstanceCount = 8
4+
5+
suite('components tab', () => {
6+
it('should detect instances inside shadow DOM', () => {
7+
cy.get('.tree > .instance:last-child').contains('Shadow')
8+
})
9+
10+
it('should select instance', () => {
11+
cy.get('.instance .self').eq(0).click().then(el => {
12+
expect(el).to.have.class('selected')
13+
})
14+
cy.get('.tree').should('be.visible')
15+
cy.get('.action-header .title').contains('Root')
16+
cy.get('.data-field').contains('$route')
17+
})
18+
19+
it('should expand root by default', () => {
20+
cy.get('.instance').should('have.length', baseInstanceCount)
21+
})
22+
23+
it('should select child instance', () => {
24+
cy.get('.instance .instance:nth-child(1) .self').eq(0).click()
25+
cy.get('.action-header .title').contains('Counter')
26+
cy.get('.data-el.vuex-bindings .data-field').contains('count:0')
27+
cy.get('.data-el.computed .data-field').contains('test:1')
28+
cy.get('.data-el.firebase-bindings .data-field').contains('hello:undefined')
29+
})
30+
31+
it('should display prop of different types', () => {
32+
cy.get('.instance .instance:nth-child(2) .self').eq(0).click()
33+
cy.get('.action-header .title').contains('Target')
34+
cy.get('.data-el.props .data-field:nth-child(1)').contains('ins:Object')
35+
cy.get('.data-el.props .data-field:nth-child(2)').contains('msg:"hi"')
36+
cy.get('.data-el.props .data-field:nth-child(3)').contains('obj:undefined')
37+
// Regexp
38+
cy.get('.data-el.data .data-field:nth-child(8)').then(el => {
39+
expect(el.text()).to.include('regex:/(a\\w+b)/g')
40+
})
41+
// Literals
42+
cy.get('.data-el.data .data-field:nth-child(5)').contains('NaN')
43+
cy.get('.data-el.data .data-field:nth-child(2)').contains('Infinity')
44+
cy.get('.data-el.data .data-field:nth-child(6)').contains('-Infinity')
45+
})
46+
47+
it('should expand child instance', () => {
48+
cy.get('.instance .instance:nth-child(2) .arrow-wrapper').click()
49+
cy.get('.instance').should('have.length', baseInstanceCount + 7)
50+
})
51+
52+
it('should add/remove component from app side', () => {
53+
cy.get('#target').iframe().then(({ get }) => {
54+
get('.add').click({ force: true })
55+
})
56+
cy.get('.instance').should('have.length', baseInstanceCount + 10)
57+
cy.get('#target').iframe().then(({ get }) => {
58+
get('.remove').click({ force: true })
59+
})
60+
cy.get('.instance').should('have.length', baseInstanceCount + 9)
61+
})
62+
63+
it('should filter components', () => {
64+
cy.get('.left .search input').clear().type('counter')
65+
cy.get('.instance').should('have.length', 1)
66+
cy.get('.left .search input').clear().type('target')
67+
cy.get('.instance').should('have.length', 10)
68+
cy.get('.left .search input').clear()
69+
})
70+
71+
it('should select component', () => {
72+
cy.get('.select-component').click()
73+
cy.get('#target').iframe().then(({ get }) => {
74+
get('.mine').eq(0)
75+
.trigger('mouseover', { force: true })
76+
.click({ force: true })
77+
})
78+
cy.get('.action-header .title').contains('Mine')
79+
cy.get('.tree').then(el => {
80+
expect(el.text()).to.include('<Mine>')
81+
})
82+
})
83+
84+
it('should display render key', () => {
85+
cy.get('.instance .self .attr-title').contains('key')
86+
cy.get('.instance .self .attr-value').contains('1')
87+
})
88+
89+
it('should display injected props', () => {
90+
cy.get('.left .search input').clear().type('Mine')
91+
cy.get('.instance').eq(1).click()
92+
cy.get('.right .data-wrapper').then(el => {
93+
expect(el.text()).to.contain('injected')
94+
expect(el.text()).to.contain('answer:42')
95+
expect(el.text()).to.contain('foo:"bar"')
96+
expect(el.text()).to.contain('noop:ƒ noop(a, b, c)')
97+
})
98+
cy.get('.left .search input').clear()
99+
})
100+
})

cypress/integration/events-tab.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { suite } from '../utils/suite'
2+
3+
suite('events tab', () => {
4+
it('should display new events counter', () => {
5+
cy.get('#target').iframe().then(({ get }) => {
6+
get('.btn-emit-event').click({ force: true })
7+
get('.btn-emit-event1').click({ force: true })
8+
get('.btn-emit-event2').click({ force: true })
9+
})
10+
cy.get('.events-tab .tag').contains(3)
11+
cy.get('.events-tab').click()
12+
cy.get('.events-tab .tag').should('not.be.visible')
13+
})
14+
15+
it('should display events', () => {
16+
cy.get('.history .entry').should('have.length', 3)
17+
})
18+
19+
it('should add event', () => {
20+
cy.get('#target').iframe().then(({ get }) => {
21+
get('.btn-emit-log-event').click({ force: true })
22+
})
23+
cy.get('.history .entry').should('have.length', 4)
24+
})
25+
26+
it('should search events', () => {
27+
cy.get('.left .search input').clear().type('event')
28+
cy.get('.history .entry[data-active="true"]').should('have.length', 3)
29+
cy.get('.left .search input').clear().type('<eventchild1>')
30+
cy.get('.history .entry[data-active="true"]').should('have.length', 1)
31+
cy.get('.left .search input').clear()
32+
cy.get('.button.reset').click()
33+
cy.get('.history .entry[data-active="true"]').should('have.length', 0)
34+
})
35+
})

cypress/integration/vuex-edit.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { suite } from '../utils/suite'
2+
3+
suite('vuex edit', () => {
4+
it('should edit state', () => {
5+
cy.get('.vuex-tab').click()
6+
// using the decrease button
7+
cy.get('.data-field').eq(0)
8+
.find('.actions .vue-ui-button').eq(1)
9+
.click({ force: true })
10+
.click({ force: true })
11+
12+
cy.get('#target').iframe().then(({ get }) => {
13+
get('#counter p').contains('-2')
14+
})
15+
16+
// using the increase button
17+
cy.get('.data-field').eq(0).click()
18+
.find('.actions .vue-ui-button').eq(2)
19+
.click({ force: true })
20+
.click({ force: true })
21+
22+
cy.get('#target').iframe().then(({ get }) => {
23+
get('#counter p').contains('0')
24+
})
25+
26+
// using the edit input
27+
cy.get('.data-field').eq(0).click()
28+
.find('.actions .vue-ui-button').eq(0).click({ force: true })
29+
cy.get('.edit-input').type('12')
30+
cy.get('.edit-overlay > .actions > :nth-child(2) > .content > .vue-ui-icon').click()
31+
32+
cy.get('#target').iframe().then(({ get }) => {
33+
get('#counter p').contains('12')
34+
})
35+
36+
// change count back to 1
37+
cy.get('.data-field').eq(0).click()
38+
.find('.actions .vue-ui-button').eq(0).click({ force: true })
39+
cy.get('.edit-input').type('0')
40+
cy.get('.edit-overlay > .actions > :nth-child(2) > .content > .vue-ui-icon').click()
41+
42+
cy.get('#target').iframe().then(({ get }) => {
43+
get('#counter p').contains('0')
44+
})
45+
})
46+
})

0 commit comments

Comments
 (0)