File tree Expand file tree Collapse file tree 4 files changed +10
-32
lines changed
packages/utils/src/transformers/vue Expand file tree Collapse file tree 4 files changed +10
-32
lines changed Original file line number Diff line number Diff line change 44
44
"@shikijs/themes" : " ^3.4.0" ,
45
45
"@unocss/reset" : " ^66.1.1" ,
46
46
"@velin-dev/core" : " workspace:^" ,
47
+ "@velin-dev/utils" : " workspace:^" ,
47
48
"@velin-dev/vue" : " workspace:^" ,
48
49
"@vitejs/plugin-vue" : " ^5.2.4" ,
49
50
"@volar/jsdelivr" : " ^2.4.13" ,
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import type {
10
10
import type { OutputModes } from '../../types/vue-repl'
11
11
import type { ImportMap } from './import-map'
12
12
13
+ import { File as VueFile } from '@velin-dev/utils/transformers/vue'
13
14
import {
14
15
computed ,
15
16
reactive ,
@@ -28,6 +29,10 @@ import { compileFile } from './transform'
28
29
export const importMapFile = 'import-map.json'
29
30
export const tsconfigFile = 'tsconfig.json'
30
31
32
+ export class File extends VueFile {
33
+ editorViewState : editor . ICodeEditorViewState | null = null
34
+ }
35
+
31
36
export function useStore (
32
37
{
33
38
files = ref ( Object . create ( null ) ) ,
@@ -505,38 +510,6 @@ export type Store = Pick<
505
510
| 'getTsConfig'
506
511
>
507
512
508
- export class File {
509
- compiled = {
510
- js : '' ,
511
- css : '' ,
512
- ssr : '' ,
513
- }
514
-
515
- editorViewState : editor . ICodeEditorViewState | null = null
516
-
517
- constructor (
518
- public filename : string ,
519
- public code = '' ,
520
- public hidden = false ,
521
- ) { }
522
-
523
- get language ( ) {
524
- if ( this . filename . endsWith ( '.vue' ) ) {
525
- return 'vue'
526
- }
527
- if ( this . filename . endsWith ( '.html' ) ) {
528
- return 'html'
529
- }
530
- if ( this . filename . endsWith ( '.css' ) ) {
531
- return 'css'
532
- }
533
- if ( this . filename . endsWith ( '.ts' ) ) {
534
- return 'typescript'
535
- }
536
- return 'javascript'
537
- }
538
- }
539
-
540
513
function addSrcPrefix ( file : string ) {
541
514
return file === importMapFile
542
515
|| file === tsconfigFile
Original file line number Diff line number Diff line change 1
1
export * from './moduleCompiler'
2
+ export * from './shared'
You can’t perform that action at this time.
0 commit comments