Skip to content

Commit 8ca06ce

Browse files
committed
Added standalone app
1 parent 464e707 commit 8ca06ce

File tree

9 files changed

+106
-6
lines changed

9 files changed

+106
-6
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ I hope to be able to scaffold an app so that identifying the below in unnecessar
3434
|- App.vue
3535
|- popup.html
3636
|- popup.js
37+
|- standalone/
38+
|- router/
39+
|- pages/
40+
|- Index.vue
41+
|- index.js
42+
|- routes.js
43+
|- App.vue
44+
|- standalone.html
45+
|- standalone.js
3746
|- store/
3847
|- actions.js
3948
|- getters.js
@@ -77,7 +86,6 @@ yarn test
7786
## Roadmap
7887
- Add some generator options for other pieces of browser extensions. This includes scaffolding the components/dirs, and registering the build options into the build time hooks.
7988
- Dev Tools
80-
- Dedicated extension pages
8189
- A preset
8290
- Key Generation
8391
- Cleanup the dist-zip directory

generator/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ module.exports = (api, options) => {
5555
}
5656
}
5757

58+
if (options.components.standalone) {
59+
console.log('Generating standalone app')
60+
api.render('./template/standalone', { name, ...options })
61+
62+
pkg.vue.pages['standalone/standalone'] = {
63+
entry: 'src/standalone/standalone.js',
64+
filename: 'app.html',
65+
title: name
66+
}
67+
}
68+
5869
if (options.components.contentScript) {
5970
api.render('./template/content-script', { ...options })
6071
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<template>
2+
<div>
3+
<router-view></router-view>
4+
</div>
5+
</template>
6+
7+
<script>
8+
export default {
9+
data () {
10+
return {}
11+
}
12+
}
13+
</script>
14+
15+
<style>
16+
html {
17+
width: 400px;
18+
height: 400px;
19+
}
20+
</style>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Vue from 'vue'
2+
import VueRouter from 'vue-router'
3+
import routes from './routes'
4+
5+
Vue.use(VueRouter)
6+
7+
export default new VueRouter({
8+
routes
9+
})
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<template>
2+
<p>Hello world!</p>
3+
</template>
4+
5+
<script>
6+
export default {
7+
data () {
8+
return {}
9+
},
10+
mounted () {
11+
chrome.runtime.sendMessage({});
12+
}
13+
}
14+
</script>
15+
16+
<style scoped>
17+
p {
18+
font-size: 20px;
19+
}
20+
</style>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import PageIndex from './pages/Index'
2+
3+
export default [
4+
{
5+
path: '/',
6+
component: PageIndex
7+
}
8+
]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<title><%- '\<\%= htmlWebpackPlugin.options.title \%\>' %></title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
</body>
12+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Vue from 'vue'
2+
import App from './App'
3+
import store from '../store'
4+
import router from './router'
5+
6+
/* eslint-disable no-new */
7+
new Vue({
8+
el: '#app',
9+
store,
10+
router,
11+
render: h => h(App)
12+
})

prompts.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ module.exports = [
2020
name: 'Content Script',
2121
value: 'contentScript',
2222
short: 'content script'
23-
// },
24-
// {
25-
// name: 'Standalone Tab',
26-
// value: 'standalone',
27-
// short: 'standalone'
23+
},
24+
{
25+
name: 'Standalone Tab',
26+
value: 'standalone',
27+
short: 'standalone'
2828
// },
2929
// {
3030
// name: 'Dev Tools Tab',

0 commit comments

Comments
 (0)