From 7fb086362ff047bb3e717812fe8c97071900e03a Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Wed, 11 Aug 2021 15:27:57 +0800 Subject: [PATCH] chore: regenerate all templates with new feature flags --- index.js | 4 +- playground/default-ts-with-tests/README.md | 0 .../default-ts-with-tests/src/vite-env.d.ts | 1 - playground/default-ts/README.md | 0 playground/default-ts/src/vite-env.d.ts | 1 - playground/default-with-tests/README.md | 0 .../default-with-tests/src/vite-env.d.ts | 1 - playground/default/README.md | 21 +++++++ playground/default/jsconfig.json | 2 +- playground/default/package.json | 1 - playground/default/src/vite-env.d.ts | 1 - .../shims-vue.d.ts => default/vite-env.d.ts} | 2 + playground/default/vite.config.js | 3 +- .../.gitignore | 0 .../jsx-router-vuex-with-tests/README.md | 21 +++++++ .../cypress.json | 0 .../cypress/fixtures/example.json | 0 .../cypress/integration/example.spec.js | 0 .../cypress/jsconfig.json | 0 .../cypress/plugins/index.js | 0 .../cypress/support/commands.js | 0 .../cypress/support/index.js | 0 .../index.html | 0 .../jsconfig.json | 2 +- .../package.json | 4 +- .../public/favicon.ico | Bin .../src/App.vue | 0 .../src/assets/logo.png | Bin .../src/components/HelloWorld.vue | 0 .../components/__tests__/HelloWorld.spec.js | 0 .../src/main.js | 0 .../src/router/index.js | 0 .../src/store/index.js | 0 .../src/views/About.vue | 0 .../src/views/Home.vue | 0 .../vite-env.d.ts} | 2 + .../vite.config.js | 0 .../.gitignore | 0 playground/jsx-router-vuex/README.md | 21 +++++++ .../index.html | 0 .../{spa => jsx-router-vuex}/jsconfig.json | 2 +- playground/jsx-router-vuex/package.json | 21 +++++++ .../public/favicon.ico | Bin .../{spa-ts => jsx-router-vuex}/src/App.vue | 0 .../src/assets/logo.png | Bin .../src/components/HelloWorld.vue | 0 .../{spa => jsx-router-vuex}/src/main.js | 0 .../src/router/index.js | 0 .../src/store/index.js | 0 .../src/views/About.vue | 0 .../src/views/Home.vue | 0 .../vite-env.d.ts} | 2 + .../vite.config.js | 0 .../.gitignore | 0 playground/jsx-router/README.md | 21 +++++++ .../index.html | 0 .../jsconfig.json | 2 +- playground/jsx-router/package.json | 20 ++++++ .../public/favicon.ico | Bin .../src/App.vue | 0 .../src/assets/logo.png | Bin .../jsx-router/src/components/HelloWorld.vue | 57 ++++++++++++++++++ playground/jsx-router/src/main.js | 9 +++ playground/jsx-router/src/router/index.js | 25 ++++++++ .../src/views/About.vue | 0 playground/jsx-router/src/views/Home.vue | 19 ++++++ .../vite-env.d.ts} | 2 + playground/{spa => jsx-router}/vite.config.js | 0 .../{spa-ts-with-tests => jsx}/.gitignore | 0 playground/jsx/README.md | 21 +++++++ .../{spa-ts-with-tests => jsx}/index.html | 0 playground/jsx/jsconfig.json | 21 +++++++ playground/jsx/package.json | 19 ++++++ .../public/favicon.ico | Bin .../{default-with-tests => jsx}/src/App.vue | 0 .../src/assets/logo.png | Bin .../src/components/HelloWorld.vue | 0 .../{default-with-tests => jsx}/src/main.js | 0 playground/jsx/vite-env.d.ts | 8 +++ .../vite.config.ts => jsx/vite.config.js} | 0 .../.gitignore | 0 playground/router-vuex-with-tests/README.md | 21 +++++++ .../cypress.json | 0 .../cypress/fixtures/example.json | 0 .../cypress/integration/example.spec.js | 13 ++++ .../cypress/jsconfig.json | 0 .../cypress/plugins/index.js | 0 .../cypress/support/commands.js | 0 .../cypress/support/index.js | 0 .../index.html | 0 .../router-vuex-with-tests/jsconfig.json | 21 +++++++ .../package.json | 16 +++-- .../public/favicon.ico | Bin .../src/App.vue | 0 .../src/assets/logo.png | Bin .../src/components/HelloWorld.vue | 57 ++++++++++++++++++ .../components/__tests__/HelloWorld.spec.js | 0 .../src/main.js} | 0 .../src/router/index.js | 25 ++++++++ .../src/store/index.js} | 0 .../src/views/About.vue | 0 .../router-vuex-with-tests/src/views/Home.vue | 19 ++++++ .../router-vuex-with-tests/vite-env.d.ts | 8 +++ .../router-vuex-with-tests/vite.config.js | 12 ++++ .../.gitignore | 0 playground/router-vuex/README.md | 21 +++++++ .../index.html | 0 playground/router-vuex/jsconfig.json | 21 +++++++ playground/{spa => router-vuex}/package.json | 3 +- .../public/favicon.ico | Bin playground/router-vuex/src/App.vue | 30 +++++++++ .../src/assets/logo.png | Bin .../router-vuex/src/components/HelloWorld.vue | 57 ++++++++++++++++++ .../src/main.ts => router-vuex/src/main.js} | 0 playground/router-vuex/src/router/index.js | 25 ++++++++ .../src/store/index.js} | 0 playground/router-vuex/src/views/About.vue | 5 ++ playground/router-vuex/src/views/Home.vue | 19 ++++++ playground/router-vuex/vite-env.d.ts | 8 +++ playground/router-vuex/vite.config.js | 12 ++++ playground/{spa => router}/.gitignore | 0 playground/router/README.md | 21 +++++++ playground/{spa => router}/index.html | 0 playground/router/jsconfig.json | 21 +++++++ playground/router/package.json | 19 ++++++ playground/{spa => router}/public/favicon.ico | Bin playground/router/src/App.vue | 30 +++++++++ .../{spa => router}/src/assets/logo.png | Bin .../router/src/components/HelloWorld.vue | 57 ++++++++++++++++++ playground/router/src/main.js | 9 +++ playground/router/src/router/index.js | 25 ++++++++ playground/router/src/views/About.vue | 5 ++ playground/router/src/views/Home.vue | 19 ++++++ playground/router/vite-env.d.ts | 8 +++ playground/router/vite.config.js | 12 ++++ playground/spa-ts-with-tests/README.md | 0 .../spa-ts-with-tests/src/shims-vue.d.ts | 6 -- .../spa-ts-with-tests/src/vite-env.d.ts | 1 - playground/spa-ts/README.md | 0 playground/spa-ts/src/shims-vue.d.ts | 6 -- playground/spa-ts/src/vite-env.d.ts | 1 - playground/spa-with-tests/README.md | 0 playground/spa-with-tests/src/shims-vue.d.ts | 6 -- playground/spa-with-tests/src/vite-env.d.ts | 1 - playground/spa/README.md | 0 playground/spa/src/shims-vue.d.ts | 6 -- playground/spa/src/vite-env.d.ts | 1 - .../.gitignore | 27 +++++++++ .../README.md | 21 +++++++ .../cypress.json | 0 .../cypress/fixtures/example.json | 0 .../cypress/integration/example.spec.ts | 0 .../cypress/plugins/index.ts | 0 .../cypress/support/commands.ts | 0 .../cypress/support/index.ts | 0 .../cypress/tsconfig.json | 0 .../index.html | 13 ++++ .../package.json | 4 +- .../public/favicon.ico | Bin 0 -> 4286 bytes .../src/App.vue | 30 +++++++++ .../src/assets/logo.png | Bin 0 -> 6849 bytes .../src/components/HelloWorld.vue | 0 .../components/__tests__/HelloWorld.spec.ts | 0 .../src/main.ts | 12 ++++ .../src/router/index.ts | 0 .../src/store/index.ts | 8 +++ .../src/views/About.vue | 5 ++ .../src/views/Home.vue | 0 .../tsconfig.json | 2 +- .../vite-env.d.ts | 8 +++ .../vite.config.ts | 0 .../typescript-jsx-router-vuex/.gitignore | 27 +++++++++ .../typescript-jsx-router-vuex/README.md | 21 +++++++ .../typescript-jsx-router-vuex/index.html | 13 ++++ .../package.json | 4 +- .../public/favicon.ico | Bin 0 -> 4286 bytes .../typescript-jsx-router-vuex/src/App.vue | 30 +++++++++ .../src/assets/logo.png | Bin 0 -> 6849 bytes .../src/components/HelloWorld.vue | 0 .../typescript-jsx-router-vuex/src/main.ts | 12 ++++ .../src/router/index.ts | 0 .../src/store/index.ts | 8 +++ .../src/views/About.vue | 5 ++ .../src/views/Home.vue | 0 .../tsconfig.json | 2 +- .../typescript-jsx-router-vuex/vite-env.d.ts | 8 +++ .../vite.config.ts | 0 playground/typescript-jsx-router/.gitignore | 27 +++++++++ playground/typescript-jsx-router/README.md | 21 +++++++ playground/typescript-jsx-router/index.html | 13 ++++ playground/typescript-jsx-router/package.json | 23 +++++++ .../typescript-jsx-router/public/favicon.ico | Bin 0 -> 4286 bytes playground/typescript-jsx-router/src/App.vue | 30 +++++++++ .../typescript-jsx-router/src/assets/logo.png | Bin 0 -> 6849 bytes .../src/components/HelloWorld.vue | 0 playground/typescript-jsx-router/src/main.ts | 9 +++ .../typescript-jsx-router/src/router/index.ts | 27 +++++++++ .../typescript-jsx-router/src/views/About.vue | 5 ++ .../typescript-jsx-router/src/views/Home.vue | 19 ++++++ .../tsconfig.json | 2 +- .../typescript-jsx-router/vite-env.d.ts | 8 +++ .../vite.config.ts | 0 playground/typescript-jsx/.gitignore | 27 +++++++++ playground/typescript-jsx/README.md | 21 +++++++ playground/typescript-jsx/index.html | 13 ++++ .../package.json | 4 +- playground/typescript-jsx/public/favicon.ico | Bin 0 -> 4286 bytes .../src/App.vue | 0 playground/typescript-jsx/src/assets/logo.png | Bin 0 -> 6849 bytes .../src/components/HelloWorld.vue | 0 .../src/main.ts | 0 .../tsconfig.json | 2 +- playground/typescript-jsx/vite-env.d.ts | 8 +++ playground/typescript-jsx/vite.config.ts | 13 ++++ playground/typescript/.gitignore | 27 +++++++++ playground/typescript/README.md | 21 +++++++ playground/typescript/index.html | 13 ++++ playground/typescript/package.json | 21 +++++++ playground/typescript/public/favicon.ico | Bin 0 -> 4286 bytes .../{default-ts => typescript}/src/App.vue | 0 playground/typescript/src/assets/logo.png | Bin 0 -> 6849 bytes .../typescript/src/components/HelloWorld.vue | 54 +++++++++++++++++ .../{default-ts => typescript}/src/main.ts | 0 playground/typescript/tsconfig.json | 21 +++++++ playground/typescript/vite-env.d.ts | 8 +++ playground/typescript/vite.config.ts | 12 ++++ playground/vuex-with-tests/.gitignore | 27 +++++++++ playground/vuex-with-tests/README.md | 21 +++++++ .../cypress.json | 0 .../cypress/fixtures/example.json | 0 .../cypress/integration/example.spec.js | 0 .../cypress/jsconfig.json} | 0 .../cypress/plugins/index.js} | 0 .../cypress/support/commands.js} | 0 .../cypress/support/index.js} | 0 playground/vuex-with-tests/index.html | 13 ++++ playground/vuex-with-tests/jsconfig.json | 21 +++++++ playground/vuex-with-tests/package.json | 27 +++++++++ playground/vuex-with-tests/public/favicon.ico | Bin 0 -> 4286 bytes playground/vuex-with-tests/src/App.vue | 22 +++++++ .../vuex-with-tests/src/assets/logo.png | Bin 0 -> 6849 bytes .../src/components/HelloWorld.vue | 38 ++++++++++++ .../components/__tests__/HelloWorld.spec.js} | 0 playground/vuex-with-tests/src/main.js | 9 +++ playground/vuex-with-tests/src/store/index.js | 8 +++ playground/vuex-with-tests/vite-env.d.ts | 8 +++ playground/vuex-with-tests/vite.config.js | 12 ++++ playground/vuex/.gitignore | 27 +++++++++ playground/vuex/README.md | 21 +++++++ playground/vuex/index.html | 13 ++++ playground/vuex/jsconfig.json | 21 +++++++ playground/vuex/package.json | 19 ++++++ playground/vuex/public/favicon.ico | Bin 0 -> 4286 bytes playground/vuex/src/App.vue | 22 +++++++ playground/vuex/src/assets/logo.png | Bin 0 -> 6849 bytes playground/vuex/src/components/HelloWorld.vue | 38 ++++++++++++ playground/vuex/src/main.js | 9 +++ playground/vuex/src/store/index.js | 8 +++ playground/vuex/vite-env.d.ts | 8 +++ playground/vuex/vite.config.js | 12 ++++ playground/with-tests/.gitignore | 27 +++++++++ playground/with-tests/README.md | 21 +++++++ playground/with-tests/cypress.json | 7 +++ .../with-tests/cypress/fixtures/example.json | 5 ++ .../cypress/integration/example.spec.js} | 2 +- playground/with-tests/cypress/jsconfig.json | 8 +++ .../with-tests/cypress/plugins/index.js | 28 +++++++++ .../with-tests/cypress/support/commands.js | 25 ++++++++ .../with-tests/cypress/support/index.js | 20 ++++++ playground/with-tests/index.html | 13 ++++ playground/with-tests/jsconfig.json | 21 +++++++ .../package.json | 3 +- playground/with-tests/public/favicon.ico | Bin 0 -> 4286 bytes playground/with-tests/src/App.vue | 22 +++++++ playground/with-tests/src/assets/logo.png | Bin 0 -> 6849 bytes .../with-tests/src/components/HelloWorld.vue | 38 ++++++++++++ .../components/__tests__/HelloWorld.spec.js | 22 +++++++ playground/with-tests/src/main.js | 4 ++ playground/with-tests/vite-env.d.ts | 8 +++ playground/with-tests/vite.config.js | 12 ++++ snapshot.js | 45 +++++++++++--- utils/templateList.js | 5 -- 282 files changed, 2353 insertions(+), 79 deletions(-) delete mode 100644 playground/default-ts-with-tests/README.md delete mode 100644 playground/default-ts-with-tests/src/vite-env.d.ts delete mode 100644 playground/default-ts/README.md delete mode 100644 playground/default-ts/src/vite-env.d.ts delete mode 100644 playground/default-with-tests/README.md delete mode 100644 playground/default-with-tests/src/vite-env.d.ts delete mode 100644 playground/default/src/vite-env.d.ts rename playground/{default-with-tests/src/shims-vue.d.ts => default/vite-env.d.ts} (81%) rename playground/{default-ts-with-tests => jsx-router-vuex-with-tests}/.gitignore (100%) create mode 100644 playground/jsx-router-vuex-with-tests/README.md rename playground/{default-ts-with-tests => jsx-router-vuex-with-tests}/cypress.json (100%) rename playground/{default-ts-with-tests => jsx-router-vuex-with-tests}/cypress/fixtures/example.json (100%) rename playground/{spa-with-tests => jsx-router-vuex-with-tests}/cypress/integration/example.spec.js (100%) rename playground/{default-with-tests => jsx-router-vuex-with-tests}/cypress/jsconfig.json (100%) rename playground/{default-with-tests => jsx-router-vuex-with-tests}/cypress/plugins/index.js (100%) rename playground/{default-with-tests => jsx-router-vuex-with-tests}/cypress/support/commands.js (100%) rename playground/{default-with-tests => jsx-router-vuex-with-tests}/cypress/support/index.js (100%) rename playground/{default-ts-with-tests => jsx-router-vuex-with-tests}/index.html (100%) rename playground/{spa-with-tests => jsx-router-vuex-with-tests}/jsconfig.json (85%) rename playground/{spa-with-tests => jsx-router-vuex-with-tests}/package.json (95%) rename playground/{default-ts-with-tests => jsx-router-vuex-with-tests}/public/favicon.ico (100%) rename playground/{spa-ts-with-tests => jsx-router-vuex-with-tests}/src/App.vue (100%) rename playground/{default-ts-with-tests => jsx-router-vuex-with-tests}/src/assets/logo.png (100%) rename playground/{spa-with-tests => jsx-router-vuex-with-tests}/src/components/HelloWorld.vue (100%) rename playground/{default-with-tests => jsx-router-vuex-with-tests}/src/components/__tests__/HelloWorld.spec.js (100%) rename playground/{spa-with-tests => jsx-router-vuex-with-tests}/src/main.js (100%) rename playground/{spa-with-tests => jsx-router-vuex-with-tests}/src/router/index.js (100%) rename playground/{spa-with-tests => jsx-router-vuex-with-tests}/src/store/index.js (100%) rename playground/{spa-ts-with-tests => jsx-router-vuex-with-tests}/src/views/About.vue (100%) rename playground/{spa-with-tests => jsx-router-vuex-with-tests}/src/views/Home.vue (100%) rename playground/{default/src/shims-vue.d.ts => jsx-router-vuex-with-tests/vite-env.d.ts} (81%) rename playground/{default-with-tests => jsx-router-vuex-with-tests}/vite.config.js (100%) rename playground/{default-ts => jsx-router-vuex}/.gitignore (100%) create mode 100644 playground/jsx-router-vuex/README.md rename playground/{default-ts => jsx-router-vuex}/index.html (100%) rename playground/{spa => jsx-router-vuex}/jsconfig.json (85%) create mode 100644 playground/jsx-router-vuex/package.json rename playground/{default-ts => jsx-router-vuex}/public/favicon.ico (100%) rename playground/{spa-ts => jsx-router-vuex}/src/App.vue (100%) rename playground/{default-ts => jsx-router-vuex}/src/assets/logo.png (100%) rename playground/{spa => jsx-router-vuex}/src/components/HelloWorld.vue (100%) rename playground/{spa => jsx-router-vuex}/src/main.js (100%) rename playground/{spa => jsx-router-vuex}/src/router/index.js (100%) rename playground/{spa => jsx-router-vuex}/src/store/index.js (100%) rename playground/{spa-ts => jsx-router-vuex}/src/views/About.vue (100%) rename playground/{spa => jsx-router-vuex}/src/views/Home.vue (100%) rename playground/{default-ts/src/shims-vue.d.ts => jsx-router-vuex/vite-env.d.ts} (81%) rename playground/{spa-with-tests => jsx-router-vuex}/vite.config.js (100%) rename playground/{default-with-tests => jsx-router}/.gitignore (100%) create mode 100644 playground/jsx-router/README.md rename playground/{default-with-tests => jsx-router}/index.html (100%) rename playground/{default-with-tests => jsx-router}/jsconfig.json (85%) create mode 100644 playground/jsx-router/package.json rename playground/{default-with-tests => jsx-router}/public/favicon.ico (100%) rename playground/{spa-with-tests => jsx-router}/src/App.vue (100%) rename playground/{default-with-tests => jsx-router}/src/assets/logo.png (100%) create mode 100644 playground/jsx-router/src/components/HelloWorld.vue create mode 100644 playground/jsx-router/src/main.js create mode 100644 playground/jsx-router/src/router/index.js rename playground/{spa-with-tests => jsx-router}/src/views/About.vue (100%) create mode 100644 playground/jsx-router/src/views/Home.vue rename playground/{default-ts-with-tests/src/shims-vue.d.ts => jsx-router/vite-env.d.ts} (81%) rename playground/{spa => jsx-router}/vite.config.js (100%) rename playground/{spa-ts-with-tests => jsx}/.gitignore (100%) create mode 100644 playground/jsx/README.md rename playground/{spa-ts-with-tests => jsx}/index.html (100%) create mode 100644 playground/jsx/jsconfig.json create mode 100644 playground/jsx/package.json rename playground/{spa-ts-with-tests => jsx}/public/favicon.ico (100%) rename playground/{default-with-tests => jsx}/src/App.vue (100%) rename playground/{spa-ts-with-tests => jsx}/src/assets/logo.png (100%) rename playground/{default-with-tests => jsx}/src/components/HelloWorld.vue (100%) rename playground/{default-with-tests => jsx}/src/main.js (100%) create mode 100644 playground/jsx/vite-env.d.ts rename playground/{default-ts-with-tests/vite.config.ts => jsx/vite.config.js} (100%) rename playground/{spa-ts => router-vuex-with-tests}/.gitignore (100%) create mode 100644 playground/router-vuex-with-tests/README.md rename playground/{default-with-tests => router-vuex-with-tests}/cypress.json (100%) rename playground/{default-with-tests => router-vuex-with-tests}/cypress/fixtures/example.json (100%) create mode 100644 playground/router-vuex-with-tests/cypress/integration/example.spec.js rename playground/{spa-with-tests => router-vuex-with-tests}/cypress/jsconfig.json (100%) rename playground/{spa-with-tests => router-vuex-with-tests}/cypress/plugins/index.js (100%) rename playground/{spa-with-tests => router-vuex-with-tests}/cypress/support/commands.js (100%) rename playground/{spa-with-tests => router-vuex-with-tests}/cypress/support/index.js (100%) rename playground/{spa-ts => router-vuex-with-tests}/index.html (100%) create mode 100644 playground/router-vuex-with-tests/jsconfig.json rename playground/{default-ts-with-tests => router-vuex-with-tests}/package.json (68%) rename playground/{spa-ts => router-vuex-with-tests}/public/favicon.ico (100%) rename playground/{spa => router-vuex-with-tests}/src/App.vue (100%) rename playground/{spa-ts => router-vuex-with-tests}/src/assets/logo.png (100%) create mode 100644 playground/router-vuex-with-tests/src/components/HelloWorld.vue rename playground/{spa-with-tests => router-vuex-with-tests}/src/components/__tests__/HelloWorld.spec.js (100%) rename playground/{spa-ts-with-tests/src/main.ts => router-vuex-with-tests/src/main.js} (100%) create mode 100644 playground/router-vuex-with-tests/src/router/index.js rename playground/{spa-ts-with-tests/src/store/index.ts => router-vuex-with-tests/src/store/index.js} (100%) rename playground/{spa => router-vuex-with-tests}/src/views/About.vue (100%) create mode 100644 playground/router-vuex-with-tests/src/views/Home.vue create mode 100644 playground/router-vuex-with-tests/vite-env.d.ts create mode 100644 playground/router-vuex-with-tests/vite.config.js rename playground/{spa-with-tests => router-vuex}/.gitignore (100%) create mode 100644 playground/router-vuex/README.md rename playground/{spa-with-tests => router-vuex}/index.html (100%) create mode 100644 playground/router-vuex/jsconfig.json rename playground/{spa => router-vuex}/package.json (86%) rename playground/{spa-with-tests => router-vuex}/public/favicon.ico (100%) create mode 100644 playground/router-vuex/src/App.vue rename playground/{spa-with-tests => router-vuex}/src/assets/logo.png (100%) create mode 100644 playground/router-vuex/src/components/HelloWorld.vue rename playground/{spa-ts/src/main.ts => router-vuex/src/main.js} (100%) create mode 100644 playground/router-vuex/src/router/index.js rename playground/{spa-ts/src/store/index.ts => router-vuex/src/store/index.js} (100%) create mode 100644 playground/router-vuex/src/views/About.vue create mode 100644 playground/router-vuex/src/views/Home.vue create mode 100644 playground/router-vuex/vite-env.d.ts create mode 100644 playground/router-vuex/vite.config.js rename playground/{spa => router}/.gitignore (100%) create mode 100644 playground/router/README.md rename playground/{spa => router}/index.html (100%) create mode 100644 playground/router/jsconfig.json create mode 100644 playground/router/package.json rename playground/{spa => router}/public/favicon.ico (100%) create mode 100644 playground/router/src/App.vue rename playground/{spa => router}/src/assets/logo.png (100%) create mode 100644 playground/router/src/components/HelloWorld.vue create mode 100644 playground/router/src/main.js create mode 100644 playground/router/src/router/index.js create mode 100644 playground/router/src/views/About.vue create mode 100644 playground/router/src/views/Home.vue create mode 100644 playground/router/vite-env.d.ts create mode 100644 playground/router/vite.config.js delete mode 100644 playground/spa-ts-with-tests/README.md delete mode 100644 playground/spa-ts-with-tests/src/shims-vue.d.ts delete mode 100644 playground/spa-ts-with-tests/src/vite-env.d.ts delete mode 100644 playground/spa-ts/README.md delete mode 100644 playground/spa-ts/src/shims-vue.d.ts delete mode 100644 playground/spa-ts/src/vite-env.d.ts delete mode 100644 playground/spa-with-tests/README.md delete mode 100644 playground/spa-with-tests/src/shims-vue.d.ts delete mode 100644 playground/spa-with-tests/src/vite-env.d.ts delete mode 100644 playground/spa/README.md delete mode 100644 playground/spa/src/shims-vue.d.ts delete mode 100644 playground/spa/src/vite-env.d.ts create mode 100644 playground/typescript-jsx-router-vuex-with-tests/.gitignore create mode 100644 playground/typescript-jsx-router-vuex-with-tests/README.md rename playground/{spa-ts-with-tests => typescript-jsx-router-vuex-with-tests}/cypress.json (100%) rename playground/{spa-ts-with-tests => typescript-jsx-router-vuex-with-tests}/cypress/fixtures/example.json (100%) rename playground/{spa-ts-with-tests => typescript-jsx-router-vuex-with-tests}/cypress/integration/example.spec.ts (100%) rename playground/{default-ts-with-tests => typescript-jsx-router-vuex-with-tests}/cypress/plugins/index.ts (100%) rename playground/{default-ts-with-tests => typescript-jsx-router-vuex-with-tests}/cypress/support/commands.ts (100%) rename playground/{default-ts-with-tests => typescript-jsx-router-vuex-with-tests}/cypress/support/index.ts (100%) rename playground/{default-ts-with-tests => typescript-jsx-router-vuex-with-tests}/cypress/tsconfig.json (100%) create mode 100644 playground/typescript-jsx-router-vuex-with-tests/index.html rename playground/{spa-ts-with-tests => typescript-jsx-router-vuex-with-tests}/package.json (94%) create mode 100644 playground/typescript-jsx-router-vuex-with-tests/public/favicon.ico create mode 100644 playground/typescript-jsx-router-vuex-with-tests/src/App.vue create mode 100644 playground/typescript-jsx-router-vuex-with-tests/src/assets/logo.png rename playground/{default-ts-with-tests => typescript-jsx-router-vuex-with-tests}/src/components/HelloWorld.vue (100%) rename playground/{default-ts-with-tests => typescript-jsx-router-vuex-with-tests}/src/components/__tests__/HelloWorld.spec.ts (100%) create mode 100644 playground/typescript-jsx-router-vuex-with-tests/src/main.ts rename playground/{spa-ts-with-tests => typescript-jsx-router-vuex-with-tests}/src/router/index.ts (100%) create mode 100644 playground/typescript-jsx-router-vuex-with-tests/src/store/index.ts create mode 100644 playground/typescript-jsx-router-vuex-with-tests/src/views/About.vue rename playground/{spa-ts-with-tests => typescript-jsx-router-vuex-with-tests}/src/views/Home.vue (100%) rename playground/{default-ts-with-tests => typescript-jsx-router-vuex-with-tests}/tsconfig.json (85%) create mode 100644 playground/typescript-jsx-router-vuex-with-tests/vite-env.d.ts rename playground/{default-ts => typescript-jsx-router-vuex-with-tests}/vite.config.ts (100%) create mode 100644 playground/typescript-jsx-router-vuex/.gitignore create mode 100644 playground/typescript-jsx-router-vuex/README.md create mode 100644 playground/typescript-jsx-router-vuex/index.html rename playground/{spa-ts => typescript-jsx-router-vuex}/package.json (92%) create mode 100644 playground/typescript-jsx-router-vuex/public/favicon.ico create mode 100644 playground/typescript-jsx-router-vuex/src/App.vue create mode 100644 playground/typescript-jsx-router-vuex/src/assets/logo.png rename playground/{default-ts => typescript-jsx-router-vuex}/src/components/HelloWorld.vue (100%) create mode 100644 playground/typescript-jsx-router-vuex/src/main.ts rename playground/{spa-ts => typescript-jsx-router-vuex}/src/router/index.ts (100%) create mode 100644 playground/typescript-jsx-router-vuex/src/store/index.ts create mode 100644 playground/typescript-jsx-router-vuex/src/views/About.vue rename playground/{spa-ts => typescript-jsx-router-vuex}/src/views/Home.vue (100%) rename playground/{spa-ts-with-tests => typescript-jsx-router-vuex}/tsconfig.json (85%) create mode 100644 playground/typescript-jsx-router-vuex/vite-env.d.ts rename playground/{spa-ts-with-tests => typescript-jsx-router-vuex}/vite.config.ts (100%) create mode 100644 playground/typescript-jsx-router/.gitignore create mode 100644 playground/typescript-jsx-router/README.md create mode 100644 playground/typescript-jsx-router/index.html create mode 100644 playground/typescript-jsx-router/package.json create mode 100644 playground/typescript-jsx-router/public/favicon.ico create mode 100644 playground/typescript-jsx-router/src/App.vue create mode 100644 playground/typescript-jsx-router/src/assets/logo.png rename playground/{spa-ts-with-tests => typescript-jsx-router}/src/components/HelloWorld.vue (100%) create mode 100644 playground/typescript-jsx-router/src/main.ts create mode 100644 playground/typescript-jsx-router/src/router/index.ts create mode 100644 playground/typescript-jsx-router/src/views/About.vue create mode 100644 playground/typescript-jsx-router/src/views/Home.vue rename playground/{spa-ts => typescript-jsx-router}/tsconfig.json (85%) create mode 100644 playground/typescript-jsx-router/vite-env.d.ts rename playground/{spa-ts => typescript-jsx-router}/vite.config.ts (100%) create mode 100644 playground/typescript-jsx/.gitignore create mode 100644 playground/typescript-jsx/README.md create mode 100644 playground/typescript-jsx/index.html rename playground/{default-ts => typescript-jsx}/package.json (94%) create mode 100644 playground/typescript-jsx/public/favicon.ico rename playground/{default-ts-with-tests => typescript-jsx}/src/App.vue (100%) create mode 100644 playground/typescript-jsx/src/assets/logo.png rename playground/{spa-ts => typescript-jsx}/src/components/HelloWorld.vue (100%) rename playground/{default-ts-with-tests => typescript-jsx}/src/main.ts (100%) rename playground/{default-ts => typescript-jsx}/tsconfig.json (85%) create mode 100644 playground/typescript-jsx/vite-env.d.ts create mode 100644 playground/typescript-jsx/vite.config.ts create mode 100644 playground/typescript/.gitignore create mode 100644 playground/typescript/README.md create mode 100644 playground/typescript/index.html create mode 100644 playground/typescript/package.json create mode 100644 playground/typescript/public/favicon.ico rename playground/{default-ts => typescript}/src/App.vue (100%) create mode 100644 playground/typescript/src/assets/logo.png create mode 100644 playground/typescript/src/components/HelloWorld.vue rename playground/{default-ts => typescript}/src/main.ts (100%) create mode 100644 playground/typescript/tsconfig.json create mode 100644 playground/typescript/vite-env.d.ts create mode 100644 playground/typescript/vite.config.ts create mode 100644 playground/vuex-with-tests/.gitignore create mode 100644 playground/vuex-with-tests/README.md rename playground/{spa-with-tests => vuex-with-tests}/cypress.json (100%) rename playground/{spa-with-tests => vuex-with-tests}/cypress/fixtures/example.json (100%) rename playground/{default-with-tests => vuex-with-tests}/cypress/integration/example.spec.js (100%) rename playground/{spa-ts-with-tests/cypress/tsconfig.json => vuex-with-tests/cypress/jsconfig.json} (100%) rename playground/{spa-ts-with-tests/cypress/plugins/index.ts => vuex-with-tests/cypress/plugins/index.js} (100%) rename playground/{spa-ts-with-tests/cypress/support/commands.ts => vuex-with-tests/cypress/support/commands.js} (100%) rename playground/{spa-ts-with-tests/cypress/support/index.ts => vuex-with-tests/cypress/support/index.js} (100%) create mode 100644 playground/vuex-with-tests/index.html create mode 100644 playground/vuex-with-tests/jsconfig.json create mode 100644 playground/vuex-with-tests/package.json create mode 100644 playground/vuex-with-tests/public/favicon.ico create mode 100644 playground/vuex-with-tests/src/App.vue create mode 100644 playground/vuex-with-tests/src/assets/logo.png create mode 100644 playground/vuex-with-tests/src/components/HelloWorld.vue rename playground/{spa-ts-with-tests/src/components/__tests__/HelloWorld.spec.ts => vuex-with-tests/src/components/__tests__/HelloWorld.spec.js} (100%) create mode 100644 playground/vuex-with-tests/src/main.js create mode 100644 playground/vuex-with-tests/src/store/index.js create mode 100644 playground/vuex-with-tests/vite-env.d.ts create mode 100644 playground/vuex-with-tests/vite.config.js create mode 100644 playground/vuex/.gitignore create mode 100644 playground/vuex/README.md create mode 100644 playground/vuex/index.html create mode 100644 playground/vuex/jsconfig.json create mode 100644 playground/vuex/package.json create mode 100644 playground/vuex/public/favicon.ico create mode 100644 playground/vuex/src/App.vue create mode 100644 playground/vuex/src/assets/logo.png create mode 100644 playground/vuex/src/components/HelloWorld.vue create mode 100644 playground/vuex/src/main.js create mode 100644 playground/vuex/src/store/index.js create mode 100644 playground/vuex/vite-env.d.ts create mode 100644 playground/vuex/vite.config.js create mode 100644 playground/with-tests/.gitignore create mode 100644 playground/with-tests/README.md create mode 100644 playground/with-tests/cypress.json create mode 100644 playground/with-tests/cypress/fixtures/example.json rename playground/{default-ts-with-tests/cypress/integration/example.spec.ts => with-tests/cypress/integration/example.spec.js} (72%) create mode 100644 playground/with-tests/cypress/jsconfig.json create mode 100644 playground/with-tests/cypress/plugins/index.js create mode 100644 playground/with-tests/cypress/support/commands.js create mode 100644 playground/with-tests/cypress/support/index.js create mode 100644 playground/with-tests/index.html create mode 100644 playground/with-tests/jsconfig.json rename playground/{default-with-tests => with-tests}/package.json (90%) create mode 100644 playground/with-tests/public/favicon.ico create mode 100644 playground/with-tests/src/App.vue create mode 100644 playground/with-tests/src/assets/logo.png create mode 100644 playground/with-tests/src/components/HelloWorld.vue create mode 100644 playground/with-tests/src/components/__tests__/HelloWorld.spec.js create mode 100644 playground/with-tests/src/main.js create mode 100644 playground/with-tests/vite-env.d.ts create mode 100644 playground/with-tests/vite.config.js delete mode 100644 utils/templateList.js diff --git a/index.js b/index.js index 1b28f39e..dd5a285e 100755 --- a/index.js +++ b/index.js @@ -8,7 +8,6 @@ import minimist from 'minimist' import prompts from 'prompts' import { red, green, bold } from 'kolorist' -import templateList from './utils/templateList.js' import renderTemplate from './utils/renderTemplate.js' import { postOrderDirectoryTraverse, @@ -45,6 +44,7 @@ function emptyDir(dir) { async function init() { const cwd = process.cwd() // possible options: + // --default // --typescript / --ts // --jsx // --router / --vue-router @@ -62,7 +62,7 @@ async function init() { // if any of the feature flags is set, we would skip the feature prompts // use `??` instead of `||` once we drop Node.js 12 support - const isFeatureFlagsUsed = typeof (argv.ts || argv.jsx || argv.router || argv.vuex || argv.tests) === 'boolean' + const isFeatureFlagsUsed = typeof (argv.default || argv.ts || argv.jsx || argv.router || argv.vuex || argv.tests) === 'boolean' let targetDir = argv._[0] const defaultProjectName = !targetDir ? 'vue-project' : targetDir diff --git a/playground/default-ts-with-tests/README.md b/playground/default-ts-with-tests/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/playground/default-ts-with-tests/src/vite-env.d.ts b/playground/default-ts-with-tests/src/vite-env.d.ts deleted file mode 100644 index 11f02fe2..00000000 --- a/playground/default-ts-with-tests/src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/playground/default-ts/README.md b/playground/default-ts/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/playground/default-ts/src/vite-env.d.ts b/playground/default-ts/src/vite-env.d.ts deleted file mode 100644 index 11f02fe2..00000000 --- a/playground/default-ts/src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/playground/default-with-tests/README.md b/playground/default-with-tests/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/playground/default-with-tests/src/vite-env.d.ts b/playground/default-with-tests/src/vite-env.d.ts deleted file mode 100644 index 11f02fe2..00000000 --- a/playground/default-with-tests/src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/playground/default/README.md b/playground/default/README.md index e69de29b..c3a42c19 100644 --- a/playground/default/README.md +++ b/playground/default/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/default/jsconfig.json b/playground/default/jsconfig.json index 9c2cfe6b..6f98acfa 100644 --- a/playground/default/jsconfig.json +++ b/playground/default/jsconfig.json @@ -16,6 +16,6 @@ "lib": ["esnext", "dom", "dom.iterable", "scripthost"], "skipLibCheck": true }, - "include": ["vite.config.*", "src/**/*", "src/**/*.vue"], + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], "exclude": ["src/**/__tests__/**"] } diff --git a/playground/default/package.json b/playground/default/package.json index b9abc773..cdc46acb 100644 --- a/playground/default/package.json +++ b/playground/default/package.json @@ -12,7 +12,6 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^1.2.5", - "@vitejs/plugin-vue-jsx": "^1.1.6", "@vue/compiler-sfc": "^3.1.5", "vite": "^2.4.3" } diff --git a/playground/default/src/vite-env.d.ts b/playground/default/src/vite-env.d.ts deleted file mode 100644 index 11f02fe2..00000000 --- a/playground/default/src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/playground/default-with-tests/src/shims-vue.d.ts b/playground/default/vite-env.d.ts similarity index 81% rename from playground/default-with-tests/src/shims-vue.d.ts rename to playground/default/vite-env.d.ts index ec4f1b2e..636d9c3f 100644 --- a/playground/default-with-tests/src/shims-vue.d.ts +++ b/playground/default/vite-env.d.ts @@ -1,3 +1,5 @@ +/// + declare module '*.vue' { import { DefineComponent } from 'vue' // eslint-disable-next-line diff --git a/playground/default/vite.config.js b/playground/default/vite.config.js index 032e163c..24c2e504 100644 --- a/playground/default/vite.config.js +++ b/playground/default/vite.config.js @@ -1,10 +1,9 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' -import vueJsx from '@vitejs/plugin-vue-jsx' // https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue(), vueJsx()], + plugins: [vue()], resolve: { alias: { '@/': new URL('./src/', import.meta.url).pathname diff --git a/playground/default-ts-with-tests/.gitignore b/playground/jsx-router-vuex-with-tests/.gitignore similarity index 100% rename from playground/default-ts-with-tests/.gitignore rename to playground/jsx-router-vuex-with-tests/.gitignore diff --git a/playground/jsx-router-vuex-with-tests/README.md b/playground/jsx-router-vuex-with-tests/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/jsx-router-vuex-with-tests/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/default-ts-with-tests/cypress.json b/playground/jsx-router-vuex-with-tests/cypress.json similarity index 100% rename from playground/default-ts-with-tests/cypress.json rename to playground/jsx-router-vuex-with-tests/cypress.json diff --git a/playground/default-ts-with-tests/cypress/fixtures/example.json b/playground/jsx-router-vuex-with-tests/cypress/fixtures/example.json similarity index 100% rename from playground/default-ts-with-tests/cypress/fixtures/example.json rename to playground/jsx-router-vuex-with-tests/cypress/fixtures/example.json diff --git a/playground/spa-with-tests/cypress/integration/example.spec.js b/playground/jsx-router-vuex-with-tests/cypress/integration/example.spec.js similarity index 100% rename from playground/spa-with-tests/cypress/integration/example.spec.js rename to playground/jsx-router-vuex-with-tests/cypress/integration/example.spec.js diff --git a/playground/default-with-tests/cypress/jsconfig.json b/playground/jsx-router-vuex-with-tests/cypress/jsconfig.json similarity index 100% rename from playground/default-with-tests/cypress/jsconfig.json rename to playground/jsx-router-vuex-with-tests/cypress/jsconfig.json diff --git a/playground/default-with-tests/cypress/plugins/index.js b/playground/jsx-router-vuex-with-tests/cypress/plugins/index.js similarity index 100% rename from playground/default-with-tests/cypress/plugins/index.js rename to playground/jsx-router-vuex-with-tests/cypress/plugins/index.js diff --git a/playground/default-with-tests/cypress/support/commands.js b/playground/jsx-router-vuex-with-tests/cypress/support/commands.js similarity index 100% rename from playground/default-with-tests/cypress/support/commands.js rename to playground/jsx-router-vuex-with-tests/cypress/support/commands.js diff --git a/playground/default-with-tests/cypress/support/index.js b/playground/jsx-router-vuex-with-tests/cypress/support/index.js similarity index 100% rename from playground/default-with-tests/cypress/support/index.js rename to playground/jsx-router-vuex-with-tests/cypress/support/index.js diff --git a/playground/default-ts-with-tests/index.html b/playground/jsx-router-vuex-with-tests/index.html similarity index 100% rename from playground/default-ts-with-tests/index.html rename to playground/jsx-router-vuex-with-tests/index.html diff --git a/playground/spa-with-tests/jsconfig.json b/playground/jsx-router-vuex-with-tests/jsconfig.json similarity index 85% rename from playground/spa-with-tests/jsconfig.json rename to playground/jsx-router-vuex-with-tests/jsconfig.json index 9c2cfe6b..6f98acfa 100644 --- a/playground/spa-with-tests/jsconfig.json +++ b/playground/jsx-router-vuex-with-tests/jsconfig.json @@ -16,6 +16,6 @@ "lib": ["esnext", "dom", "dom.iterable", "scripthost"], "skipLibCheck": true }, - "include": ["vite.config.*", "src/**/*", "src/**/*.vue"], + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], "exclude": ["src/**/__tests__/**"] } diff --git a/playground/spa-with-tests/package.json b/playground/jsx-router-vuex-with-tests/package.json similarity index 95% rename from playground/spa-with-tests/package.json rename to playground/jsx-router-vuex-with-tests/package.json index 49c07602..3400d2a6 100644 --- a/playground/spa-with-tests/package.json +++ b/playground/jsx-router-vuex-with-tests/package.json @@ -1,5 +1,5 @@ { - "name": "spa-with-tests", + "name": "jsx-router-vuex-with-tests", "version": "0.0.0", "scripts": { "dev": "vite", @@ -18,9 +18,9 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^1.2.5", - "@vitejs/plugin-vue-jsx": "^1.1.6", "@vue/compiler-sfc": "^3.1.5", "vite": "^2.4.3", + "@vitejs/plugin-vue-jsx": "^1.1.6", "@cypress/vite-dev-server": "^2.0.2", "@cypress/vue": "^3.0.1", "cypress": "^8.0.0", diff --git a/playground/default-ts-with-tests/public/favicon.ico b/playground/jsx-router-vuex-with-tests/public/favicon.ico similarity index 100% rename from playground/default-ts-with-tests/public/favicon.ico rename to playground/jsx-router-vuex-with-tests/public/favicon.ico diff --git a/playground/spa-ts-with-tests/src/App.vue b/playground/jsx-router-vuex-with-tests/src/App.vue similarity index 100% rename from playground/spa-ts-with-tests/src/App.vue rename to playground/jsx-router-vuex-with-tests/src/App.vue diff --git a/playground/default-ts-with-tests/src/assets/logo.png b/playground/jsx-router-vuex-with-tests/src/assets/logo.png similarity index 100% rename from playground/default-ts-with-tests/src/assets/logo.png rename to playground/jsx-router-vuex-with-tests/src/assets/logo.png diff --git a/playground/spa-with-tests/src/components/HelloWorld.vue b/playground/jsx-router-vuex-with-tests/src/components/HelloWorld.vue similarity index 100% rename from playground/spa-with-tests/src/components/HelloWorld.vue rename to playground/jsx-router-vuex-with-tests/src/components/HelloWorld.vue diff --git a/playground/default-with-tests/src/components/__tests__/HelloWorld.spec.js b/playground/jsx-router-vuex-with-tests/src/components/__tests__/HelloWorld.spec.js similarity index 100% rename from playground/default-with-tests/src/components/__tests__/HelloWorld.spec.js rename to playground/jsx-router-vuex-with-tests/src/components/__tests__/HelloWorld.spec.js diff --git a/playground/spa-with-tests/src/main.js b/playground/jsx-router-vuex-with-tests/src/main.js similarity index 100% rename from playground/spa-with-tests/src/main.js rename to playground/jsx-router-vuex-with-tests/src/main.js diff --git a/playground/spa-with-tests/src/router/index.js b/playground/jsx-router-vuex-with-tests/src/router/index.js similarity index 100% rename from playground/spa-with-tests/src/router/index.js rename to playground/jsx-router-vuex-with-tests/src/router/index.js diff --git a/playground/spa-with-tests/src/store/index.js b/playground/jsx-router-vuex-with-tests/src/store/index.js similarity index 100% rename from playground/spa-with-tests/src/store/index.js rename to playground/jsx-router-vuex-with-tests/src/store/index.js diff --git a/playground/spa-ts-with-tests/src/views/About.vue b/playground/jsx-router-vuex-with-tests/src/views/About.vue similarity index 100% rename from playground/spa-ts-with-tests/src/views/About.vue rename to playground/jsx-router-vuex-with-tests/src/views/About.vue diff --git a/playground/spa-with-tests/src/views/Home.vue b/playground/jsx-router-vuex-with-tests/src/views/Home.vue similarity index 100% rename from playground/spa-with-tests/src/views/Home.vue rename to playground/jsx-router-vuex-with-tests/src/views/Home.vue diff --git a/playground/default/src/shims-vue.d.ts b/playground/jsx-router-vuex-with-tests/vite-env.d.ts similarity index 81% rename from playground/default/src/shims-vue.d.ts rename to playground/jsx-router-vuex-with-tests/vite-env.d.ts index ec4f1b2e..636d9c3f 100644 --- a/playground/default/src/shims-vue.d.ts +++ b/playground/jsx-router-vuex-with-tests/vite-env.d.ts @@ -1,3 +1,5 @@ +/// + declare module '*.vue' { import { DefineComponent } from 'vue' // eslint-disable-next-line diff --git a/playground/default-with-tests/vite.config.js b/playground/jsx-router-vuex-with-tests/vite.config.js similarity index 100% rename from playground/default-with-tests/vite.config.js rename to playground/jsx-router-vuex-with-tests/vite.config.js diff --git a/playground/default-ts/.gitignore b/playground/jsx-router-vuex/.gitignore similarity index 100% rename from playground/default-ts/.gitignore rename to playground/jsx-router-vuex/.gitignore diff --git a/playground/jsx-router-vuex/README.md b/playground/jsx-router-vuex/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/jsx-router-vuex/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/default-ts/index.html b/playground/jsx-router-vuex/index.html similarity index 100% rename from playground/default-ts/index.html rename to playground/jsx-router-vuex/index.html diff --git a/playground/spa/jsconfig.json b/playground/jsx-router-vuex/jsconfig.json similarity index 85% rename from playground/spa/jsconfig.json rename to playground/jsx-router-vuex/jsconfig.json index 9c2cfe6b..6f98acfa 100644 --- a/playground/spa/jsconfig.json +++ b/playground/jsx-router-vuex/jsconfig.json @@ -16,6 +16,6 @@ "lib": ["esnext", "dom", "dom.iterable", "scripthost"], "skipLibCheck": true }, - "include": ["vite.config.*", "src/**/*", "src/**/*.vue"], + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], "exclude": ["src/**/__tests__/**"] } diff --git a/playground/jsx-router-vuex/package.json b/playground/jsx-router-vuex/package.json new file mode 100644 index 00000000..3466fc62 --- /dev/null +++ b/playground/jsx-router-vuex/package.json @@ -0,0 +1,21 @@ +{ + "name": "jsx-router-vuex", + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preserve": "vite build", + "serve": "vite preview --port 5050" + }, + "dependencies": { + "vue": "^3.1.5", + "vue-router": "^4.0.10", + "vuex": "^4.0.2" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^1.2.5", + "@vue/compiler-sfc": "^3.1.5", + "vite": "^2.4.3", + "@vitejs/plugin-vue-jsx": "^1.1.6" + } +} diff --git a/playground/default-ts/public/favicon.ico b/playground/jsx-router-vuex/public/favicon.ico similarity index 100% rename from playground/default-ts/public/favicon.ico rename to playground/jsx-router-vuex/public/favicon.ico diff --git a/playground/spa-ts/src/App.vue b/playground/jsx-router-vuex/src/App.vue similarity index 100% rename from playground/spa-ts/src/App.vue rename to playground/jsx-router-vuex/src/App.vue diff --git a/playground/default-ts/src/assets/logo.png b/playground/jsx-router-vuex/src/assets/logo.png similarity index 100% rename from playground/default-ts/src/assets/logo.png rename to playground/jsx-router-vuex/src/assets/logo.png diff --git a/playground/spa/src/components/HelloWorld.vue b/playground/jsx-router-vuex/src/components/HelloWorld.vue similarity index 100% rename from playground/spa/src/components/HelloWorld.vue rename to playground/jsx-router-vuex/src/components/HelloWorld.vue diff --git a/playground/spa/src/main.js b/playground/jsx-router-vuex/src/main.js similarity index 100% rename from playground/spa/src/main.js rename to playground/jsx-router-vuex/src/main.js diff --git a/playground/spa/src/router/index.js b/playground/jsx-router-vuex/src/router/index.js similarity index 100% rename from playground/spa/src/router/index.js rename to playground/jsx-router-vuex/src/router/index.js diff --git a/playground/spa/src/store/index.js b/playground/jsx-router-vuex/src/store/index.js similarity index 100% rename from playground/spa/src/store/index.js rename to playground/jsx-router-vuex/src/store/index.js diff --git a/playground/spa-ts/src/views/About.vue b/playground/jsx-router-vuex/src/views/About.vue similarity index 100% rename from playground/spa-ts/src/views/About.vue rename to playground/jsx-router-vuex/src/views/About.vue diff --git a/playground/spa/src/views/Home.vue b/playground/jsx-router-vuex/src/views/Home.vue similarity index 100% rename from playground/spa/src/views/Home.vue rename to playground/jsx-router-vuex/src/views/Home.vue diff --git a/playground/default-ts/src/shims-vue.d.ts b/playground/jsx-router-vuex/vite-env.d.ts similarity index 81% rename from playground/default-ts/src/shims-vue.d.ts rename to playground/jsx-router-vuex/vite-env.d.ts index ec4f1b2e..636d9c3f 100644 --- a/playground/default-ts/src/shims-vue.d.ts +++ b/playground/jsx-router-vuex/vite-env.d.ts @@ -1,3 +1,5 @@ +/// + declare module '*.vue' { import { DefineComponent } from 'vue' // eslint-disable-next-line diff --git a/playground/spa-with-tests/vite.config.js b/playground/jsx-router-vuex/vite.config.js similarity index 100% rename from playground/spa-with-tests/vite.config.js rename to playground/jsx-router-vuex/vite.config.js diff --git a/playground/default-with-tests/.gitignore b/playground/jsx-router/.gitignore similarity index 100% rename from playground/default-with-tests/.gitignore rename to playground/jsx-router/.gitignore diff --git a/playground/jsx-router/README.md b/playground/jsx-router/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/jsx-router/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/default-with-tests/index.html b/playground/jsx-router/index.html similarity index 100% rename from playground/default-with-tests/index.html rename to playground/jsx-router/index.html diff --git a/playground/default-with-tests/jsconfig.json b/playground/jsx-router/jsconfig.json similarity index 85% rename from playground/default-with-tests/jsconfig.json rename to playground/jsx-router/jsconfig.json index 9c2cfe6b..6f98acfa 100644 --- a/playground/default-with-tests/jsconfig.json +++ b/playground/jsx-router/jsconfig.json @@ -16,6 +16,6 @@ "lib": ["esnext", "dom", "dom.iterable", "scripthost"], "skipLibCheck": true }, - "include": ["vite.config.*", "src/**/*", "src/**/*.vue"], + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], "exclude": ["src/**/__tests__/**"] } diff --git a/playground/jsx-router/package.json b/playground/jsx-router/package.json new file mode 100644 index 00000000..143545f1 --- /dev/null +++ b/playground/jsx-router/package.json @@ -0,0 +1,20 @@ +{ + "name": "jsx-router", + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preserve": "vite build", + "serve": "vite preview --port 5050" + }, + "dependencies": { + "vue": "^3.1.5", + "vue-router": "^4.0.10" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^1.2.5", + "@vue/compiler-sfc": "^3.1.5", + "vite": "^2.4.3", + "@vitejs/plugin-vue-jsx": "^1.1.6" + } +} diff --git a/playground/default-with-tests/public/favicon.ico b/playground/jsx-router/public/favicon.ico similarity index 100% rename from playground/default-with-tests/public/favicon.ico rename to playground/jsx-router/public/favicon.ico diff --git a/playground/spa-with-tests/src/App.vue b/playground/jsx-router/src/App.vue similarity index 100% rename from playground/spa-with-tests/src/App.vue rename to playground/jsx-router/src/App.vue diff --git a/playground/default-with-tests/src/assets/logo.png b/playground/jsx-router/src/assets/logo.png similarity index 100% rename from playground/default-with-tests/src/assets/logo.png rename to playground/jsx-router/src/assets/logo.png diff --git a/playground/jsx-router/src/components/HelloWorld.vue b/playground/jsx-router/src/components/HelloWorld.vue new file mode 100644 index 00000000..51f81a8f --- /dev/null +++ b/playground/jsx-router/src/components/HelloWorld.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/playground/jsx-router/src/main.js b/playground/jsx-router/src/main.js new file mode 100644 index 00000000..c8e37b03 --- /dev/null +++ b/playground/jsx-router/src/main.js @@ -0,0 +1,9 @@ +import { createApp } from 'vue' +import App from './App.vue' +import router from './router' + +const app = createApp(App) + +app.use(router) + +app.mount('#app') diff --git a/playground/jsx-router/src/router/index.js b/playground/jsx-router/src/router/index.js new file mode 100644 index 00000000..26bf8e7e --- /dev/null +++ b/playground/jsx-router/src/router/index.js @@ -0,0 +1,25 @@ +import { createRouter, createWebHistory } from 'vue-router' +import Home from '../views/Home.vue' + +const routes = [ + { + path: '/', + name: 'Home', + component: Home + }, + { + path: '/about', + name: 'About', + // route level code-splitting + // this generates a separate chunk (About.[hash].js) for this route + // which is lazy-loaded when the route is visited. + component: () => import('../views/About.vue') + } +] + +const router = createRouter({ + history: createWebHistory(import.meta.env.BASE_URL), + routes +}) + +export default router diff --git a/playground/spa-with-tests/src/views/About.vue b/playground/jsx-router/src/views/About.vue similarity index 100% rename from playground/spa-with-tests/src/views/About.vue rename to playground/jsx-router/src/views/About.vue diff --git a/playground/jsx-router/src/views/Home.vue b/playground/jsx-router/src/views/Home.vue new file mode 100644 index 00000000..d74dda2c --- /dev/null +++ b/playground/jsx-router/src/views/Home.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/playground/default-ts-with-tests/src/shims-vue.d.ts b/playground/jsx-router/vite-env.d.ts similarity index 81% rename from playground/default-ts-with-tests/src/shims-vue.d.ts rename to playground/jsx-router/vite-env.d.ts index ec4f1b2e..636d9c3f 100644 --- a/playground/default-ts-with-tests/src/shims-vue.d.ts +++ b/playground/jsx-router/vite-env.d.ts @@ -1,3 +1,5 @@ +/// + declare module '*.vue' { import { DefineComponent } from 'vue' // eslint-disable-next-line diff --git a/playground/spa/vite.config.js b/playground/jsx-router/vite.config.js similarity index 100% rename from playground/spa/vite.config.js rename to playground/jsx-router/vite.config.js diff --git a/playground/spa-ts-with-tests/.gitignore b/playground/jsx/.gitignore similarity index 100% rename from playground/spa-ts-with-tests/.gitignore rename to playground/jsx/.gitignore diff --git a/playground/jsx/README.md b/playground/jsx/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/jsx/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/spa-ts-with-tests/index.html b/playground/jsx/index.html similarity index 100% rename from playground/spa-ts-with-tests/index.html rename to playground/jsx/index.html diff --git a/playground/jsx/jsconfig.json b/playground/jsx/jsconfig.json new file mode 100644 index 00000000..6f98acfa --- /dev/null +++ b/playground/jsx/jsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "target": "esnext", + "useDefineForClassFields": true, + "module": "esnext", + "moduleResolution": "node", + "strict": true, + "jsx": "preserve", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "paths": { + "@/*": ["src/*"] + }, + "lib": ["esnext", "dom", "dom.iterable", "scripthost"], + "skipLibCheck": true + }, + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/**"] +} diff --git a/playground/jsx/package.json b/playground/jsx/package.json new file mode 100644 index 00000000..8e823726 --- /dev/null +++ b/playground/jsx/package.json @@ -0,0 +1,19 @@ +{ + "name": "jsx", + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preserve": "vite build", + "serve": "vite preview --port 5050" + }, + "dependencies": { + "vue": "^3.1.5" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^1.2.5", + "@vue/compiler-sfc": "^3.1.5", + "vite": "^2.4.3", + "@vitejs/plugin-vue-jsx": "^1.1.6" + } +} diff --git a/playground/spa-ts-with-tests/public/favicon.ico b/playground/jsx/public/favicon.ico similarity index 100% rename from playground/spa-ts-with-tests/public/favicon.ico rename to playground/jsx/public/favicon.ico diff --git a/playground/default-with-tests/src/App.vue b/playground/jsx/src/App.vue similarity index 100% rename from playground/default-with-tests/src/App.vue rename to playground/jsx/src/App.vue diff --git a/playground/spa-ts-with-tests/src/assets/logo.png b/playground/jsx/src/assets/logo.png similarity index 100% rename from playground/spa-ts-with-tests/src/assets/logo.png rename to playground/jsx/src/assets/logo.png diff --git a/playground/default-with-tests/src/components/HelloWorld.vue b/playground/jsx/src/components/HelloWorld.vue similarity index 100% rename from playground/default-with-tests/src/components/HelloWorld.vue rename to playground/jsx/src/components/HelloWorld.vue diff --git a/playground/default-with-tests/src/main.js b/playground/jsx/src/main.js similarity index 100% rename from playground/default-with-tests/src/main.js rename to playground/jsx/src/main.js diff --git a/playground/jsx/vite-env.d.ts b/playground/jsx/vite-env.d.ts new file mode 100644 index 00000000..636d9c3f --- /dev/null +++ b/playground/jsx/vite-env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import { DefineComponent } from 'vue' + // eslint-disable-next-line + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/playground/default-ts-with-tests/vite.config.ts b/playground/jsx/vite.config.js similarity index 100% rename from playground/default-ts-with-tests/vite.config.ts rename to playground/jsx/vite.config.js diff --git a/playground/spa-ts/.gitignore b/playground/router-vuex-with-tests/.gitignore similarity index 100% rename from playground/spa-ts/.gitignore rename to playground/router-vuex-with-tests/.gitignore diff --git a/playground/router-vuex-with-tests/README.md b/playground/router-vuex-with-tests/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/router-vuex-with-tests/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/default-with-tests/cypress.json b/playground/router-vuex-with-tests/cypress.json similarity index 100% rename from playground/default-with-tests/cypress.json rename to playground/router-vuex-with-tests/cypress.json diff --git a/playground/default-with-tests/cypress/fixtures/example.json b/playground/router-vuex-with-tests/cypress/fixtures/example.json similarity index 100% rename from playground/default-with-tests/cypress/fixtures/example.json rename to playground/router-vuex-with-tests/cypress/fixtures/example.json diff --git a/playground/router-vuex-with-tests/cypress/integration/example.spec.js b/playground/router-vuex-with-tests/cypress/integration/example.spec.js new file mode 100644 index 00000000..ec952ec4 --- /dev/null +++ b/playground/router-vuex-with-tests/cypress/integration/example.spec.js @@ -0,0 +1,13 @@ +// https://docs.cypress.io/api/introduction/api.html + +describe('My First Test', () => { + it('visits the app root url', () => { + cy.visit('/') + cy.contains('h1', 'Hello Vue 3 + Vite') + }) + + it('navigates to the about page', () => { + cy.visit('/about') + cy.contains('h1', 'This is an about page') + }) +}) diff --git a/playground/spa-with-tests/cypress/jsconfig.json b/playground/router-vuex-with-tests/cypress/jsconfig.json similarity index 100% rename from playground/spa-with-tests/cypress/jsconfig.json rename to playground/router-vuex-with-tests/cypress/jsconfig.json diff --git a/playground/spa-with-tests/cypress/plugins/index.js b/playground/router-vuex-with-tests/cypress/plugins/index.js similarity index 100% rename from playground/spa-with-tests/cypress/plugins/index.js rename to playground/router-vuex-with-tests/cypress/plugins/index.js diff --git a/playground/spa-with-tests/cypress/support/commands.js b/playground/router-vuex-with-tests/cypress/support/commands.js similarity index 100% rename from playground/spa-with-tests/cypress/support/commands.js rename to playground/router-vuex-with-tests/cypress/support/commands.js diff --git a/playground/spa-with-tests/cypress/support/index.js b/playground/router-vuex-with-tests/cypress/support/index.js similarity index 100% rename from playground/spa-with-tests/cypress/support/index.js rename to playground/router-vuex-with-tests/cypress/support/index.js diff --git a/playground/spa-ts/index.html b/playground/router-vuex-with-tests/index.html similarity index 100% rename from playground/spa-ts/index.html rename to playground/router-vuex-with-tests/index.html diff --git a/playground/router-vuex-with-tests/jsconfig.json b/playground/router-vuex-with-tests/jsconfig.json new file mode 100644 index 00000000..6f98acfa --- /dev/null +++ b/playground/router-vuex-with-tests/jsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "target": "esnext", + "useDefineForClassFields": true, + "module": "esnext", + "moduleResolution": "node", + "strict": true, + "jsx": "preserve", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "paths": { + "@/*": ["src/*"] + }, + "lib": ["esnext", "dom", "dom.iterable", "scripthost"], + "skipLibCheck": true + }, + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/**"] +} diff --git a/playground/default-ts-with-tests/package.json b/playground/router-vuex-with-tests/package.json similarity index 68% rename from playground/default-ts-with-tests/package.json rename to playground/router-vuex-with-tests/package.json index fee85fe2..65d87f51 100644 --- a/playground/default-ts-with-tests/package.json +++ b/playground/router-vuex-with-tests/package.json @@ -1,30 +1,28 @@ { - "name": "default-ts-with-tests", + "name": "router-vuex-with-tests", "version": "0.0.0", "scripts": { "dev": "vite", - "build": "vue-tsc --noEmit && vite build", + "build": "vite build", "preserve": "vite build", "serve": "vite preview --port 5050", "test:unit": "cypress open-ct", "test:unit:ci": "cypress run-ct --quiet --reporter spec", "test:e2e": "start-server-and-test serve 5050 'cypress open'", - "test:e2e:ci": "start-server-and-test serve 5050 'cypress run'", - "typecheck": "vue-tsc --noEmit" + "test:e2e:ci": "start-server-and-test serve 5050 'cypress run'" }, "dependencies": { - "vue": "^3.1.5" + "vue": "^3.1.5", + "vue-router": "^4.0.10", + "vuex": "^4.0.2" }, "devDependencies": { "@vitejs/plugin-vue": "^1.2.5", - "@vitejs/plugin-vue-jsx": "^1.1.6", "@vue/compiler-sfc": "^3.1.5", "vite": "^2.4.3", "@cypress/vite-dev-server": "^2.0.2", "@cypress/vue": "^3.0.1", "cypress": "^8.0.0", - "start-server-and-test": "^1.12.6", - "typescript": "~4.3.5", - "vue-tsc": "^0.2.2" + "start-server-and-test": "^1.12.6" } } diff --git a/playground/spa-ts/public/favicon.ico b/playground/router-vuex-with-tests/public/favicon.ico similarity index 100% rename from playground/spa-ts/public/favicon.ico rename to playground/router-vuex-with-tests/public/favicon.ico diff --git a/playground/spa/src/App.vue b/playground/router-vuex-with-tests/src/App.vue similarity index 100% rename from playground/spa/src/App.vue rename to playground/router-vuex-with-tests/src/App.vue diff --git a/playground/spa-ts/src/assets/logo.png b/playground/router-vuex-with-tests/src/assets/logo.png similarity index 100% rename from playground/spa-ts/src/assets/logo.png rename to playground/router-vuex-with-tests/src/assets/logo.png diff --git a/playground/router-vuex-with-tests/src/components/HelloWorld.vue b/playground/router-vuex-with-tests/src/components/HelloWorld.vue new file mode 100644 index 00000000..51f81a8f --- /dev/null +++ b/playground/router-vuex-with-tests/src/components/HelloWorld.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/playground/spa-with-tests/src/components/__tests__/HelloWorld.spec.js b/playground/router-vuex-with-tests/src/components/__tests__/HelloWorld.spec.js similarity index 100% rename from playground/spa-with-tests/src/components/__tests__/HelloWorld.spec.js rename to playground/router-vuex-with-tests/src/components/__tests__/HelloWorld.spec.js diff --git a/playground/spa-ts-with-tests/src/main.ts b/playground/router-vuex-with-tests/src/main.js similarity index 100% rename from playground/spa-ts-with-tests/src/main.ts rename to playground/router-vuex-with-tests/src/main.js diff --git a/playground/router-vuex-with-tests/src/router/index.js b/playground/router-vuex-with-tests/src/router/index.js new file mode 100644 index 00000000..26bf8e7e --- /dev/null +++ b/playground/router-vuex-with-tests/src/router/index.js @@ -0,0 +1,25 @@ +import { createRouter, createWebHistory } from 'vue-router' +import Home from '../views/Home.vue' + +const routes = [ + { + path: '/', + name: 'Home', + component: Home + }, + { + path: '/about', + name: 'About', + // route level code-splitting + // this generates a separate chunk (About.[hash].js) for this route + // which is lazy-loaded when the route is visited. + component: () => import('../views/About.vue') + } +] + +const router = createRouter({ + history: createWebHistory(import.meta.env.BASE_URL), + routes +}) + +export default router diff --git a/playground/spa-ts-with-tests/src/store/index.ts b/playground/router-vuex-with-tests/src/store/index.js similarity index 100% rename from playground/spa-ts-with-tests/src/store/index.ts rename to playground/router-vuex-with-tests/src/store/index.js diff --git a/playground/spa/src/views/About.vue b/playground/router-vuex-with-tests/src/views/About.vue similarity index 100% rename from playground/spa/src/views/About.vue rename to playground/router-vuex-with-tests/src/views/About.vue diff --git a/playground/router-vuex-with-tests/src/views/Home.vue b/playground/router-vuex-with-tests/src/views/Home.vue new file mode 100644 index 00000000..d74dda2c --- /dev/null +++ b/playground/router-vuex-with-tests/src/views/Home.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/playground/router-vuex-with-tests/vite-env.d.ts b/playground/router-vuex-with-tests/vite-env.d.ts new file mode 100644 index 00000000..636d9c3f --- /dev/null +++ b/playground/router-vuex-with-tests/vite-env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import { DefineComponent } from 'vue' + // eslint-disable-next-line + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/playground/router-vuex-with-tests/vite.config.js b/playground/router-vuex-with-tests/vite.config.js new file mode 100644 index 00000000..24c2e504 --- /dev/null +++ b/playground/router-vuex-with-tests/vite.config.js @@ -0,0 +1,12 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue()], + resolve: { + alias: { + '@/': new URL('./src/', import.meta.url).pathname + } + } +}) diff --git a/playground/spa-with-tests/.gitignore b/playground/router-vuex/.gitignore similarity index 100% rename from playground/spa-with-tests/.gitignore rename to playground/router-vuex/.gitignore diff --git a/playground/router-vuex/README.md b/playground/router-vuex/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/router-vuex/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/spa-with-tests/index.html b/playground/router-vuex/index.html similarity index 100% rename from playground/spa-with-tests/index.html rename to playground/router-vuex/index.html diff --git a/playground/router-vuex/jsconfig.json b/playground/router-vuex/jsconfig.json new file mode 100644 index 00000000..6f98acfa --- /dev/null +++ b/playground/router-vuex/jsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "target": "esnext", + "useDefineForClassFields": true, + "module": "esnext", + "moduleResolution": "node", + "strict": true, + "jsx": "preserve", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "paths": { + "@/*": ["src/*"] + }, + "lib": ["esnext", "dom", "dom.iterable", "scripthost"], + "skipLibCheck": true + }, + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/**"] +} diff --git a/playground/spa/package.json b/playground/router-vuex/package.json similarity index 86% rename from playground/spa/package.json rename to playground/router-vuex/package.json index bc2cd488..ae370045 100644 --- a/playground/spa/package.json +++ b/playground/router-vuex/package.json @@ -1,5 +1,5 @@ { - "name": "spa", + "name": "router-vuex", "version": "0.0.0", "scripts": { "dev": "vite", @@ -14,7 +14,6 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^1.2.5", - "@vitejs/plugin-vue-jsx": "^1.1.6", "@vue/compiler-sfc": "^3.1.5", "vite": "^2.4.3" } diff --git a/playground/spa-with-tests/public/favicon.ico b/playground/router-vuex/public/favicon.ico similarity index 100% rename from playground/spa-with-tests/public/favicon.ico rename to playground/router-vuex/public/favicon.ico diff --git a/playground/router-vuex/src/App.vue b/playground/router-vuex/src/App.vue new file mode 100644 index 00000000..6a65bcc1 --- /dev/null +++ b/playground/router-vuex/src/App.vue @@ -0,0 +1,30 @@ + + + diff --git a/playground/spa-with-tests/src/assets/logo.png b/playground/router-vuex/src/assets/logo.png similarity index 100% rename from playground/spa-with-tests/src/assets/logo.png rename to playground/router-vuex/src/assets/logo.png diff --git a/playground/router-vuex/src/components/HelloWorld.vue b/playground/router-vuex/src/components/HelloWorld.vue new file mode 100644 index 00000000..51f81a8f --- /dev/null +++ b/playground/router-vuex/src/components/HelloWorld.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/playground/spa-ts/src/main.ts b/playground/router-vuex/src/main.js similarity index 100% rename from playground/spa-ts/src/main.ts rename to playground/router-vuex/src/main.js diff --git a/playground/router-vuex/src/router/index.js b/playground/router-vuex/src/router/index.js new file mode 100644 index 00000000..26bf8e7e --- /dev/null +++ b/playground/router-vuex/src/router/index.js @@ -0,0 +1,25 @@ +import { createRouter, createWebHistory } from 'vue-router' +import Home from '../views/Home.vue' + +const routes = [ + { + path: '/', + name: 'Home', + component: Home + }, + { + path: '/about', + name: 'About', + // route level code-splitting + // this generates a separate chunk (About.[hash].js) for this route + // which is lazy-loaded when the route is visited. + component: () => import('../views/About.vue') + } +] + +const router = createRouter({ + history: createWebHistory(import.meta.env.BASE_URL), + routes +}) + +export default router diff --git a/playground/spa-ts/src/store/index.ts b/playground/router-vuex/src/store/index.js similarity index 100% rename from playground/spa-ts/src/store/index.ts rename to playground/router-vuex/src/store/index.js diff --git a/playground/router-vuex/src/views/About.vue b/playground/router-vuex/src/views/About.vue new file mode 100644 index 00000000..3fa28070 --- /dev/null +++ b/playground/router-vuex/src/views/About.vue @@ -0,0 +1,5 @@ + diff --git a/playground/router-vuex/src/views/Home.vue b/playground/router-vuex/src/views/Home.vue new file mode 100644 index 00000000..d74dda2c --- /dev/null +++ b/playground/router-vuex/src/views/Home.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/playground/router-vuex/vite-env.d.ts b/playground/router-vuex/vite-env.d.ts new file mode 100644 index 00000000..636d9c3f --- /dev/null +++ b/playground/router-vuex/vite-env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import { DefineComponent } from 'vue' + // eslint-disable-next-line + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/playground/router-vuex/vite.config.js b/playground/router-vuex/vite.config.js new file mode 100644 index 00000000..24c2e504 --- /dev/null +++ b/playground/router-vuex/vite.config.js @@ -0,0 +1,12 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue()], + resolve: { + alias: { + '@/': new URL('./src/', import.meta.url).pathname + } + } +}) diff --git a/playground/spa/.gitignore b/playground/router/.gitignore similarity index 100% rename from playground/spa/.gitignore rename to playground/router/.gitignore diff --git a/playground/router/README.md b/playground/router/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/router/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/spa/index.html b/playground/router/index.html similarity index 100% rename from playground/spa/index.html rename to playground/router/index.html diff --git a/playground/router/jsconfig.json b/playground/router/jsconfig.json new file mode 100644 index 00000000..6f98acfa --- /dev/null +++ b/playground/router/jsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "target": "esnext", + "useDefineForClassFields": true, + "module": "esnext", + "moduleResolution": "node", + "strict": true, + "jsx": "preserve", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "paths": { + "@/*": ["src/*"] + }, + "lib": ["esnext", "dom", "dom.iterable", "scripthost"], + "skipLibCheck": true + }, + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/**"] +} diff --git a/playground/router/package.json b/playground/router/package.json new file mode 100644 index 00000000..2c75ccc9 --- /dev/null +++ b/playground/router/package.json @@ -0,0 +1,19 @@ +{ + "name": "router", + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preserve": "vite build", + "serve": "vite preview --port 5050" + }, + "dependencies": { + "vue": "^3.1.5", + "vue-router": "^4.0.10" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^1.2.5", + "@vue/compiler-sfc": "^3.1.5", + "vite": "^2.4.3" + } +} diff --git a/playground/spa/public/favicon.ico b/playground/router/public/favicon.ico similarity index 100% rename from playground/spa/public/favicon.ico rename to playground/router/public/favicon.ico diff --git a/playground/router/src/App.vue b/playground/router/src/App.vue new file mode 100644 index 00000000..6a65bcc1 --- /dev/null +++ b/playground/router/src/App.vue @@ -0,0 +1,30 @@ + + + diff --git a/playground/spa/src/assets/logo.png b/playground/router/src/assets/logo.png similarity index 100% rename from playground/spa/src/assets/logo.png rename to playground/router/src/assets/logo.png diff --git a/playground/router/src/components/HelloWorld.vue b/playground/router/src/components/HelloWorld.vue new file mode 100644 index 00000000..51f81a8f --- /dev/null +++ b/playground/router/src/components/HelloWorld.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/playground/router/src/main.js b/playground/router/src/main.js new file mode 100644 index 00000000..c8e37b03 --- /dev/null +++ b/playground/router/src/main.js @@ -0,0 +1,9 @@ +import { createApp } from 'vue' +import App from './App.vue' +import router from './router' + +const app = createApp(App) + +app.use(router) + +app.mount('#app') diff --git a/playground/router/src/router/index.js b/playground/router/src/router/index.js new file mode 100644 index 00000000..26bf8e7e --- /dev/null +++ b/playground/router/src/router/index.js @@ -0,0 +1,25 @@ +import { createRouter, createWebHistory } from 'vue-router' +import Home from '../views/Home.vue' + +const routes = [ + { + path: '/', + name: 'Home', + component: Home + }, + { + path: '/about', + name: 'About', + // route level code-splitting + // this generates a separate chunk (About.[hash].js) for this route + // which is lazy-loaded when the route is visited. + component: () => import('../views/About.vue') + } +] + +const router = createRouter({ + history: createWebHistory(import.meta.env.BASE_URL), + routes +}) + +export default router diff --git a/playground/router/src/views/About.vue b/playground/router/src/views/About.vue new file mode 100644 index 00000000..3fa28070 --- /dev/null +++ b/playground/router/src/views/About.vue @@ -0,0 +1,5 @@ + diff --git a/playground/router/src/views/Home.vue b/playground/router/src/views/Home.vue new file mode 100644 index 00000000..d74dda2c --- /dev/null +++ b/playground/router/src/views/Home.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/playground/router/vite-env.d.ts b/playground/router/vite-env.d.ts new file mode 100644 index 00000000..636d9c3f --- /dev/null +++ b/playground/router/vite-env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import { DefineComponent } from 'vue' + // eslint-disable-next-line + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/playground/router/vite.config.js b/playground/router/vite.config.js new file mode 100644 index 00000000..24c2e504 --- /dev/null +++ b/playground/router/vite.config.js @@ -0,0 +1,12 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue()], + resolve: { + alias: { + '@/': new URL('./src/', import.meta.url).pathname + } + } +}) diff --git a/playground/spa-ts-with-tests/README.md b/playground/spa-ts-with-tests/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/playground/spa-ts-with-tests/src/shims-vue.d.ts b/playground/spa-ts-with-tests/src/shims-vue.d.ts deleted file mode 100644 index ec4f1b2e..00000000 --- a/playground/spa-ts-with-tests/src/shims-vue.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module '*.vue' { - import { DefineComponent } from 'vue' - // eslint-disable-next-line - const component: DefineComponent<{}, {}, any> - export default component -} diff --git a/playground/spa-ts-with-tests/src/vite-env.d.ts b/playground/spa-ts-with-tests/src/vite-env.d.ts deleted file mode 100644 index 11f02fe2..00000000 --- a/playground/spa-ts-with-tests/src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/playground/spa-ts/README.md b/playground/spa-ts/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/playground/spa-ts/src/shims-vue.d.ts b/playground/spa-ts/src/shims-vue.d.ts deleted file mode 100644 index ec4f1b2e..00000000 --- a/playground/spa-ts/src/shims-vue.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module '*.vue' { - import { DefineComponent } from 'vue' - // eslint-disable-next-line - const component: DefineComponent<{}, {}, any> - export default component -} diff --git a/playground/spa-ts/src/vite-env.d.ts b/playground/spa-ts/src/vite-env.d.ts deleted file mode 100644 index 11f02fe2..00000000 --- a/playground/spa-ts/src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/playground/spa-with-tests/README.md b/playground/spa-with-tests/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/playground/spa-with-tests/src/shims-vue.d.ts b/playground/spa-with-tests/src/shims-vue.d.ts deleted file mode 100644 index ec4f1b2e..00000000 --- a/playground/spa-with-tests/src/shims-vue.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module '*.vue' { - import { DefineComponent } from 'vue' - // eslint-disable-next-line - const component: DefineComponent<{}, {}, any> - export default component -} diff --git a/playground/spa-with-tests/src/vite-env.d.ts b/playground/spa-with-tests/src/vite-env.d.ts deleted file mode 100644 index 11f02fe2..00000000 --- a/playground/spa-with-tests/src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/playground/spa/README.md b/playground/spa/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/playground/spa/src/shims-vue.d.ts b/playground/spa/src/shims-vue.d.ts deleted file mode 100644 index ec4f1b2e..00000000 --- a/playground/spa/src/shims-vue.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module '*.vue' { - import { DefineComponent } from 'vue' - // eslint-disable-next-line - const component: DefineComponent<{}, {}, any> - export default component -} diff --git a/playground/spa/src/vite-env.d.ts b/playground/spa/src/vite-env.d.ts deleted file mode 100644 index 11f02fe2..00000000 --- a/playground/spa/src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/playground/typescript-jsx-router-vuex-with-tests/.gitignore b/playground/typescript-jsx-router-vuex-with-tests/.gitignore new file mode 100644 index 00000000..133da84e --- /dev/null +++ b/playground/typescript-jsx-router-vuex-with-tests/.gitignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/playground/typescript-jsx-router-vuex-with-tests/README.md b/playground/typescript-jsx-router-vuex-with-tests/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/typescript-jsx-router-vuex-with-tests/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/spa-ts-with-tests/cypress.json b/playground/typescript-jsx-router-vuex-with-tests/cypress.json similarity index 100% rename from playground/spa-ts-with-tests/cypress.json rename to playground/typescript-jsx-router-vuex-with-tests/cypress.json diff --git a/playground/spa-ts-with-tests/cypress/fixtures/example.json b/playground/typescript-jsx-router-vuex-with-tests/cypress/fixtures/example.json similarity index 100% rename from playground/spa-ts-with-tests/cypress/fixtures/example.json rename to playground/typescript-jsx-router-vuex-with-tests/cypress/fixtures/example.json diff --git a/playground/spa-ts-with-tests/cypress/integration/example.spec.ts b/playground/typescript-jsx-router-vuex-with-tests/cypress/integration/example.spec.ts similarity index 100% rename from playground/spa-ts-with-tests/cypress/integration/example.spec.ts rename to playground/typescript-jsx-router-vuex-with-tests/cypress/integration/example.spec.ts diff --git a/playground/default-ts-with-tests/cypress/plugins/index.ts b/playground/typescript-jsx-router-vuex-with-tests/cypress/plugins/index.ts similarity index 100% rename from playground/default-ts-with-tests/cypress/plugins/index.ts rename to playground/typescript-jsx-router-vuex-with-tests/cypress/plugins/index.ts diff --git a/playground/default-ts-with-tests/cypress/support/commands.ts b/playground/typescript-jsx-router-vuex-with-tests/cypress/support/commands.ts similarity index 100% rename from playground/default-ts-with-tests/cypress/support/commands.ts rename to playground/typescript-jsx-router-vuex-with-tests/cypress/support/commands.ts diff --git a/playground/default-ts-with-tests/cypress/support/index.ts b/playground/typescript-jsx-router-vuex-with-tests/cypress/support/index.ts similarity index 100% rename from playground/default-ts-with-tests/cypress/support/index.ts rename to playground/typescript-jsx-router-vuex-with-tests/cypress/support/index.ts diff --git a/playground/default-ts-with-tests/cypress/tsconfig.json b/playground/typescript-jsx-router-vuex-with-tests/cypress/tsconfig.json similarity index 100% rename from playground/default-ts-with-tests/cypress/tsconfig.json rename to playground/typescript-jsx-router-vuex-with-tests/cypress/tsconfig.json diff --git a/playground/typescript-jsx-router-vuex-with-tests/index.html b/playground/typescript-jsx-router-vuex-with-tests/index.html new file mode 100644 index 00000000..11603f87 --- /dev/null +++ b/playground/typescript-jsx-router-vuex-with-tests/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/playground/spa-ts-with-tests/package.json b/playground/typescript-jsx-router-vuex-with-tests/package.json similarity index 94% rename from playground/spa-ts-with-tests/package.json rename to playground/typescript-jsx-router-vuex-with-tests/package.json index c55fef80..d74580bd 100644 --- a/playground/spa-ts-with-tests/package.json +++ b/playground/typescript-jsx-router-vuex-with-tests/package.json @@ -1,5 +1,5 @@ { - "name": "spa-ts-with-tests", + "name": "typescript-jsx-router-vuex-with-tests", "version": "0.0.0", "scripts": { "dev": "vite", @@ -19,9 +19,9 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^1.2.5", - "@vitejs/plugin-vue-jsx": "^1.1.6", "@vue/compiler-sfc": "^3.1.5", "vite": "^2.4.3", + "@vitejs/plugin-vue-jsx": "^1.1.6", "@cypress/vite-dev-server": "^2.0.2", "@cypress/vue": "^3.0.1", "cypress": "^8.0.0", diff --git a/playground/typescript-jsx-router-vuex-with-tests/public/favicon.ico b/playground/typescript-jsx-router-vuex-with-tests/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..df36fcfb72584e00488330b560ebcf34a41c64c2 GIT binary patch literal 4286 zc-q~UO-NKx6vyu*Vj+`4)S?!;bXAL*8OO4jfgrOFtOP;wW2`J?iWIaDl9|3-1{t(4 zS0U0O3ZqC{nTsL8l}k73B3CX35*lQf+xfqDUcI^RK2sYf=ncQ&&bjBD|2^m4dGkgH z54|cY1>VK$av}B!A*u*6iLfy3##JubeV8fe8d$HC7-vcgrEjafnfSpp z7pe!Wv!9qDBs0UdLe+kc$lCO?Y}>XT*t8E43pQ4+E$sux?IOl>wcmbTE8EWa3@~=-!5HV* zYV8+@RaHCjHY_`%)v~qDXMizmnl-F)j!pG|{r3{ny4ri69Fwi5d^y18(t~Nvwb|Nx zh>WT|Fcy-Rn*wI-mOhPP!<=Rf8P2t#9R!(}OH)*|iT5OOAW|$B2ye1a;^AJJsDlb^(kr+0->47CAIMSYl0Rmk=YW z&*RS#dFMr~Y(MAMow3o5#=y?#dA|S{!>0Nn7CDehvxX7YZgMJuSC*<)|>2qR-2@}Ny=kqhHQP;qrn{=7X!b} zFUGK84nFo6>?w0HA&@;8$aZ>+b*d+EdxFXhOA>MX{ds~2p>oZ^ohvEHDO z)1gD!|N4Klw61Ji%1p>4U15?clX9`dWU9y{;gJ$yL{^A6$OsVvX(1|7LX?3;AxglM T5Je#2NqB@O!Jnp#S;+nbsq**E literal 0 Hc-jL100001 diff --git a/playground/typescript-jsx-router-vuex-with-tests/src/App.vue b/playground/typescript-jsx-router-vuex-with-tests/src/App.vue new file mode 100644 index 00000000..6a65bcc1 --- /dev/null +++ b/playground/typescript-jsx-router-vuex-with-tests/src/App.vue @@ -0,0 +1,30 @@ + + + diff --git a/playground/typescript-jsx-router-vuex-with-tests/src/assets/logo.png b/playground/typescript-jsx-router-vuex-with-tests/src/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..f3d2503fc2a44b5053b0837ebea6e87a2d339a43 GIT binary patch literal 6849 zc-nn=2Uru`)-Fh-DT-7nLI?zqPLL8LbRr;4np6QH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MZowvHzsi!D65HbAz9aFGLE( z2wDOiR&JXzpn}vM#y4#%oiXrt4D1|eUSYZ9L!#eZLNr)Q1-1_dmm1*e6%?WGpKczh zlK?cN9QB{;z|W4Je@gDPPD6Ln&vY-gftbbk1hF6- g1!6qyAfq4?0x&QzG literal 0 Hc-jL100001 diff --git a/playground/default-ts-with-tests/src/components/HelloWorld.vue b/playground/typescript-jsx-router-vuex-with-tests/src/components/HelloWorld.vue similarity index 100% rename from playground/default-ts-with-tests/src/components/HelloWorld.vue rename to playground/typescript-jsx-router-vuex-with-tests/src/components/HelloWorld.vue diff --git a/playground/default-ts-with-tests/src/components/__tests__/HelloWorld.spec.ts b/playground/typescript-jsx-router-vuex-with-tests/src/components/__tests__/HelloWorld.spec.ts similarity index 100% rename from playground/default-ts-with-tests/src/components/__tests__/HelloWorld.spec.ts rename to playground/typescript-jsx-router-vuex-with-tests/src/components/__tests__/HelloWorld.spec.ts diff --git a/playground/typescript-jsx-router-vuex-with-tests/src/main.ts b/playground/typescript-jsx-router-vuex-with-tests/src/main.ts new file mode 100644 index 00000000..ab55e6d5 --- /dev/null +++ b/playground/typescript-jsx-router-vuex-with-tests/src/main.ts @@ -0,0 +1,12 @@ +import { createApp } from 'vue' +import App from './App.vue' + +import router from './router' +import store from './store' + +const app = createApp(App) + +app.use(router) +app.use(store) + +app.mount('#app') diff --git a/playground/spa-ts-with-tests/src/router/index.ts b/playground/typescript-jsx-router-vuex-with-tests/src/router/index.ts similarity index 100% rename from playground/spa-ts-with-tests/src/router/index.ts rename to playground/typescript-jsx-router-vuex-with-tests/src/router/index.ts diff --git a/playground/typescript-jsx-router-vuex-with-tests/src/store/index.ts b/playground/typescript-jsx-router-vuex-with-tests/src/store/index.ts new file mode 100644 index 00000000..2b9da8fe --- /dev/null +++ b/playground/typescript-jsx-router-vuex-with-tests/src/store/index.ts @@ -0,0 +1,8 @@ +import { createStore } from 'vuex' + +export default createStore({ + state: {}, + mutations: {}, + actions: {}, + modules: {} +}) diff --git a/playground/typescript-jsx-router-vuex-with-tests/src/views/About.vue b/playground/typescript-jsx-router-vuex-with-tests/src/views/About.vue new file mode 100644 index 00000000..3fa28070 --- /dev/null +++ b/playground/typescript-jsx-router-vuex-with-tests/src/views/About.vue @@ -0,0 +1,5 @@ + diff --git a/playground/spa-ts-with-tests/src/views/Home.vue b/playground/typescript-jsx-router-vuex-with-tests/src/views/Home.vue similarity index 100% rename from playground/spa-ts-with-tests/src/views/Home.vue rename to playground/typescript-jsx-router-vuex-with-tests/src/views/Home.vue diff --git a/playground/default-ts-with-tests/tsconfig.json b/playground/typescript-jsx-router-vuex-with-tests/tsconfig.json similarity index 85% rename from playground/default-ts-with-tests/tsconfig.json rename to playground/typescript-jsx-router-vuex-with-tests/tsconfig.json index 9c2cfe6b..6f98acfa 100644 --- a/playground/default-ts-with-tests/tsconfig.json +++ b/playground/typescript-jsx-router-vuex-with-tests/tsconfig.json @@ -16,6 +16,6 @@ "lib": ["esnext", "dom", "dom.iterable", "scripthost"], "skipLibCheck": true }, - "include": ["vite.config.*", "src/**/*", "src/**/*.vue"], + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], "exclude": ["src/**/__tests__/**"] } diff --git a/playground/typescript-jsx-router-vuex-with-tests/vite-env.d.ts b/playground/typescript-jsx-router-vuex-with-tests/vite-env.d.ts new file mode 100644 index 00000000..636d9c3f --- /dev/null +++ b/playground/typescript-jsx-router-vuex-with-tests/vite-env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import { DefineComponent } from 'vue' + // eslint-disable-next-line + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/playground/default-ts/vite.config.ts b/playground/typescript-jsx-router-vuex-with-tests/vite.config.ts similarity index 100% rename from playground/default-ts/vite.config.ts rename to playground/typescript-jsx-router-vuex-with-tests/vite.config.ts diff --git a/playground/typescript-jsx-router-vuex/.gitignore b/playground/typescript-jsx-router-vuex/.gitignore new file mode 100644 index 00000000..133da84e --- /dev/null +++ b/playground/typescript-jsx-router-vuex/.gitignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/playground/typescript-jsx-router-vuex/README.md b/playground/typescript-jsx-router-vuex/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/typescript-jsx-router-vuex/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/typescript-jsx-router-vuex/index.html b/playground/typescript-jsx-router-vuex/index.html new file mode 100644 index 00000000..11603f87 --- /dev/null +++ b/playground/typescript-jsx-router-vuex/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/playground/spa-ts/package.json b/playground/typescript-jsx-router-vuex/package.json similarity index 92% rename from playground/spa-ts/package.json rename to playground/typescript-jsx-router-vuex/package.json index afa896da..ab9944f6 100644 --- a/playground/spa-ts/package.json +++ b/playground/typescript-jsx-router-vuex/package.json @@ -1,5 +1,5 @@ { - "name": "spa-ts", + "name": "typescript-jsx-router-vuex", "version": "0.0.0", "scripts": { "dev": "vite", @@ -15,9 +15,9 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^1.2.5", - "@vitejs/plugin-vue-jsx": "^1.1.6", "@vue/compiler-sfc": "^3.1.5", "vite": "^2.4.3", + "@vitejs/plugin-vue-jsx": "^1.1.6", "typescript": "~4.3.5", "vue-tsc": "^0.2.2" } diff --git a/playground/typescript-jsx-router-vuex/public/favicon.ico b/playground/typescript-jsx-router-vuex/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..df36fcfb72584e00488330b560ebcf34a41c64c2 GIT binary patch literal 4286 zc-q~UO-NKx6vyu*Vj+`4)S?!;bXAL*8OO4jfgrOFtOP;wW2`J?iWIaDl9|3-1{t(4 zS0U0O3ZqC{nTsL8l}k73B3CX35*lQf+xfqDUcI^RK2sYf=ncQ&&bjBD|2^m4dGkgH z54|cY1>VK$av}B!A*u*6iLfy3##JubeV8fe8d$HC7-vcgrEjafnfSpp z7pe!Wv!9qDBs0UdLe+kc$lCO?Y}>XT*t8E43pQ4+E$sux?IOl>wcmbTE8EWa3@~=-!5HV* zYV8+@RaHCjHY_`%)v~qDXMizmnl-F)j!pG|{r3{ny4ri69Fwi5d^y18(t~Nvwb|Nx zh>WT|Fcy-Rn*wI-mOhPP!<=Rf8P2t#9R!(}OH)*|iT5OOAW|$B2ye1a;^AJJsDlb^(kr+0->47CAIMSYl0Rmk=YW z&*RS#dFMr~Y(MAMow3o5#=y?#dA|S{!>0Nn7CDehvxX7YZgMJuSC*<)|>2qR-2@}Ny=kqhHQP;qrn{=7X!b} zFUGK84nFo6>?w0HA&@;8$aZ>+b*d+EdxFXhOA>MX{ds~2p>oZ^ohvEHDO z)1gD!|N4Klw61Ji%1p>4U15?clX9`dWU9y{;gJ$yL{^A6$OsVvX(1|7LX?3;AxglM T5Je#2NqB@O!Jnp#S;+nbsq**E literal 0 Hc-jL100001 diff --git a/playground/typescript-jsx-router-vuex/src/App.vue b/playground/typescript-jsx-router-vuex/src/App.vue new file mode 100644 index 00000000..6a65bcc1 --- /dev/null +++ b/playground/typescript-jsx-router-vuex/src/App.vue @@ -0,0 +1,30 @@ + + + diff --git a/playground/typescript-jsx-router-vuex/src/assets/logo.png b/playground/typescript-jsx-router-vuex/src/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..f3d2503fc2a44b5053b0837ebea6e87a2d339a43 GIT binary patch literal 6849 zc-nn=2Uru`)-Fh-DT-7nLI?zqPLL8LbRr;4np6QHK!gNH=-p7H_aa>oM5IWQ(2Mk< zh#)O=LF7Za1`yCcc)su4|K8`^GtV=bS!>>R?KOL^wfEYSXal`FbhPZWWMpJ?TAJ#H zr0c->Nli)mtu(93CtcV)HOxGX+#Ef9>@Wy26$iJ62%r|q&Iw_NuygS97(^(Lkx}p> zjmh|RPdE289*UC?SQ^0S2R}M7Y6!cSDti#t`-LY|3Exl zV4#0FWu|KYRCB{1fYM?zqV^J!w}7%xF-d6|S*WZC5JHm0CFH~*5~31Nd1)zm2?+4- z14L>K&oWv!eP^h>BL>vMUB_TwyerQiS zUr{uc_a6)D2&_E@>F$YiLj%ucyN7OGo-h#TpI1P+>+1g7FdF-JN0GWr+}F-sTvALz z9EB492aWYKL^%F;G}hS99U*Rrz`A*1>`CL{$os#V`tQ_pAjunfbvJu26aww3r49p; zG-3`&2YDz|Mpab~t|BWVDI+PVA*~{JOG6H>Dk*adDk%d|m-~mSg~oc?q3sd>aFPFq z3;nNLc{L2e&eIKJ?B?eB&*&LAyLq}{o!#7lYHC11T|0Xu`dq$w-nW0diohVf5e{&S z8w&WRbL5f#!2ua*85KzgY0PDy5RwB@P)RwcoH|rO6)vZyaZ6SP^f%YxKfL(gT$TSX zSDfUG`2RD~|ENgebAJ2pxFreyj(h}~6z&*OT$^&m36YVp-qKQ6G4`GPX6+JZ{mJXW zy4OxCET8S_nl%+|qXOs5GJ=}C)G&BezxecP!7t~Dr5gLW@Dwu)&lQ@hJgm$0;RaDR zn8IIPiUtTJBUPxcH9dZjL=8ap+@-V+=uB|>)^yN#sLROc*s)h2HAL7(Em+UGIai%vd<{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W>CO_fGf8Q`7>wRjC|p>q?4eqCmOTcwQuXtQckPy|4F1on8lP*h>d+cH#X zQf|+6c|S{7SF(LwNJ25teDYyUrX#YGoI>yM5%T48eG*}K5-y-(co530ouso%Nl0MN zcY6XWRi*iOs}ud#XKA@nIq7xu0V(qOuYcm_?sp6jiy$pp?%af&*rT%?A}1|4>dLg2 zZ505ip)lGIK;A(>g_IlMZowvHzsi!D65HbAz9aFGLE( z2wDOiR&JXzpn}vM#y4#%oiXrt4D1|eUSYZ9L!#eZLNr)Q1-1_dmm1*e6%?WGpKczh zlK?cN9QB{;z|W4Je@gDPPD6Ln&vY-gftbbk1hF6- g1!6qyAfq4?0x&QzG literal 0 Hc-jL100001 diff --git a/playground/default-ts/src/components/HelloWorld.vue b/playground/typescript-jsx-router-vuex/src/components/HelloWorld.vue similarity index 100% rename from playground/default-ts/src/components/HelloWorld.vue rename to playground/typescript-jsx-router-vuex/src/components/HelloWorld.vue diff --git a/playground/typescript-jsx-router-vuex/src/main.ts b/playground/typescript-jsx-router-vuex/src/main.ts new file mode 100644 index 00000000..ab55e6d5 --- /dev/null +++ b/playground/typescript-jsx-router-vuex/src/main.ts @@ -0,0 +1,12 @@ +import { createApp } from 'vue' +import App from './App.vue' + +import router from './router' +import store from './store' + +const app = createApp(App) + +app.use(router) +app.use(store) + +app.mount('#app') diff --git a/playground/spa-ts/src/router/index.ts b/playground/typescript-jsx-router-vuex/src/router/index.ts similarity index 100% rename from playground/spa-ts/src/router/index.ts rename to playground/typescript-jsx-router-vuex/src/router/index.ts diff --git a/playground/typescript-jsx-router-vuex/src/store/index.ts b/playground/typescript-jsx-router-vuex/src/store/index.ts new file mode 100644 index 00000000..2b9da8fe --- /dev/null +++ b/playground/typescript-jsx-router-vuex/src/store/index.ts @@ -0,0 +1,8 @@ +import { createStore } from 'vuex' + +export default createStore({ + state: {}, + mutations: {}, + actions: {}, + modules: {} +}) diff --git a/playground/typescript-jsx-router-vuex/src/views/About.vue b/playground/typescript-jsx-router-vuex/src/views/About.vue new file mode 100644 index 00000000..3fa28070 --- /dev/null +++ b/playground/typescript-jsx-router-vuex/src/views/About.vue @@ -0,0 +1,5 @@ + diff --git a/playground/spa-ts/src/views/Home.vue b/playground/typescript-jsx-router-vuex/src/views/Home.vue similarity index 100% rename from playground/spa-ts/src/views/Home.vue rename to playground/typescript-jsx-router-vuex/src/views/Home.vue diff --git a/playground/spa-ts-with-tests/tsconfig.json b/playground/typescript-jsx-router-vuex/tsconfig.json similarity index 85% rename from playground/spa-ts-with-tests/tsconfig.json rename to playground/typescript-jsx-router-vuex/tsconfig.json index 9c2cfe6b..6f98acfa 100644 --- a/playground/spa-ts-with-tests/tsconfig.json +++ b/playground/typescript-jsx-router-vuex/tsconfig.json @@ -16,6 +16,6 @@ "lib": ["esnext", "dom", "dom.iterable", "scripthost"], "skipLibCheck": true }, - "include": ["vite.config.*", "src/**/*", "src/**/*.vue"], + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], "exclude": ["src/**/__tests__/**"] } diff --git a/playground/typescript-jsx-router-vuex/vite-env.d.ts b/playground/typescript-jsx-router-vuex/vite-env.d.ts new file mode 100644 index 00000000..636d9c3f --- /dev/null +++ b/playground/typescript-jsx-router-vuex/vite-env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import { DefineComponent } from 'vue' + // eslint-disable-next-line + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/playground/spa-ts-with-tests/vite.config.ts b/playground/typescript-jsx-router-vuex/vite.config.ts similarity index 100% rename from playground/spa-ts-with-tests/vite.config.ts rename to playground/typescript-jsx-router-vuex/vite.config.ts diff --git a/playground/typescript-jsx-router/.gitignore b/playground/typescript-jsx-router/.gitignore new file mode 100644 index 00000000..133da84e --- /dev/null +++ b/playground/typescript-jsx-router/.gitignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/playground/typescript-jsx-router/README.md b/playground/typescript-jsx-router/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/typescript-jsx-router/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/typescript-jsx-router/index.html b/playground/typescript-jsx-router/index.html new file mode 100644 index 00000000..11603f87 --- /dev/null +++ b/playground/typescript-jsx-router/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/playground/typescript-jsx-router/package.json b/playground/typescript-jsx-router/package.json new file mode 100644 index 00000000..c2196de6 --- /dev/null +++ b/playground/typescript-jsx-router/package.json @@ -0,0 +1,23 @@ +{ + "name": "typescript-jsx-router", + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vue-tsc --noEmit && vite build", + "preserve": "vite build", + "serve": "vite preview --port 5050", + "typecheck": "vue-tsc --noEmit" + }, + "dependencies": { + "vue": "^3.1.5", + "vue-router": "^4.0.10" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^1.2.5", + "@vue/compiler-sfc": "^3.1.5", + "vite": "^2.4.3", + "@vitejs/plugin-vue-jsx": "^1.1.6", + "typescript": "~4.3.5", + "vue-tsc": "^0.2.2" + } +} diff --git a/playground/typescript-jsx-router/public/favicon.ico b/playground/typescript-jsx-router/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..df36fcfb72584e00488330b560ebcf34a41c64c2 GIT binary patch literal 4286 zc-q~UO-NKx6vyu*Vj+`4)S?!;bXAL*8OO4jfgrOFtOP;wW2`J?iWIaDl9|3-1{t(4 zS0U0O3ZqC{nTsL8l}k73B3CX35*lQf+xfqDUcI^RK2sYf=ncQ&&bjBD|2^m4dGkgH z54|cY1>VK$av}B!A*u*6iLfy3##JubeV8fe8d$HC7-vcgrEjafnfSpp z7pe!Wv!9qDBs0UdLe+kc$lCO?Y}>XT*t8E43pQ4+E$sux?IOl>wcmbTE8EWa3@~=-!5HV* zYV8+@RaHCjHY_`%)v~qDXMizmnl-F)j!pG|{r3{ny4ri69Fwi5d^y18(t~Nvwb|Nx zh>WT|Fcy-Rn*wI-mOhPP!<=Rf8P2t#9R!(}OH)*|iT5OOAW|$B2ye1a;^AJJsDlb^(kr+0->47CAIMSYl0Rmk=YW z&*RS#dFMr~Y(MAMow3o5#=y?#dA|S{!>0Nn7CDehvxX7YZgMJuSC*<)|>2qR-2@}Ny=kqhHQP;qrn{=7X!b} zFUGK84nFo6>?w0HA&@;8$aZ>+b*d+EdxFXhOA>MX{ds~2p>oZ^ohvEHDO z)1gD!|N4Klw61Ji%1p>4U15?clX9`dWU9y{;gJ$yL{^A6$OsVvX(1|7LX?3;AxglM T5Je#2NqB@O!Jnp#S;+nbsq**E literal 0 Hc-jL100001 diff --git a/playground/typescript-jsx-router/src/App.vue b/playground/typescript-jsx-router/src/App.vue new file mode 100644 index 00000000..6a65bcc1 --- /dev/null +++ b/playground/typescript-jsx-router/src/App.vue @@ -0,0 +1,30 @@ + + + diff --git a/playground/typescript-jsx-router/src/assets/logo.png b/playground/typescript-jsx-router/src/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..f3d2503fc2a44b5053b0837ebea6e87a2d339a43 GIT binary patch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p6jiy$pp?%af&*rT%?A}1|4>dLg2 zZ505ip)lGIK;A(>g_IlMZowvHzsi!D65HbAz9aFGLE( z2wDOiR&JXzpn}vM#y4#%oiXrt4D1|eUSYZ9L!#eZLNr)Q1-1_dmm1*e6%?WGpKczh zlK?cN9QB{;z|W4Je@gDPPD6Ln&vY-gftbbk1hF6- g1!6qyAfq4?0x&QzG literal 0 Hc-jL100001 diff --git a/playground/spa-ts-with-tests/src/components/HelloWorld.vue b/playground/typescript-jsx-router/src/components/HelloWorld.vue similarity index 100% rename from playground/spa-ts-with-tests/src/components/HelloWorld.vue rename to playground/typescript-jsx-router/src/components/HelloWorld.vue diff --git a/playground/typescript-jsx-router/src/main.ts b/playground/typescript-jsx-router/src/main.ts new file mode 100644 index 00000000..c8e37b03 --- /dev/null +++ b/playground/typescript-jsx-router/src/main.ts @@ -0,0 +1,9 @@ +import { createApp } from 'vue' +import App from './App.vue' +import router from './router' + +const app = createApp(App) + +app.use(router) + +app.mount('#app') diff --git a/playground/typescript-jsx-router/src/router/index.ts b/playground/typescript-jsx-router/src/router/index.ts new file mode 100644 index 00000000..06036285 --- /dev/null +++ b/playground/typescript-jsx-router/src/router/index.ts @@ -0,0 +1,27 @@ +import { createRouter, createWebHistory } from 'vue-router' +import type { RouteRecordRaw } from 'vue-router' + +import Home from '../views/Home.vue' + +const routes: Array = [ + { + path: '/', + name: 'Home', + component: Home + }, + { + path: '/about', + name: 'About', + // route level code-splitting + // this generates a separate chunk (About.[hash].js) for this route + // which is lazy-loaded when the route is visited. + component: () => import('../views/About.vue') + } +] + +const router = createRouter({ + history: createWebHistory(import.meta.env.BASE_URL), + routes +}) + +export default router diff --git a/playground/typescript-jsx-router/src/views/About.vue b/playground/typescript-jsx-router/src/views/About.vue new file mode 100644 index 00000000..3fa28070 --- /dev/null +++ b/playground/typescript-jsx-router/src/views/About.vue @@ -0,0 +1,5 @@ + diff --git a/playground/typescript-jsx-router/src/views/Home.vue b/playground/typescript-jsx-router/src/views/Home.vue new file mode 100644 index 00000000..4ade1db6 --- /dev/null +++ b/playground/typescript-jsx-router/src/views/Home.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/playground/spa-ts/tsconfig.json b/playground/typescript-jsx-router/tsconfig.json similarity index 85% rename from playground/spa-ts/tsconfig.json rename to playground/typescript-jsx-router/tsconfig.json index 9c2cfe6b..6f98acfa 100644 --- a/playground/spa-ts/tsconfig.json +++ b/playground/typescript-jsx-router/tsconfig.json @@ -16,6 +16,6 @@ "lib": ["esnext", "dom", "dom.iterable", "scripthost"], "skipLibCheck": true }, - "include": ["vite.config.*", "src/**/*", "src/**/*.vue"], + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], "exclude": ["src/**/__tests__/**"] } diff --git a/playground/typescript-jsx-router/vite-env.d.ts b/playground/typescript-jsx-router/vite-env.d.ts new file mode 100644 index 00000000..636d9c3f --- /dev/null +++ b/playground/typescript-jsx-router/vite-env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import { DefineComponent } from 'vue' + // eslint-disable-next-line + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/playground/spa-ts/vite.config.ts b/playground/typescript-jsx-router/vite.config.ts similarity index 100% rename from playground/spa-ts/vite.config.ts rename to playground/typescript-jsx-router/vite.config.ts diff --git a/playground/typescript-jsx/.gitignore b/playground/typescript-jsx/.gitignore new file mode 100644 index 00000000..133da84e --- /dev/null +++ b/playground/typescript-jsx/.gitignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/playground/typescript-jsx/README.md b/playground/typescript-jsx/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/typescript-jsx/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/typescript-jsx/index.html b/playground/typescript-jsx/index.html new file mode 100644 index 00000000..11603f87 --- /dev/null +++ b/playground/typescript-jsx/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/playground/default-ts/package.json b/playground/typescript-jsx/package.json similarity index 94% rename from playground/default-ts/package.json rename to playground/typescript-jsx/package.json index 875e356b..a161a228 100644 --- a/playground/default-ts/package.json +++ b/playground/typescript-jsx/package.json @@ -1,5 +1,5 @@ { - "name": "default-ts", + "name": "typescript-jsx", "version": "0.0.0", "scripts": { "dev": "vite", @@ -13,9 +13,9 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^1.2.5", - "@vitejs/plugin-vue-jsx": "^1.1.6", "@vue/compiler-sfc": "^3.1.5", "vite": "^2.4.3", + "@vitejs/plugin-vue-jsx": "^1.1.6", "typescript": "~4.3.5", "vue-tsc": "^0.2.2" } diff --git a/playground/typescript-jsx/public/favicon.ico b/playground/typescript-jsx/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..df36fcfb72584e00488330b560ebcf34a41c64c2 GIT binary patch literal 4286 zc-q~UO-NKx6vyu*Vj+`4)S?!;bXAL*8OO4jfgrOFtOP;wW2`J?iWIaDl9|3-1{t(4 zS0U0O3ZqC{nTsL8l}k73B3CX35*lQf+xfqDUcI^RK2sYf=ncQ&&bjBD|2^m4dGkgH z54|cY1>VK$av}B!A*u*6iLfy3##JubeV8fe8d$HC7-vcgrEjafnfSpp z7pe!Wv!9qDBs0UdLe+kc$lCO?Y}>XT*t8E43pQ4+E$sux?IOl>wcmbTE8EWa3@~=-!5HV* zYV8+@RaHCjHY_`%)v~qDXMizmnl-F)j!pG|{r3{ny4ri69Fwi5d^y18(t~Nvwb|Nx zh>WT|Fcy-Rn*wI-mOhPP!<=Rf8P2t#9R!(}OH)*|iT5OOAW|$B2ye1a;^AJJsDlb^(kr+0->47CAIMSYl0Rmk=YW z&*RS#dFMr~Y(MAMow3o5#=y?#dA|S{!>0Nn7CDehvxX7YZgMJuSC*<)|>2qR-2@}Ny=kqhHQP;qrn{=7X!b} zFUGK84nFo6>?w0HA&@;8$aZ>+b*d+EdxFXhOA>MX{ds~2p>oZ^ohvEHDO z)1gD!|N4Klw61Ji%1p>4U15?clX9`dWU9y{;gJ$yL{^A6$OsVvX(1|7LX?3;AxglM T5Je#2NqB@O!Jnp#S;+nbsq**E literal 0 Hc-jL100001 diff --git a/playground/default-ts-with-tests/src/App.vue b/playground/typescript-jsx/src/App.vue similarity index 100% rename from playground/default-ts-with-tests/src/App.vue rename to playground/typescript-jsx/src/App.vue diff --git a/playground/typescript-jsx/src/assets/logo.png b/playground/typescript-jsx/src/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..f3d2503fc2a44b5053b0837ebea6e87a2d339a43 GIT binary patch literal 6849 zc-nn=2Uru`)-Fh-DT-7nLI?zqPLL8LbRr;4np6QHK!gNH=-p7H_aa>oM5IWQ(2Mk< zh#)O=LF7Za1`yCcc)su4|K8`^GtV=bS!>>R?KOL^wfEYSXal`FbhPZWWMpJ?TAJ#H zr0c->Nli)mtu(93CtcV)HOxGX+#Ef9>@Wy26$iJ62%r|q&Iw_NuygS97(^(Lkx}p> zjmh|RPdE289*UC?SQ^0S2R}M7Y6!cSDti#t`-LY|3Exl zV4#0FWu|KYRCB{1f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~=&>1TRd49LORBlD8qroP?s$0Y!&IZ4fJa(Q(!%>Xl&U~8mmWoG_|&zjszi0=M}&0tS#gE zeXHxg`kY8R151<+i5A{6O^iOEE!XT5GH!fTFxOrrc^W@TO1bU28dsX535!m`LTS$% z5Tj(%K>kUu(Z|GQg_y*s8vzw=CA8y@0LNg$CD*Aaj%wccw_3z7)=pyS#Ls9KKNZ%NaV!QP>6B%I zQYTNKpZPhYz?zqqADe!Ih*aPGsa(F$N?3^qX`2j*PiAoNK8-1EV@-}Ib&X2{ipKHK zJ??|kKyDN3=F9Akn6~R{?%@Q#l1h(Tm&fHC>{YetFVY(()B!({bD(t6fb2M=LLZTX zE-bpso}Cgrpkr3b^WnOnievxIG#7IDB&4TLxe$=WoFh07dHKnp;jqd8mrKvmPQOb5kv8QW$~jMqF!699oasg}|EQ%dD>AUj`OgD@SR;n%&iUK_)ms$9@;rt81O3 zPbyxYEB8cG+N|t9{(NbGbHF`!wFI2td;bWL+_i1IA71-ZxRGFAt{WEo@k)dsg*)}@ z`&n#&`^so(c@?b5wJS#OCJ%PSw+p5LSCW2IB!4%T25ZLJ$JEZZV^e>S9KII&Wah!U zrRLYOF2W>CO_fGf8Q`7>wRjC|p>q?4eqCmOTcwQuXtQckPy|4F1on8lP*h>d+cH#X zQf|+6c|S{7SF(LwNJ25teDYyUrX#YGoI>yM5%T48eG*}K5-y-(co530ouso%Nl0MN zcY6XWRi*iOs}ud#XKA@nIq7xu0V(qOuYcm_?sp6jiy$pp?%af&*rT%?A}1|4>dLg2 zZ505ip)lGIK;A(>g_IlMZowvHzsi!D65HbAz9aFGLE( z2wDOiR&JXzpn}vM#y4#%oiXrt4D1|eUSYZ9L!#eZLNr)Q1-1_dmm1*e6%?WGpKczh zlK?cN9QB{;z|W4Je@gDPPD6Ln&vY-gftbbk1hF6- g1!6qyAfq4?0x&QzG literal 0 Hc-jL100001 diff --git a/playground/spa-ts/src/components/HelloWorld.vue b/playground/typescript-jsx/src/components/HelloWorld.vue similarity index 100% rename from playground/spa-ts/src/components/HelloWorld.vue rename to playground/typescript-jsx/src/components/HelloWorld.vue diff --git a/playground/default-ts-with-tests/src/main.ts b/playground/typescript-jsx/src/main.ts similarity index 100% rename from playground/default-ts-with-tests/src/main.ts rename to playground/typescript-jsx/src/main.ts diff --git a/playground/default-ts/tsconfig.json b/playground/typescript-jsx/tsconfig.json similarity index 85% rename from playground/default-ts/tsconfig.json rename to playground/typescript-jsx/tsconfig.json index 9c2cfe6b..6f98acfa 100644 --- a/playground/default-ts/tsconfig.json +++ b/playground/typescript-jsx/tsconfig.json @@ -16,6 +16,6 @@ "lib": ["esnext", "dom", "dom.iterable", "scripthost"], "skipLibCheck": true }, - "include": ["vite.config.*", "src/**/*", "src/**/*.vue"], + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], "exclude": ["src/**/__tests__/**"] } diff --git a/playground/typescript-jsx/vite-env.d.ts b/playground/typescript-jsx/vite-env.d.ts new file mode 100644 index 00000000..636d9c3f --- /dev/null +++ b/playground/typescript-jsx/vite-env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import { DefineComponent } from 'vue' + // eslint-disable-next-line + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/playground/typescript-jsx/vite.config.ts b/playground/typescript-jsx/vite.config.ts new file mode 100644 index 00000000..032e163c --- /dev/null +++ b/playground/typescript-jsx/vite.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue(), vueJsx()], + resolve: { + alias: { + '@/': new URL('./src/', import.meta.url).pathname + } + } +}) diff --git a/playground/typescript/.gitignore b/playground/typescript/.gitignore new file mode 100644 index 00000000..133da84e --- /dev/null +++ b/playground/typescript/.gitignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/playground/typescript/README.md b/playground/typescript/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/typescript/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/typescript/index.html b/playground/typescript/index.html new file mode 100644 index 00000000..11603f87 --- /dev/null +++ b/playground/typescript/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/playground/typescript/package.json b/playground/typescript/package.json new file mode 100644 index 00000000..c3c3ee7a --- /dev/null +++ b/playground/typescript/package.json @@ -0,0 +1,21 @@ +{ + "name": "typescript", + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vue-tsc --noEmit && vite build", + "preserve": "vite build", + "serve": "vite preview --port 5050", + "typecheck": "vue-tsc --noEmit" + }, + "dependencies": { + "vue": "^3.1.5" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^1.2.5", + "@vue/compiler-sfc": "^3.1.5", + "vite": "^2.4.3", + "typescript": "~4.3.5", + "vue-tsc": "^0.2.2" + } +} diff --git a/playground/typescript/public/favicon.ico b/playground/typescript/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..df36fcfb72584e00488330b560ebcf34a41c64c2 GIT binary patch literal 4286 zc-q~UO-NKx6vyu*Vj+`4)S?!;bXAL*8OO4jfgrOFtOP;wW2`J?iWIaDl9|3-1{t(4 zS0U0O3ZqC{nTsL8l}k73B3CX35*lQf+xfqDUcI^RK2sYf=ncQ&&bjBD|2^m4dGkgH z54|cY1>VK$av}B!A*u*6iLfy3##JubeV8fe8d$HC7-vcgrEjafnfSpp z7pe!Wv!9qDBs0UdLe+kc$lCO?Y}>XT*t8E43pQ4+E$sux?IOl>wcmbTE8EWa3@~=-!5HV* zYV8+@RaHCjHY_`%)v~qDXMizmnl-F)j!pG|{r3{ny4ri69Fwi5d^y18(t~Nvwb|Nx zh>WT|Fcy-Rn*wI-mOhPP!<=Rf8P2t#9R!(}OH)*|iT5OOAW|$B2ye1a;^AJJsDlb^(kr+0->47CAIMSYl0Rmk=YW z&*RS#dFMr~Y(MAMow3o5#=y?#dA|S{!>0Nn7CDehvxX7YZgMJuSC*<)|>2qR-2@}Ny=kqhHQP;qrn{=7X!b} zFUGK84nFo6>?w0HA&@;8$aZ>+b*d+EdxFXhOA>MX{ds~2p>oZ^ohvEHDO z)1gD!|N4Klw61Ji%1p>4U15?clX9`dWU9y{;gJ$yL{^A6$OsVvX(1|7LX?3;AxglM T5Je#2NqB@O!Jnp#S;+nbsq**E literal 0 Hc-jL100001 diff --git a/playground/default-ts/src/App.vue b/playground/typescript/src/App.vue similarity index 100% rename from playground/default-ts/src/App.vue rename to playground/typescript/src/App.vue diff --git a/playground/typescript/src/assets/logo.png b/playground/typescript/src/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..f3d2503fc2a44b5053b0837ebea6e87a2d339a43 GIT binary patch literal 6849 zc-nn=2Uru`)-Fh-DT-7nLI?zqPLL8LbRr;4np6QHK!gNH=-p7H_aa>oM5IWQ(2Mk< zh#)O=LF7Za1`yCcc)su4|K8`^GtV=bS!>>R?KOL^wfEYSXal`FbhPZWWMpJ?TAJ#H zr0c->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{;z|W4Je@gDPPD6Ln&vY-gftbbk1hF6- g1!6qyAfq4?0x&QzG literal 0 Hc-jL100001 diff --git a/playground/typescript/src/components/HelloWorld.vue b/playground/typescript/src/components/HelloWorld.vue new file mode 100644 index 00000000..97b3d3da --- /dev/null +++ b/playground/typescript/src/components/HelloWorld.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/playground/default-ts/src/main.ts b/playground/typescript/src/main.ts similarity index 100% rename from playground/default-ts/src/main.ts rename to playground/typescript/src/main.ts diff --git a/playground/typescript/tsconfig.json b/playground/typescript/tsconfig.json new file mode 100644 index 00000000..6f98acfa --- /dev/null +++ b/playground/typescript/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "target": "esnext", + "useDefineForClassFields": true, + "module": "esnext", + "moduleResolution": "node", + "strict": true, + "jsx": "preserve", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "paths": { + "@/*": ["src/*"] + }, + "lib": ["esnext", "dom", "dom.iterable", "scripthost"], + "skipLibCheck": true + }, + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/**"] +} diff --git a/playground/typescript/vite-env.d.ts b/playground/typescript/vite-env.d.ts new file mode 100644 index 00000000..636d9c3f --- /dev/null +++ b/playground/typescript/vite-env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import { DefineComponent } from 'vue' + // eslint-disable-next-line + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/playground/typescript/vite.config.ts b/playground/typescript/vite.config.ts new file mode 100644 index 00000000..24c2e504 --- /dev/null +++ b/playground/typescript/vite.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue()], + resolve: { + alias: { + '@/': new URL('./src/', import.meta.url).pathname + } + } +}) diff --git a/playground/vuex-with-tests/.gitignore b/playground/vuex-with-tests/.gitignore new file mode 100644 index 00000000..133da84e --- /dev/null +++ b/playground/vuex-with-tests/.gitignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/playground/vuex-with-tests/README.md b/playground/vuex-with-tests/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/vuex-with-tests/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/spa-with-tests/cypress.json b/playground/vuex-with-tests/cypress.json similarity index 100% rename from playground/spa-with-tests/cypress.json rename to playground/vuex-with-tests/cypress.json diff --git a/playground/spa-with-tests/cypress/fixtures/example.json b/playground/vuex-with-tests/cypress/fixtures/example.json similarity index 100% rename from playground/spa-with-tests/cypress/fixtures/example.json rename to playground/vuex-with-tests/cypress/fixtures/example.json diff --git a/playground/default-with-tests/cypress/integration/example.spec.js b/playground/vuex-with-tests/cypress/integration/example.spec.js similarity index 100% rename from playground/default-with-tests/cypress/integration/example.spec.js rename to playground/vuex-with-tests/cypress/integration/example.spec.js diff --git a/playground/spa-ts-with-tests/cypress/tsconfig.json b/playground/vuex-with-tests/cypress/jsconfig.json similarity index 100% rename from playground/spa-ts-with-tests/cypress/tsconfig.json rename to playground/vuex-with-tests/cypress/jsconfig.json diff --git a/playground/spa-ts-with-tests/cypress/plugins/index.ts b/playground/vuex-with-tests/cypress/plugins/index.js similarity index 100% rename from playground/spa-ts-with-tests/cypress/plugins/index.ts rename to playground/vuex-with-tests/cypress/plugins/index.js diff --git a/playground/spa-ts-with-tests/cypress/support/commands.ts b/playground/vuex-with-tests/cypress/support/commands.js similarity index 100% rename from playground/spa-ts-with-tests/cypress/support/commands.ts rename to playground/vuex-with-tests/cypress/support/commands.js diff --git a/playground/spa-ts-with-tests/cypress/support/index.ts b/playground/vuex-with-tests/cypress/support/index.js similarity index 100% rename from playground/spa-ts-with-tests/cypress/support/index.ts rename to playground/vuex-with-tests/cypress/support/index.js diff --git a/playground/vuex-with-tests/index.html b/playground/vuex-with-tests/index.html new file mode 100644 index 00000000..11603f87 --- /dev/null +++ b/playground/vuex-with-tests/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/playground/vuex-with-tests/jsconfig.json b/playground/vuex-with-tests/jsconfig.json new file mode 100644 index 00000000..6f98acfa --- /dev/null +++ b/playground/vuex-with-tests/jsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "target": "esnext", + "useDefineForClassFields": true, + "module": "esnext", + "moduleResolution": "node", + "strict": true, + "jsx": "preserve", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "paths": { + "@/*": ["src/*"] + }, + "lib": ["esnext", "dom", "dom.iterable", "scripthost"], + "skipLibCheck": true + }, + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/**"] +} diff --git a/playground/vuex-with-tests/package.json b/playground/vuex-with-tests/package.json new file mode 100644 index 00000000..267dec69 --- /dev/null +++ b/playground/vuex-with-tests/package.json @@ -0,0 +1,27 @@ +{ + "name": "vuex-with-tests", + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preserve": "vite build", + "serve": "vite preview --port 5050", + "test:unit": "cypress open-ct", + "test:unit:ci": "cypress run-ct --quiet --reporter spec", + "test:e2e": "start-server-and-test serve 5050 'cypress open'", + "test:e2e:ci": "start-server-and-test serve 5050 'cypress run'" + }, + "dependencies": { + "vue": "^3.1.5", + "vuex": "^4.0.2" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^1.2.5", + "@vue/compiler-sfc": "^3.1.5", + "vite": "^2.4.3", + "@cypress/vite-dev-server": "^2.0.2", + "@cypress/vue": "^3.0.1", + "cypress": "^8.0.0", + "start-server-and-test": "^1.12.6" + } +} diff --git a/playground/vuex-with-tests/public/favicon.ico b/playground/vuex-with-tests/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..df36fcfb72584e00488330b560ebcf34a41c64c2 GIT binary patch literal 4286 zc-q~UO-NKx6vyu*Vj+`4)S?!;bXAL*8OO4jfgrOFtOP;wW2`J?iWIaDl9|3-1{t(4 zS0U0O3ZqC{nTsL8l}k73B3CX35*lQf+xfqDUcI^RK2sYf=ncQ&&bjBD|2^m4dGkgH z54|cY1>VK$av}B!A*u*6iLfy3##JubeV8fe8d$HC7-vcgrEjafnfSpp z7pe!Wv!9qDBs0UdLe+kc$lCO?Y}>XT*t8E43pQ4+E$sux?IOl>wcmbTE8EWa3@~=-!5HV* zYV8+@RaHCjHY_`%)v~qDXMizmnl-F)j!pG|{r3{ny4ri69Fwi5d^y18(t~Nvwb|Nx zh>WT|Fcy-Rn*wI-mOhPP!<=Rf8P2t#9R!(}OH)*|iT5OOAW|$B2ye1a;^AJJsDlb^(kr+0->47CAIMSYl0Rmk=YW z&*RS#dFMr~Y(MAMow3o5#=y?#dA|S{!>0Nn7CDehvxX7YZgMJuSC*<)|>2qR-2@}Ny=kqhHQP;qrn{=7X!b} zFUGK84nFo6>?w0HA&@;8$aZ>+b*d+EdxFXhOA>MX{ds~2p>oZ^ohvEHDO z)1gD!|N4Klw61Ji%1p>4U15?clX9`dWU9y{;gJ$yL{^A6$OsVvX(1|7LX?3;AxglM T5Je#2NqB@O!Jnp#S;+nbsq**E literal 0 Hc-jL100001 diff --git a/playground/vuex-with-tests/src/App.vue b/playground/vuex-with-tests/src/App.vue new file mode 100644 index 00000000..a058d171 --- /dev/null +++ b/playground/vuex-with-tests/src/App.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/playground/vuex-with-tests/src/assets/logo.png b/playground/vuex-with-tests/src/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..f3d2503fc2a44b5053b0837ebea6e87a2d339a43 GIT binary patch literal 6849 zc-nn=2Uru`)-Fh-DT-7nLI?zqPLL8LbRr;4np6QHK!gNH=-p7H_aa>oM5IWQ(2Mk< zh#)O=LF7Za1`yCcc)su4|K8`^GtV=bS!>>R?KOL^wfEYSXal`FbhPZWWMpJ?TAJ#H zr0c->Nli)mtu(93CtcV)HOxGX+#Ef9>@Wy26$iJ62%r|q&Iw_NuygS97(^(Lkx}p> zjmh|RPdE289*UC?SQ^0S2R}M7Y6!cSDti#t`-LY|3Exl zV4#0FWu|KYRCB{1fYM?zqV^J!w}7%xF-d6|S*WZC5JHm0CFH~*5~31Nd1)zm2?+4- z14L>K&oWv!eP^h>BL>vMUB_TwyerQiS zUr{uc_a6)D2&_E@>F$YiLj%ucyN7OGo-h#TpI1P+>+1g7FdF-JN0GWr+}F-sTvALz z9EB492aWYKL^%F;G}hS99U*Rrz`A*1>`CL{$os#V`tQ_pAjunfbvJu26aww3r49p; zG-3`&2YDz|Mpab~t|BWVDI+PVA*~{JOG6H>Dk*adDk%d|m-~mSg~oc?q3sd>aFPFq z3;nNLc{L2e&eIKJ?B?eB&*&LAyLq}{o!#7lYHC11T|0Xu`dq$w-nW0diohVf5e{&S z8w&WRbL5f#!2ua*85KzgY0PDy5RwB@P)RwcoH|rO6)vZyaZ6SP^f%YxKfL(gT$TSX zSDfUG`2RD~|ENgebAJ2pxFrey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%dD>AUj`OgD@SR;n%&iUK_)ms$9@;rt81O3 zPbyxYEB8cG+N|t9{(NbGbHF`!wFI2td;bWL+_i1IA71-ZxRGFAt{WEo@k)dsg*)}@ z`&n#&`^so(c@?b5wJS#OCJ%PSw+p5LSCW2IB!4%T25ZLJ$JEZZV^e>S9KII&Wah!U zrRLYOF2W>CO_fGf8Q`7>wRjC|p>q?4eqCmOTcwQuXtQckPy|4F1on8lP*h>d+cH#X zQf|+6c|S{7SF(LwNJ25teDYyUrX#YGoI>yM5%T48eG*}K5-y-(co530ouso%Nl0MN zcY6XWRi*iOs}ud#XKA@nIq7xu0V(qOuYcm_?sp6jiy$pp?%af&*rT%?A}1|4>dLg2 zZ505ip)lGIK;A(>g_IlMZowvHzsi!D65HbAz9aFGLE( z2wDOiR&JXzpn}vM#y4#%oiXrt4D1|eUSYZ9L!#eZLNr)Q1-1_dmm1*e6%?WGpKczh zlK?cN9QB{;z|W4Je@gDPPD6Ln&vY-gftbbk1hF6- g1!6qyAfq4?0x&QzG literal 0 Hc-jL100001 diff --git a/playground/vuex-with-tests/src/components/HelloWorld.vue b/playground/vuex-with-tests/src/components/HelloWorld.vue new file mode 100644 index 00000000..36a089f1 --- /dev/null +++ b/playground/vuex-with-tests/src/components/HelloWorld.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/playground/spa-ts-with-tests/src/components/__tests__/HelloWorld.spec.ts b/playground/vuex-with-tests/src/components/__tests__/HelloWorld.spec.js similarity index 100% rename from playground/spa-ts-with-tests/src/components/__tests__/HelloWorld.spec.ts rename to playground/vuex-with-tests/src/components/__tests__/HelloWorld.spec.js diff --git a/playground/vuex-with-tests/src/main.js b/playground/vuex-with-tests/src/main.js new file mode 100644 index 00000000..020a706b --- /dev/null +++ b/playground/vuex-with-tests/src/main.js @@ -0,0 +1,9 @@ +import { createApp } from 'vue' +import App from './App.vue' +import store from './store' + +const app = createApp(App) + +app.use(store) + +app.mount('#app') diff --git a/playground/vuex-with-tests/src/store/index.js b/playground/vuex-with-tests/src/store/index.js new file mode 100644 index 00000000..2b9da8fe --- /dev/null +++ b/playground/vuex-with-tests/src/store/index.js @@ -0,0 +1,8 @@ +import { createStore } from 'vuex' + +export default createStore({ + state: {}, + mutations: {}, + actions: {}, + modules: {} +}) diff --git a/playground/vuex-with-tests/vite-env.d.ts b/playground/vuex-with-tests/vite-env.d.ts new file mode 100644 index 00000000..636d9c3f --- /dev/null +++ b/playground/vuex-with-tests/vite-env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import { DefineComponent } from 'vue' + // eslint-disable-next-line + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/playground/vuex-with-tests/vite.config.js b/playground/vuex-with-tests/vite.config.js new file mode 100644 index 00000000..24c2e504 --- /dev/null +++ b/playground/vuex-with-tests/vite.config.js @@ -0,0 +1,12 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue()], + resolve: { + alias: { + '@/': new URL('./src/', import.meta.url).pathname + } + } +}) diff --git a/playground/vuex/.gitignore b/playground/vuex/.gitignore new file mode 100644 index 00000000..133da84e --- /dev/null +++ b/playground/vuex/.gitignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/playground/vuex/README.md b/playground/vuex/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/vuex/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/vuex/index.html b/playground/vuex/index.html new file mode 100644 index 00000000..11603f87 --- /dev/null +++ b/playground/vuex/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/playground/vuex/jsconfig.json b/playground/vuex/jsconfig.json new file mode 100644 index 00000000..6f98acfa --- /dev/null +++ b/playground/vuex/jsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "target": "esnext", + "useDefineForClassFields": true, + "module": "esnext", + "moduleResolution": "node", + "strict": true, + "jsx": "preserve", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "paths": { + "@/*": ["src/*"] + }, + "lib": ["esnext", "dom", "dom.iterable", "scripthost"], + "skipLibCheck": true + }, + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/**"] +} diff --git a/playground/vuex/package.json b/playground/vuex/package.json new file mode 100644 index 00000000..49ebcaad --- /dev/null +++ b/playground/vuex/package.json @@ -0,0 +1,19 @@ +{ + "name": "vuex", + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preserve": "vite build", + "serve": "vite preview --port 5050" + }, + "dependencies": { + "vue": "^3.1.5", + "vuex": "^4.0.2" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^1.2.5", + "@vue/compiler-sfc": "^3.1.5", + "vite": "^2.4.3" + } +} diff --git a/playground/vuex/public/favicon.ico b/playground/vuex/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..df36fcfb72584e00488330b560ebcf34a41c64c2 GIT binary patch literal 4286 zc-q~UO-NKx6vyu*Vj+`4)S?!;bXAL*8OO4jfgrOFtOP;wW2`J?iWIaDl9|3-1{t(4 zS0U0O3ZqC{nTsL8l}k73B3CX35*lQf+xfqDUcI^RK2sYf=ncQ&&bjBD|2^m4dGkgH z54|cY1>VK$av}B!A*u*6iLfy3##JubeV8fe8d$HC7-vcgrEjafnfSpp z7pe!Wv!9qDBs0UdLe+kc$lCO?Y}>XT*t8E43pQ4+E$sux?IOl>wcmbTE8EWa3@~=-!5HV* zYV8+@RaHCjHY_`%)v~qDXMizmnl-F)j!pG|{r3{ny4ri69Fwi5d^y18(t~Nvwb|Nx zh>WT|Fcy-Rn*wI-mOhPP!<=Rf8P2t#9R!(}OH)*|iT5OOAW|$B2ye1a;^AJJsDlb^(kr+0->47CAIMSYl0Rmk=YW z&*RS#dFMr~Y(MAMow3o5#=y?#dA|S{!>0Nn7CDehvxX7YZgMJuSC*<)|>2qR-2@}Ny=kqhHQP;qrn{=7X!b} zFUGK84nFo6>?w0HA&@;8$aZ>+b*d+EdxFXhOA>MX{ds~2p>oZ^ohvEHDO z)1gD!|N4Klw61Ji%1p>4U15?clX9`dWU9y{;gJ$yL{^A6$OsVvX(1|7LX?3;AxglM T5Je#2NqB@O!Jnp#S;+nbsq**E literal 0 Hc-jL100001 diff --git a/playground/vuex/src/App.vue b/playground/vuex/src/App.vue new file mode 100644 index 00000000..a058d171 --- /dev/null +++ b/playground/vuex/src/App.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/playground/vuex/src/assets/logo.png b/playground/vuex/src/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..f3d2503fc2a44b5053b0837ebea6e87a2d339a43 GIT binary patch literal 6849 zc-nn=2Uru`)-Fh-DT-7nLI?zqPLL8LbRr;4np6QHK!gNH=-p7H_aa>oM5IWQ(2Mk< zh#)O=LF7Za1`yCcc)su4|K8`^GtV=bS!>>R?KOL^wfEYSXal`FbhPZWWMpJ?TAJ#H zr0c->Nli)mtu(93CtcV)HO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ln&vY-gftbbk1hF6- g1!6qyAfq4?0x&QzG literal 0 Hc-jL100001 diff --git a/playground/vuex/src/components/HelloWorld.vue b/playground/vuex/src/components/HelloWorld.vue new file mode 100644 index 00000000..36a089f1 --- /dev/null +++ b/playground/vuex/src/components/HelloWorld.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/playground/vuex/src/main.js b/playground/vuex/src/main.js new file mode 100644 index 00000000..020a706b --- /dev/null +++ b/playground/vuex/src/main.js @@ -0,0 +1,9 @@ +import { createApp } from 'vue' +import App from './App.vue' +import store from './store' + +const app = createApp(App) + +app.use(store) + +app.mount('#app') diff --git a/playground/vuex/src/store/index.js b/playground/vuex/src/store/index.js new file mode 100644 index 00000000..2b9da8fe --- /dev/null +++ b/playground/vuex/src/store/index.js @@ -0,0 +1,8 @@ +import { createStore } from 'vuex' + +export default createStore({ + state: {}, + mutations: {}, + actions: {}, + modules: {} +}) diff --git a/playground/vuex/vite-env.d.ts b/playground/vuex/vite-env.d.ts new file mode 100644 index 00000000..636d9c3f --- /dev/null +++ b/playground/vuex/vite-env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import { DefineComponent } from 'vue' + // eslint-disable-next-line + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/playground/vuex/vite.config.js b/playground/vuex/vite.config.js new file mode 100644 index 00000000..24c2e504 --- /dev/null +++ b/playground/vuex/vite.config.js @@ -0,0 +1,12 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue()], + resolve: { + alias: { + '@/': new URL('./src/', import.meta.url).pathname + } + } +}) diff --git a/playground/with-tests/.gitignore b/playground/with-tests/.gitignore new file mode 100644 index 00000000..133da84e --- /dev/null +++ b/playground/with-tests/.gitignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/playground/with-tests/README.md b/playground/with-tests/README.md new file mode 100644 index 00000000..c3a42c19 --- /dev/null +++ b/playground/with-tests/README.md @@ -0,0 +1,21 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +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. + +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. + +## Customize configuration + +See [Vite Configuration Reference](https://vitejs.dev/config/). + +## Usage + + diff --git a/playground/with-tests/cypress.json b/playground/with-tests/cypress.json new file mode 100644 index 00000000..3d372252 --- /dev/null +++ b/playground/with-tests/cypress.json @@ -0,0 +1,7 @@ +{ + "baseUrl": "http://localhost:5050", + "component": { + "componentFolder": "src", + "testFiles": "**/__tests__/*.spec.{js,ts,jsx,tsx}" + } +} diff --git a/playground/with-tests/cypress/fixtures/example.json b/playground/with-tests/cypress/fixtures/example.json new file mode 100644 index 00000000..02e42543 --- /dev/null +++ b/playground/with-tests/cypress/fixtures/example.json @@ -0,0 +1,5 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io", + "body": "Fixtures are a great way to mock data for responses to routes" +} diff --git a/playground/default-ts-with-tests/cypress/integration/example.spec.ts b/playground/with-tests/cypress/integration/example.spec.js similarity index 72% rename from playground/default-ts-with-tests/cypress/integration/example.spec.ts rename to playground/with-tests/cypress/integration/example.spec.js index bbe8f52d..493bfcf0 100644 --- a/playground/default-ts-with-tests/cypress/integration/example.spec.ts +++ b/playground/with-tests/cypress/integration/example.spec.js @@ -3,6 +3,6 @@ describe('My First Test', () => { it('visits the app root url', () => { cy.visit('/') - cy.contains('h1', 'Hello Vue 3 + TypeScript + Vite') + cy.contains('h1', 'Hello Vue 3 + Vite') }) }) diff --git a/playground/with-tests/cypress/jsconfig.json b/playground/with-tests/cypress/jsconfig.json new file mode 100644 index 00000000..b5b2f972 --- /dev/null +++ b/playground/with-tests/cypress/jsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["es5", "dom"], + "types": ["cypress"] + }, + "include": ["./**/*"] +} diff --git a/playground/with-tests/cypress/plugins/index.js b/playground/with-tests/cypress/plugins/index.js new file mode 100644 index 00000000..ad2e351d --- /dev/null +++ b/playground/with-tests/cypress/plugins/index.js @@ -0,0 +1,28 @@ +/// +// *********************************************************** +// This example plugins/index.js can be used to load plugins +// +// You can change the location of this file or turn off loading +// the plugins file with the 'pluginsFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/plugins-guide +// *********************************************************** + +// This function is called when a project is opened or re-opened (e.g. due to +// the project's config changing) + +const { startDevServer } = require('@cypress/vite-dev-server') + +/** + * @type {Cypress.PluginConfig} + */ +// eslint-disable-next-line no-unused-vars +module.exports = (on, config) => { + // `on` is used to hook into various events Cypress emits + // `config` is the resolved Cypress config + on('dev-server:start', (options) => { + return startDevServer({ options }) + }) + return config +} diff --git a/playground/with-tests/cypress/support/commands.js b/playground/with-tests/cypress/support/commands.js new file mode 100644 index 00000000..119ab03f --- /dev/null +++ b/playground/with-tests/cypress/support/commands.js @@ -0,0 +1,25 @@ +// *********************************************** +// This example commands.js shows you how to +// create various custom commands and overwrite +// existing commands. +// +// For more comprehensive examples of custom +// commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** +// +// +// -- This is a parent command -- +// Cypress.Commands.add('login', (email, password) => { ... }) +// +// +// -- This is a child command -- +// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) +// +// +// -- This is a dual command -- +// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) +// +// +// -- This will overwrite an existing command -- +// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) diff --git a/playground/with-tests/cypress/support/index.js b/playground/with-tests/cypress/support/index.js new file mode 100644 index 00000000..d68db96d --- /dev/null +++ b/playground/with-tests/cypress/support/index.js @@ -0,0 +1,20 @@ +// *********************************************************** +// This example support/index.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands' + +// Alternatively you can use CommonJS syntax: +// require('./commands') diff --git a/playground/with-tests/index.html b/playground/with-tests/index.html new file mode 100644 index 00000000..11603f87 --- /dev/null +++ b/playground/with-tests/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/playground/with-tests/jsconfig.json b/playground/with-tests/jsconfig.json new file mode 100644 index 00000000..6f98acfa --- /dev/null +++ b/playground/with-tests/jsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "target": "esnext", + "useDefineForClassFields": true, + "module": "esnext", + "moduleResolution": "node", + "strict": true, + "jsx": "preserve", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "paths": { + "@/*": ["src/*"] + }, + "lib": ["esnext", "dom", "dom.iterable", "scripthost"], + "skipLibCheck": true + }, + "include": ["vite.config.*", "vite-env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/**"] +} diff --git a/playground/default-with-tests/package.json b/playground/with-tests/package.json similarity index 90% rename from playground/default-with-tests/package.json rename to playground/with-tests/package.json index c95e46c7..9f52650e 100644 --- a/playground/default-with-tests/package.json +++ b/playground/with-tests/package.json @@ -1,5 +1,5 @@ { - "name": "default-with-tests", + "name": "with-tests", "version": "0.0.0", "scripts": { "dev": "vite", @@ -16,7 +16,6 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^1.2.5", - "@vitejs/plugin-vue-jsx": "^1.1.6", "@vue/compiler-sfc": "^3.1.5", "vite": "^2.4.3", "@cypress/vite-dev-server": "^2.0.2", diff --git a/playground/with-tests/public/favicon.ico b/playground/with-tests/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..df36fcfb72584e00488330b560ebcf34a41c64c2 GIT binary patch literal 4286 zc-q~UO-NKx6vyu*Vj+`4)S?!;bXAL*8OO4jfgrOFtOP;wW2`J?iWIaDl9|3-1{t(4 zS0U0O3ZqC{nTsL8l}k73B3CX35*lQf+xfqDUcI^RK2sYf=ncQ&&bjBD|2^m4dGkgH z54|cY1>VK$av}B!A*u*6iLfy3##JubeV8fe8d$HC7-vcgrEjafnfSpp z7pe!Wv!9qDBs0UdLe+kc$lCO?Y}>XT*t8E43pQ4+E$sux?IOl>wcmbTE8EWa3@~=-!5HV* zYV8+@RaHCjHY_`%)v~qDXMizmnl-F)j!pG|{r3{ny4ri69Fwi5d^y18(t~Nvwb|Nx zh>WT|Fcy-Rn*wI-mOhPP!<=Rf8P2t#9R!(}OH)*|iT5OOAW|$B2ye1a;^AJJsDlb^(kr+0->47CAIMSYl0Rmk=YW z&*RS#dFMr~Y(MAMow3o5#=y?#dA|S{!>0Nn7CDehvxX7YZgMJuSC*<)|>2qR-2@}Ny=kqhHQP;qrn{=7X!b} zFUGK84nFo6>?w0HA&@;8$aZ>+b*d+EdxFXhOA>MX{ds~2p>oZ^ohvEHDO z)1gD!|N4Klw61Ji%1p>4U15?clX9`dWU9y{;gJ$yL{^A6$OsVvX(1|7LX?3;AxglM T5Je#2NqB@O!Jnp#S;+nbsq**E literal 0 Hc-jL100001 diff --git a/playground/with-tests/src/App.vue b/playground/with-tests/src/App.vue new file mode 100644 index 00000000..a058d171 --- /dev/null +++ b/playground/with-tests/src/App.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/playground/with-tests/src/assets/logo.png b/playground/with-tests/src/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..f3d2503fc2a44b5053b0837ebea6e87a2d339a43 GIT binary patch literal 6849 zc-nn=2Uru`)-Fh-DT-7nLI?zqPLL8LbRr;4np6QHK!gNH=-p7H_aa>oM5IWQ(2Mk< zh#)O=LF7Za1`yCcc)su4|K8`^GtV=bS!>>R?KOL^wfEYSXal`FbhPZWWMpJ?TAJ#H zr0c->Nli)mtu(93CtcV)HOxGX+#Ef9>@Wy26$iJ62%r|q&Iw_NuygS97(^(Lkx}p> zjmh|RPdE289*UC?SQ^0S2R}M7Y6!cSDti#t`-LY|3Exl zV4#0FWu|KYRCB{1fYM?zqV^J!w}7%xF-d6|S*WZC5JHm0CFH~*5~31Nd1)zm2?+4- z14L>K&oWv!eP^h>BL>vMUB_TwyerQiS zUr{uc_a6)D2&_E@>F$YiLj%ucyN7OGo-h#TpI1P+>+1g7FdF-JN0GWr+}F-sTvALz z9EB492aWYKL^%F;G}hS99U*Rrz`A*1>`CL{$os#V`tQ_pAjunfbvJu26aww3r49p; zG-3`&2YDz|Mpab~t|BWVDI+PVA*~{JOG6H>Dk*adDk%d|m-~mSg~oc?q3sd>aFPFq z3;nNLc{L2e&eIKJ?B?eB&*&LAyLq}{o!#7lYHC11T|0Xu`dq$w-nW0diohVf5e{&S z8w&WRbL5f#!2ua*85KzgY0PDy5RwB@P)RwcoH|rO6)vZyaZ6SP^f%YxKfL(gT$TSX zSDfUG`2RD~|ENgebAJ2pxFreyj(h}~6z&*OT$^&m36YVp-qKQ6G4`GPX6+JZ{mJXW zy4OxCET8S_nl%+|qXOs5GJ=}C)G&BezxecP!7t~Dr5gLW@Dwu)&lQ@hJgm$0;RaDR zn8IIPiUtTJBUPxcH9dZjL=8ap+@-V+=uB|>)^yN#sLROc*s)h2HAL7(Em+UGIai%vd<{Zko6E47Kt9S9thR? zIWagV8hk*&}M3<+`ZJu;CAOs!t(nwHj=f;+H?{g?)FL$xk-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6c|S{7SF(LwNJ25teDYyUrX#YGoI>yM5%T48eG*}K5-y-(co530ouso%Nl0MN zcY6XWRi*iOs}ud#XKA@nIq7xu0V(qOuYcm_?sp6jiy$pp?%af&*rT%?A}1|4>dLg2 zZ505ip)lGIK;A(>g_IlMZowvHzsi!D65HbAz9aFGLE( z2wDOiR&JXzpn}vM#y4#%oiXrt4D1|eUSYZ9L!#eZLNr)Q1-1_dmm1*e6%?WGpKczh zlK?cN9QB{;z|W4Je@gDPPD6Ln&vY-gftbbk1hF6- g1!6qyAfq4?0x&QzG literal 0 Hc-jL100001 diff --git a/playground/with-tests/src/components/HelloWorld.vue b/playground/with-tests/src/components/HelloWorld.vue new file mode 100644 index 00000000..36a089f1 --- /dev/null +++ b/playground/with-tests/src/components/HelloWorld.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/playground/with-tests/src/components/__tests__/HelloWorld.spec.js b/playground/with-tests/src/components/__tests__/HelloWorld.spec.js new file mode 100644 index 00000000..087c9561 --- /dev/null +++ b/playground/with-tests/src/components/__tests__/HelloWorld.spec.js @@ -0,0 +1,22 @@ +import { mount } from '@cypress/vue' +import HelloWorld from '../HelloWorld.vue' + +describe('HelloWorld', () => { + it('playground', () => { + mount(HelloWorld, { props: { msg: 'Hello Cypress' } }) + }) + + it('renders properly', () => { + mount(HelloWorld, { props: { msg: 'Hello Cypress' } }) + cy.get('h1').should('contain', 'Hello Cypress') + }) + + it('adds 1 when clicking the plus button', () => { + mount(HelloWorld, { props: { msg: 'Hello Cypress' } }) + + cy.get('button') + .should('contain', '0') + .click() + .should('contain', '1') + }) +}) diff --git a/playground/with-tests/src/main.js b/playground/with-tests/src/main.js new file mode 100644 index 00000000..01433bca --- /dev/null +++ b/playground/with-tests/src/main.js @@ -0,0 +1,4 @@ +import { createApp } from 'vue' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/playground/with-tests/vite-env.d.ts b/playground/with-tests/vite-env.d.ts new file mode 100644 index 00000000..636d9c3f --- /dev/null +++ b/playground/with-tests/vite-env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import { DefineComponent } from 'vue' + // eslint-disable-next-line + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/playground/with-tests/vite.config.js b/playground/with-tests/vite.config.js new file mode 100644 index 00000000..24c2e504 --- /dev/null +++ b/playground/with-tests/vite.config.js @@ -0,0 +1,12 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue()], + resolve: { + alias: { + '@/': new URL('./src/', import.meta.url).pathname + } + } +}) diff --git a/snapshot.js b/snapshot.js index 06952187..aa65b034 100644 --- a/snapshot.js +++ b/snapshot.js @@ -1,17 +1,48 @@ -import templateList from './utils/templateList.js' import { spawnSync } from 'child_process' -for (const template of templateList) { +const bin = new URL('./index.js', import.meta.url).pathname +const playgroundDir = new URL('./playground/', import.meta.url).pathname + +function createProjectWithFeatureFlags(flags) { + const projectName = flags.join('-') + console.log(`Creating project ${projectName}`) spawnSync( 'node', [ - new URL('./index.js', import.meta.url).pathname, - template, - '--template', - template + bin, + projectName, + ...flags.map(flag => `--${flag}`) ], { - cwd: new URL('./playground/', import.meta.url).pathname + cwd: playgroundDir } ) } + +const featureFlags = [ + 'typescript', + 'jsx', + 'router', + 'vuex', + 'with-tests' +] + +function getCombinations(arr) { + const combinations = [] + + for (let i = 0; i < arr.length; i++) { + for (let j = i; j < arr.length; j++) { + const combination = arr.slice(i, j + 1) + combinations.push(combination) + } + } + + return combinations +} + +const flagCombinations = getCombinations(featureFlags) +flagCombinations.push(['default']) + +for (const flags of flagCombinations) { + createProjectWithFeatureFlags(flags) +} diff --git a/utils/templateList.js b/utils/templateList.js deleted file mode 100644 index 60fe1cd0..00000000 --- a/utils/templateList.js +++ /dev/null @@ -1,5 +0,0 @@ -const templateList = ['default', 'spa'] - .flatMap((x) => [x, x + '-ts']) - .flatMap((x) => [x, x + '-with-tests']) - -export default templateList -- 2.39.5