Socket
Socket
Sign inDemoInstall

vue-tsc

Package Overview
Dependencies
Maintainers
1
Versions
310
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-tsc - npm Package Compare versions

Comparing version 1.6.5 to 1.8.24

23

bin/vue-tsc.js

@@ -24,7 +24,22 @@ #!/usr/bin/env node

if (semver.gt(tsPkg.version, '5.0.0')) {
tryReplace(`for (const existingRoot of buildInfoVersionMap.roots) {`, `for (const existingRoot of buildInfoVersionMap.roots
.filter(file => !file.toLowerCase().includes('__vls_'))
.map(file => file.replace(/\.vue\.(j|t)sx?$/i, '.vue'))
) {`);
tryReplace(
`for (const existingRoot of buildInfoVersionMap.roots) {`,
`for (const existingRoot of buildInfoVersionMap.roots
.filter(file => !file.toLowerCase().includes('__vls_'))
.map(file => file.replace(/\.vue\.(j|t)sx?$/i, '.vue'))
) {`
);
tryReplace(
`return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];`,
`return [toFileId(key), toFileIdListId(new Set(arrayFrom(state.exportedModulesMap.getValues(key)).filter(file => file !== void 0)))];`
);
}
if (semver.gte(tsPkg.version, '5.0.4')) {
tryReplace(
`return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);`,
s => `buildInfo.program.fileNames = buildInfo.program.fileNames
.filter(file => !file.toLowerCase().includes('__vls_'))
.map(file => file.replace(/\.vue\.(j|t)sx?$/i, '.vue'));\n` + s
);
}

@@ -31,0 +46,0 @@ return tsc;

12

out/index.d.ts

@@ -1,4 +0,3 @@

import * as ts from 'typescript';
import * as vue from '@volar/vue-language-core';
import * as vueTs from '@volar/vue-typescript';
import type * as ts from 'typescript/lib/tsserverlibrary';
import * as vue from '@vue/language-core';
export type Hook = (program: _Program) => void;

@@ -11,6 +10,9 @@ export type _Program = ts.Program & {

options: ts.CreateProgramOptions;
languageServiceHost: vue.VueLanguageServiceHost;
languageService: ReturnType<typeof vueTs.createLanguageService>;
languageHost: vue.TypeScriptLanguageHost;
vueCompilerOptions: Partial<vue.VueCompilerOptions>;
langaugeContext: vue.LanguageContext;
languageService: ts.LanguageService;
}
export declare function createProgram(options: ts.CreateProgramOptions): _Program;
export {};
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createProgram = void 0;
const ts = require("typescript");
const vue = require("@volar/vue-language-core");
const vueTs = require("@volar/vue-typescript");
const vue = require("@vue/language-core");
const volarTs = require("@volar/typescript");
const shared_1 = require("./shared");
const windowsPathReg = /\\/g;
function createProgram(options) {

@@ -17,2 +17,3 @@ if (!options.options.noEmit && !options.options.emitDeclarationOnly)

throw toThrow('!options.host');
const ts = require('typescript');
let program = options.oldProgram;

@@ -27,26 +28,24 @@ if (shared_1.state.hook) {

options,
get languageServiceHost() {
return vueLsHost;
get languageHost() {
return languageHost;
},
get vueCompilerOptions() {
return vueCompilerOptions;
},
get languageService() {
return vueTsLs;
},
get langaugeContext() {
return languageContext;
},
};
const vueCompilerOptions = getVueCompilerOptions();
const scripts = new Map();
const vueLsHost = new Proxy({
// avoid failed with tsc built-in fileExists
resolveModuleNames: undefined,
resolveModuleNameLiterals: undefined,
writeFile: (fileName, content) => {
if (fileName.indexOf('__VLS_') === -1) {
ctx.options.host.writeFile(fileName, content, false);
}
},
const languageHost = {
workspacePath: ctx.options.host.getCurrentDirectory().replace(windowsPathReg, '/'),
rootPath: ctx.options.host.getCurrentDirectory().replace(windowsPathReg, '/'),
getCompilationSettings: () => ctx.options.options,
getVueCompilationSettings: () => vueCompilerOptions,
getScriptFileNames: () => {
return ctx.options.rootNames;
},
getScriptVersion,
getScriptSnapshot,

@@ -57,13 +56,9 @@ getProjectVersion: () => {

getProjectReferences: () => ctx.options.projectReferences,
isTsc: true,
}, {
get: (target, property) => {
if (property in target) {
return target[property];
}
return ctx.options.host[property];
},
});
const vueTsLs = vueTs.createLanguageService(vueLsHost);
program = vueTsLs.getProgram();
getCancellationToken: ctx.options.host.getCancellationToken ? () => ctx.options.host.getCancellationToken() : undefined,
};
const languageContext = vue.createLanguageContext(languageHost, vue.createLanguages(ts, languageHost.getCompilationSettings(), vueCompilerOptions));
const languageServiceHost = volarTs.createLanguageServiceHost(languageContext, ts, ts.sys);
const vueTsLs = ts.createLanguageService(languageServiceHost, volarTs.getDocumentRegistry(ts, ts.sys.useCaseSensitiveFileNames, languageHost.workspacePath));
volarTs.decorateLanguageService(languageContext.virtualFiles, vueTsLs, false);
program = volarTs.getProgram(ts, languageContext, vueTsLs, ts.sys);
program.__vue = ctx;

@@ -73,9 +68,6 @@ function getVueCompilerOptions() {

if (typeof tsConfig === 'string') {
return vue.createParsedCommandLine(ts, ts.sys, tsConfig, []).vueOptions;
return vue.createParsedCommandLine(ts, ts.sys, tsConfig.replace(windowsPathReg, '/')).vueOptions;
}
return {};
}
function getScriptVersion(fileName) {
return getScript(fileName)?.version ?? '';
}
function getScriptSnapshot(fileName) {

@@ -113,4 +105,4 @@ return getScript(fileName)?.scriptSnapshot;

}
const vueCompilerOptions = program.__vue.languageServiceHost.getVueCompilationSettings();
if (vueCompilerOptions.hooks) {
const vueCompilerOptions = program.__vue.vueCompilerOptions;
if (vueCompilerOptions?.hooks) {
const index = (shared_1.state.hook?.index ?? -1) + 1;

@@ -117,0 +109,0 @@ if (index < vueCompilerOptions.hooks.length) {

@@ -9,1 +9,2 @@ import type { _Program } from './index';

};
//# sourceMappingURL=shared.d.ts.map
{
"name": "vue-tsc",
"version": "1.6.5",
"version": "1.8.24",
"main": "out/index.js",

@@ -14,3 +14,3 @@ "license": "MIT",

"url": "https://github.com/vuejs/language-tools.git",
"directory": "packages/vue-tsc"
"directory": "packages/tsc"
},

@@ -21,5 +21,5 @@ "bin": {

"dependencies": {
"@volar/vue-language-core": "1.6.5",
"@volar/vue-typescript": "1.6.5",
"semver": "^7.3.8"
"@volar/typescript": "~1.11.1",
"@vue/language-core": "1.8.24",
"semver": "^7.5.4"
},

@@ -29,3 +29,6 @@ "peerDependencies": {

},
"gitHead": "d9f0c995e254bd0a3acf910c6a766aabd56792a7"
"devDependencies": {
"@types/node": "latest"
},
"gitHead": "6f850196d6b9cd1bee62104d3d92867cf0b6777e"
}

@@ -7,3 +7,3 @@ # vue-tsc

Vue 3 command line Type-Checking tool base on IDE plugin [Volar](https://github.com/johnsoncodehk/volar).
Vue 3 command line Type-Checking tool base on IDE plugin [Volar](https://github.com/vuejs/language-tools).

@@ -29,3 +29,3 @@ Roadmap:

Check out https://github.com/johnsoncodehk/volar/discussions/640#discussioncomment-1555479 for example repo.
Check out https://github.com/vuejs/language-tools/discussions/640#discussioncomment-1555479 for example repo.

@@ -32,0 +32,0 @@ ## Sponsors

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc