create-vue 3.0.0-beta.6 → 3.0.0
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.
- package/outfile.cjs +151 -149
- package/package.json +16 -14
- package/template/base/package.json +4 -5
- package/template/base/vite.config.js +3 -1
- package/template/code/default/src/App.vue +2 -2
- package/template/code/default/src/components/{Welcome.vue → TheWelcome.vue} +0 -0
- package/template/code/router/src/App.vue +8 -8
- package/template/code/router/src/components/{Welcome.vue → TheWelcome.vue} +0 -0
- package/template/code/router/src/router/index.js +5 -5
- package/template/code/router/src/views/{About.vue → AboutView.vue} +0 -0
- package/template/code/{typescript-router/src/views/Home.vue → router/src/views/HomeView.vue} +2 -2
- package/template/code/typescript-default/src/App.vue +2 -2
- package/template/code/typescript-default/src/components/HelloWorld.vue +1 -1
- package/template/code/typescript-default/src/components/{Welcome.vue → TheWelcome.vue} +0 -0
- package/template/code/typescript-router/src/App.vue +8 -8
- package/template/code/typescript-router/src/components/HelloWorld.vue +1 -1
- package/template/code/typescript-router/src/components/{Welcome.vue → TheWelcome.vue} +0 -0
- package/template/code/typescript-router/src/router/index.ts +5 -5
- package/template/code/typescript-router/src/views/{About.vue → AboutView.vue} +0 -0
- package/template/code/{router/src/views/Home.vue → typescript-router/src/views/HomeView.vue} +2 -2
- package/template/config/cypress/package.json +5 -5
- package/template/config/jsx/package.json +1 -1
- package/template/config/jsx/vite.config.js +3 -1
- package/template/config/pinia/package.json +5 -0
- package/template/config/pinia/src/stores/counter.js +16 -0
- package/template/config/router/package.json +1 -1
- package/template/config/typescript/package.json +3 -2
- package/template/entry/{vuex → pinia}/src/main.js +2 -2
- package/template/entry/{vuex-and-router → router-and-pinia}/src/main.js +3 -3
- package/template/code/typescript-router/src/main.ts +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vue",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "An easy way to start a Vue project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,16 @@
|
|
|
11
11
|
"template"
|
|
12
12
|
],
|
|
13
13
|
"engines": {
|
|
14
|
-
"node": "^
|
|
14
|
+
"node": "^14.13.1 || >=16.0.0"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"prepare": "husky install",
|
|
18
|
+
"format": "prettier --write .",
|
|
19
|
+
"build": "esbuild --bundle index.js --format=cjs --platform=node --outfile=outfile.cjs",
|
|
20
|
+
"snapshot": "node snapshot.js",
|
|
21
|
+
"pretest": "run-s build snapshot",
|
|
22
|
+
"test": "node test.js",
|
|
23
|
+
"prepublishOnly": "run-s build snapshot"
|
|
15
24
|
},
|
|
16
25
|
"repository": {
|
|
17
26
|
"type": "git",
|
|
@@ -25,25 +34,18 @@
|
|
|
25
34
|
},
|
|
26
35
|
"homepage": "https://github.com/vuejs/create-vue#readme",
|
|
27
36
|
"devDependencies": {
|
|
28
|
-
"esbuild": "^0.
|
|
29
|
-
"husky": "^7.0.
|
|
37
|
+
"esbuild": "^0.13.15",
|
|
38
|
+
"husky": "^7.0.4",
|
|
30
39
|
"kolorist": "^1.5.0",
|
|
31
|
-
"lint-staged": "^
|
|
40
|
+
"lint-staged": "^12.1.2",
|
|
32
41
|
"minimist": "^1.2.5",
|
|
33
42
|
"npm-run-all": "^4.1.5",
|
|
34
43
|
"prettier": "^2.4.1",
|
|
35
|
-
"prompts": "^2.4.
|
|
44
|
+
"prompts": "^2.4.2"
|
|
36
45
|
},
|
|
37
46
|
"lint-staged": {
|
|
38
47
|
"*.{js,ts,vue,json}": [
|
|
39
48
|
"prettier --write"
|
|
40
49
|
]
|
|
41
|
-
},
|
|
42
|
-
"scripts": {
|
|
43
|
-
"format": "prettier --write .",
|
|
44
|
-
"build": "esbuild --bundle index.js --format=cjs --platform=node --outfile=outfile.cjs",
|
|
45
|
-
"snapshot": "node snapshot.js",
|
|
46
|
-
"pretest": "run-s build snapshot",
|
|
47
|
-
"test": "node test.js"
|
|
48
50
|
}
|
|
49
|
-
}
|
|
51
|
+
}
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
"scripts": {
|
|
3
3
|
"dev": "vite",
|
|
4
4
|
"build": "vite build",
|
|
5
|
-
"
|
|
6
|
-
"serve": "vite preview --port 5050"
|
|
5
|
+
"preview": "vite preview --port 5050"
|
|
7
6
|
},
|
|
8
7
|
"dependencies": {
|
|
9
|
-
"vue": "^3.2.
|
|
8
|
+
"vue": "^3.2.22"
|
|
10
9
|
},
|
|
11
10
|
"devDependencies": {
|
|
12
|
-
"@vitejs/plugin-vue": "^1.
|
|
13
|
-
"vite": "^2.6.
|
|
11
|
+
"@vitejs/plugin-vue": "^1.10.0",
|
|
12
|
+
"vite": "^2.6.14"
|
|
14
13
|
}
|
|
15
14
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { fileURLToPath } from 'url'
|
|
2
|
+
|
|
1
3
|
import { defineConfig } from 'vite'
|
|
2
4
|
import vue from '@vitejs/plugin-vue'
|
|
3
5
|
|
|
@@ -6,7 +8,7 @@ export default defineConfig({
|
|
|
6
8
|
plugins: [vue()],
|
|
7
9
|
resolve: {
|
|
8
10
|
alias: {
|
|
9
|
-
'
|
|
11
|
+
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
10
12
|
}
|
|
11
13
|
}
|
|
12
14
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import HelloWorld from './components/HelloWorld.vue'
|
|
3
|
-
import
|
|
3
|
+
import TheWelcome from './components/TheWelcome.vue'
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<template>
|
|
@@ -13,7 +13,7 @@ import Welcome from './components/Welcome.vue'
|
|
|
13
13
|
</header>
|
|
14
14
|
|
|
15
15
|
<main>
|
|
16
|
-
<
|
|
16
|
+
<TheWelcome />
|
|
17
17
|
</main>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
File without changes
|
|
@@ -9,10 +9,10 @@ import HelloWorld from '@/components/HelloWorld.vue'
|
|
|
9
9
|
<div class="wrapper">
|
|
10
10
|
<HelloWorld msg="You did it!" />
|
|
11
11
|
|
|
12
|
-
<
|
|
12
|
+
<nav>
|
|
13
13
|
<router-link to="/">Home</router-link>
|
|
14
14
|
<router-link to="/about">About</router-link>
|
|
15
|
-
</
|
|
15
|
+
</nav>
|
|
16
16
|
</div>
|
|
17
17
|
</header>
|
|
18
18
|
|
|
@@ -53,28 +53,28 @@ a,
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
nav {
|
|
57
57
|
width: 100%;
|
|
58
58
|
font-size: 12px;
|
|
59
59
|
text-align: center;
|
|
60
60
|
margin-top: 2rem;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
nav a.router-link-exact-active {
|
|
64
64
|
color: var(--color-text);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
nav a.router-link-exact-active:hover {
|
|
68
68
|
background-color: transparent;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
nav a {
|
|
72
72
|
display: inline-block;
|
|
73
73
|
padding: 0 1rem;
|
|
74
74
|
border-left: 1px solid var(--color-border);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
nav a:first-of-type {
|
|
78
78
|
border: 0;
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -106,7 +106,7 @@ a,
|
|
|
106
106
|
margin: 0 2rem 0 0;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
nav {
|
|
110
110
|
text-align: left;
|
|
111
111
|
margin-left: -1rem;
|
|
112
112
|
font-size: 1rem;
|
|
File without changes
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { createRouter, createWebHistory } from 'vue-router'
|
|
2
|
-
import
|
|
2
|
+
import HomeView from '../views/HomeView.vue'
|
|
3
3
|
|
|
4
4
|
const router = createRouter({
|
|
5
5
|
history: createWebHistory(import.meta.env.BASE_URL),
|
|
6
6
|
routes: [
|
|
7
7
|
{
|
|
8
8
|
path: '/',
|
|
9
|
-
name: '
|
|
10
|
-
component:
|
|
9
|
+
name: 'home',
|
|
10
|
+
component: HomeView
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
path: '/about',
|
|
14
|
-
name: '
|
|
14
|
+
name: 'about',
|
|
15
15
|
// route level code-splitting
|
|
16
16
|
// this generates a separate chunk (About.[hash].js) for this route
|
|
17
17
|
// which is lazy-loaded when the route is visited.
|
|
18
|
-
component: () => import('../views/
|
|
18
|
+
component: () => import('../views/AboutView.vue')
|
|
19
19
|
}
|
|
20
20
|
]
|
|
21
21
|
})
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import HelloWorld from './components/HelloWorld.vue'
|
|
3
|
-
import
|
|
3
|
+
import TheWelcome from './components/TheWelcome.vue'
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<template>
|
|
@@ -13,7 +13,7 @@ import Welcome from './components/Welcome.vue'
|
|
|
13
13
|
</header>
|
|
14
14
|
|
|
15
15
|
<main>
|
|
16
|
-
<
|
|
16
|
+
<TheWelcome />
|
|
17
17
|
</main>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
File without changes
|
|
@@ -9,10 +9,10 @@ import HelloWorld from '@/components/HelloWorld.vue'
|
|
|
9
9
|
<div class="wrapper">
|
|
10
10
|
<HelloWorld msg="You did it!" />
|
|
11
11
|
|
|
12
|
-
<
|
|
12
|
+
<nav>
|
|
13
13
|
<router-link to="/">Home</router-link>
|
|
14
14
|
<router-link to="/about">About</router-link>
|
|
15
|
-
</
|
|
15
|
+
</nav>
|
|
16
16
|
</div>
|
|
17
17
|
</header>
|
|
18
18
|
|
|
@@ -53,28 +53,28 @@ a,
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
nav {
|
|
57
57
|
width: 100%;
|
|
58
58
|
font-size: 12px;
|
|
59
59
|
text-align: center;
|
|
60
60
|
margin-top: 2rem;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
nav a.router-link-exact-active {
|
|
64
64
|
color: var(--color-text);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
nav a.router-link-exact-active:hover {
|
|
68
68
|
background-color: transparent;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
nav a {
|
|
72
72
|
display: inline-block;
|
|
73
73
|
padding: 0 1rem;
|
|
74
74
|
border-left: 1px solid var(--color-border);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
nav a:first-of-type {
|
|
78
78
|
border: 0;
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -106,7 +106,7 @@ a,
|
|
|
106
106
|
margin: 0 2rem 0 0;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
nav {
|
|
110
110
|
text-align: left;
|
|
111
111
|
margin-left: -1rem;
|
|
112
112
|
font-size: 1rem;
|
|
File without changes
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { createRouter, createWebHistory } from 'vue-router'
|
|
2
|
-
import
|
|
2
|
+
import HomeView from '../views/HomeView.vue'
|
|
3
3
|
|
|
4
4
|
const router = createRouter({
|
|
5
5
|
history: createWebHistory(import.meta.env.BASE_URL),
|
|
6
6
|
routes: [
|
|
7
7
|
{
|
|
8
8
|
path: '/',
|
|
9
|
-
name: '
|
|
10
|
-
component:
|
|
9
|
+
name: 'home',
|
|
10
|
+
component: HomeView
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
path: '/about',
|
|
14
|
-
name: '
|
|
14
|
+
name: 'about',
|
|
15
15
|
// route level code-splitting
|
|
16
16
|
// this generates a separate chunk (About.[hash].js) for this route
|
|
17
17
|
// which is lazy-loaded when the route is visited.
|
|
18
|
-
component: () => import('../views/
|
|
18
|
+
component: () => import('../views/AboutView.vue')
|
|
19
19
|
}
|
|
20
20
|
]
|
|
21
21
|
})
|
|
File without changes
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"scripts": {
|
|
3
3
|
"test:unit": "cypress open-ct",
|
|
4
4
|
"test:unit:ci": "cypress run-ct --quiet --reporter spec",
|
|
5
|
-
"test:e2e": "start-server-and-test
|
|
6
|
-
"test:e2e:ci": "start-server-and-test
|
|
5
|
+
"test:e2e": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress open'",
|
|
6
|
+
"test:e2e:ci": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress run'"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"@cypress/vite-dev-server": "^2.
|
|
10
|
-
"@cypress/vue": "^3.0.
|
|
11
|
-
"cypress": "^
|
|
9
|
+
"@cypress/vite-dev-server": "^2.2.1",
|
|
10
|
+
"@cypress/vue": "^3.0.5",
|
|
11
|
+
"cypress": "^9.1.0",
|
|
12
12
|
"start-server-and-test": "^1.14.0"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { fileURLToPath } from 'url'
|
|
2
|
+
|
|
1
3
|
import { defineConfig } from 'vite'
|
|
2
4
|
import vue from '@vitejs/plugin-vue'
|
|
3
5
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
@@ -7,7 +9,7 @@ export default defineConfig({
|
|
|
7
9
|
plugins: [vue(), vueJsx()],
|
|
8
10
|
resolve: {
|
|
9
11
|
alias: {
|
|
10
|
-
'
|
|
12
|
+
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
11
13
|
}
|
|
12
14
|
}
|
|
13
15
|
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineStore } from 'pinia'
|
|
2
|
+
|
|
3
|
+
export const useCounterStore = defineStore({
|
|
4
|
+
id: 'counter',
|
|
5
|
+
state: () => ({
|
|
6
|
+
counter: 0
|
|
7
|
+
}),
|
|
8
|
+
getters: {
|
|
9
|
+
doubleCount: (state) => state.counter * 2
|
|
10
|
+
},
|
|
11
|
+
actions: {
|
|
12
|
+
increment() {
|
|
13
|
+
this.counter++
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
})
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createApp } from 'vue'
|
|
2
|
-
import
|
|
2
|
+
import { createPinia } from 'pinia'
|
|
3
3
|
|
|
4
|
+
import App from './App.vue'
|
|
4
5
|
import router from './router'
|
|
5
|
-
import store from './store'
|
|
6
6
|
|
|
7
7
|
const app = createApp(App)
|
|
8
8
|
|
|
9
|
+
app.use(createPinia())
|
|
9
10
|
app.use(router)
|
|
10
|
-
app.use(store)
|
|
11
11
|
|
|
12
12
|
app.mount('#app')
|