Skip to content

Commit 59f5913

Browse files
committedFeb 4, 2018
feat: update default component content
1 parent 691cfa2 commit 59f5913

File tree

6 files changed

+72
-28
lines changed

6 files changed

+72
-28
lines changed
 

‎packages/@vue/cli-plugin-typescript/generator/template/src/components/HelloWorld.vue

+19-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
<template>
22
<div class="hello">
33
<h1>{{ msg }}</h1>
4-
<h2>Essential Links</h2>
4+
<p>
5+
For guide and recipes on how to configure / customize this project,<br>
6+
check out the
7+
<a href="https://github.com/vuejs/vue-cli/tree/dev/docs" target="_blank">vue-cli documentation</a>.
8+
</p>
9+
<h3>Installed CLI Plugins</h3>
10+
<ul>
11+
<%_ for (plugin of plugins) { _%>
12+
<li><a href="<%- plugin.link %>" target="_blank"><%- plugin.name %></a></li>
13+
<%_ } _%>
14+
</ul>
15+
<h3>Essential Links</h3>
516
<ul>
617
<li><a href="https://vuejs.org" target="_blank">Core Docs</a></li>
718
<li><a href="https://forum.vuejs.org" target="_blank">Forum</a></li>
819
<li><a href="https://chat.vuejs.org" target="_blank">Community Chat</a></li>
920
<li><a href="https://twitter.com/vuejs" target="_blank">Twitter</a></li>
10-
<br>
11-
<li><a href="http://vuejs-templates.github.io/webpack/" target="_blank">Docs for This Template</a></li>
1221
</ul>
13-
<h2>Ecosystem</h2>
22+
<h3>Ecosystem</h3>
1423
<ul>
15-
<li><a href="http://router.vuejs.org/" target="_blank">vue-router</a></li>
16-
<li><a href="http://vuex.vuejs.org/" target="_blank">vuex</a></li>
17-
<li><a href="http://vue-loader.vuejs.org/" target="_blank">vue-loader</a></li>
24+
<li><a href="https://router.vuejs.org/en/essentials/getting-started.html" target="_blank">vue-router</a></li>
25+
<li><a href="https://vuex.vuejs.org/en/intro.html" target="_blank">vuex</a></li>
26+
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank">vue-devtools</a></li>
27+
<li><a href="https://vue-loader.vuejs.org/en" target="_blank">vue-loader</a></li>
1828
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank">awesome-vue</a></li>
1929
</ul>
2030
</div>
@@ -42,8 +52,8 @@ export default class HelloWorld extends Vue {
4252

4353
<!-- Add "scoped" attribute to limit CSS to this component only -->
4454
<style scoped>
45-
h1, h2 {
46-
font-weight: normal;
55+
h3 {
56+
margin: 40px 0 0;
4757
}
4858
ul {
4959
list-style-type: none;

‎packages/@vue/cli-service/__tests__/buildLib.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ test('build as lib', async () => {
3939
})
4040
expect(h1Text).toMatch('') // no props given
4141

42-
const h2Text = await page.evaluate(() => {
43-
return document.querySelector('h2').textContent
42+
const h3Text = await page.evaluate(() => {
43+
return document.querySelector('h3').textContent
4444
})
45-
expect(h2Text).toMatch('Essential Links')
45+
expect(h3Text).toMatch('Installed CLI Plugins')
4646
})
4747

4848
afterAll(async () => {

‎packages/@vue/cli-service/__tests__/buildWc.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ test('build as wc', async () => {
4747
})
4848
expect(childStyleCount).toBe(1)
4949

50-
const h2Text = await page.evaluate(() => {
51-
return document.querySelector('build-wc-hello-world').shadowRoot.querySelector('h2').textContent
50+
const h3Text = await page.evaluate(() => {
51+
return document.querySelector('build-wc-hello-world').shadowRoot.querySelector('h3').textContent
5252
})
53-
expect(h2Text).toMatch('Essential Links')
53+
expect(h3Text).toMatch('Installed CLI Plugins')
5454
})
5555

5656
afterAll(async () => {

‎packages/@vue/cli-service/__tests__/buildWcAsync.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ test('build as wc in async mode', async () => {
5353
})
5454
expect(childStyleCount).toBe(1)
5555

56-
const h2Text = await page.evaluate(() => {
57-
return document.querySelector('build-wc-async-hello-world').shadowRoot.querySelector('h2').textContent
56+
const h3Text = await page.evaluate(() => {
57+
return document.querySelector('build-wc-async-hello-world').shadowRoot.querySelector('h3').textContent
5858
})
59-
expect(h2Text).toMatch('Essential Links')
59+
expect(h3Text).toMatch('Installed CLI Plugins')
6060
})
6161

6262
afterAll(async () => {

‎packages/@vue/cli-service/generator/index.js

+25-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
1+
// get link for a 3rd party plugin.
2+
function getLink (id) {
3+
const pkg = require(`${id}/package.json`)
4+
return (
5+
pkg.homepage ||
6+
(pkg.repository && pkg.repository.url) ||
7+
`https://www.npmjs.com/package/${id.replace(`/`, `%2F`)}`
8+
)
9+
}
10+
111
module.exports = (api, options) => {
2-
api.render('./template')
12+
api.render('./template', {
13+
plugins: api.generator.plugins
14+
.filter(({ id }) => id !== `@vue/cli-service`)
15+
.map(({ id }) => {
16+
const name = id.replace(/^(@vue|vue-)\/cli-plugin-/, '')
17+
const isOfficial = /^@vue/.test(id)
18+
return {
19+
name: name,
20+
link: isOfficial
21+
? `https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-${name}`
22+
: getLink(id)
23+
}
24+
})
25+
})
26+
327
api.extendPackage({
428
scripts: {
529
'serve': 'vue-cli-service serve' + (

‎packages/@vue/cli-service/generator/template/src/components/HelloWorld.vue

+19-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
<template>
22
<div class="hello">
33
<h1>{{ msg }}</h1>
4-
<h2>Essential Links</h2>
4+
<p>
5+
For guide and recipes on how to configure / customize this project,<br>
6+
check out the
7+
<a href="https://github.com/vuejs/vue-cli/tree/dev/docs" target="_blank">vue-cli documentation</a>.
8+
</p>
9+
<h3>Installed CLI Plugins</h3>
10+
<ul>
11+
<%_ for (plugin of plugins) { _%>
12+
<li><a href="<%- plugin.link %>" target="_blank"><%- plugin.name %></a></li>
13+
<%_ } _%>
14+
</ul>
15+
<h3>Essential Links</h3>
516
<ul>
617
<li><a href="https://vuejs.org" target="_blank">Core Docs</a></li>
718
<li><a href="https://forum.vuejs.org" target="_blank">Forum</a></li>
819
<li><a href="https://chat.vuejs.org" target="_blank">Community Chat</a></li>
920
<li><a href="https://twitter.com/vuejs" target="_blank">Twitter</a></li>
10-
<br>
11-
<li><a href="http://vuejs-templates.github.io/webpack/" target="_blank">Docs for This Template</a></li>
1221
</ul>
13-
<h2>Ecosystem</h2>
22+
<h3>Ecosystem</h3>
1423
<ul>
15-
<li><a href="http://router.vuejs.org/" target="_blank">vue-router</a></li>
16-
<li><a href="http://vuex.vuejs.org/" target="_blank">vuex</a></li>
17-
<li><a href="http://vue-loader.vuejs.org/" target="_blank">vue-loader</a></li>
24+
<li><a href="https://router.vuejs.org/en/essentials/getting-started.html" target="_blank">vue-router</a></li>
25+
<li><a href="https://vuex.vuejs.org/en/intro.html" target="_blank">vuex</a></li>
26+
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank">vue-devtools</a></li>
27+
<li><a href="https://vue-loader.vuejs.org/en" target="_blank">vue-loader</a></li>
1828
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank">awesome-vue</a></li>
1929
</ul>
2030
</div>
@@ -31,8 +41,8 @@ export default {
3141

3242
<!-- Add "scoped" attribute to limit CSS to this component only -->
3343
<style scoped>
34-
h1, h2 {
35-
font-weight: normal;
44+
h3 {
45+
margin: 40px 0 0;
3646
}
3747
ul {
3848
list-style-type: none;

0 commit comments

Comments
 (0)
Please sign in to comment.