unjs / mkdist

Lightweight file-to-file transpiler.
MIT License
367 stars 25 forks source link

Not compatible with vue-tsc 2.1.2 #239

Closed Teages closed 2 months ago

Teages commented 2 months ago

Environment

{
  "devDependencies": {
    "@types/node": "^20",
    "mkdist": "^1.5.4",
    "tsx": "^4.19.0",
    "vue-tsc": "^2.1.2"
  }
}

Reproduction

https://github.com/Teages/mkdist-vue-tools-2-1

Describe the bug

vue-tsc (or vue/language-tools) makes a lot of break changes in the last minor version, they removed some functions which mkdist depends on to generate dts.

If the package manager selected vue-tsc >= 2.1.0. their build will break with error:

<~>\mkdist-vue-tools-2-1\node_modules\.pnpm\@vue+language-core@2.1.2_typescript@5.5.4\node_modules\@vue\language-core\lib\plugins.js:48
        ...pluginContext.vueCompilerOptions.plugins,
                                            ^

TypeError: pluginContext.vueCompilerOptions.plugins is not iterable
    at createPlugins (D:\Documents\GitHub\mkdist-vue-tools-2-1\node_modules\.pnpm\@vue+language-core@2.1.2_typescript@5.5.4\node_modules\@vue\language-core\lib\plugins.js:48:45)
    at Object.createVueLanguagePlugin (D:\Documents\GitHub\mkdist-vue-tools-2-1\node_modules\.pnpm\@vue+language-core@2.1.2_typescript@5.5.4\node_modules\@vue\language-core\lib\languagePlugin.js:52:49)
    at <anonymous> (D:\Documents\GitHub\mkdist-vue-tools-2-1\node_modules\.pnpm\mkdist@1.5.4_typescript@5.5.4_vue-tsc@2.1.2_typescript@5.5.4_\node_modules\mkdist\dist\index.mjs:423:49)
    at Object.apply (D:\Documents\GitHub\mkdist-vue-tools-2-1\node_modules\.pnpm\@volar+typescript@2.4.1\node_modules\@volar\typescript\lib\node\proxyCreateProgram.js:50:33)
    at emitVueTscV2 (D:\Documents\GitHub\mkdist-vue-tools-2-1\node_modules\.pnpm\mkdist@1.5.4_typescript@5.5.4_vue-tsc@2.1.2_typescript@5.5.4_\node_modules\mkdist\dist\index.mjs:442:19)
    at getVueDeclarations (D:\Documents\GitHub\mkdist-vue-tools-2-1\node_modules\.pnpm\mkdist@1.5.4_typescript@5.5.4_vue-tsc@2.1.2_typescript@5.5.4_\node_modules\mkdist\dist\index.mjs:345:7)
    at mkdist (D:\Documents\GitHub\mkdist-vue-tools-2-1\node_modules\.pnpm\mkdist@1.5.4_typescript@5.5.4_vue-tsc@2.1.2_typescript@5.5.4_\node_modules\mkdist\dist\index.mjs:508:35)
    at <anonymous> (D:\Documents\GitHub\mkdist-vue-tools-2-1\index.ts:6:26)

Additional context

I will make a pr to fix this :)

Logs

No response