create-vue 3.0.0-beta.8 → 3.0.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.
- package/README.md +7 -1
- package/outfile.cjs +10 -10
- package/package.json +10 -12
- package/template/base/_gitignore +1 -1
- package/template/base/package.json +3 -3
- package/template/code/default/src/components/HelloWorld.vue +0 -1
- package/template/config/cypress/package.json +1 -1
- package/template/config/jsx/package.json +1 -1
- package/template/config/pinia/package.json +5 -0
- package/template/config/pinia/src/stores/counter.js +16 -0
- 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/README.md
CHANGED
package/outfile.cjs
CHANGED
|
@@ -5529,7 +5529,7 @@ async function init() {
|
|
|
5529
5529
|
},
|
|
5530
5530
|
boolean: true
|
|
5531
5531
|
});
|
|
5532
|
-
const isFeatureFlagsUsed = typeof (argv.default || argv.ts || argv.jsx || argv.router || argv.
|
|
5532
|
+
const isFeatureFlagsUsed = typeof (argv.default || argv.ts || argv.jsx || argv.router || argv.pinia || argv.tests) === "boolean";
|
|
5533
5533
|
let targetDir = argv._[0];
|
|
5534
5534
|
const defaultProjectName = !targetDir ? "vue-project" : targetDir;
|
|
5535
5535
|
const forceOverwrite = argv.force;
|
|
@@ -5592,9 +5592,9 @@ async function init() {
|
|
|
5592
5592
|
inactive: "No"
|
|
5593
5593
|
},
|
|
5594
5594
|
{
|
|
5595
|
-
name: "
|
|
5595
|
+
name: "needsPinia",
|
|
5596
5596
|
type: () => isFeatureFlagsUsed ? null : "toggle",
|
|
5597
|
-
message: "Add
|
|
5597
|
+
message: "Add Pinia for state management?",
|
|
5598
5598
|
initial: false,
|
|
5599
5599
|
active: "Yes",
|
|
5600
5600
|
inactive: "No"
|
|
@@ -5622,7 +5622,7 @@ async function init() {
|
|
|
5622
5622
|
needsJsx = argv.jsx,
|
|
5623
5623
|
needsTypeScript = argv.typescript,
|
|
5624
5624
|
needsRouter = argv.router,
|
|
5625
|
-
|
|
5625
|
+
needsPinia = argv.pinia,
|
|
5626
5626
|
needsTests = argv.tests
|
|
5627
5627
|
} = result;
|
|
5628
5628
|
const root = import_path3.default.join(cwd, targetDir);
|
|
@@ -5647,8 +5647,8 @@ Scaffolding project in ${root}...`);
|
|
|
5647
5647
|
if (needsRouter) {
|
|
5648
5648
|
render("config/router");
|
|
5649
5649
|
}
|
|
5650
|
-
if (
|
|
5651
|
-
render("config/
|
|
5650
|
+
if (needsPinia) {
|
|
5651
|
+
render("config/pinia");
|
|
5652
5652
|
}
|
|
5653
5653
|
if (needsTests) {
|
|
5654
5654
|
render("config/cypress");
|
|
@@ -5658,10 +5658,10 @@ Scaffolding project in ${root}...`);
|
|
|
5658
5658
|
}
|
|
5659
5659
|
const codeTemplate = (needsTypeScript ? "typescript-" : "") + (needsRouter ? "router" : "default");
|
|
5660
5660
|
render(`code/${codeTemplate}`);
|
|
5661
|
-
if (
|
|
5662
|
-
render("entry/
|
|
5663
|
-
} else if (
|
|
5664
|
-
render("entry/
|
|
5661
|
+
if (needsPinia && needsRouter) {
|
|
5662
|
+
render("entry/router-and-pinia");
|
|
5663
|
+
} else if (needsPinia) {
|
|
5664
|
+
render("entry/pinia");
|
|
5665
5665
|
} else if (needsRouter) {
|
|
5666
5666
|
render("entry/router");
|
|
5667
5667
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vue",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "An easy way to start a Vue project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,15 +13,6 @@
|
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": "^14.13.1 || >=16.0.0"
|
|
15
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"
|
|
24
|
-
},
|
|
25
16
|
"repository": {
|
|
26
17
|
"type": "git",
|
|
27
18
|
"url": "git+https://github.com/vuejs/create-vue.git"
|
|
@@ -40,12 +31,19 @@
|
|
|
40
31
|
"lint-staged": "^12.1.2",
|
|
41
32
|
"minimist": "^1.2.5",
|
|
42
33
|
"npm-run-all": "^4.1.5",
|
|
43
|
-
"prettier": "^2.
|
|
34
|
+
"prettier": "^2.5.1",
|
|
44
35
|
"prompts": "^2.4.2"
|
|
45
36
|
},
|
|
46
37
|
"lint-staged": {
|
|
47
38
|
"*.{js,ts,vue,json}": [
|
|
48
39
|
"prettier --write"
|
|
49
40
|
]
|
|
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"
|
|
50
48
|
}
|
|
51
|
-
}
|
|
49
|
+
}
|
package/template/base/_gitignore
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
"preview": "vite preview --port 5050"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"vue": "^3.2.
|
|
8
|
+
"vue": "^3.2.26"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"@vitejs/plugin-vue": "^
|
|
12
|
-
"vite": "^2.
|
|
11
|
+
"@vitejs/plugin-vue": "^2.0.0",
|
|
12
|
+
"vite": "^2.7.1"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -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')
|