vite-plugin-dts 4.1.1 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -19
- package/dist/index.mjs +6 -20
- package/package.json +5 -6
package/dist/index.cjs
CHANGED
|
@@ -9,7 +9,6 @@ const node_os = require('node:os');
|
|
|
9
9
|
const languageCore = require('@vue/language-core');
|
|
10
10
|
const typescript = require('@volar/typescript');
|
|
11
11
|
const ts = require('typescript');
|
|
12
|
-
const vueTsc = require('vue-tsc');
|
|
13
12
|
const localPkg = require('local-pkg');
|
|
14
13
|
const pluginutils = require('@rollup/pluginutils');
|
|
15
14
|
const debug = require('debug');
|
|
@@ -283,22 +282,11 @@ const hasVue = !!tryGetPackageInfo("vue");
|
|
|
283
282
|
const _createProgram = !hasVue ? ts__default.createProgram : typescript.proxyCreateProgram(ts__default, ts__default.createProgram, (ts2, options) => {
|
|
284
283
|
const { configFilePath } = options.options;
|
|
285
284
|
const vueOptions = typeof configFilePath === "string" ? languageCore.createParsedCommandLine(ts2, ts2.sys, configFilePath.replace(/\\/g, "/")).vueOptions : languageCore.resolveVueCompilerOptions({});
|
|
286
|
-
|
|
287
|
-
const writeFile = options.host.writeFile.bind(options.host);
|
|
288
|
-
options.host.writeFile = (fileName, contents, ...args) => {
|
|
289
|
-
return writeFile(fileName, vueTsc.removeEmitGlobalTypes(contents), ...args);
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
const vueLanguagePlugin = languageCore.createVueLanguagePlugin2(
|
|
285
|
+
const vueLanguagePlugin = languageCore.createVueLanguagePlugin(
|
|
293
286
|
ts2,
|
|
294
|
-
(id) => id,
|
|
295
|
-
languageCore.createRootFileChecker(
|
|
296
|
-
void 0,
|
|
297
|
-
() => options.rootNames.map((rootName) => rootName.replace(/\\/g, "/")),
|
|
298
|
-
options.host?.useCaseSensitiveFileNames?.() ?? false
|
|
299
|
-
),
|
|
300
287
|
options.options,
|
|
301
|
-
vueOptions
|
|
288
|
+
vueOptions,
|
|
289
|
+
(id) => id
|
|
302
290
|
);
|
|
303
291
|
return [vueLanguagePlugin];
|
|
304
292
|
});
|
|
@@ -310,9 +298,7 @@ const createProgram = !hasVue ? ts__default.createProgram : (options) => {
|
|
|
310
298
|
return emit(
|
|
311
299
|
targetSourceFile,
|
|
312
300
|
(fileName, data, writeByteOrderMark, onError, sourceFiles) => {
|
|
313
|
-
if (fileName.endsWith(".d.ts"))
|
|
314
|
-
data = vueTsc.removeEmitGlobalTypes(data);
|
|
315
|
-
}
|
|
301
|
+
if (fileName.endsWith(".d.ts")) ;
|
|
316
302
|
return writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles);
|
|
317
303
|
},
|
|
318
304
|
cancellationToken,
|
|
@@ -475,7 +461,7 @@ function VueResolver() {
|
|
|
475
461
|
program.emit(
|
|
476
462
|
sourceFile,
|
|
477
463
|
(path, content) => {
|
|
478
|
-
outputs.push({ path, content
|
|
464
|
+
outputs.push({ path, content });
|
|
479
465
|
},
|
|
480
466
|
void 0,
|
|
481
467
|
true
|
package/dist/index.mjs
CHANGED
|
@@ -9,10 +9,9 @@ import { relative, posix, resolve as resolve$1, isAbsolute, dirname, normalize,
|
|
|
9
9
|
import { existsSync, readdirSync, lstatSync, rmdirSync } from 'node:fs';
|
|
10
10
|
import { readFile, mkdir, writeFile, unlink } from 'node:fs/promises';
|
|
11
11
|
import { cpus } from 'node:os';
|
|
12
|
-
import { createParsedCommandLine, resolveVueCompilerOptions,
|
|
12
|
+
import { createParsedCommandLine, resolveVueCompilerOptions, createVueLanguagePlugin } from '@vue/language-core';
|
|
13
13
|
import { proxyCreateProgram } from '@volar/typescript';
|
|
14
14
|
import ts from 'typescript';
|
|
15
|
-
import { removeEmitGlobalTypes } from 'vue-tsc';
|
|
16
15
|
import { getPackageInfoSync, resolveModule } from 'local-pkg';
|
|
17
16
|
import { createFilter } from '@rollup/pluginutils';
|
|
18
17
|
import debug from 'debug';
|
|
@@ -280,22 +279,11 @@ const hasVue = !!tryGetPackageInfo("vue");
|
|
|
280
279
|
const _createProgram = !hasVue ? ts.createProgram : proxyCreateProgram(ts, ts.createProgram, (ts2, options) => {
|
|
281
280
|
const { configFilePath } = options.options;
|
|
282
281
|
const vueOptions = typeof configFilePath === "string" ? createParsedCommandLine(ts2, ts2.sys, configFilePath.replace(/\\/g, "/")).vueOptions : resolveVueCompilerOptions({});
|
|
283
|
-
|
|
284
|
-
const writeFile = options.host.writeFile.bind(options.host);
|
|
285
|
-
options.host.writeFile = (fileName, contents, ...args) => {
|
|
286
|
-
return writeFile(fileName, removeEmitGlobalTypes(contents), ...args);
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
const vueLanguagePlugin = createVueLanguagePlugin2(
|
|
282
|
+
const vueLanguagePlugin = createVueLanguagePlugin(
|
|
290
283
|
ts2,
|
|
291
|
-
(id) => id,
|
|
292
|
-
createRootFileChecker(
|
|
293
|
-
void 0,
|
|
294
|
-
() => options.rootNames.map((rootName) => rootName.replace(/\\/g, "/")),
|
|
295
|
-
options.host?.useCaseSensitiveFileNames?.() ?? false
|
|
296
|
-
),
|
|
297
284
|
options.options,
|
|
298
|
-
vueOptions
|
|
285
|
+
vueOptions,
|
|
286
|
+
(id) => id
|
|
299
287
|
);
|
|
300
288
|
return [vueLanguagePlugin];
|
|
301
289
|
});
|
|
@@ -307,9 +295,7 @@ const createProgram = !hasVue ? ts.createProgram : (options) => {
|
|
|
307
295
|
return emit(
|
|
308
296
|
targetSourceFile,
|
|
309
297
|
(fileName, data, writeByteOrderMark, onError, sourceFiles) => {
|
|
310
|
-
if (fileName.endsWith(".d.ts"))
|
|
311
|
-
data = removeEmitGlobalTypes(data);
|
|
312
|
-
}
|
|
298
|
+
if (fileName.endsWith(".d.ts")) ;
|
|
313
299
|
return writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles);
|
|
314
300
|
},
|
|
315
301
|
cancellationToken,
|
|
@@ -472,7 +458,7 @@ function VueResolver() {
|
|
|
472
458
|
program.emit(
|
|
473
459
|
sourceFile,
|
|
474
460
|
(path, content) => {
|
|
475
|
-
outputs.push({ path, content
|
|
461
|
+
outputs.push({ path, content });
|
|
476
462
|
},
|
|
477
463
|
void 0,
|
|
478
464
|
true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-dts",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"packageManager": "pnpm@9.9.0",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,16 +58,15 @@
|
|
|
58
58
|
"url": "https://github.com/qmhc/vite-plugin-dts/issues"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@microsoft/api-extractor": "7.47.
|
|
61
|
+
"@microsoft/api-extractor": "7.47.7",
|
|
62
62
|
"@rollup/pluginutils": "^5.1.0",
|
|
63
|
-
"@volar/typescript": "^2.
|
|
64
|
-
"@vue/language-core": "2.
|
|
63
|
+
"@volar/typescript": "^2.4.4",
|
|
64
|
+
"@vue/language-core": "2.1.6",
|
|
65
65
|
"compare-versions": "^6.1.1",
|
|
66
66
|
"debug": "^4.3.6",
|
|
67
67
|
"kolorist": "^1.8.0",
|
|
68
68
|
"local-pkg": "^0.5.0",
|
|
69
|
-
"magic-string": "^0.30.11"
|
|
70
|
-
"vue-tsc": "2.0.29"
|
|
69
|
+
"magic-string": "^0.30.11"
|
|
71
70
|
},
|
|
72
71
|
"devDependencies": {
|
|
73
72
|
"@commitlint/cli": "^19.3.0",
|