create-vue 3.0.0-alpha.2 → 3.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +6 -0
  2. package/index.js +27 -43
  3. package/outfile.cjs +5693 -0
  4. package/package.json +22 -14
  5. package/template/base/package.json +4 -4
  6. package/template/code/default/cypress/integration/example.spec.js +1 -1
  7. package/template/code/default/src/App.vue +73 -14
  8. package/template/code/default/src/assets/base.css +74 -0
  9. package/template/code/default/src/assets/logo.svg +1 -0
  10. package/template/code/default/src/components/HelloWorld.vue +28 -41
  11. package/template/code/default/src/components/Welcome.vue +84 -0
  12. package/template/code/default/src/components/WelcomeItem.vue +86 -0
  13. package/template/code/default/src/components/__tests__/HelloWorld.spec.js +0 -9
  14. package/template/code/default/src/components/icons/IconCommunity.vue +7 -0
  15. package/template/code/default/src/components/icons/IconDocumentation.vue +7 -0
  16. package/template/code/default/src/components/icons/IconEcosystem.vue +7 -0
  17. package/template/code/default/src/components/icons/IconSupport.vue +7 -0
  18. package/template/code/default/src/components/icons/IconTooling.vue +19 -0
  19. package/template/code/router/cypress/integration/example.spec.js +1 -1
  20. package/template/code/router/src/App.vue +102 -14
  21. package/template/code/router/src/assets/base.css +74 -0
  22. package/template/code/router/src/assets/logo.svg +1 -0
  23. package/template/code/router/src/components/HelloWorld.vue +28 -41
  24. package/template/code/router/src/components/Welcome.vue +84 -0
  25. package/template/code/router/src/components/WelcomeItem.vue +86 -0
  26. package/template/code/router/src/components/__tests__/HelloWorld.spec.js +0 -9
  27. package/template/code/router/src/components/icons/IconCommunity.vue +7 -0
  28. package/template/code/router/src/components/icons/IconDocumentation.vue +7 -0
  29. package/template/code/router/src/components/icons/IconEcosystem.vue +7 -0
  30. package/template/code/router/src/components/icons/IconSupport.vue +7 -0
  31. package/template/code/router/src/components/icons/IconTooling.vue +19 -0
  32. package/template/code/router/src/views/About.vue +10 -0
  33. package/template/code/router/src/views/Home.vue +7 -17
  34. package/template/code/typescript-default/cypress/integration/example.spec.ts +1 -1
  35. package/template/code/typescript-default/src/App.vue +73 -11
  36. package/template/code/typescript-default/src/assets/base.css +74 -0
  37. package/template/code/typescript-default/src/assets/logo.svg +1 -0
  38. package/template/code/typescript-default/src/components/HelloWorld.vue +28 -41
  39. package/template/code/typescript-default/src/components/Welcome.vue +84 -0
  40. package/template/code/typescript-default/src/components/WelcomeItem.vue +86 -0
  41. package/template/code/typescript-default/src/components/__tests__/HelloWorld.spec.ts +0 -9
  42. package/template/code/typescript-default/src/components/icons/IconCommunity.vue +7 -0
  43. package/template/code/typescript-default/src/components/icons/IconDocumentation.vue +7 -0
  44. package/template/code/typescript-default/src/components/icons/IconEcosystem.vue +7 -0
  45. package/template/code/typescript-default/src/components/icons/IconSupport.vue +7 -0
  46. package/template/code/typescript-default/src/components/icons/IconTooling.vue +19 -0
  47. package/template/code/typescript-router/cypress/integration/example.spec.ts +1 -1
  48. package/template/code/typescript-router/src/App.vue +102 -14
  49. package/template/code/typescript-router/src/assets/base.css +74 -0
  50. package/template/code/typescript-router/src/assets/logo.svg +1 -0
  51. package/template/code/typescript-router/src/components/HelloWorld.vue +28 -41
  52. package/template/code/typescript-router/src/components/Welcome.vue +84 -0
  53. package/template/code/typescript-router/src/components/WelcomeItem.vue +86 -0
  54. package/template/code/typescript-router/src/components/__tests__/HelloWorld.spec.ts +0 -9
  55. package/template/code/typescript-router/src/components/icons/IconCommunity.vue +7 -0
  56. package/template/code/typescript-router/src/components/icons/IconDocumentation.vue +7 -0
  57. package/template/code/typescript-router/src/components/icons/IconEcosystem.vue +7 -0
  58. package/template/code/typescript-router/src/components/icons/IconSupport.vue +7 -0
  59. package/template/code/typescript-router/src/components/icons/IconTooling.vue +19 -0
  60. package/template/code/{router/src/main.js → typescript-router/src/main.ts} +0 -0
  61. package/template/code/typescript-router/src/views/About.vue +10 -0
  62. package/template/code/typescript-router/src/views/Home.vue +6 -16
  63. package/template/config/cypress/package.json +4 -4
  64. package/template/config/jsx/package.json +1 -1
  65. package/template/config/router/package.json +1 -1
  66. package/template/{base/vite-env.d.ts → config/typescript/env.d.ts} +0 -0
  67. package/template/config/typescript/package.json +2 -2
  68. package/template/{base/jsconfig.json → config/typescript/tsconfig.json} +1 -2
  69. package/template/code/default/src/assets/logo.png +0 -0
  70. package/template/code/default/src/main.js +0 -4
  71. package/template/code/router/src/assets/logo.png +0 -0
  72. package/template/code/typescript-default/src/assets/logo.png +0 -0
  73. package/template/code/typescript-default/src/main.ts +0 -4
  74. package/template/code/typescript-router/src/assets/logo.png +0 -0
  75. package/template/config/cypress/cypress/.DS_Store +0 -0
  76. package/utils/deepMerge.js +0 -26
  77. package/utils/directoryTraverse.js +0 -29
  78. package/utils/docs/README-TEMPLATE.md +0 -17
  79. package/utils/docs/SFC-TYPE-SUPPORT.md +0 -5
  80. package/utils/generateReadme.js +0 -69
  81. package/utils/getCommand.js +0 -7
  82. package/utils/renderTemplate.js +0 -47
@@ -1,54 +1,41 @@
1
- <template>
2
- <h1>{{ msg }}</h1>
3
-
4
- <p>
5
- Recommended IDE setup:
6
- <a href="https://code.visualstudio.com/" target="_blank">VSCode</a>
7
- +
8
- <a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
9
- </p>
10
-
11
- <p>See <code>README.md</code> for more information.</p>
12
-
13
- <p>
14
- <a href="https://vitejs.dev/guide/features.html" target="_blank">
15
- Vite Docs
16
- </a>
17
- |
18
- <a href="https://v3.vuejs.org/" target="_blank">Vue 3 Docs</a>
19
- </p>
20
-
21
- <button type="button" @click="count++">count is: {{ count }}</button>
22
- <p>
23
- Edit
24
- <code>components/HelloWorld.vue</code> to test hot module replacement.
25
- </p>
26
- </template>
27
-
28
1
  <script setup lang="ts">
29
- import { ref } from 'vue'
30
-
31
2
  defineProps<{
32
3
  msg: String
33
4
  }>()
34
-
35
- const count = ref(0)
36
5
  </script>
37
6
 
7
+ <template>
8
+ <div class="greetings">
9
+ <h1 class="green">{{ msg }}</h1>
10
+ <h3>
11
+ You’ve successfully created a project with
12
+ <a target="_blank" href="https://vitejs.dev/">Vite</a> +
13
+ <a target="_blank" href="https://v3.vuejs.org/">Vue 3</a>. What's next?
14
+ </h3>
15
+ </div>
16
+ </template>
17
+
38
18
  <style scoped>
39
- a {
40
- color: #42b983;
19
+ h1 {
20
+ font-weight: 500;
21
+ font-size: 2.6rem;
22
+ top: -10px;
23
+ }
24
+
25
+ h3 {
26
+ font-size: 1.2rem;
41
27
  }
42
28
 
43
- label {
44
- margin: 0 0.5em;
45
- font-weight: bold;
29
+ .greetings h1,
30
+ .greetings h3 {
31
+ text-align: center;
46
32
  }
47
33
 
48
- code {
49
- background-color: #eee;
50
- padding: 2px 4px;
51
- border-radius: 4px;
52
- color: #304455;
34
+ @media (min-width: 1024px) {
35
+ .greetings h1,
36
+ .greetings h3 {
37
+ display: block;
38
+ text-align: left;
39
+ }
53
40
  }
54
41
  </style>
@@ -0,0 +1,84 @@
1
+ <script setup lang="ts">
2
+ import WelcomeItem from './WelcomeItem.vue'
3
+ import DocumentationIcon from './icons/IconDocumentation.vue'
4
+ import ToolingIcon from './icons/IconTooling.vue'
5
+ import EcosystemIcon from './icons/IconEcosystem.vue'
6
+ import CommunityIcon from './icons/IconCommunity.vue'
7
+ import SupportIcon from './icons/IconSupport.vue'
8
+ </script>
9
+
10
+ <template>
11
+ <WelcomeItem>
12
+ <template #icon>
13
+ <DocumentationIcon />
14
+ </template>
15
+ <template #heading>Documentation</template>
16
+
17
+ Vue’s
18
+ <a target="_blank" href="https://v3.vuejs.org/">official documentation</a>
19
+ provides you with all information you need to get started.
20
+ </WelcomeItem>
21
+
22
+ <WelcomeItem>
23
+ <template #icon>
24
+ <ToolingIcon />
25
+ </template>
26
+ <template #heading>Tooling</template>
27
+
28
+ This project is served and bundled with
29
+ <a href="https://vitejs.dev/guide/features.html" target="_blank">Vite</a>. The recommended IDE
30
+ setup is <a href="https://code.visualstudio.com/" target="_blank">VSCode</a> +
31
+ <a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>. If you need to test
32
+ your components and web pages, check out
33
+ <a href="https://www.cypress.io/" target="_blank">Cypress</a> and
34
+ <a href="https://docs.cypress.io/guides/component-testing/introduction" target="_blank"
35
+ >Cypress Component Testing</a
36
+ >.
37
+
38
+ <br />
39
+
40
+ More instructions are available in <code>README.md</code>.
41
+ </WelcomeItem>
42
+
43
+ <WelcomeItem>
44
+ <template #icon>
45
+ <EcosystemIcon />
46
+ </template>
47
+ <template #heading>Ecosystem</template>
48
+
49
+ Get official tools and libraries for your project:
50
+ <a target="_blank" href="https://next.vuex.vuejs.org/">Vuex</a>,
51
+ <a target="_blank" href="https://next.router.vuejs.org/">Vue Router</a>,
52
+ <a target="_blank" href="https://next.vue-test-utils.vuejs.org/">Vue Test Utils</a>, and
53
+ <a target="_blank" href="https://github.com/vuejs/devtools">Vue Dev Tools</a>. If you need more
54
+ resources, we suggest paying
55
+ <a target="_blank" href="https://github.com/vuejs/awesome-vue">Awesome Vue</a>
56
+ a visit.
57
+ </WelcomeItem>
58
+
59
+ <WelcomeItem>
60
+ <template #icon>
61
+ <CommunityIcon />
62
+ </template>
63
+ <template #heading>Community</template>
64
+
65
+ Got stuck? Ask your question on
66
+ <a target="_blank" href="https://chat.vuejs.org">Vue Land</a>, our official Discord server, or
67
+ <a target="_blank" href="https://stackoverflow.com/questions/tagged/vue.js">StackOverflow</a>.
68
+ You should also subscribe to
69
+ <a target="_blank" href="https://news.vuejs.org">our mailing list</a> and follow the official
70
+ <a target="_blank" href="https://twitter.com/vuejs">@vuejs</a>
71
+ twitter account for latest news in the Vue world.
72
+ </WelcomeItem>
73
+
74
+ <WelcomeItem>
75
+ <template #icon>
76
+ <SupportIcon />
77
+ </template>
78
+ <template #heading>Support Vue</template>
79
+
80
+ As an independent project, Vue relies on community backing for its sustainability. You can help
81
+ us by
82
+ <a target="_blank" href="https://vuejs.org/support-vuejs/">becoming a sponsor</a>.
83
+ </WelcomeItem>
84
+ </template>
@@ -0,0 +1,86 @@
1
+ <template>
2
+ <div class="item">
3
+ <i>
4
+ <slot name="icon"></slot>
5
+ </i>
6
+ <div class="details">
7
+ <h3>
8
+ <slot name="heading"></slot>
9
+ </h3>
10
+ <slot></slot>
11
+ </div>
12
+ </div>
13
+ </template>
14
+
15
+ <style scoped>
16
+ .item {
17
+ margin-top: 2rem;
18
+ display: flex;
19
+ }
20
+
21
+ .details {
22
+ flex: 1;
23
+ margin-left: 1rem;
24
+ }
25
+
26
+ i {
27
+ display: flex;
28
+ place-items: center;
29
+ place-content: center;
30
+ width: 32px;
31
+ height: 32px;
32
+
33
+ color: var(--color-text);
34
+ }
35
+
36
+ h3 {
37
+ font-size: 1.2rem;
38
+ font-weight: 500;
39
+ margin-bottom: 0.4rem;
40
+ color: var(--color-heading);
41
+ }
42
+
43
+ @media (min-width: 1024px) {
44
+ .item {
45
+ margin-top: 0;
46
+ padding: 0.4rem 0 1rem calc(var(--section-gap) / 2);
47
+ }
48
+
49
+ i {
50
+ top: calc(50% - 25px);
51
+ left: -26px;
52
+ position: absolute;
53
+ border: 1px solid var(--color-border);
54
+ background: var(--color-background);
55
+ border-radius: 8px;
56
+ width: 50px;
57
+ height: 50px;
58
+ }
59
+
60
+ .item:before {
61
+ content: ' ';
62
+ border-left: 1px solid var(--color-border);
63
+ position: absolute;
64
+ left: 0;
65
+ bottom: calc(50% + 25px);
66
+ height: calc(50% - 25px);
67
+ }
68
+
69
+ .item:after {
70
+ content: ' ';
71
+ border-left: 1px solid var(--color-border);
72
+ position: absolute;
73
+ left: 0;
74
+ top: calc(50% + 25px);
75
+ height: calc(50% - 25px);
76
+ }
77
+
78
+ .item:first-of-type:before {
79
+ display: none;
80
+ }
81
+
82
+ .item:last-of-type:after {
83
+ display: none;
84
+ }
85
+ }
86
+ </style>
@@ -10,13 +10,4 @@ describe('HelloWorld', () => {
10
10
  mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
11
11
  cy.get('h1').should('contain', 'Hello Cypress')
12
12
  })
13
-
14
- it('adds 1 when clicking the plus button', () => {
15
- mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
16
-
17
- cy.get('button')
18
- .should('contain', '0')
19
- .click()
20
- .should('contain', '1')
21
- })
22
13
  })
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor">
3
+ <path
4
+ d="M15 4a1 1 0 1 0 0 2V4zm0 11v-1a1 1 0 0 0-1 1h1zm0 4l-.707.707A1 1 0 0 0 16 19h-1zm-4-4l.707-.707A1 1 0 0 0 11 14v1zm-4.707-1.293a1 1 0 0 0-1.414 1.414l1.414-1.414zm-.707.707l-.707-.707.707.707zM9 11v-1a1 1 0 0 0-.707.293L9 11zm-4 0h1a1 1 0 0 0-1-1v1zm0 4H4a1 1 0 0 0 1.707.707L5 15zm10-9h2V4h-2v2zm2 0a1 1 0 0 1 1 1h2a3 3 0 0 0-3-3v2zm1 1v6h2V7h-2zm0 6a1 1 0 0 1-1 1v2a3 3 0 0 0 3-3h-2zm-1 1h-2v2h2v-2zm-3 1v4h2v-4h-2zm1.707 3.293l-4-4-1.414 1.414 4 4 1.414-1.414zM11 14H7v2h4v-2zm-4 0c-.276 0-.525-.111-.707-.293l-1.414 1.414C5.42 15.663 6.172 16 7 16v-2zm-.707 1.121l3.414-3.414-1.414-1.414-3.414 3.414 1.414 1.414zM9 12h4v-2H9v2zm4 0a3 3 0 0 0 3-3h-2a1 1 0 0 1-1 1v2zm3-3V3h-2v6h2zm0-6a3 3 0 0 0-3-3v2a1 1 0 0 1 1 1h2zm-3-3H3v2h10V0zM3 0a3 3 0 0 0-3 3h2a1 1 0 0 1 1-1V0zM0 3v6h2V3H0zm0 6a3 3 0 0 0 3 3v-2a1 1 0 0 1-1-1H0zm3 3h2v-2H3v2zm1-1v4h2v-4H4zm1.707 4.707l.586-.586-1.414-1.414-.586.586 1.414 1.414z"
5
+ />
6
+ </svg>
7
+ </template>
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" fill="currentColor">
3
+ <path
4
+ d="M11 2.253a1 1 0 1 0-2 0h2zm-2 13a1 1 0 1 0 2 0H9zm.447-12.167a1 1 0 1 0 1.107-1.666L9.447 3.086zM1 2.253L.447 1.42A1 1 0 0 0 0 2.253h1zm0 13H0a1 1 0 0 0 1.553.833L1 15.253zm8.447.833a1 1 0 1 0 1.107-1.666l-1.107 1.666zm0-14.666a1 1 0 1 0 1.107 1.666L9.447 1.42zM19 2.253h1a1 1 0 0 0-.447-.833L19 2.253zm0 13l-.553.833A1 1 0 0 0 20 15.253h-1zm-9.553-.833a1 1 0 1 0 1.107 1.666L9.447 14.42zM9 2.253v13h2v-13H9zm1.553-.833C9.203.523 7.42 0 5.5 0v2c1.572 0 2.961.431 3.947 1.086l1.107-1.666zM5.5 0C3.58 0 1.797.523.447 1.42l1.107 1.666C2.539 2.431 3.928 2 5.5 2V0zM0 2.253v13h2v-13H0zm1.553 13.833C2.539 15.431 3.928 15 5.5 15v-2c-1.92 0-3.703.523-5.053 1.42l1.107 1.666zM5.5 15c1.572 0 2.961.431 3.947 1.086l1.107-1.666C9.203 13.523 7.42 13 5.5 13v2zm5.053-11.914C11.539 2.431 12.928 2 14.5 2V0c-1.92 0-3.703.523-5.053 1.42l1.107 1.666zM14.5 2c1.573 0 2.961.431 3.947 1.086l1.107-1.666C18.203.523 16.421 0 14.5 0v2zm3.5.253v13h2v-13h-2zm1.553 12.167C18.203 13.523 16.421 13 14.5 13v2c1.573 0 2.961.431 3.947 1.086l1.107-1.666zM14.5 13c-1.92 0-3.703.523-5.053 1.42l1.107 1.666C11.539 15.431 12.928 15 14.5 15v-2z"
5
+ />
6
+ </svg>
7
+ </template>
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="20" fill="currentColor">
3
+ <path
4
+ d="M11.447 8.894a1 1 0 1 0-.894-1.789l.894 1.789zm-2.894-.789a1 1 0 1 0 .894 1.789l-.894-1.789zm0 1.789a1 1 0 1 0 .894-1.789l-.894 1.789zM7.447 7.106a1 1 0 1 0-.894 1.789l.894-1.789zM10 9a1 1 0 1 0-2 0h2zm-2 2.5a1 1 0 1 0 2 0H8zm9.447-5.606a1 1 0 1 0-.894-1.789l.894 1.789zm-2.894-.789a1 1 0 1 0 .894 1.789l-.894-1.789zm2 .789a1 1 0 1 0 .894-1.789l-.894 1.789zm-1.106-2.789a1 1 0 1 0-.894 1.789l.894-1.789zM18 5a1 1 0 1 0-2 0h2zm-2 2.5a1 1 0 1 0 2 0h-2zm-5.447-4.606a1 1 0 1 0 .894-1.789l-.894 1.789zM9 1l.447-.894a1 1 0 0 0-.894 0L9 1zm-2.447.106a1 1 0 1 0 .894 1.789l-.894-1.789zm-6 3a1 1 0 1 0 .894 1.789L.553 4.106zm2.894.789a1 1 0 1 0-.894-1.789l.894 1.789zm-2-.789a1 1 0 1 0-.894 1.789l.894-1.789zm1.106 2.789a1 1 0 1 0 .894-1.789l-.894 1.789zM2 5a1 1 0 1 0-2 0h2zM0 7.5a1 1 0 1 0 2 0H0zm8.553 12.394a1 1 0 1 0 .894-1.789l-.894 1.789zm-1.106-2.789a1 1 0 1 0-.894 1.789l.894-1.789zm1.106 1a1 1 0 1 0 .894 1.789l-.894-1.789zm2.894.789a1 1 0 1 0-.894-1.789l.894 1.789zM8 19a1 1 0 1 0 2 0H8zm2-2.5a1 1 0 1 0-2 0h2zm-7.447.394a1 1 0 1 0 .894-1.789l-.894 1.789zM1 15H0a1 1 0 0 0 .553.894L1 15zm1-2.5a1 1 0 1 0-2 0h2zm12.553 2.606a1 1 0 1 0 .894 1.789l-.894-1.789zM17 15l.447.894A1 1 0 0 0 18 15h-1zm1-2.5a1 1 0 1 0-2 0h2zm-7.447-5.394l-2 1 .894 1.789 2-1-.894-1.789zm-1.106 1l-2-1-.894 1.789 2 1 .894-1.789zM8 9v2.5h2V9H8zm8.553-4.894l-2 1 .894 1.789 2-1-.894-1.789zm.894 0l-2-1-.894 1.789 2 1 .894-1.789zM16 5v2.5h2V5h-2zm-4.553-3.894l-2-1-.894 1.789 2 1 .894-1.789zm-2.894-1l-2 1 .894 1.789 2-1L8.553.106zM1.447 5.894l2-1-.894-1.789-2 1 .894 1.789zm-.894 0l2 1 .894-1.789-2-1-.894 1.789zM0 5v2.5h2V5H0zm9.447 13.106l-2-1-.894 1.789 2 1 .894-1.789zm0 1.789l2-1-.894-1.789-2 1 .894 1.789zM10 19v-2.5H8V19h2zm-6.553-3.894l-2-1-.894 1.789 2 1 .894-1.789zM2 15v-2.5H0V15h2zm13.447 1.894l2-1-.894-1.789-2 1 .894 1.789zM18 15v-2.5h-2V15h2z"
5
+ />
6
+ </svg>
7
+ </template>
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor">
3
+ <path
4
+ d="M10 3.22l-.61-.6a5.5 5.5 0 0 0-7.666.105 5.5 5.5 0 0 0-.114 7.665L10 18.78l8.39-8.4a5.5 5.5 0 0 0-.114-7.665 5.5 5.5 0 0 0-7.666-.105l-.61.61z"
5
+ />
6
+ </svg>
7
+ </template>
@@ -0,0 +1,19 @@
1
+ <!-- This icon is from <https://github.com/Templarian/MaterialDesign>, distributed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0) license-->
2
+ <template>
3
+ <svg
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ xmlns:xlink="http://www.w3.org/1999/xlink"
6
+ aria-hidden="true"
7
+ role="img"
8
+ class="iconify iconify--mdi"
9
+ width="24"
10
+ height="24"
11
+ preserveAspectRatio="xMidYMid meet"
12
+ viewBox="0 0 24 24"
13
+ >
14
+ <path
15
+ d="M20 18v-4h-3v1h-2v-1H9v1H7v-1H4v4h16M6.33 8l-1.74 4H7v-1h2v1h6v-1h2v1h2.41l-1.74-4H6.33M9 5v1h6V5H9m12.84 7.61c.1.22.16.48.16.8V18c0 .53-.21 1-.6 1.41c-.4.4-.85.59-1.4.59H4c-.55 0-1-.19-1.4-.59C2.21 19 2 18.53 2 18v-4.59c0-.32.06-.58.16-.8L4.5 7.22C4.84 6.41 5.45 6 6.33 6H7V5c0-.55.18-1 .57-1.41C7.96 3.2 8.44 3 9 3h6c.56 0 1.04.2 1.43.59c.39.41.57.86.57 1.41v1h.67c.88 0 1.49.41 1.83 1.22l2.34 5.39z"
16
+ fill="currentColor"
17
+ ></path>
18
+ </svg>
19
+ </template>
@@ -3,3 +3,13 @@
3
3
  <h1>This is an about page</h1>
4
4
  </div>
5
5
  </template>
6
+
7
+ <style>
8
+ @media (min-width: 1024px) {
9
+ .about {
10
+ min-height: 100vh;
11
+ display: flex;
12
+ align-items: center;
13
+ }
14
+ }
15
+ </style>
@@ -1,19 +1,9 @@
1
- <template>
2
- <img alt="Vue logo" src="@/assets/logo.png" />
3
- <HelloWorld msg="Hello Vue 3 + TypeScript + Vite" />
4
- </template>
5
-
6
1
  <script setup lang="ts">
7
- import HelloWorld from '@/components/HelloWorld.vue'
2
+ import Welcome from '@/components/Welcome.vue'
8
3
  </script>
9
4
 
10
- <style>
11
- #app {
12
- font-family: Avenir, Helvetica, Arial, sans-serif;
13
- -webkit-font-smoothing: antialiased;
14
- -moz-osx-font-smoothing: grayscale;
15
- text-align: center;
16
- color: #2c3e50;
17
- margin-top: 60px;
18
- }
19
- </style>
5
+ <template>
6
+ <main>
7
+ <Welcome />
8
+ </main>
9
+ </template>
@@ -6,9 +6,9 @@
6
6
  "test:e2e:ci": "start-server-and-test serve 5050 'cypress run'"
7
7
  },
8
8
  "devDependencies": {
9
- "@cypress/vite-dev-server": "^2.0.2",
10
- "@cypress/vue": "^3.0.1",
11
- "cypress": "^8.0.0",
12
- "start-server-and-test": "^1.12.6"
9
+ "@cypress/vite-dev-server": "^2.1.0",
10
+ "@cypress/vue": "^3.0.3",
11
+ "cypress": "^8.4.0",
12
+ "start-server-and-test": "^1.14.0"
13
13
  }
14
14
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "devDependencies": {
3
- "@vitejs/plugin-vue-jsx": "^1.1.6"
3
+ "@vitejs/plugin-vue-jsx": "^1.1.8"
4
4
  }
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "dependencies": {
3
- "vue-router": "^4.0.10"
3
+ "vue-router": "^4.0.11"
4
4
  }
5
5
  }
@@ -4,7 +4,7 @@
4
4
  "typecheck": "vue-tsc --noEmit"
5
5
  },
6
6
  "devDependencies": {
7
- "typescript": "~4.3.5",
8
- "vue-tsc": "^0.2.2"
7
+ "typescript": "~4.4.3",
8
+ "vue-tsc": "^0.3.0"
9
9
  }
10
10
  }
@@ -16,6 +16,5 @@
16
16
  "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
17
17
  "skipLibCheck": true
18
18
  },
19
- "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"],
20
- "exclude": ["src/**/__tests__/**"]
19
+ "include": ["vite.config.*", "env.d.ts", "src/**/*", "src/**/*.vue"]
21
20
  }
@@ -1,4 +0,0 @@
1
- import { createApp } from 'vue'
2
- import App from './App.vue'
3
-
4
- createApp(App).mount('#app')
@@ -1,4 +0,0 @@
1
- import { createApp } from 'vue'
2
- import App from './App.vue'
3
-
4
- createApp(App).mount('#app')
@@ -1,26 +0,0 @@
1
- const isObject = (val) => val && typeof val === 'object'
2
- const mergeArrayWithDedupe = (a, b) => Array.from(new Set([...a, ...b]))
3
-
4
- /**
5
- * Recursively merge the content of the new object to the existing one
6
- * @param {Object} target the existing object
7
- * @param {Object} obj the new object
8
- */
9
- function deepMerge(target, obj) {
10
- for (const key of Object.keys(obj)) {
11
- const oldVal = target[key]
12
- const newVal = obj[key]
13
-
14
- if (Array.isArray(oldVal) && Array.isArray(newVal)) {
15
- target[key] = mergeArrayWithDedupe(oldVal, newVal)
16
- } else if (isObject(oldVal) && isObject(newVal)) {
17
- target[key] = deepMerge(oldVal, newVal)
18
- } else {
19
- target[key] = newVal
20
- }
21
- }
22
-
23
- return target
24
- }
25
-
26
- export default deepMerge
@@ -1,29 +0,0 @@
1
- import fs from 'fs'
2
- import path from 'path'
3
-
4
- export function preOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
5
- for (const filename of fs.readdirSync(dir)) {
6
- const fullpath = path.resolve(dir, filename)
7
- if (fs.lstatSync(fullpath).isDirectory()) {
8
- dirCallback(fullpath)
9
- // in case the dirCallback removes the directory entirely
10
- if (fs.existsSync(fullpath)) {
11
- preOrderDirectoryTraverse(fullpath, dirCallback, fileCallback)
12
- }
13
- continue
14
- }
15
- fileCallback(fullpath)
16
- }
17
- }
18
-
19
- export function postOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
20
- for (const filename of fs.readdirSync(dir)) {
21
- const fullpath = path.resolve(dir, filename)
22
- if (fs.lstatSync(fullpath).isDirectory()) {
23
- postOrderDirectoryTraverse(fullpath, dirCallback, fileCallback)
24
- dirCallback(fullpath)
25
- continue
26
- }
27
- fileCallback(fullpath)
28
- }
29
- }
@@ -1,17 +0,0 @@
1
- # {{projectName}}
2
-
3
- This template should help get you started developing with Vue 3 in Vite.
4
-
5
- ## Recommended IDE Setup
6
-
7
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur).
8
-
9
- <!-- SFC-TYPE-SUPPORT -->
10
-
11
- ## Customize configuration
12
-
13
- See [Vite Configuration Reference](https://vitejs.dev/config/).
14
-
15
- ## Project Setup
16
-
17
- <!-- NPM-SCRIPTS -->
@@ -1,5 +0,0 @@
1
- ## Type Support for `.vue` Imports in TS
2
-
3
- Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates.
4
-
5
- However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can run `Volar: Switch TS Plugin on/off` from VSCode command palette.
@@ -1,69 +0,0 @@
1
- import fs from 'fs'
2
-
3
- import getCommand from './getCommand.js'
4
-
5
- const sfcTypeSupportDoc = fs.readFileSync(
6
- new URL('./docs/SFC-TYPE-SUPPORT.md', import.meta.url).pathname,
7
- 'utf8'
8
- )
9
-
10
- export default function generateReadme({
11
- projectName,
12
- packageManager,
13
- needsTypeScript,
14
- needsTests
15
- }) {
16
- let template = fs.readFileSync(
17
- new URL('./docs/README-TEMPLATE.md', import.meta.url).pathname,
18
- 'utf8'
19
- )
20
-
21
- template = template.replace('{{projectName}}', projectName)
22
-
23
- if (needsTypeScript) {
24
- template = template.replace('<!-- SFC-TYPE-SUPPORT -->\n', sfcTypeSupportDoc)
25
- } else {
26
- template = template.replace('<!-- SFC-TYPE-SUPPORT -->\n\n', '')
27
- }
28
-
29
- let npmScriptsDescriptions =
30
- `\`\`\`sh
31
- ${getCommand(packageManager, 'install')}
32
- \`\`\`
33
-
34
- ### Compile and Hot-Reload for Development
35
-
36
- \`\`\`sh
37
- ${getCommand(packageManager, 'dev')}
38
- \`\`\`
39
-
40
- ### ${needsTypeScript ? 'Type-Check, ' : ''}Compile and Minify for Production
41
-
42
- \`\`\`sh
43
- ${getCommand(packageManager, 'build')}
44
- \`\`\`
45
- `
46
-
47
- if (needsTests) {
48
- npmScriptsDescriptions +=`
49
- ### Run Unit Tests with [Cypress Component Testing](https://docs.cypress.io/guides/component-testing/introduction)
50
-
51
- \`\`\`sh
52
- ${getCommand(packageManager, 'test:unit')} # or \`${getCommand(packageManager, 'test:unit:ci')}\` for headless testing
53
- \`\`\`
54
-
55
- ### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
56
-
57
- \`\`\`sh
58
- ${getCommand(packageManager, 'test:e2e')} # or \`${getCommand(packageManager, 'test:e2e:ci')}\` for headless testing
59
- \`\`\`
60
- `
61
- }
62
-
63
- template = template.replace(
64
- '<!-- NPM-SCRIPTS -->\n',
65
- npmScriptsDescriptions
66
- )
67
-
68
- return template
69
- }
@@ -1,7 +0,0 @@
1
- export default function getCommand(packageManager, scriptName) {
2
- if (scriptName === 'install') {
3
- return packageManager === 'yarn' ? 'yarn': `${packageManager} install`
4
- }
5
-
6
- return packageManager === 'npm' ? `npm run ${scriptName}` : `${packageManager} ${scriptName}`
7
- }
@@ -1,47 +0,0 @@
1
- import fs from 'fs'
2
- import path from 'path'
3
-
4
- import deepMerge from './deepMerge.js'
5
-
6
- /**
7
- * Renders a template folder/file to the file system,
8
- * by recursively copying all files under the `src` directory,
9
- * with the following exception:
10
- * - `_filename` should be renamed to `.filename`
11
- * - Fields in `package.json` should be recursively merged
12
- * @param {string} src source filename to copy
13
- * @param {string} dest destination filename of the copy operation
14
- */
15
- function renderTemplate(src, dest) {
16
- const stats = fs.statSync(src)
17
-
18
- if (stats.isDirectory()) {
19
- // if it's a directory, render its subdirectories and files recusively
20
- fs.mkdirSync(dest, { recursive: true })
21
- for (const file of fs.readdirSync(src)) {
22
- renderTemplate(path.resolve(src, file), path.resolve(dest, file))
23
- }
24
- return
25
- }
26
-
27
- const filename = path.basename(src)
28
-
29
- if (filename === 'package.json' && fs.existsSync(dest)) {
30
- // merge instead of overwriting
31
- const pkg = deepMerge(
32
- JSON.parse(fs.readFileSync(dest)),
33
- JSON.parse(fs.readFileSync(src))
34
- )
35
- fs.writeFileSync(dest, JSON.stringify(pkg, null, 2) + '\n')
36
- return
37
- }
38
-
39
- if (filename.startsWith('_')) {
40
- // rename `_file` to `.file`
41
- dest = path.resolve(path.dirname(dest), filename.replace(/^_/, '.'))
42
- }
43
-
44
- fs.copyFileSync(src, dest)
45
- }
46
-
47
- export default renderTemplate