@@ -38,11 +38,28 @@ export default async function metrics({login, q}, {graphql, rest, plugins, conf,
3838 }
3939 : null ) ,
4040 }
41+ const { "debug.flags" :dflags , "experimental.features" :_experimental , "config.order" :_partials } = imports . metadata . plugins . core . inputs ( { account :"bypass" , q} )
4142 const extras = { css : imports . metadata . plugins . core . extras ( "extras_css" , { ...conf . settings , error : false } ) ? q [ "extras.css" ] ?? "" : "" , js : imports . metadata . plugins . core . extras ( "extras_js" , { ...conf . settings , error : false } ) ? q [ "extras.js" ] ?? "" : "" }
4243 const data = { q, animated : true , large : false , base : { } , config : { } , errors : [ ] , warnings, plugins : { } , computed : { } , extras, postscripts : [ ] }
43- const experimental = new Set ( decodeURIComponent ( q [ "experimental.features" ] ?? "" ) . split ( " " ) . map ( x => x . trim ( ) . toLocaleLowerCase ( ) ) . filter ( x => x ) )
44- if ( conf . settings [ "debug.headless" ] )
44+ const experimental = new Set ( _experimental )
45+ if ( conf . settings [ "debug.headless" ] ) {
4546 imports . puppeteer . headless = false
47+ console . debug ( `metrics/compute/${ login } > disabled puppeteer headless mode` )
48+ }
49+ if ( ( conf . settings . debug ) || ( process . env . GITHUB_ACTIONS ) ) {
50+ if ( dflags . includes ( "--puppeteer-disable-headless" ) ) {
51+ imports . puppeteer . headless = false
52+ console . debug ( `metrics/compute/${ login } > disabled puppeteer headless mode` )
53+ }
54+ if ( dflags . includes ( "--puppeteer-debug" ) ) {
55+ process . env . DEBUG = "puppeteer:*"
56+ console . debug ( `metrics/compute/${ login } > enabled puppeteer debugging` )
57+ }
58+ if ( dflags . find ( flag => flag . startsWith ( "--puppeteer-wait-" ) ) ) {
59+ imports . puppeteer . events = dflags . filter ( flag => flag . startsWith ( "--puppeteer-wait-" ) ) . map ( flag => flag . replace ( "--puppeteer-wait-" , "" ) )
60+ console . debug ( `metrics/compute/${ login } > overridden puppeteer wait events [${ imports . puppeteer . events } ]` )
61+ }
62+ }
4663
4764 //Metrics insights
4865 if ( convert === "insights" )
@@ -51,7 +68,7 @@ export default async function metrics({login, q}, {graphql, rest, plugins, conf,
5168 //Partial parts
5269 {
5370 data . partials = new Set ( [
54- ...decodeURIComponent ( q [ "config.order" ] ?? "" ) . split ( "," ) . map ( x => x . trim ( ) . toLocaleLowerCase ( ) ) . filter ( partial => partials . includes ( partial ) ) ,
71+ ..._partials . filter ( partial => partials . includes ( partial ) ) ,
5572 ...partials ,
5673 ] )
5774 console . debug ( `metrics/compute/${ login } > content order : ${ [ ...data . partials ] } ` )
0 commit comments