Comparing version 2.0.29 to 2.1.0
@@ -1,2 +0,1 @@ | ||
export declare function run(): void; | ||
export declare function removeEmitGlobalTypes(dts: string): string; | ||
export declare function run(tscPath?: string): void; |
26
index.js
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.run = run; | ||
exports.removeEmitGlobalTypes = removeEmitGlobalTypes; | ||
const runTsc_1 = require("@volar/typescript/lib/quickstart/runTsc"); | ||
const vue = require("@vue/language-core"); | ||
const windowsPathReg = /\\/g; | ||
function run() { | ||
function run(tscPath = require.resolve('typescript/lib/tsc')) { | ||
let runExtensions = ['.vue']; | ||
const extensionsChangedException = new Error('extensions changed'); | ||
const main = () => (0, runTsc_1.runTsc)(require.resolve('typescript/lib/tsc'), runExtensions, (ts, options) => { | ||
const main = () => (0, runTsc_1.runTsc)(tscPath, runExtensions, (ts, options) => { | ||
const { configFilePath } = options.options; | ||
@@ -19,7 +18,14 @@ const vueOptions = typeof configFilePath === 'string' | ||
&& runExtensions.every(ext => allExtensions.includes(ext))) { | ||
const writeFile = options.host.writeFile.bind(options.host); | ||
options.host.writeFile = (fileName, contents, ...args) => { | ||
return writeFile(fileName, removeEmitGlobalTypes(contents), ...args); | ||
}; | ||
const vueLanguagePlugin = vue.createVueLanguagePlugin2(ts, id => id, vue.createRootFileChecker(undefined, () => options.rootNames.map(rootName => rootName.replace(windowsPathReg, '/')), options.host?.useCaseSensitiveFileNames?.() ?? false), options.options, vueOptions); | ||
try { | ||
const rootDir = typeof configFilePath === 'string' | ||
? configFilePath | ||
: options.host?.getCurrentDirectory() ?? ts.sys.getCurrentDirectory(); | ||
const libDir = require.resolve(`${vueOptions.lib}/package.json`, { paths: [rootDir] }) | ||
.slice(0, -'package.json'.length); | ||
const globalTypesPath = `${libDir}__globalTypes_${vueOptions.target}_${vueOptions.strictTemplates}.d.ts`; | ||
const globalTypesContents = vue.generateGlobalTypes(vueOptions.lib, vueOptions.target, vueOptions.strictTemplates); | ||
ts.sys.writeFile(globalTypesPath, globalTypesContents); | ||
} | ||
catch { } | ||
const vueLanguagePlugin = vue.createVueLanguagePlugin(ts, options.options, vueOptions, id => id); | ||
return { languagePlugins: [vueLanguagePlugin] }; | ||
@@ -44,6 +50,2 @@ } | ||
} | ||
const removeEmitGlobalTypesRegexp = /^[^\n]*__VLS_globalTypesStart[\w\W]*__VLS_globalTypesEnd[^\n]*\n?$/mg; | ||
function removeEmitGlobalTypes(dts) { | ||
return dts.replace(removeEmitGlobalTypesRegexp, ''); | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "vue-tsc", | ||
"version": "2.0.29", | ||
"version": "2.1.0", | ||
"license": "MIT", | ||
@@ -19,4 +19,4 @@ "files": [ | ||
"dependencies": { | ||
"@volar/typescript": "~2.4.0-alpha.18", | ||
"@vue/language-core": "2.0.29", | ||
"@volar/typescript": "~2.4.1", | ||
"@vue/language-core": "2.1.0", | ||
"semver": "^7.5.4" | ||
@@ -30,3 +30,3 @@ }, | ||
}, | ||
"gitHead": "49ad9563e6f2677595878a000179dfea83fb910c" | ||
"gitHead": "510063740b90b64caedaee1f0bde70974613a92c" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4860
52
1
+ Added@vue/language-core@2.1.0(transitive)
- Removed@vue/language-core@2.0.29(transitive)
Updated@volar/typescript@~2.4.1
Updated@vue/language-core@2.1.0