diff --git a/.eslintignore b/.eslintignore index de4d1f0..8704933 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ dist node_modules +*.vue diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 054e238..88725e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,13 +8,15 @@ on: jobs: release: runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - uses: actions/setup-node@v2 with: - node-version: '14' + node-version: lts/* registry-url: https://registry.npmjs.org/ - run: npm i -g pnpm @antfu/ni - run: nci diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3bf87ec..fde9231 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - node: [14.x] + node: [18.x] os: [ubuntu-latest, windows-latest, macos-latest] fail-fast: false @@ -31,7 +31,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ matrix.node }} - cache: "pnpm" + cache: pnpm - uses: actions/checkout@v2 diff --git a/.npmrc b/.npmrc index 84342cc..0483dfa 100644 --- a/.npmrc +++ b/.npmrc @@ -1,3 +1,2 @@ -shamefully-hoist=true ignore-workspace-root-check=true strict-peer-dependencies=false diff --git a/README.md b/README.md index ed25f76..91f4c1d 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ npm i -D @vue/cli-plugin-typescript vue-tsc ```ts const ScriptSetup = require('unplugin-vue2-script-setup/webpack').default + module.exports = { parallel: false, configureWebpack: { @@ -113,6 +114,7 @@ And then use [`vue-tsc`](https://github.com/johnsoncodehk/volar) to do the type ```ts // webpack.config.js const ScriptSetup = require('unplugin-vue2-script-setup/webpack').default + module.exports = { /* ... */ plugins: [ @@ -148,6 +150,7 @@ export default { // esbuild.config.js import { build } from 'esbuild' import ScriptSetup from 'unplugin-vue2-script-setup/esbuild' + build({ /* ... */ plugins: [ @@ -230,11 +233,11 @@ Volar preferentially supports Vue 3. Vue 3 and Vue 2 template has some different ```jsonc { "compilerOptions": { - ... + // ... }, "vueCompilerOptions": { - "experimentalCompatMode": 2 - }, + "target": 2 + } } ``` diff --git a/esbuild.d.ts b/esbuild.d.ts index c882474..c7f713d 100644 --- a/esbuild.d.ts +++ b/esbuild.d.ts @@ -1,2 +1 @@ -import './shims' export { default } from './dist/esbuild' diff --git a/examples/vue-cli/package.json b/examples/vue-cli/package.json index a43fd6e..1d7fe0d 100644 --- a/examples/vue-cli/package.json +++ b/examples/vue-cli/package.json @@ -8,17 +8,17 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "@vue/composition-api": "^1.6.2", - "core-js": "^3.22.7", + "@vue/composition-api": "^1.7.1", + "core-js": "^3.32.0", "vue": "~2.6.14" }, "devDependencies": { - "@vue/cli-plugin-babel": "^5.0.4", - "@vue/cli-plugin-typescript": "^5.0.4", - "@vue/cli-service": "^5.0.4", - "typescript": "^4.7.4", + "@vue/cli-plugin-babel": "^5.0.8", + "@vue/cli-plugin-typescript": "^5.0.8", + "@vue/cli-service": "^5.0.8", + "typescript": "^5.1.6", "unplugin-vue2-script-setup": "workspace:*", "vue-template-compiler": "~2.6.14", - "vue-tsc": "^0.38.1" + "vue-tsc": "^1.8.8" } } diff --git a/examples/vue-cli/vue.config.cjs b/examples/vue-cli/vue.config.cjs index 1503cd4..cfe8aca 100644 --- a/examples/vue-cli/vue.config.cjs +++ b/examples/vue-cli/vue.config.cjs @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ - const { defineConfig } = require('@vue/cli-service') const ScriptSetup = require('unplugin-vue2-script-setup/webpack').default diff --git a/index.d.ts b/index.d.ts index cc8b2ef..5437e96 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,2 +1 @@ -import './shims' export { default } from './dist/index' diff --git a/jest.js b/jest.js index dcd4584..802eaa6 100644 --- a/jest.js +++ b/jest.js @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ const { transform } = require('./dist/index') function requireVueJest() { diff --git a/nuxt.d.ts b/nuxt.d.ts index b08cd2c..3a5fdb3 100644 --- a/nuxt.d.ts +++ b/nuxt.d.ts @@ -1,2 +1 @@ -import './shims' export { default } from './dist/nuxt' diff --git a/package.json b/package.json index d2e63ae..b8157d3 100644 --- a/package.json +++ b/package.json @@ -1,69 +1,62 @@ { "name": "unplugin-vue2-script-setup", - "version": "0.11.3", - "packageManager": "pnpm@7.5.0", + "version": "0.11.4", + "packageManager": "pnpm@8.6.11", "description": "Bring