@@ -71,7 +71,7 @@ module.exports = function (eleventyConfig) {
71
71
72
72
eleventyConfig . addWatchTarget ( '../lit-dev-api/api-data/*/*.json' ) ;
73
73
eleventyConfig . addWatchTarget (
74
- '../lit-dev-content/samples/tutorials/**/tutorial.json'
74
+ '../lit-dev-content/samples/tutorials/**/tutorial.json' ,
75
75
) ;
76
76
eleventyConfig . addWatchTarget ( '../lit-dev-content/samples/tutorials/**/*.md' ) ;
77
77
eleventyConfig . addWatchTarget ( '../lit-dev-content/rollupout/server/*' ) ;
@@ -119,14 +119,14 @@ ${content}
119
119
Object . assign ( new state . Token ( 'div_open' , 'div' , 1 ) , {
120
120
attrs : [ [ 'class' , `heading ${ headingTag } ` ] ] ,
121
121
block : true ,
122
- } )
122
+ } ) ,
123
123
) ;
124
124
state . tokens . splice (
125
125
idx + 4 ,
126
126
0 ,
127
127
Object . assign ( new state . Token ( 'div_close' , 'div' , - 1 ) , {
128
128
block : true ,
129
- } )
129
+ } ) ,
130
130
) ;
131
131
linkAfterHeaderBase ( slug , opts , state , idx + 1 ) ;
132
132
} ;
@@ -165,16 +165,16 @@ ${content}
165
165
function ( url , latestVersion ) {
166
166
if ( ! latestVersion ) {
167
167
throw new Error (
168
- `No latestVersion provided to 'removeLatestVersionFromUrl`
168
+ `No latestVersion provided to 'removeLatestVersionFromUrl` ,
169
169
) ;
170
170
}
171
171
if ( ! url . includes ( `/${ latestVersion } /` ) ) {
172
172
throw new Error (
173
- `'${ url } ' does not include the latestVersion versioned path segment`
173
+ `'${ url } ' does not include the latestVersion versioned path segment` ,
174
174
) ;
175
175
}
176
176
return url . replace ( `/${ latestVersion } /` , '/' ) ;
177
- }
177
+ } ,
178
178
) ;
179
179
180
180
/**
@@ -191,11 +191,11 @@ ${content}
191
191
}
192
192
if ( ! latestVersion ) {
193
193
throw new Error (
194
- `latestVersion not provided to 'fixUnversionedCrossLinks`
194
+ `latestVersion not provided to 'fixUnversionedCrossLinks` ,
195
195
) ;
196
196
}
197
197
return content . replaceAll ( `/docs/${ latestVersion } /` , '/docs/' ) ;
198
- }
198
+ } ,
199
199
) ;
200
200
201
201
eleventyConfig . addFilter ( 'removeExtension' , function ( url ) {
@@ -446,7 +446,7 @@ ${content}
446
446
if ( location === undefined ) {
447
447
throw new Error (
448
448
`Ambiguous symbol ${ symbol } . ` +
449
- `Options: ${ locations . map ( ( l ) => l . anchor ) . join ( ', ' ) } `
449
+ `Options: ${ locations . map ( ( l ) => l . anchor ) . join ( ', ' ) } ` ,
450
450
) ;
451
451
}
452
452
@@ -459,17 +459,17 @@ ${content}
459
459
'api-v3' ,
460
460
'/docs/v3/api' ,
461
461
JSON . parse (
462
- fsSync . readFileSync ( '../lit-dev-api/api-data/lit-3/symbols.json' , 'utf8' )
463
- )
462
+ fsSync . readFileSync ( '../lit-dev-api/api-data/lit-3/symbols.json' , 'utf8' ) ,
463
+ ) ,
464
464
) ;
465
465
466
466
addApiShortcode (
467
467
'api' ,
468
468
'/docs/v2/api' ,
469
469
// Don't use require() because of Node caching in watch mode.
470
470
JSON . parse (
471
- fsSync . readFileSync ( '../lit-dev-api/api-data/lit-2/symbols.json' , 'utf8' )
472
- )
471
+ fsSync . readFileSync ( '../lit-dev-api/api-data/lit-2/symbols.json' , 'utf8' ) ,
472
+ ) ,
473
473
) ;
474
474
475
475
addApiShortcode (
@@ -478,9 +478,9 @@ ${content}
478
478
JSON . parse (
479
479
fsSync . readFileSync (
480
480
'../lit-dev-api/api-data/lit-html-1/symbols.json' ,
481
- 'utf8'
482
- )
483
- )
481
+ 'utf8' ,
482
+ ) ,
483
+ ) ,
484
484
) ;
485
485
486
486
addApiShortcode (
@@ -489,9 +489,9 @@ ${content}
489
489
JSON . parse (
490
490
fsSync . readFileSync (
491
491
'../lit-dev-api/api-data/lit-element-2/symbols.json' ,
492
- 'utf8'
493
- )
494
- )
492
+ 'utf8' ,
493
+ ) ,
494
+ ) ,
495
495
) ;
496
496
497
497
/**
@@ -520,7 +520,7 @@ ${content}
520
520
`CleanCSS errors/warnings on file ${ path } :\n\n${ [
521
521
...result . errors ,
522
522
...result . warnings ,
523
- ] . join ( '\n' ) } `
523
+ ] . join ( '\n' ) } `,
524
524
) ;
525
525
}
526
526
return `<style>${ result . styles } </style>` ;
@@ -554,14 +554,14 @@ ${content}
554
554
// Source: https://github.com/11ty/eleventy-base-blog/blob/master/.eleventy.js
555
555
eleventyConfig . addFilter ( 'readableDate' , ( dateObj ) => {
556
556
return luxon . DateTime . fromJSDate ( dateObj , { zone : 'utc' } ) . toFormat (
557
- 'LLL d, yyyy'
557
+ 'LLL d, yyyy' ,
558
558
) ;
559
559
} ) ;
560
560
561
561
// https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string
562
562
eleventyConfig . addFilter ( 'yyyymmdd' , ( dateObj ) => {
563
563
return luxon . DateTime . fromJSDate ( dateObj , { zone : 'utc' } ) . toFormat (
564
- 'yyyy-LL-dd'
564
+ 'yyyy-LL-dd' ,
565
565
) ;
566
566
} ) ;
567
567
@@ -587,15 +587,15 @@ ${content}
587
587
ENV . eleventyOutDir + '/docs/v3/introduction.html' ,
588
588
ENV . eleventyOutDir + '/docs/v3/*/index.html' ,
589
589
] ,
590
- { ignore : ENV . eleventyOutDir + '/docs/(v1|v2|v3)/index.html' }
590
+ { ignore : ENV . eleventyOutDir + '/docs/(v1|v2|v3)/index.html' } ,
591
591
)
592
592
) . filter (
593
593
// TODO(aomarks) This is brittle, we need a way to annotate inside an md
594
594
// file that a page shouldn't be generated.
595
595
( file ) =>
596
596
! file . includes ( 'why-lit' ) &&
597
597
! file . includes ( 'getting-started' ) &&
598
- ! file . includes ( 'browser-support' )
598
+ ! file . includes ( 'browser-support' ) ,
599
599
) ;
600
600
await Promise . all ( emptyDocsIndexFiles . map ( ( path ) => fs . unlink ( path ) ) ) ;
601
601
@@ -611,32 +611,32 @@ ${content}
611
611
// immediately, instead of triggering an Eleventy build.
612
612
await symlinkForce (
613
613
path . join ( __dirname , 'site' , 'css' ) ,
614
- path . join ( __dirname , ENV . eleventyOutDir , 'css' )
614
+ path . join ( __dirname , ENV . eleventyOutDir , 'css' ) ,
615
615
) ;
616
616
await symlinkForce (
617
617
path . join ( __dirname , 'site' , 'images' ) ,
618
- path . join ( __dirname , ENV . eleventyOutDir , 'images' )
618
+ path . join ( __dirname , ENV . eleventyOutDir , 'images' ) ,
619
619
) ;
620
620
await symlinkForce (
621
621
path . join ( __dirname , 'site' , 'fonts' ) ,
622
- path . join ( __dirname , ENV . eleventyOutDir , 'fonts' )
622
+ path . join ( __dirname , ENV . eleventyOutDir , 'fonts' ) ,
623
623
) ;
624
624
await symlinkForce (
625
625
path . join ( __dirname , 'samples' ) ,
626
- path . join ( __dirname , ENV . eleventyOutDir , 'samples' )
626
+ path . join ( __dirname , ENV . eleventyOutDir , 'samples' ) ,
627
627
) ;
628
628
629
629
// Symlink lib -> _dev/js. This lets us directly reference tsc outputs in
630
630
// dev mode, instead of the Rollup bundles we use for production.
631
631
await symlinkForce (
632
632
path . join ( __dirname , 'lib' ) ,
633
- path . join ( __dirname , ENV . eleventyOutDir , 'js' )
633
+ path . join ( __dirname , ENV . eleventyOutDir , 'js' ) ,
634
634
) ;
635
635
} else {
636
636
// Inline all Playground project files directly into their manifests, to
637
637
// cut down on requests per project.
638
638
await inlinePlaygroundFilesIntoManifests (
639
- `${ ENV . eleventyOutDir } /samples/**/project.json`
639
+ `${ ENV . eleventyOutDir } /samples/**/project.json` ,
640
640
) ;
641
641
642
642
// Pre-compress all outputs as .br and .gz files so the server can read
@@ -649,7 +649,7 @@ ${content}
649
649
await fs . writeFile (
650
650
path . join ( ENV . eleventyOutDir , 'csp-inline-script-hashes.txt' ) ,
651
651
[ ...cspInlineScriptHashes ] . join ( '\n' ) ,
652
- 'utf8'
652
+ 'utf8' ,
653
653
) ;
654
654
}
655
655
} ) ;
@@ -676,7 +676,7 @@ ${content}
676
676
// In prod SSR should use the lit templates run through the minifier.
677
677
if ( ! DEV ) {
678
678
componentModules = componentModules . map ( ( componentPath ) =>
679
- componentPath . replace ( 'lib/components' , 'rollupout/server' )
679
+ componentPath . replace ( 'lib/components' , 'rollupout/server' ) ,
680
680
) ;
681
681
}
682
682
0 commit comments