@@ -6,31 +6,30 @@ import { computedFiles } from './computedFiles';
6
6
import { computedMappings } from './computedMappings' ;
7
7
import { computedSfc } from './computedSfc' ;
8
8
import { computedVueSfc } from './computedVueSfc' ;
9
- import { Signal , computed , signal } from 'computeds' ;
9
+ import { Signal , signal } from 'computeds' ;
10
10
11
11
const jsxReg = / ^ \. ( j s | t s ) x ? $ / ;
12
12
13
13
export class VueFile implements VirtualFile {
14
14
15
15
// sources
16
16
17
- __snapshot : Signal < ts . IScriptSnapshot > ;
17
+ _snapshot : Signal < ts . IScriptSnapshot > ;
18
18
19
19
// computeds
20
20
21
- _snapshot = computed ( ( ) => this . __snapshot ( ) ) ;
22
- vueSfc = computedVueSfc ( this . plugins , this . fileName , this . _snapshot ) ;
23
- sfc = computedSfc ( this . ts , this . plugins , this . fileName , this . _snapshot , this . vueSfc ) ;
24
- _mappings = computedMappings ( this . _snapshot , this . sfc ) ;
25
- _embeddedFiles = computedFiles ( this . plugins , this . fileName , this . sfc , this . codegenStack ) ;
21
+ getVueSfc = computedVueSfc ( this . plugins , this . fileName , ( ) => this . _snapshot ( ) ) ;
22
+ sfc = computedSfc ( this . ts , this . plugins , this . fileName , ( ) => this . _snapshot ( ) , this . getVueSfc ) ;
23
+ getMappings = computedMappings ( ( ) => this . _snapshot ( ) , this . sfc ) ;
24
+ getMmbeddedFiles = computedFiles ( this . plugins , this . fileName , this . sfc , this . codegenStack ) ;
26
25
27
26
// others
28
27
29
28
capabilities = FileCapabilities . full ;
30
29
kind = FileKind . TextFile ;
31
30
codegenStacks : Stack [ ] = [ ] ;
32
31
get embeddedFiles ( ) {
33
- return this . _embeddedFiles ( ) ;
32
+ return this . getMmbeddedFiles ( ) ;
34
33
}
35
34
get mainScriptName ( ) {
36
35
let res : string = '' ;
@@ -45,7 +44,7 @@ export class VueFile implements VirtualFile {
45
44
return this . _snapshot ( ) ;
46
45
}
47
46
get mappings ( ) {
48
- return this . _mappings ( ) ;
47
+ return this . getMappings ( ) ;
49
48
}
50
49
51
50
constructor (
@@ -56,10 +55,10 @@ export class VueFile implements VirtualFile {
56
55
public ts : typeof import ( 'typescript/lib/tsserverlibrary' ) ,
57
56
public codegenStack : boolean ,
58
57
) {
59
- this . __snapshot = signal ( initSnapshot ) ;
58
+ this . _snapshot = signal ( initSnapshot ) ;
60
59
}
61
60
62
61
update ( newSnapshot : ts . IScriptSnapshot ) {
63
- this . __snapshot . set ( newSnapshot ) ;
62
+ this . _snapshot . set ( newSnapshot ) ;
64
63
}
65
64
}
0 commit comments