Skip to content

Commit 08a5af5

Browse files
committed
refactor(language-core): move utils/ts.ts to compilerOptions.ts
1 parent 99264b1 commit 08a5af5

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

packages/language-core/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
export * from './lib/codegen/globalTypes';
22
export * from './lib/codegen/template';
3+
export * from './lib/compilerOptions';
34
export * from './lib/languagePlugin';
45
export * from './lib/parsers/scriptSetupRanges';
56
export * from './lib/plugins';
67
export * from './lib/types';
78
export * from './lib/utils/collectBindings';
89
export * from './lib/utils/parseSfc';
910
export * from './lib/utils/shared';
10-
export * from './lib/utils/ts';
1111
export * from './lib/virtualFile/vueFile';
1212

1313
export { tsCodegen } from './lib/plugins/vue-tsx';

packages/language-core/lib/utils/ts.ts renamed to packages/language-core/lib/compilerOptions.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { camelize, NOOP as noop } from '@vue/shared';
22
import { posix as path } from 'path-browserify';
33
import type * as ts from 'typescript';
4-
import { generateGlobalTypes, getGlobalTypesFileName } from '../codegen/globalTypes';
5-
import type { RawVueCompilerOptions, VueCompilerOptions, VueLanguagePlugin } from '../types';
6-
import { hyphenateTag } from './shared';
4+
import { generateGlobalTypes, getGlobalTypesFileName } from './codegen/globalTypes';
5+
import type { RawVueCompilerOptions, VueCompilerOptions, VueLanguagePlugin } from './types';
6+
import { hyphenateTag } from './utils/shared';
77

88
interface ParseConfigHost extends Omit<ts.ParseConfigHost, 'readDirectory'> {}
99

@@ -107,7 +107,6 @@ export function createParsedCommandLine(
107107
}
108108

109109
export class CompilerOptionsResolver {
110-
configRoots = new Set<string>();
111110
options: Omit<RawVueCompilerOptions, 'target' | 'globalTypesPath' | 'plugins'> = {};
112111
target: number | undefined;
113112
globalTypesPath: string | undefined;
@@ -118,7 +117,6 @@ export class CompilerOptionsResolver {
118117
) {}
119118

120119
addConfig(options: RawVueCompilerOptions, rootDir: string) {
121-
this.configRoots.add(rootDir);
122120
for (const key in options) {
123121
switch (key) {
124122
case 'target':

packages/language-core/lib/plugins/vue-tsx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { computed } from 'alien-signals';
33
import * as path from 'path-browserify';
44
import { generateScript } from '../codegen/script';
55
import { generateTemplate } from '../codegen/template';
6+
import { CompilerOptionsResolver } from '../compilerOptions';
67
import { parseScriptRanges } from '../parsers/scriptRanges';
78
import { parseScriptSetupRanges } from '../parsers/scriptSetupRanges';
89
import { parseVueCompilerOptions } from '../parsers/vueCompilerOptions';
910
import type { Sfc, VueLanguagePlugin } from '../types';
1011
import { computedSet } from '../utils/signals';
11-
import { CompilerOptionsResolver } from '../utils/ts';
1212

1313
export const tsCodegen = new WeakMap<Sfc, ReturnType<typeof createTsx>>();
1414

0 commit comments

Comments
 (0)