Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Sep 4, 2024
1 parent b14b8a9 commit 566d9f6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/component-meta/lib/base.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TypeScriptProjectHost, createLanguageServiceHost, resolveFileLanguageId } from '@volar/typescript';
import * as vue from '@vue/language-core';
import * as path from 'path-browserify';
import { posix as path } from 'path-browserify';
import type * as ts from 'typescript';
import { code as typeHelpersCode } from 'vue-component-type-helpers';
import { code as vue2TypeHelpersCode } from 'vue-component-type-helpers/vue2';
Expand Down
2 changes: 1 addition & 1 deletion packages/language-core/lib/plugins/vue-tsx.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Mapping } from '@volar/language-core';
import { computed } from 'computeds';
import * as path from 'path-browserify';
import { posix as path } from 'path-browserify';
import { generateScript } from '../codegen/script';
import { generateTemplate } from '../codegen/template';
import { parseScriptRanges } from '../parsers/scriptRanges';
Expand Down
8 changes: 4 additions & 4 deletions packages/language-core/lib/utils/ts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { camelize } from '@vue/shared';
import type * as ts from 'typescript';
import * as path from 'path-browserify';
import { posix as path } from 'path-browserify';
import type { RawVueCompilerOptions, VueCompilerOptions, VueLanguagePlugin } from '../types';
import { getAllExtensions } from '../languagePlugin';
import { generateGlobalTypes } from '../codegen/globalTypes';
Expand Down Expand Up @@ -287,14 +287,14 @@ export function setupGlobalTypes(rootDir: string, vueOptions: VueCompilerOptions
}
try {
let dir = rootDir;
while (!host.fileExists(path.resolve(dir, `node_modules/${vueOptions.lib}/package.json`))) {
const parentDir = path.resolve(dir, '..');
while (!host.fileExists(path.posix.join(dir, 'node_modules', vueOptions.lib, 'package.json'))) {
const parentDir = path.posix.dirname(dir);
if (dir === parentDir) {
throw 0;
}
dir = parentDir;
}
const globalTypesPath = path.resolve(dir, `node_modules/.vue-global-types/${vueOptions.lib}_${vueOptions.target}_${vueOptions.strictTemplates}.d.ts`);
const globalTypesPath = path.posix.join(dir, 'node_modules', '.vue-global-types', `${vueOptions.lib}_${vueOptions.target}_${vueOptions.strictTemplates}.d.ts`);
const globalTypesContents = `// @ts-nocheck\nexport {};\n` + generateGlobalTypes(vueOptions.lib, vueOptions.target, vueOptions.strictTemplates);
host.writeFile(globalTypesPath, globalTypesContents);
return true;
Expand Down
2 changes: 1 addition & 1 deletion packages/language-service/lib/plugins/vue-document-drop.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { VueVirtualCode, forEachEmbeddedCode } from '@vue/language-core';
import { camelize, capitalize, hyphenate } from '@vue/shared';
import * as path from 'path-browserify';
import { posix as path } from 'path-browserify';
import { getUserPreferences } from 'volar-service-typescript/lib/configs/getUserPreferences';
import type * as vscode from 'vscode-languageserver-protocol';
import { URI } from 'vscode-uri';
Expand Down

0 comments on commit 566d9f6

Please sign in to comment.