From ee1539999c1423202f27b05451e4062df2a319a8 Mon Sep 17 00:00:00 2001 From: ZHAO Jinxiang Date: Fri, 31 Dec 2021 22:35:52 +0800 Subject: [PATCH] fix: examples and playground --- .eslintrc => .eslintrc.json | 0 examples/nuxt/components/HelloWorld.vue | 40 ++++----- examples/nuxt/pages/index.vue | 11 +-- examples/nuxt/shims-vue.d.ts | 1 + examples/nuxt/tsconfig.json | 19 ++--- examples/vue-cli/package.json | 6 +- examples/vue-cli/src/App.vue | 8 +- .../vue-cli/src/components/HelloWorld.vue | 12 ++- examples/vue-cli/src/main.ts | 8 +- examples/vue-cli/src/shims-vue.d.ts | 5 +- examples/vue-cli/tsconfig.json | 25 ++---- examples/vue-cli/vue.config.js | 1 + playground/index.html | 2 +- playground/main.ts | 8 -- playground/package.json | 8 +- playground/{ => src}/App.vue | 15 ++-- playground/{ => src}/Async.vue | 0 playground/{ => src}/Bar.vue | 0 playground/{ => src}/Foo.vue | 0 playground/{ => src}/HelloWorld.vue | 41 +++++----- playground/src/main.ts | 9 +++ playground/src/shims-vue.d.ts | 2 + playground/tsconfig.json | 31 +++++++ playground/vite.config.ts | 4 +- pnpm-lock.yaml | 46 ++++++++--- src/nuxt.ts | 5 +- src/rollup.ts | 5 +- src/vite.ts | 5 +- src/webpack.ts | 5 +- test/__snapshots__/transform.test.ts.snap | 81 ++++++++----------- test/transform.test.ts | 2 +- tsconfig.json | 6 +- 32 files changed, 230 insertions(+), 181 deletions(-) rename .eslintrc => .eslintrc.json (100%) create mode 100644 examples/nuxt/shims-vue.d.ts delete mode 100644 playground/main.ts rename playground/{ => src}/App.vue (81%) rename playground/{ => src}/Async.vue (100%) rename playground/{ => src}/Bar.vue (100%) rename playground/{ => src}/Foo.vue (100%) rename playground/{ => src}/HelloWorld.vue (76%) create mode 100644 playground/src/main.ts create mode 100644 playground/src/shims-vue.d.ts create mode 100644 playground/tsconfig.json diff --git a/.eslintrc b/.eslintrc.json similarity index 100% rename from .eslintrc rename to .eslintrc.json diff --git a/examples/nuxt/components/HelloWorld.vue b/examples/nuxt/components/HelloWorld.vue index e873c6d..d6a19a1 100644 --- a/examples/nuxt/components/HelloWorld.vue +++ b/examples/nuxt/components/HelloWorld.vue @@ -1,19 +1,17 @@ - + - - + diff --git a/examples/nuxt/pages/index.vue b/examples/nuxt/pages/index.vue index 8648c5c..6e14f73 100644 --- a/examples/nuxt/pages/index.vue +++ b/examples/nuxt/pages/index.vue @@ -1,13 +1,14 @@ - + diff --git a/examples/nuxt/shims-vue.d.ts b/examples/nuxt/shims-vue.d.ts new file mode 100644 index 0000000..06ef633 --- /dev/null +++ b/examples/nuxt/shims-vue.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/nuxt/tsconfig.json b/examples/nuxt/tsconfig.json index ef822c0..35370a6 100644 --- a/examples/nuxt/tsconfig.json +++ b/examples/nuxt/tsconfig.json @@ -9,27 +9,20 @@ "DOM" ], "esModuleInterop": true, - "skipLibCheck": true, + "skipLibCheck": false, "allowJs": true, "sourceMap": true, "strict": true, "noEmit": true, - "baseUrl": ".", - "paths": { - "~/*": [ - "./*" - ], - "@/*": [ - "./*" - ] - }, "types": [ "@types/node", - "@nuxt/types", - "unplugin-vue2-script-setup/types" + "@nuxt/types" ] }, "exclude": [ "node_modules" - ] + ], + "vueCompilerOptions": { + "experimentalCompatMode": 2 + } } diff --git a/examples/vue-cli/package.json b/examples/vue-cli/package.json index fd42a0f..92e64fc 100644 --- a/examples/vue-cli/package.json +++ b/examples/vue-cli/package.json @@ -7,8 +7,9 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@vue/composition-api": "^1.4.3", "core-js": "^3.20.1", - "vue": "^2.6.11" + "vue": "^2.6.14" }, "devDependencies": { "@vue/cli-plugin-babel": "^4.5.15", @@ -18,5 +19,8 @@ "unplugin-vue2-script-setup": "workspace:*", "vue-template-compiler": "^2.6.14", "vue-tsc": "^0.30.1" + }, + "vueCompilerOptions": { + "experimentalCompatMode": 2 } } diff --git a/examples/vue-cli/src/App.vue b/examples/vue-cli/src/App.vue index 9db9937..aa4ac08 100644 --- a/examples/vue-cli/src/App.vue +++ b/examples/vue-cli/src/App.vue @@ -1,13 +1,11 @@ + - - -