create-vue 3.0.0-beta.1 → 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.
package/package.json CHANGED
@@ -1,27 +1,19 @@
1
1
  {
2
2
  "name": "create-vue",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.2",
4
4
  "description": "An easy way to start a Vue project",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "bin": {
8
- "create-vue": "index.js"
8
+ "create-vue": "outfile.js"
9
9
  },
10
10
  "files": [
11
- "index.js",
12
- "utils",
11
+ "outfile.cjs",
13
12
  "template"
14
13
  ],
15
14
  "engines": {
16
15
  "node": "^12.13.0 || ^14.0.0 || >= 16.0.0"
17
16
  },
18
- "scripts": {
19
- "prepare": "husky install",
20
- "format": "prettier --write .",
21
- "pretest": "node snapshot.js",
22
- "test": "node test.js",
23
- "prepublishOnly": "node snapshot.js"
24
- },
25
17
  "repository": {
26
18
  "type": "git",
27
19
  "url": "git+https://github.com/vuejs/create-vue.git"
@@ -33,19 +25,26 @@
33
25
  "url": "https://github.com/vuejs/create-vue/issues"
34
26
  },
35
27
  "homepage": "https://github.com/vuejs/create-vue#readme",
36
- "dependencies": {
28
+ "devDependencies": {
29
+ "esbuild": "^0.12.28",
30
+ "husky": "^7.0.2",
37
31
  "kolorist": "^1.5.0",
32
+ "lint-staged": "^11.1.2",
38
33
  "minimist": "^1.2.5",
34
+ "npm-run-all": "^4.1.5",
35
+ "prettier": "^2.4.1",
39
36
  "prompts": "^2.4.1"
40
37
  },
41
- "devDependencies": {
42
- "husky": "^7.0.1",
43
- "lint-staged": "^11.1.2",
44
- "prettier": "^2.3.2"
45
- },
46
38
  "lint-staged": {
47
39
  "*.{js,ts,vue,json}": [
48
40
  "prettier --write"
49
41
  ]
42
+ },
43
+ "scripts": {
44
+ "format": "prettier --write .",
45
+ "build": "esbuild --bundle index.js --format=cjs --platform=node --outfile=outfile.cjs",
46
+ "snapshot": "node snapshot.js",
47
+ "pretest": "run-s build snapshot",
48
+ "test": "node test.js"
50
49
  }
51
- }
50
+ }
@@ -6,11 +6,11 @@
6
6
  "serve": "vite preview --port 5050"
7
7
  },
8
8
  "dependencies": {
9
- "vue": "^3.2.2"
9
+ "vue": "^3.2.11"
10
10
  },
11
11
  "devDependencies": {
12
- "@vitejs/plugin-vue": "^1.4.0",
13
- "@vue/compiler-sfc": "^3.2.2",
14
- "vite": "^2.5.0"
12
+ "@vitejs/plugin-vue": "^1.6.2",
13
+ "@vue/compiler-sfc": "^3.2.11",
14
+ "vite": "^2.5.8"
15
15
  }
16
16
  }
@@ -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.7",
9
+ "@cypress/vite-dev-server": "^2.1.0",
10
10
  "@cypress/vue": "^3.0.3",
11
- "cypress": "^8.2.0",
12
- "start-server-and-test": "^1.13.1"
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.7"
3
+ "@vitejs/plugin-vue-jsx": "^1.1.8"
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.3"
7
+ "typescript": "~4.4.3",
8
+ "vue-tsc": "^0.3.0"
9
9
  }
10
10
  }
@@ -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,71 +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 = `\`\`\`sh
30
- ${getCommand(packageManager, 'install')}
31
- \`\`\`
32
-
33
- ### Compile and Hot-Reload for Development
34
-
35
- \`\`\`sh
36
- ${getCommand(packageManager, 'dev')}
37
- \`\`\`
38
-
39
- ### ${needsTypeScript ? 'Type-Check, ' : ''}Compile and Minify for Production
40
-
41
- \`\`\`sh
42
- ${getCommand(packageManager, 'build')}
43
- \`\`\`
44
- `
45
-
46
- if (needsTests) {
47
- npmScriptsDescriptions += `
48
- ### Run Unit Tests with [Cypress Component Testing](https://docs.cypress.io/guides/component-testing/introduction)
49
-
50
- \`\`\`sh
51
- ${getCommand(packageManager, 'test:unit')} # or \`${getCommand(
52
- packageManager,
53
- 'test:unit:ci'
54
- )}\` for headless testing
55
- \`\`\`
56
-
57
- ### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
58
-
59
- \`\`\`sh
60
- ${getCommand(packageManager, 'test:e2e')} # or \`${getCommand(
61
- packageManager,
62
- 'test:e2e:ci'
63
- )}\` for headless testing
64
- \`\`\`
65
- `
66
- }
67
-
68
- template = template.replace('<!-- NPM-SCRIPTS -->\n', npmScriptsDescriptions)
69
-
70
- return template
71
- }
@@ -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,44 +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(JSON.parse(fs.readFileSync(dest)), JSON.parse(fs.readFileSync(src)))
32
- fs.writeFileSync(dest, JSON.stringify(pkg, null, 2) + '\n')
33
- return
34
- }
35
-
36
- if (filename.startsWith('_')) {
37
- // rename `_file` to `.file`
38
- dest = path.resolve(path.dirname(dest), filename.replace(/^_/, '.'))
39
- }
40
-
41
- fs.copyFileSync(src, dest)
42
- }
43
-
44
- export default renderTemplate