create-vue 2.0.5 → 2.1.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.
Files changed (70) hide show
  1. package/LICENSE +153 -1
  2. package/outfile.cjs +338 -129
  3. package/package.json +16 -12
  4. package/template/base/node_modules/.bin/vite +17 -0
  5. package/template/base/package.json +5 -10
  6. package/template/base/vite.config.js +2 -11
  7. package/template/code/default/src/components/icons/IconTooling.vue +0 -2
  8. package/template/code/router/src/components/icons/IconTooling.vue +0 -2
  9. package/template/code/typescript-default/src/components/icons/IconTooling.vue +0 -2
  10. package/template/code/typescript-router/src/components/icons/IconTooling.vue +0 -2
  11. package/template/{code/default/cypress/integration/example.spec.js → config/cypress/cypress/e2e/example.cy.js} +0 -0
  12. package/template/config/cypress/cypress/{jsconfig.json → e2e/jsconfig.json} +1 -1
  13. package/template/config/cypress/cypress/support/commands.ts +37 -0
  14. package/template/config/cypress/cypress/support/{index.js → e2e.js} +0 -0
  15. package/template/config/cypress/cypress.config.js +8 -0
  16. package/template/config/cypress/cypress.config.ts +8 -0
  17. package/template/config/cypress/node_modules/.bin/cypress +17 -0
  18. package/template/config/cypress/node_modules/.bin/server-test +17 -0
  19. package/template/config/cypress/node_modules/.bin/start-server-and-test +17 -0
  20. package/template/config/cypress/node_modules/.bin/start-test +17 -0
  21. package/template/config/cypress/package.json +3 -7
  22. package/template/config/cypress-ct/cypress/support/component-index.html +12 -0
  23. package/template/config/cypress-ct/cypress/support/component.js +27 -0
  24. package/template/config/cypress-ct/cypress/support/component.ts +39 -0
  25. package/template/config/cypress-ct/cypress.config.js +15 -0
  26. package/template/config/cypress-ct/cypress.config.ts +15 -0
  27. package/template/config/cypress-ct/node_modules/.bin/cypress +17 -0
  28. package/template/config/cypress-ct/package.json +12 -0
  29. package/template/{code/typescript-default/src/components/__tests__/HelloWorld.spec.ts → config/cypress-ct/src/components/__tests__/HelloWorld.cy.js} +2 -3
  30. package/template/config/jsx/node_modules/.bin/vite +17 -0
  31. package/template/config/jsx/package.json +9 -0
  32. package/template/config/jsx/vite.config.js +23 -0
  33. package/template/config/pinia/package.json +2 -1
  34. package/template/config/router/package.json +1 -1
  35. package/template/config/typescript/env.d.ts +0 -1
  36. package/template/config/typescript/node_modules/.bin/npm-run-all +17 -0
  37. package/template/config/typescript/node_modules/.bin/run-p +17 -0
  38. package/template/config/typescript/node_modules/.bin/run-s +17 -0
  39. package/template/config/typescript/node_modules/.bin/tsc +17 -0
  40. package/template/config/typescript/node_modules/.bin/tsserver +17 -0
  41. package/template/config/typescript/node_modules/.bin/vue-tsc +17 -0
  42. package/template/config/typescript/package.json +7 -5
  43. package/template/config/vitest/node_modules/.bin/vitest +17 -0
  44. package/template/config/vitest/package.json +14 -0
  45. package/template/config/vitest/src/components/__tests__/HelloWorld.spec.js +11 -0
  46. package/template/entry/default/src/main.js +3 -9
  47. package/template/entry/pinia/src/main.js +4 -8
  48. package/template/entry/router/src/main.js +3 -8
  49. package/template/entry/router-and-pinia/src/main.js +4 -8
  50. package/template/eslint/package.json +11 -0
  51. package/template/tsconfig/base/package.json +5 -0
  52. package/template/tsconfig/base/tsconfig.config.json +8 -0
  53. package/template/tsconfig/base/tsconfig.json +16 -0
  54. package/template/tsconfig/cypress/cypress/e2e/tsconfig.json +10 -0
  55. package/template/tsconfig/cypress-ct/tsconfig.app.json +12 -0
  56. package/template/tsconfig/cypress-ct/tsconfig.cypress-ct.json +8 -0
  57. package/template/tsconfig/cypress-ct/tsconfig.json +14 -0
  58. package/template/tsconfig/vitest/package.json +8 -0
  59. package/template/tsconfig/vitest/tsconfig.app.json +12 -0
  60. package/template/tsconfig/vitest/tsconfig.json +14 -0
  61. package/template/tsconfig/vitest/tsconfig.vitest.json +9 -0
  62. package/template/code/default/src/components/__tests__/HelloWorld.spec.js +0 -13
  63. package/template/code/router/cypress/integration/example.spec.js +0 -13
  64. package/template/code/router/src/components/__tests__/HelloWorld.spec.js +0 -13
  65. package/template/code/typescript-default/cypress/integration/example.spec.ts +0 -8
  66. package/template/code/typescript-router/cypress/integration/example.spec.ts +0 -13
  67. package/template/code/typescript-router/src/components/__tests__/HelloWorld.spec.ts +0 -13
  68. package/template/config/cypress/cypress/plugins/index.js +0 -28
  69. package/template/config/cypress/cypress.json +0 -7
  70. package/template/config/typescript/tsconfig.json +0 -24
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/Users/haoqun/Developer/vuejs/vue-2-scaffolder/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/vue-2-scaffolder/node_modules/.pnpm/node_modules"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/bin/tsserver" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/bin/tsserver" "$@"
17
+ fi
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/Users/haoqun/Developer/vuejs/vue-2-scaffolder/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/vue-2-scaffolder/node_modules/.pnpm/node_modules"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vue-tsc@0.38.4_typescript@4.7.4/node_modules/vue-tsc/bin/vue-tsc.js" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../node_modules/.pnpm/vue-tsc@0.38.4_typescript@4.7.4/node_modules/vue-tsc/bin/vue-tsc.js" "$@"
17
+ fi
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "scripts": {
3
- "build": "vue-tsc --noEmit && vite build",
4
- "typecheck": "vue-tsc --noEmit"
3
+ "build": "run-p type-check build-only",
4
+ "build-only": "vite build",
5
+ "type-check": "vue-tsc --noEmit"
5
6
  },
6
7
  "devDependencies": {
7
- "@types/node": "^16.11.25",
8
- "typescript": "~4.5.5",
9
- "vue-tsc": "^0.31.4"
8
+ "@types/node": "^16.11.43",
9
+ "npm-run-all": "^4.1.5",
10
+ "typescript": "~4.7.4",
11
+ "vue-tsc": "^0.38.4"
10
12
  }
11
13
  }
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/Users/haoqun/Developer/vuejs/vue-2-scaffolder/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/vue-2-scaffolder/node_modules/.pnpm/node_modules"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vitest@0.18.0_jsdom@20.0.0/node_modules/vitest/vitest.mjs" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../node_modules/.pnpm/vitest@0.18.0_jsdom@20.0.0/node_modules/vitest/vitest.mjs" "$@"
17
+ fi
@@ -0,0 +1,14 @@
1
+ {
2
+ "scripts": {
3
+ "test:unit": "vitest --environment jsdom"
4
+ },
5
+ "dependencies": {
6
+ "vue": "^2.7.4"
7
+ },
8
+ "devDependencies": {
9
+ "@vue/test-utils": "^1.3.0",
10
+ "jsdom": "^20.0.0",
11
+ "vitest": "^0.18.0",
12
+ "vue-template-compiler": "^2.7.4"
13
+ }
14
+ }
@@ -0,0 +1,11 @@
1
+ import { describe, it, expect } from 'vitest'
2
+
3
+ import { mount } from '@vue/test-utils'
4
+ import HelloWorld from '../HelloWorld.vue'
5
+
6
+ describe('HelloWorld', () => {
7
+ it('renders properly', () => {
8
+ const wrapper = mount(HelloWorld, { propsData: { msg: 'Hello Vitest' } })
9
+ expect(wrapper.text()).toContain('Hello Vitest')
10
+ })
11
+ })
@@ -1,12 +1,6 @@
1
1
  import Vue from 'vue'
2
- import VueCompositionAPI, { createApp, h } from '@vue/composition-api'
3
-
4
2
  import App from './App.vue'
5
3
 
6
- Vue.use(VueCompositionAPI)
7
-
8
- const app = createApp({
9
- render: () => h(App)
10
- })
11
-
12
- app.mount('#app')
4
+ new Vue({
5
+ render: (h) => h(App)
6
+ }).$mount('#app')
@@ -1,15 +1,11 @@
1
1
  import Vue from 'vue'
2
- import VueCompositionAPI, { createApp, h } from '@vue/composition-api'
3
2
  import { createPinia, PiniaVuePlugin } from 'pinia'
4
3
 
5
4
  import App from './App.vue'
6
5
 
7
- Vue.use(VueCompositionAPI)
6
+ Vue.use(PiniaVuePlugin)
8
7
 
9
- const app = createApp({
8
+ new Vue({
10
9
  pinia: createPinia(),
11
- render: () => h(App)
12
- })
13
- app.use(PiniaVuePlugin)
14
-
15
- app.mount('#app')
10
+ render: (h) => h(App)
11
+ }).$mount('#app')
@@ -1,14 +1,9 @@
1
1
  import Vue from 'vue'
2
- import VueCompositionAPI, { createApp, h } from '@vue/composition-api'
3
2
 
4
3
  import App from './App.vue'
5
4
  import router from './router'
6
5
 
7
- Vue.use(VueCompositionAPI)
8
-
9
- const app = createApp({
6
+ new Vue({
10
7
  router,
11
- render: () => h(App)
12
- })
13
-
14
- app.mount('#app')
8
+ render: (h) => h(App)
9
+ }).$mount('#app')
@@ -1,17 +1,13 @@
1
1
  import Vue from 'vue'
2
- import VueCompositionAPI, { createApp, h } from '@vue/composition-api'
3
2
  import { createPinia, PiniaVuePlugin } from 'pinia'
4
3
 
5
4
  import App from './App.vue'
6
5
  import router from './router'
7
6
 
8
- Vue.use(VueCompositionAPI)
7
+ Vue.use(PiniaVuePlugin)
9
8
 
10
- const app = createApp({
9
+ new Vue({
11
10
  router,
12
11
  pinia: createPinia(),
13
- render: () => h(App)
14
- })
15
- app.use(PiniaVuePlugin)
16
-
17
- app.mount('#app')
12
+ render: (h) => h(App)
13
+ }).$mount('#app')
@@ -0,0 +1,11 @@
1
+ {
2
+ "devDependencies": {
3
+ "@rushstack/eslint-patch": "^1.1.0",
4
+ "@vue/eslint-config-prettier": "^7.0.0",
5
+ "@vue/eslint-config-typescript": "^11.0.0",
6
+ "eslint": "^8.5.0",
7
+ "eslint-plugin-cypress": "^2.12.1",
8
+ "eslint-plugin-vue": "^9.0.0",
9
+ "prettier": "^2.5.1"
10
+ }
11
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "devDependencies": {
3
+ "@vue/tsconfig": "^0.1.3"
4
+ }
5
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.node.json",
3
+ "include": ["vite.config.*", "vitest.config.*", "cypress.config.*"],
4
+ "compilerOptions": {
5
+ "composite": true,
6
+ "types": ["node"]
7
+ }
8
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.web.json",
3
+ "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
4
+ "compilerOptions": {
5
+ "baseUrl": ".",
6
+ "paths": {
7
+ "@/*": ["./src/*"]
8
+ }
9
+ },
10
+
11
+ "references": [
12
+ {
13
+ "path": "./tsconfig.config.json"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.web.json",
3
+ "include": ["./**/*", "../support/**/*"],
4
+ "compilerOptions": {
5
+ "isolatedModules": false,
6
+ "target": "es5",
7
+ "lib": ["es5", "dom"],
8
+ "types": ["cypress"]
9
+ }
10
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.web.json",
3
+ "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
4
+ "exclude": ["src/**/__tests__/*"],
5
+ "compilerOptions": {
6
+ "composite": true,
7
+ "baseUrl": ".",
8
+ "paths": {
9
+ "@/*": ["./src/*"]
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./tsconfig.app.json",
3
+ "include": ["env.d.ts", "src/**/*", "src/**/*.vue", "cypress/support/component.*"],
4
+ "exclude": [],
5
+ "compilerOptions": {
6
+ "composite": true
7
+ }
8
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.config.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.app.json"
9
+ },
10
+ {
11
+ "path": "./tsconfig.cypress-ct.json"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "scripts": {
3
+ "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false"
4
+ },
5
+ "devDependencies": {
6
+ "@types/jsdom": "^16.2.14"
7
+ }
8
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.web.json",
3
+ "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
4
+ "exclude": ["src/**/__tests__/*"],
5
+ "compilerOptions": {
6
+ "composite": true,
7
+ "baseUrl": ".",
8
+ "paths": {
9
+ "@/*": ["./src/*"]
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.config.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.app.json"
9
+ },
10
+ {
11
+ "path": "./tsconfig.vitest.json"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.app.json",
3
+ "exclude": [],
4
+ "compilerOptions": {
5
+ "composite": true,
6
+ "lib": [],
7
+ "types": ["node", "jsdom"]
8
+ }
9
+ }
@@ -1,13 +0,0 @@
1
- import { mount } from '@cypress/vue'
2
- import HelloWorld from '../HelloWorld.vue'
3
-
4
- describe('HelloWorld', () => {
5
- it('playground', () => {
6
- mount(HelloWorld, { propsData: { msg: 'Hello Cypress' } })
7
- })
8
-
9
- it('renders properly', () => {
10
- mount(HelloWorld, { propsData: { msg: 'Hello Cypress' } })
11
- cy.get('h1').should('contain', 'Hello Cypress')
12
- })
13
- })
@@ -1,13 +0,0 @@
1
- // https://docs.cypress.io/api/introduction/api.html
2
-
3
- describe('My First Test', () => {
4
- it('visits the app root url', () => {
5
- cy.visit('/')
6
- cy.contains('h1', 'You did it!')
7
- })
8
-
9
- it('navigates to the about page', () => {
10
- cy.visit('/about')
11
- cy.contains('h1', 'This is an about page')
12
- })
13
- })
@@ -1,13 +0,0 @@
1
- import { mount } from '@cypress/vue'
2
- import HelloWorld from '../HelloWorld.vue'
3
-
4
- describe('HelloWorld', () => {
5
- it('playground', () => {
6
- mount(HelloWorld, { propsData: { msg: 'Hello Cypress' } })
7
- })
8
-
9
- it('renders properly', () => {
10
- mount(HelloWorld, { propsData: { msg: 'Hello Cypress' } })
11
- cy.get('h1').should('contain', 'Hello Cypress')
12
- })
13
- })
@@ -1,8 +0,0 @@
1
- // https://docs.cypress.io/api/introduction/api.html
2
-
3
- describe('My First Test', () => {
4
- it('visits the app root url', () => {
5
- cy.visit('/')
6
- cy.contains('h1', 'You did it!')
7
- })
8
- })
@@ -1,13 +0,0 @@
1
- // https://docs.cypress.io/api/introduction/api.html
2
-
3
- describe('My First Test', () => {
4
- it('visits the app root url', () => {
5
- cy.visit('/')
6
- cy.contains('h1', 'You did it!')
7
- })
8
-
9
- it('navigates to the about page', () => {
10
- cy.visit('/about')
11
- cy.contains('h1', 'This is an about page')
12
- })
13
- })
@@ -1,13 +0,0 @@
1
- import { mount } from '@cypress/vue'
2
- import HelloWorld from '../HelloWorld.vue'
3
-
4
- describe('HelloWorld', () => {
5
- it('playground', () => {
6
- mount(HelloWorld, { propsData: { msg: 'Hello Cypress' } })
7
- })
8
-
9
- it('renders properly', () => {
10
- mount(HelloWorld, { propsData: { msg: 'Hello Cypress' } })
11
- cy.get('h1').should('contain', 'Hello Cypress')
12
- })
13
- })
@@ -1,28 +0,0 @@
1
- /// <reference types="cypress" />
2
- // ***********************************************************
3
- // This example plugins/index.js can be used to load plugins
4
- //
5
- // You can change the location of this file or turn off loading
6
- // the plugins file with the 'pluginsFile' configuration option.
7
- //
8
- // You can read more here:
9
- // https://on.cypress.io/plugins-guide
10
- // ***********************************************************
11
-
12
- // This function is called when a project is opened or re-opened (e.g. due to
13
- // the project's config changing)
14
-
15
- const { startDevServer } = require('@cypress/vite-dev-server')
16
-
17
- /**
18
- * @type {Cypress.PluginConfig}
19
- */
20
- // eslint-disable-next-line no-unused-vars
21
- module.exports = (on, config) => {
22
- // `on` is used to hook into various events Cypress emits
23
- // `config` is the resolved Cypress config
24
- on('dev-server:start', (options) => {
25
- return startDevServer({ options })
26
- })
27
- return config
28
- }
@@ -1,7 +0,0 @@
1
- {
2
- "baseUrl": "http://localhost:5050",
3
- "component": {
4
- "componentFolder": "src",
5
- "testFiles": "**/__tests__/*.spec.{js,ts,jsx,tsx}"
6
- }
7
- }
@@ -1,24 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "baseUrl": "./",
4
- "target": "esnext",
5
- "useDefineForClassFields": true,
6
- "module": "esnext",
7
- "moduleResolution": "node",
8
- "isolatedModules": true,
9
- "strict": true,
10
- "jsx": "preserve",
11
- "sourceMap": true,
12
- "resolveJsonModule": true,
13
- "esModuleInterop": true,
14
- "paths": {
15
- "@/*": ["src/*"]
16
- },
17
- "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
18
- "skipLibCheck": true
19
- },
20
- "vueCompilerOptions": {
21
- "experimentalCompatMode": 2
22
- },
23
- "include": ["vite.config.*", "env.d.ts", "src/**/*", "src/**/*.vue"]
24
- }