Skip to content

Commit 006ffff

Browse files
author
Guillaume Chau
committed
feat: beta channel
1 parent 79687b7 commit 006ffff

File tree

5 files changed

+51
-4
lines changed

5 files changed

+51
-4
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"zip:chrome": "cd shells && zip -r -FS ../dist/chrome.zip chrome -x *src/* -x *webpack.config.js",
1515
"zip:firefox": "web-ext build -s shells/chrome -a dist -i src --overwrite-dest",
1616
"release": "node release.js && npm run test && npm run build && npm run zip",
17+
"release:beta": "cross-env CHANNEL=beta && npm run release",
1718
"test": "npm run lint && npm run test:e2e",
1819
"test:e2e": "cross-env PORT=4040 start-server-and-test dev:shell http://localhost:4040 test:e2e:run",
1920
"test:e2e:run": "cypress run --config baseUrl=http://localhost:4040",

shells/createConfig.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ module.exports = (config, target = { chrome: 52, firefox: 48 }) => {
6666
},
6767
plugins: [
6868
new VueLoaderPlugin(),
69-
...(process.env.VUE_DEVTOOL_TEST ? [] : [new FriendlyErrorsPlugin()])
69+
...(process.env.VUE_DEVTOOL_TEST ? [] : [new FriendlyErrorsPlugin()]),
70+
new webpack.DefinePlugin({
71+
'process.env': {
72+
CHANNEL: JSON.stringify(process.env.CHANNEL || 'stable')
73+
}
74+
})
7075
],
7176
devServer: {
7277
port: process.env.PORT

src/devtools/App.vue

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
<div
33
id="app"
44
class="app"
5+
:class="{
6+
beta: isBeta
7+
}"
58
>
69
<datalist id="special-tokens">
710
<option
@@ -22,7 +25,16 @@
2225
:key="message"
2326
class="message"
2427
>
25-
{{ message }}
28+
<span>{{ message }}</span>
29+
30+
<span class="badges">
31+
<span
32+
v-if="isBeta"
33+
class="badge"
34+
>
35+
beta devtools
36+
</span>
37+
</span>
2638
</span>
2739
</transition>
2840
</span>
@@ -207,8 +219,18 @@ export default {
207219
background-color $background-color
208220
display flex
209221
flex-direction column
222+
position relative
210223
.vue-ui-dark-mode &
211224
background-color $dark-background-color
225+
&.beta
226+
&::after
227+
display block
228+
content ''
229+
position absolute
230+
top 0
231+
left 0
232+
width 100%
233+
border-top 2px rgba($orange, .4) solid
212234
213235
.header
214236
display flex
@@ -236,6 +258,23 @@ export default {
236258
color $active-color
237259
transition all .3s ease
238260
position absolute
261+
display flex
262+
align-items center
263+
264+
.badges
265+
display flex
266+
align-items center
267+
268+
.badge
269+
background rgba($orange, .7)
270+
color white
271+
font-size 10px
272+
line-height 10px
273+
padding 2px 6px
274+
border-radius 8px
275+
margin-left 6px
276+
.vue-ui-dark-mode &
277+
opacity .75
239278
240279
.actions
241280
flex auto 1 1

src/devtools/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ let panelShown = !isChrome
1414
let pendingAction = null
1515

1616
const isDark = isChrome ? chrome.devtools.panels.themeName === 'dark' : false
17+
const isBeta = process.env.CHANNEL === 'beta'
1718

1819
// Capture and log devtool errors when running as actual extension
1920
// so that we can debug it by inspecting the background page.
@@ -160,7 +161,8 @@ function initApp (shell) {
160161
store,
161162

162163
data: {
163-
isDark
164+
isDark,
165+
isBeta
164166
},
165167

166168
watch: {

src/devtools/variables.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $green = #42B983
77
$darkerGreen = #3BA776
88
$slate = #242424
99
$white = #FFFFFF
10-
$orange = #DB6B00
10+
$orange = #FF6B00
1111
$red = #c41a16
1212
$black = #222
1313
$vividBlue = #0033cc

0 commit comments

Comments
 (0)