@@ -94,7 +94,7 @@ interface EmitFileResult {
94
94
}
95
95
type FileEmitter = (
96
96
file : string ,
97
- source ?: ts . SourceFile
97
+ source ?: ts . SourceFile ,
98
98
) => Promise < EmitFileResult | undefined > ;
99
99
100
100
/**
@@ -169,7 +169,7 @@ export function angular(options?: PluginOptions): Plugin[] {
169
169
let viteServer : ViteDevServer | undefined ;
170
170
let styleTransform : (
171
171
code : string ,
172
- filename : string
172
+ filename : string ,
173
173
) => ReturnType < typeof preprocessCSS > | undefined ;
174
174
175
175
const styleUrlsResolver = new StyleUrlsResolver ( ) ;
@@ -200,7 +200,7 @@ export function angular(options?: PluginOptions): Plugin[] {
200
200
config . root || '.' ,
201
201
process . env [ 'NODE_ENV' ] === 'test'
202
202
? './tsconfig.spec.json'
203
- : './tsconfig.app.json'
203
+ : './tsconfig.app.json' ,
204
204
) ;
205
205
206
206
return {
@@ -219,7 +219,7 @@ export function angular(options?: PluginOptions): Plugin[] {
219
219
incremental : watchMode ,
220
220
} ,
221
221
isTest ,
222
- ! isAstroIntegration
222
+ ! isAstroIntegration ,
223
223
) ,
224
224
] ,
225
225
define : {
@@ -264,7 +264,7 @@ export function angular(options?: PluginOptions): Plugin[] {
264
264
const angularComponentMiddleware : Connect . HandleFunction = async (
265
265
req : Connect . IncomingMessage ,
266
266
res : ServerResponse < Connect . IncomingMessage > ,
267
- next : Connect . NextFunction
267
+ next : Connect . NextFunction ,
268
268
) => {
269
269
if ( req . url === undefined || res . writableEnded ) {
270
270
return ;
@@ -351,7 +351,7 @@ export function angular(options?: PluginOptions): Plugin[] {
351
351
) {
352
352
const relativeFileId = `${ relative (
353
353
process . cwd ( ) ,
354
- fileId
354
+ fileId ,
355
355
) } @${ classNames . get ( fileId ) } `;
356
356
357
357
sendHMRComponentUpdate ( ctx . server , relativeFileId ) ;
@@ -372,15 +372,15 @@ export function angular(options?: PluginOptions): Plugin[] {
372
372
* for an external resource (styles, html).
373
373
*/
374
374
const isDirect = ctx . modules . find (
375
- ( mod ) => ctx . file === mod . file && mod . id ?. includes ( '?direct' )
375
+ ( mod ) => ctx . file === mod . file && mod . id ?. includes ( '?direct' ) ,
376
376
) ;
377
377
if ( isDirect ) {
378
378
if ( pluginOptions . liveReload && isDirect ?. id && isDirect . file ) {
379
379
const isComponentStyle =
380
380
isDirect . type === 'css' && isComponentStyleSheet ( isDirect . id ) ;
381
381
if ( isComponentStyle ) {
382
382
const { encapsulation } = getComponentStyleSheetMeta (
383
- isDirect . id
383
+ isDirect . id ,
384
384
) ;
385
385
386
386
// Track if the component uses ShadowDOM encapsulation
@@ -438,7 +438,7 @@ export function angular(options?: PluginOptions): Plugin[] {
438
438
updates . forEach ( ( updateId ) => {
439
439
const impRelativeFileId = `${ relative (
440
440
process . cwd ( ) ,
441
- updateId
441
+ updateId ,
442
442
) } @${ classNames . get ( updateId ) } `;
443
443
444
444
sendHMRComponentUpdate ( ctx . server , impRelativeFileId ) ;
@@ -464,14 +464,14 @@ export function angular(options?: PluginOptions): Plugin[] {
464
464
if ( id . startsWith ( 'angular:jit:' ) ) {
465
465
const path = id . split ( ';' ) [ 1 ] ;
466
466
return `${ normalizePath (
467
- resolve ( dirname ( importer as string ) , path )
467
+ resolve ( dirname ( importer as string ) , path ) ,
468
468
) } ?raw`;
469
469
}
470
470
471
471
// Map angular external styleUrls to the source file
472
472
if ( isComponentStyleSheet ( id ) ) {
473
473
const componentStyles = externalComponentStyles ?. get (
474
- getFilenameFromPath ( id )
474
+ getFilenameFromPath ( id ) ,
475
475
) ;
476
476
if ( componentStyles ) {
477
477
return componentStyles + new URL ( id , 'http://localhost' ) . search ;
@@ -484,7 +484,7 @@ export function angular(options?: PluginOptions): Plugin[] {
484
484
// Map angular inline styles to the source text
485
485
if ( isComponentStyleSheet ( id ) ) {
486
486
const componentStyles = inlineComponentStyles ?. get (
487
- getFilenameFromPath ( id )
487
+ getFilenameFromPath ( id ) ,
488
488
) ;
489
489
if ( componentStyles ) {
490
490
return componentStyles ;
@@ -506,8 +506,8 @@ export function angular(options?: PluginOptions): Plugin[] {
506
506
const result = await fileEmitter ?.(
507
507
resolve (
508
508
process . cwd ( ) ,
509
- decodeURIComponent ( componentId ) . split ( '@' ) [ 0 ]
510
- )
509
+ decodeURIComponent ( componentId ) . split ( '@' ) [ 0 ] ,
510
+ ) ,
511
511
) ;
512
512
513
513
return result ?. hmrUpdateCode || '' ;
@@ -620,23 +620,23 @@ export function angular(options?: PluginOptions): Plugin[] {
620
620
if ( jit && data . includes ( 'angular:jit:' ) ) {
621
621
data = data . replace (
622
622
/ a n g u l a r : j i t : s t y l e : i n l i n e ; / g,
623
- 'virtual:angular:jit:style:inline;'
623
+ 'virtual:angular:jit:style:inline;' ,
624
624
) ;
625
625
626
626
templateUrls . forEach ( ( templateUrlSet ) => {
627
627
const [ templateFile , resolvedTemplateUrl ] =
628
628
templateUrlSet . split ( '|' ) ;
629
629
data = data . replace (
630
630
`angular:jit:template:file;${ templateFile } ` ,
631
- `${ resolvedTemplateUrl } ?raw`
631
+ `${ resolvedTemplateUrl } ?raw` ,
632
632
) ;
633
633
} ) ;
634
634
635
635
styleUrls . forEach ( ( styleUrlSet ) => {
636
636
const [ styleFile , resolvedStyleUrl ] = styleUrlSet . split ( '|' ) ;
637
637
data = data . replace (
638
638
`angular:jit:style:file;${ styleFile } ` ,
639
- `${ resolvedStyleUrl } ?inline`
639
+ `${ resolvedStyleUrl } ?inline` ,
640
640
) ;
641
641
} ) ;
642
642
}
@@ -663,7 +663,7 @@ export function angular(options?: PluginOptions): Plugin[] {
663
663
const metadata = await getFrontmatterMetadata (
664
664
code ,
665
665
id ,
666
- pluginOptions . markdownTemplateTransforms || [ ]
666
+ pluginOptions . markdownTemplateTransforms || [ ] ,
667
667
) ;
668
668
data += metadata ;
669
669
}
@@ -712,18 +712,18 @@ export function angular(options?: PluginOptions): Plugin[] {
712
712
713
713
const fg = require ( 'fast-glob' ) ;
714
714
const appRoot = normalizePath (
715
- resolve ( pluginOptions . workspaceRoot , config . root || '.' )
715
+ resolve ( pluginOptions . workspaceRoot , config . root || '.' ) ,
716
716
) ;
717
717
const workspaceRoot = normalizePath ( resolve ( pluginOptions . workspaceRoot ) ) ;
718
718
719
719
const globs = [
720
720
`${ appRoot } /**/*.{analog,agx,ag}` ,
721
721
...extraGlobs . map ( ( glob ) => `${ workspaceRoot } ${ glob } .{analog,agx,ag}` ) ,
722
722
...( pluginOptions . additionalContentDirs || [ ] ) ?. map (
723
- ( glob ) => `${ workspaceRoot } ${ glob } /**/*.agx`
723
+ ( glob ) => `${ workspaceRoot } ${ glob } /**/*.agx` ,
724
724
) ,
725
725
...pluginOptions . include . map ( ( glob ) =>
726
- `${ workspaceRoot } ${ glob } ` . replace ( / \. t s $ / , '.analog' )
726
+ `${ workspaceRoot } ${ glob } ` . replace ( / \. t s $ / , '.analog' ) ,
727
727
) ,
728
728
] ;
729
729
@@ -830,7 +830,7 @@ export function angular(options?: PluginOptions): Plugin[] {
830
830
rootNames ,
831
831
compilerOptions ,
832
832
host as CompilerHost ,
833
- nextProgram as any
833
+ nextProgram as any ,
834
834
) ;
835
835
angularCompiler = angularProgram . compiler ;
836
836
typeScriptProgram = angularProgram . getTsProgram ( ) ;
@@ -840,7 +840,7 @@ export function angular(options?: PluginOptions): Plugin[] {
840
840
ts . createEmitAndSemanticDiagnosticsBuilderProgram (
841
841
typeScriptProgram ,
842
842
host ,
843
- builderProgram
843
+ builderProgram ,
844
844
) ;
845
845
846
846
await angularCompiler . analyzeAsync ( ) ;
@@ -852,7 +852,7 @@ export function angular(options?: PluginOptions): Plugin[] {
852
852
rootNames ,
853
853
compilerOptions ,
854
854
host ,
855
- nextProgram as any
855
+ nextProgram as any ,
856
856
) ;
857
857
858
858
typeScriptProgram = builder . getProgram ( ) ;
@@ -874,7 +874,7 @@ export function angular(options?: PluginOptions): Plugin[] {
874
874
...( jit
875
875
? [
876
876
compilerCli . constructorParametersDownlevelTransform (
877
- builder . getProgram ( )
877
+ builder . getProgram ( ) ,
878
878
) ,
879
879
createJitResourceTransformer ( getTypeChecker ) ,
880
880
]
@@ -885,12 +885,12 @@ export function angular(options?: PluginOptions): Plugin[] {
885
885
afterDeclarations :
886
886
pluginOptions . advanced . tsTransformers . afterDeclarations ,
887
887
} ,
888
- jit ? { } : angularCompiler ! . prepareEmit ( ) . transformers
888
+ jit ? { } : angularCompiler ! . prepareEmit ( ) . transformers ,
889
889
) ,
890
890
( ) => [ ] ,
891
891
angularCompiler ! ,
892
892
pluginOptions . liveReload ,
893
- pluginOptions . disableTypeChecking
893
+ pluginOptions . disableTypeChecking ,
894
894
) ;
895
895
}
896
896
}
@@ -910,7 +910,7 @@ export function createFileEmitter(
910
910
onAfterEmit ?: ( sourceFile : ts . SourceFile ) => void ,
911
911
angularCompiler ?: NgtscProgram [ 'compiler' ] ,
912
912
liveReload ?: boolean ,
913
- disableTypeChecking ?: boolean
913
+ disableTypeChecking ?: boolean ,
914
914
) : FileEmitter {
915
915
return async ( file : string , stale ?: ts . SourceFile ) => {
916
916
const sourceFile = program . getSourceFile ( file ) ;
@@ -922,7 +922,7 @@ export function createFileEmitter(
922
922
const hmrEligible = ! ! analyzeFileUpdates (
923
923
stale ,
924
924
sourceFile ,
925
- angularCompiler !
925
+ angularCompiler ! ,
926
926
) ;
927
927
return { dependencies : [ ] , hmrEligible } ;
928
928
}
@@ -931,15 +931,15 @@ export function createFileEmitter(
931
931
sourceFile ,
932
932
! ! disableTypeChecking ,
933
933
program ,
934
- angularCompiler
934
+ angularCompiler ,
935
935
) ;
936
936
937
937
const errors = diagnostics
938
938
. filter ( ( d ) => d . category === ts . DiagnosticCategory ?. Error )
939
939
. map ( ( d ) =>
940
940
typeof d . messageText === 'object'
941
941
? d . messageText . messageText
942
- : d . messageText
942
+ : d . messageText ,
943
943
) ;
944
944
945
945
const warnings = diagnostics
@@ -967,7 +967,7 @@ export function createFileEmitter(
967
967
} ,
968
968
undefined /* cancellationToken */ ,
969
969
undefined /* emitOnlyDtsFiles */ ,
970
- transformers
970
+ transformers ,
971
971
) ;
972
972
973
973
onAfterEmit ?.( sourceFile ) ;
@@ -980,7 +980,7 @@ function getDiagnosticsForSourceFile(
980
980
sourceFile : ts . SourceFile ,
981
981
disableTypeChecking : boolean ,
982
982
program : ts . BuilderProgram ,
983
- angularCompiler ?: NgtscProgram [ 'compiler' ]
983
+ angularCompiler ?: NgtscProgram [ 'compiler' ] ,
984
984
) {
985
985
const syntacticDiagnostics = program . getSyntacticDiagnostics ( sourceFile ) ;
986
986
0 commit comments