vue-component-meta
Advanced tools
Comparing version 2.1.2 to 2.1.4
@@ -59,3 +59,6 @@ "use strict"; | ||
}; | ||
const vueLanguagePlugin = vue.createVueLanguagePlugin(ts, projectHost.getCompilationSettings(), commandLine.vueOptions, id => id); | ||
const vueLanguagePlugin = vue.createVueLanguagePlugin(ts, projectHost.getCompilationSettings(), { | ||
...commandLine.vueOptions, | ||
__setupedGlobalTypes: () => true, | ||
}, id => id); | ||
const language = vue.createLanguage([ | ||
@@ -100,8 +103,22 @@ vueLanguagePlugin, | ||
const tsLs = ts.createLanguageService(languageServiceHost); | ||
const directoryExists = languageServiceHost.directoryExists?.bind(languageServiceHost); | ||
const fileExists = languageServiceHost.fileExists.bind(languageServiceHost); | ||
const getScriptSnapshot = languageServiceHost.getScriptSnapshot.bind(languageServiceHost); | ||
const globalTypesName = `__globalTypes_${commandLine.vueOptions.target}_${commandLine.vueOptions.strictTemplates}.d.ts`; | ||
const snapshots = new Map(); | ||
const globalTypesName = `${commandLine.vueOptions.lib}_${commandLine.vueOptions.target}_${commandLine.vueOptions.strictTemplates}.d.ts`; | ||
const globalTypesContents = vue.generateGlobalTypes('global', commandLine.vueOptions.lib, commandLine.vueOptions.target, commandLine.vueOptions.strictTemplates); | ||
const globalTypesSnapshot = { | ||
getText: (start, end) => globalTypesContents.substring(start, end), | ||
getLength: () => globalTypesContents.length, | ||
getChangeRange: () => undefined, | ||
}; | ||
if (directoryExists) { | ||
languageServiceHost.directoryExists = path => { | ||
if (path.endsWith('.vue-global-types')) { | ||
return true; | ||
} | ||
return directoryExists(path); | ||
}; | ||
} | ||
languageServiceHost.fileExists = path => { | ||
if (path.endsWith(globalTypesName)) { | ||
if (path.endsWith(`.vue-global-types/${globalTypesName}`) || path.endsWith(`.vue-global-types\\${globalTypesName}`)) { | ||
return true; | ||
@@ -112,12 +129,4 @@ } | ||
languageServiceHost.getScriptSnapshot = path => { | ||
if (path.endsWith(globalTypesName)) { | ||
if (!snapshots.has(path)) { | ||
const contents = vue.generateGlobalTypes(commandLine.vueOptions.lib, commandLine.vueOptions.target, commandLine.vueOptions.strictTemplates); | ||
snapshots.set(path, { | ||
getText: (start, end) => contents.substring(start, end), | ||
getLength: () => contents.length, | ||
getChangeRange: () => undefined, | ||
}); | ||
} | ||
return snapshots.get(path); | ||
if (path.endsWith(`.vue-global-types/${globalTypesName}`) || path.endsWith(`.vue-global-types\\${globalTypesName}`)) { | ||
return globalTypesSnapshot; | ||
} | ||
@@ -124,0 +133,0 @@ return getScriptSnapshot(path); |
{ | ||
"name": "vue-component-meta", | ||
"version": "2.1.2", | ||
"version": "2.1.4", | ||
"license": "MIT", | ||
@@ -16,5 +16,5 @@ "files": [ | ||
"@volar/typescript": "~2.4.1", | ||
"@vue/language-core": "2.1.2", | ||
"@vue/language-core": "2.1.4", | ||
"path-browserify": "^1.0.1", | ||
"vue-component-type-helpers": "2.1.2" | ||
"vue-component-type-helpers": "2.1.4" | ||
}, | ||
@@ -33,3 +33,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "4e4b839ea20ae11a2aef7ee9206465cb60a4be53" | ||
"gitHead": "5e197d08eaef57209ff2927c943ba1db3bf4eff6" | ||
} |
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
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
43826
907
+ Added@vue/language-core@2.1.4(transitive)
+ Addedvue-component-type-helpers@2.1.4(transitive)
- Removed@vue/language-core@2.1.2(transitive)
- Removedvue-component-type-helpers@2.1.2(transitive)
Updated@vue/language-core@2.1.4