@flanksource/page-runtime 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vitest/gavel-reporter-3e3dfb64eda19344.mjs +59 -0
- package/.vitest/vitest-report-root-1793958008919344000.json +1 -0
- package/.vitest/vitest-report-root-1793958052786561000.json +1 -0
- package/.vitest/vitest-report-root-1793958143511414000.json +1 -0
- package/.vitest/vitest-report-root-1793958185908019000.json +1 -0
- package/.vitest/vitest-report-root-1793958252687550000.json +1 -0
- package/.vitest/vitest-report-root-1793958260385388000.json +1 -0
- package/.vitest/vitest-report-root-1793958312358683000.json +1 -0
- package/.vitest/vitest-report-root-1793958386118791000.json +1 -0
- package/.vitest/vitest-report-root-1793958388712140000.json +1 -0
- package/.vitest/vitest-report-root-1793958429135603000.json +1 -0
- package/.vitest/vitest-report-root-1793958433387809000.json +1 -0
- package/.vitest/vitest-report-root-1793958517322792000.json +1 -0
- package/.vitest/vitest-report-root-1793958542332252000.json +1 -0
- package/.vitest/vitest-report-root-1793958617698698000.json +1 -0
- package/.vitest/vitest-report-root-1793958676587753000.json +1 -0
- package/.vitest/vitest-report-root-1793958707827469000.json +1 -0
- package/.vitest/vitest-report-root-1793958729745028000.json +1 -0
- package/.vitest/vitest-report-root-1793958736696408000.json +1 -0
- package/.vitest/vitest-report-root-1793958740449993000.json +1 -0
- package/.vitest/vitest-report-root-1793958841510921000.json +1 -0
- package/.vitest/vitest-report-root-1793958847664582000.json +1 -0
- package/.vitest/vitest-report-root-1793958900327643000.json +1 -0
- package/.vitest/vitest-report-root-1793958950822823000.json +1 -0
- package/.vitest/vitest-report-root-1793959013655262000.json +1 -0
- package/.vitest/vitest-report-root-1793959017905881000.json +1 -0
- package/.vitest/vitest-report-root-1793959093169044000.json +1 -0
- package/.vitest/vitest-report-root-1793959093978087000.json +1 -0
- package/.vitest/vitest-report-root-1793959101111925000.json +1 -0
- package/.vitest/vitest-report-root-1793959145317906000.json +1 -0
- package/.vitest/vitest-report-root-1793959190760607000.json +1 -0
- package/.vitest/vitest-report-root-1793959249695805000.json +1 -0
- package/.vitest/vitest-report-root-1793959323191511000.json +1 -0
- package/.vitest/vitest-report-root-1793959453311564000.json +1 -0
- package/.vitest/vitest-report-root-1793959495806182000.json +1 -0
- package/.vitest/vitest-report-root-1793959499945435000.json +1 -0
- package/.vitest/vitest-report-root-1793959546773807000.json +1 -0
- package/.vitest/vitest-report-root-1793959583335593000.json +1 -0
- package/.vitest/vitest-report-root-1793959621479504000.json +1 -0
- package/.vitest/vitest-report-root-1793959651002360000.json +1 -0
- package/.vitest/vitest-report-root-1793959655646061000.json +1 -0
- package/.vitest/vitest-report-root-1793959741176826000.json +1 -0
- package/.vitest/vitest-report-root-1793959744743733000.json +1 -0
- package/.vitest/vitest-report-root-1793959833244182000.json +1 -0
- package/.vitest/vitest-report-root-1793959882131751000.json +1 -0
- package/.vitest/vitest-report-root-1793959887033254000.json +1 -0
- package/.vitest/vitest-report-root-1793960000631977000.json +1 -0
- package/.vitest/vitest-report-root-1793960011938504000.json +1 -0
- package/.vitest/vitest-report-root-1793961370018852000.json +1 -0
- package/.vitest/vitest-report-root-1793961745370827000.json +1 -0
- package/.vitest/vitest-report-root-1793961764143180000.json +1 -0
- package/.vitest/vitest-report-root-1793961835963066000.json +1 -0
- package/.vitest/vitest-report-root-1793961890729922000.json +1 -0
- package/.vitest/vitest-report-root-1793961968680074000.json +1 -0
- package/.vitest/vitest-report-root-1793962066862337000.json +1 -0
- package/.vitest/vitest-report-root-1793962087917497000.json +1 -0
- package/.vitest/vitest-report-root-1793962157254386000.json +1 -0
- package/.vitest/vitest-report-root-1793962171214865000.json +1 -0
- package/.vitest/vitest-report-root-1793962183290533000.json +1 -0
- package/.vitest/vitest-report-root-1793962184809932000.json +1 -0
- package/.vitest/vitest-report-root-1793962197715204000.json +1 -0
- package/.vitest/vitest-report-root-1793962244650717000.json +1 -0
- package/.vitest/vitest-report-root-1793962259802273000.json +1 -0
- package/.vitest/vitest-report-root-1793962278799745000.json +1 -0
- package/.vitest/vitest-report-root-1793962304412974000.json +1 -0
- package/.vitest/vitest-report-root-1793962328411454000.json +1 -0
- package/.vitest/vitest-report-root-1793962355747869000.json +1 -0
- package/.vitest/vitest-report-root-1793962381401572000.json +1 -0
- package/.vitest/vitest-report-root-1793962393326735000.json +1 -0
- package/.vitest/vitest-report-root-1793962393329206000.json +1 -0
- package/.vitest/vitest-report-root-1793962437796768000.json +1 -0
- package/.vitest/vitest-report-root-1793962444190384000.json +1 -0
- package/.vitest/vitest-report-root-1793962445347541000.json +1 -0
- package/.vitest/vitest-report-root-1793962473691143000.json +1 -0
- package/.vitest/vitest-report-root-1793962474291457000.json +1 -0
- package/.vitest/vitest-report-root-1793962499680468000.json +1 -0
- package/.vitest/vitest-report-root-1793962504410483000.json +1 -0
- package/.vitest/vitest-report-root-1793962516850524000.json +1 -0
- package/.vitest/vitest-report-root-1793962536736273000.json +1 -0
- package/.vitest/vitest-report-root-1793962551181783000.json +1 -0
- package/.vitest/vitest-report-root-1793962553575620000.json +1 -0
- package/.vitest/vitest-report-root-1793962555169730000.json +1 -0
- package/.vitest/vitest-report-root-1793962572639765000.json +1 -0
- package/.vitest/vitest-report-root-1793962597102952000.json +1 -0
- package/.vitest/vitest-report-root-1793962637156669000.json +1 -0
- package/.vitest/vitest-report-root-1793962653530027000.json +1 -0
- package/.vitest/vitest-report-root-1793962665824334000.json +1 -0
- package/.vitest/vitest-report-root-1793962682161714000.json +1 -0
- package/.vitest/vitest-report-root-1793962719526168000.json +1 -0
- package/.vitest/vitest-report-root-1793962723853934000.json +1 -0
- package/.vitest/vitest-report-root-1793962741927728000.json +1 -0
- package/.vitest/vitest-report-root-1793962794308371000.json +1 -0
- package/.vitest/vitest-report-root-1793962796334481000.json +1 -0
- package/.vitest/vitest-report-root-1793962798075169000.json +1 -0
- package/.vitest/vitest-report-root-1793962836466676000.json +1 -0
- package/.vitest/vitest-report-root-1793962846507317000.json +1 -0
- package/.vitest/vitest-report-root-1793962876266701000.json +1 -0
- package/.vitest/vitest-report-root-1793962922031308000.json +1 -0
- package/.vitest/vitest-report-root-1793962932957166000.json +1 -0
- package/.vitest/vitest-report-root-1793962946930725000.json +1 -0
- package/.vitest/vitest-report-root-1793963027896350000.json +1 -0
- package/.vitest/vitest-report-root-1793963036618707000.json +1 -0
- package/.vitest/vitest-report-root-1793963067365318000.json +1 -0
- package/.vitest/vitest-report-root-1793963077597641000.json +1 -0
- package/.vitest/vitest-report-root-1793963126365651000.json +1 -0
- package/.vitest/vitest-report-root-1793963208744553000.json +1 -0
- package/.vitest/vitest-report-root-1793963232806450000.json +1 -0
- package/.vitest/vitest-report-root-1793963325077422000.json +1 -0
- package/.vitest/vitest-report-root-1793963392172877000.json +1 -0
- package/.vitest/vitest-report-root-1793963398218324000.json +1 -0
- package/.vitest/vitest-report-root-1793963410749092000.json +1 -0
- package/.vitest/vitest-report-root-1793963437279580000.json +1 -0
- package/.vitest/vitest-report-root-1793963450096193000.json +1 -0
- package/.vitest/vitest-report-root-1793963478908641000.json +1 -0
- package/.vitest/vitest-report-root-1793963507838465000.json +1 -0
- package/.vitest/vitest-report-root-1793963528668174000.json +1 -0
- package/.vitest/vitest-report-root-1793963601860390000.json +1 -0
- package/.vitest/vitest-report-root-1793963611633446000.json +1 -0
- package/.vitest/vitest-report-root-1793963624713406000.json +1 -0
- package/.vitest/vitest-report-root-1793963680656685000.json +1 -0
- package/.vitest/vitest-report-root-1793963705231851000.json +1 -0
- package/.vitest/vitest-report-root-1793963708929500000.json +1 -0
- package/.vitest/vitest-report-root-1793963710267844000.json +1 -0
- package/.vitest/vitest-report-root-1793963713999248000.json +1 -0
- package/.vitest/vitest-report-root-1793963786513455000.json +1 -0
- package/.vitest/vitest-report-root-1793963792518765000.json +1 -0
- package/.vitest/vitest-report-root-1793963804089549000.json +1 -0
- package/.vitest/vitest-report-root-1793963840412921000.json +1 -0
- package/.vitest/vitest-report-root-1793963880361176000.json +1 -0
- package/.vitest/vitest-report-root-1793963935121106000.json +1 -0
- package/.vitest/vitest-report-root-1793963937290698000.json +1 -0
- package/.vitest/vitest-report-root-1793963977050773000.json +1 -0
- package/.vitest/vitest-report-root-1793963981229158000.json +1 -0
- package/.vitest/vitest-report-root-1793963989422080000.json +1 -0
- package/.vitest/vitest-report-root-1793964025924629000.json +1 -0
- package/.vitest/vitest-report-root-1793964027983705000.json +1 -0
- package/.vitest/vitest-report-root-1793964059969386000.json +1 -0
- package/.vitest/vitest-report-root-1793964071524069000.json +1 -0
- package/.vitest/vitest-report-root-1793964076285860000.json +1 -0
- package/.vitest/vitest-report-root-1793964077988100000.json +1 -0
- package/.vitest/vitest-report-root-1793964093289042000.json +1 -0
- package/.vitest/vitest-report-root-1793964102899356000.json +1 -0
- package/.vitest/vitest-report-root-1793964128089691000.json +1 -0
- package/.vitest/vitest-report-root-1793964129495156000.json +1 -0
- package/.vitest/vitest-report-root-1793964182849665000.json +1 -0
- package/.vitest/vitest-report-root-1793964223959893000.json +1 -0
- package/.vitest/vitest-report-root-1793964253351716000.json +1 -0
- package/.vitest/vitest-report-root-1793964290220122000.json +1 -0
- package/.vitest/vitest-report-root-1793964318037006000.json +1 -0
- package/.vitest/vitest-report-root-1793964334676691000.json +1 -0
- package/.vitest/vitest-report-root-1793964378520677000.json +1 -0
- package/.vitest/vitest-report-root-1793964383748994000.json +1 -0
- package/.vitest/vitest-report-root-1793964394042303000.json +1 -0
- package/.vitest/vitest-report-root-1793964466521881000.json +1 -0
- package/.vitest/vitest-report-root-1793964470478175000.json +1 -0
- package/.vitest/vitest-report-root-1793964484499019000.json +1 -0
- package/.vitest/vitest-report-root-1793964527645213000.json +1 -0
- package/.vitest/vitest-report-root-1793964608875865000.json +1 -0
- package/.vitest/vitest-report-root-1793964623608336000.json +1 -0
- package/.vitest/vitest-report-root-1793964629870846000.json +1 -0
- package/.vitest/vitest-report-root-1793964674515564000.json +1 -0
- package/.vitest/vitest-report-root-1793964706923651000.json +1 -0
- package/.vitest/vitest-report-root-1793964712832942000.json +1 -0
- package/.vitest/vitest-report-root-1793964714824633000.json +1 -0
- package/.vitest/vitest-report-root-1793964755433952000.json +1 -0
- package/.vitest/vitest-report-root-1793964783157670000.json +1 -0
- package/.vitest/vitest-report-root-1793964818963246000.json +1 -0
- package/.vitest/vitest-report-root-1793964843818548000.json +1 -0
- package/.vitest/vitest-report-root-1793964929824204000.json +1 -0
- package/.vitest/vitest-report-root-1793964973060713000.json +1 -0
- package/.vitest/vitest-report-root-1793964983122482000.json +1 -0
- package/.vitest/vitest-report-root-1793965107264567000.json +1 -0
- package/.vitest/vitest-report-root-1793965258759177000.json +1 -0
- package/.vitest/vitest-report-root-1793965277212091000.json +1 -0
- package/.vitest/vitest-report-root-1793965420648188000.json +1 -0
- package/.vitest/vitest-report-root-1793965611688414000.json +1 -0
- package/.vitest/vitest-report-root-1793965753407694000.json +1 -0
- package/.vitest/vitest-report-root-1793965766104309000.json +1 -0
- package/.vitest/vitest-report-root-1793965766823098000.json +1 -0
- package/.vitest/vitest-report-root-1793965806066109000.json +1 -0
- package/.vitest/vitest-report-root-1793965824697182000.json +1 -0
- package/.vitest/vitest-report-root-1793965904374564000.json +1 -0
- package/.vitest/vitest-report-root-1793965920838340000.json +1 -0
- package/.vitest/vitest-report-root-1793965932520617000.json +1 -0
- package/.vitest/vitest-report-root-1793965971574656000.json +1 -0
- package/.vitest/vitest-report-root-1793966049815024000.json +1 -0
- package/.vitest/vitest-report-root-1793966057888034000.json +1 -0
- package/.vitest/vitest-report-root-1793966066838868000.json +1 -0
- package/.vitest/vitest-report-root-1793966160347764000.json +1 -0
- package/.vitest/vitest-report-root-1793966196305985000.json +1 -0
- package/.vitest/vitest-report-root-1793966221538043000.json +1 -0
- package/.vitest/vitest-report-root-1793966251519918000.json +1 -0
- package/.vitest/vitest-report-root-1793966447000588000.json +1 -0
- package/.vitest/vitest-report-root-1793966463178249000.json +1 -0
- package/.vitest/vitest-report-root-1793966486995648000.json +1 -0
- package/.vitest/vitest-report-root-1793966726756953000.json +1 -0
- package/.vitest/vitest-report-root-1793966763656807000.json +1 -0
- package/.vitest/vitest-report-root-1793966979409799000.json +1 -0
- package/.vitest/vitest-report-root-1793967385250149000.json +1 -0
- package/.vitest/vitest-report-root-1793967617080163000.json +1 -0
- package/.vitest/vitest-report-root-1793967649428508000.json +1 -0
- package/.vitest/vitest-report-root-1793967773689520000.json +1 -0
- package/.vitest/vitest-report-root-1793968743743508000.json +1 -0
- package/.vitest/vitest-report-root-1793968846470407000.json +1 -0
- package/.vitest/vitest-report-root-1793968880878391000.json +1 -0
- package/.vitest/vitest-report-root-1793969027713529000.json +1 -0
- package/.vitest/vitest-report-root-1793969041841266000.json +1 -0
- package/.vitest/vitest-report-root-1793969142007468000.json +1 -0
- package/.vitest/vitest-report-root-1793969164867379000.json +1 -0
- package/.vitest/vitest-report-root-1793969193145858000.json +1 -0
- package/.vitest/vitest-report-root-1793969246818533000.json +1 -0
- package/.vitest/vitest-report-root-1793969270845486000.json +1 -0
- package/.vitest/vitest-report-root-1793969272514219000.json +1 -0
- package/.vitest/vitest-report-root-1793969302476105000.json +1 -0
- package/.vitest/vitest-report-root-1793969401697799000.json +1 -0
- package/.vitest/vitest-report-root-1793969433222630000.json +1 -0
- package/.vitest/vitest-report-root-1793969453350714000.json +1 -0
- package/.vitest/vitest-report-root-1793969567187400000.json +1 -0
- package/.vitest/vitest-report-root-1793969602230024000.json +1 -0
- package/.vitest/vitest-report-root-1793969633261063000.json +1 -0
- package/.vitest/vitest-report-root-1793969673876404000.json +1 -0
- package/.vitest/vitest-report-root-1793969702287010000.json +1 -0
- package/.vitest/vitest-report-root-1793969745828386000.json +1 -0
- package/.vitest/vitest-report-root-1793969893687205000.json +1 -0
- package/.vitest/vitest-report-root-1793969949642120000.json +1 -0
- package/.vitest/vitest-report-root-1793969981399076000.json +1 -0
- package/.vitest/vitest-report-root-1793970027152713000.json +1 -0
- package/.vitest/vitest-report-root-1793970030585158000.json +1 -0
- package/.vitest/vitest-report-root-1793970160195767000.json +1 -0
- package/.vitest/vitest-report-root-1793970215752422000.json +1 -0
- package/.vitest/vitest-report-root-1793970217114968000.json +1 -0
- package/.vitest/vitest-report-root-1793970329879319000.json +1 -0
- package/.vitest/vitest-report-root-1793970590586994000.json +1 -0
- package/.vitest/vitest-report-root-1793970625359990000.json +1 -0
- package/.vitest/vitest-report-root-1793970672590269000.json +1 -0
- package/.vitest/vitest-report-root-1793970796789022000.json +1 -0
- package/.vitest/vitest-report-root-1793970825710990000.json +1 -0
- package/.vitest/vitest-report-root-1793970884000509000.json +1 -0
- package/.vitest/vitest-report-root-1793970900444617000.json +1 -0
- package/.vitest/vitest-report-root-1793972186024681000.json +1 -0
- package/.vitest/vitest-report-root-1793972227757396000.json +1 -0
- package/.vitest/vitest-report-root-1793972736341600000.json +1 -0
- package/.vitest/vitest-report-root-1793972769249562000.json +1 -0
- package/.vitest/vitest-report-root-1793972859435283000.json +1 -0
- package/.vitest/vitest-report-root-1793972915169294000.json +1 -0
- package/.vitest/vitest-report-root-1793973081515450000.json +1 -0
- package/.vitest/vitest-report-root-1793973111336773000.json +1 -0
- package/.vitest/vitest-report-root-1793973253986969000.json +1 -0
- package/.vitest/vitest-report-root-1793973561283775000.json +1 -0
- package/.vitest/vitest-report-root-1793973593320977000.json +1 -0
- package/.vitest/vitest-report-root-1793973648302867000.json +1 -0
- package/.vitest/vitest-report-root-1793973819657242000.json +1 -0
- package/.vitest/vitest-report-root-1793973952727311000.json +1 -0
- package/.vitest/vitest-report-root-1793974334455876000.json +1 -0
- package/.vitest/vitest-report-root-1793974437074196000.json +1 -0
- package/.vitest/vitest-report-root-1793974437553146000.json +1 -0
- package/.vitest/vitest-report-root-1793974461818626000.json +1 -0
- package/.vitest/vitest-report-root-1793974515255198000.json +1 -0
- package/.vitest/vitest-report-root-1793974516267191000.json +1 -0
- package/.vitest/vitest-report-root-1793974621202824000.json +1 -0
- package/.vitest/vitest-report-root-1793974718450330000.json +1 -0
- package/.vitest/vitest-report-root-1793974834942373000.json +1 -0
- package/.vitest/vitest-report-root-1793974921367314000.json +1 -0
- package/.vitest/vitest-report-root-1793975019367156000.json +1 -0
- package/.vitest/vitest-report-root-1793975048166096000.json +1 -0
- package/.vitest/vitest-report-root-1793975133024339000.json +1 -0
- package/.vitest/vitest-report-root-1793975159711704000.json +1 -0
- package/.vitest/vitest-report-root-1793975517481736000.json +1 -0
- package/.vitest/vitest-report-root-1793975680008825000.json +1 -0
- package/.vitest/vitest-report-root-1793976067648494000.json +1 -0
- package/.vitest/vitest-report-root-1793976314122479000.json +1 -0
- package/.vitest/vitest-report-root-1793976513022402000.json +1 -0
- package/.vitest/vitest-report-root-1793976540410805000.json +1 -0
- package/.vitest/vitest-report-root-1793976555103273000.json +1 -0
- package/.vitest/vitest-report-root-1793976702974407000.json +1 -0
- package/.vitest/vitest-report-root-1793976721093108000.json +1 -0
- package/.vitest/vitest-report-root-1793976955473681000.json +1 -0
- package/.vitest/vitest-report-root-1793977049628483000.json +1 -0
- package/.vitest/vitest-report-root-1793977098467804000.json +1 -0
- package/.vitest/vitest-report-root-1793977132144900000.json +1 -0
- package/.vitest/vitest-report-root-1793977279648191000.json +1 -0
- package/.vitest/vitest-report-root-1793977365312127000.json +1 -0
- package/.vitest/vitest-report-root-1793978227796817000.json +1 -0
- package/.vitest/vitest-report-root-1793978255189735000.json +1 -0
- package/.vitest/vitest-report-root-1793978306509070000.json +1 -0
- package/.vitest/vitest-report-root-1793978418301216000.json +1 -0
- package/.vitest/vitest-report-root-1793978445072573000.json +1 -0
- package/.vitest/vitest-report-root-1793978546605517000.json +1 -0
- package/.vitest/vitest-report-root-1793978576060950000.json +1 -0
- package/.vitest/vitest-report-root-1793978590261408000.json +1 -0
- package/.vitest/vitest-report-root-1793978674733179000.json +1 -0
- package/.vitest/vitest-report-root-1793978718588785000.json +1 -0
- package/.vitest/vitest-report-root-1793978725363453000.json +1 -0
- package/.vitest/vitest-report-root-1793978729967285000.json +1 -0
- package/.vitest/vitest-report-root-1793978755641607000.json +1 -0
- package/.vitest/vitest-report-root-1793978782769802000.json +1 -0
- package/.vitest/vitest-report-root-1793978784870947000.json +1 -0
- package/.vitest/vitest-report-root-1793978806927335000.json +1 -0
- package/.vitest/vitest-report-root-1793978822508324000.json +1 -0
- package/.vitest/vitest-report-root-1793978836339794000.json +1 -0
- package/.vitest/vitest-report-root-1793978837947352000.json +1 -0
- package/.vitest/vitest-report-root-1793978891548295000.json +1 -0
- package/.vitest/vitest-report-root-1793978946172947000.json +1 -0
- package/.vitest/vitest-report-root-1793978947109807000.json +1 -0
- package/.vitest/vitest-report-root-1793979034208662000.json +1 -0
- package/.vitest/vitest-report-root-1793979070583608000.json +1 -0
- package/.vitest/vitest-report-root-1793979081187144000.json +1 -0
- package/.vitest/vitest-report-root-1793979085428673000.json +1 -0
- package/.vitest/vitest-report-root-1793979155097858000.json +1 -0
- package/.vitest/vitest-report-root-1793979233508873000.json +1 -0
- package/.vitest/vitest-report-root-1793979268653273000.json +1 -0
- package/.vitest/vitest-report-root-1793979341978843000.json +1 -0
- package/.vitest/vitest-report-root-1793979345344877000.json +1 -0
- package/.vitest/vitest-report-root-1793979389390374000.json +1 -0
- package/.vitest/vitest-report-root-1793979400063493000.json +1 -0
- package/.vitest/vitest-report-root-1793979432448725000.json +1 -0
- package/.vitest/vitest-report-root-1793979459139430000.json +1 -0
- package/.vitest/vitest-report-root-1793979480341961000.json +1 -0
- package/.vitest/vitest-report-root-1793979510130869000.json +1 -0
- package/.vitest/vitest-report-root-1793979524763924000.json +1 -0
- package/.vitest/vitest-report-root-1793979571563010000.json +1 -0
- package/.vitest/vitest-report-root-1793979627916920000.json +1 -0
- package/.vitest/vitest-report-root-1793979726395379000.json +1 -0
- package/.vitest/vitest-report-root-1793979752029533000.json +1 -0
- package/.vitest/vitest-report-root-1793979753365744000.json +1 -0
- package/.vitest/vitest-report-root-1793979759386206000.json +1 -0
- package/.vitest/vitest-report-root-1793979787819109000.json +1 -0
- package/.vitest/vitest-report-root-1793979827615051000.json +1 -0
- package/.vitest/vitest-report-root-1793979927737393000.json +1 -0
- package/.vitest/vitest-report-root-1793979929836169000.json +1 -0
- package/.vitest/vitest-report-root-1793979955780781000.json +1 -0
- package/.vitest/vitest-report-root-1793980200569636000.json +1 -0
- package/.vitest/vitest-report-root-1793980206045213000.json +1 -0
- package/.vitest/vitest-report-root-1793980285772027000.json +1 -0
- package/.vitest/vitest-report-root-1793980459229828000.json +1 -0
- package/.vitest/vitest-report-root-1793980460545874000.json +1 -0
- package/.vitest/vitest-report-root-1793980554484341000.json +1 -0
- package/.vitest/vitest-report-root-1793980674494388000.json +1 -0
- package/.vitest/vitest-report-root-1793980683752195000.json +1 -0
- package/.vitest/vitest-report-root-1793980947108651000.json +1 -0
- package/.vitest/vitest-report-root-1793981129616629000.json +1 -0
- package/.vitest/vitest-report-root-1793981196611441000.json +1 -0
- package/.vitest/vitest-report-root-1793981226583545000.json +1 -0
- package/.vitest/vitest-report-root-1793981294259721000.json +1 -0
- package/.vitest/vitest-report-root-1793981353393048000.json +1 -0
- package/.vitest/vitest-report-root-1793981424585368000.json +1 -0
- package/.vitest/vitest-report-root-1793981513266687000.json +1 -0
- package/.vitest/vitest-report-root-1793981526418218000.json +1 -0
- package/.vitest/vitest-report-root-1793981540069877000.json +1 -0
- package/.vitest/vitest-report-root-1793981761193625000.json +1 -0
- package/.vitest/vitest-report-root-1793981868520992000.json +1 -0
- package/.vitest/vitest-report-root-1793982048467772000.json +1 -0
- package/.vitest/vitest-report-root-1793982119518020000.json +1 -0
- package/.vitest/vitest-report-root-1793982243473651000.json +1 -0
- package/.vitest/vitest-report-root-1793982406880629000.json +1 -0
- package/.vitest/vitest-report-root-1793982433563632000.json +1 -0
- package/.vitest/vitest-report-root-1793982496753204000.json +1 -0
- package/.vitest/vitest-report-root-1793982500153311000.json +1 -0
- package/.vitest/vitest-report-root-1793982542086095000.json +1 -0
- package/.vitest/vitest-report-root-1793982659482988000.json +1 -0
- package/.vitest/vitest-report-root-1793983799132716000.json +1 -0
- package/.vitest/vitest-report-root-1793983822721833000.json +1 -0
- package/.vitest/vitest-report-root-1793984998618484000.json +1 -0
- package/.vitest/vitest-report-root-1793985050475750000.json +1 -0
- package/.vitest/vitest-report-root-1793985095516077000.json +1 -0
- package/.vitest/vitest-report-root-1793985130729074000.json +1 -0
- package/.vitest/vitest-report-root-1793985177150997000.json +1 -0
- package/.vitest/vitest-report-root-1793985267658626000.json +1 -0
- package/.vitest/vitest-report-root-1793985412705211000.json +1 -0
- package/.vitest/vitest-report-root-1793985433752853000.json +1 -0
- package/.vitest/vitest-report-root-1794087938302852000.json +1 -0
- package/.vitest/vitest-report-root-1794087978339022000.json +1 -0
- package/.vitest/vitest-report-root-1794088095283811000.json +1 -0
- package/.vitest/vitest-report-root-1794088129997065000.json +1 -0
- package/.vitest/vitest-report-root-1794088147336556000.json +1 -0
- package/.vitest/vitest-report-root-1794088173414593000.json +1 -0
- package/.vitest/vitest-report-root-1794088221289657000.json +1 -0
- package/.vitest/vitest-report-root-1794088250766611000.json +1 -0
- package/.vitest/vitest-report-root-1794088365553234000.json +1 -0
- package/.vitest/vitest-report-root-1794088395202655000.json +1 -0
- package/.vitest/vitest-report-root-1794090028732187000.json +1 -0
- package/.vitest/vitest-report-root-1794090054787283000.json +1 -0
- package/.vitest/vitest-report-root-1794090153955794000.json +1 -0
- package/.vitest/vitest-report-root-1794090161850160000.json +1 -0
- package/.vitest/vitest-report-root-1794091755693314000.json +1 -0
- package/.vitest/vitest-report-root-1794091765029349000.json +1 -0
- package/.vitest/vitest-report-root-1794091975649927000.json +1 -0
- package/.vitest/vitest-report-root-1794091994027950000.json +1 -0
- package/.vitest/vitest-report-root-1794092005178771000.json +1 -0
- package/.vitest/vitest-report-root-1794113295302382000.json +1 -0
- package/.vitest/vitest-report-root-1794114156337032000.json +1 -0
- package/.vitest/vitest-report-root-1794114198454137000.json +1 -0
- package/.vitest/vitest-report-root-1794114254064413000.json +1 -0
- package/.vitest/vitest-report-root-1794114280107510000.json +1 -0
- package/.vitest/vitest-report-root-1794114495199837000.json +1 -0
- package/.vitest/vitest-report-root-1794114646604233000.json +1 -0
- package/.vitest/vitest-report-root-1794114666311689000.json +1 -0
- package/.vitest/vitest-report-root-1794114974303438000.json +1 -0
- package/.vitest/vitest-report-root-1794115037361450000.json +1 -0
- package/.vitest/vitest-report-root-1794115097838937000.json +1 -0
- package/.vitest/vitest-report-root-1794115604669388000.json +1 -0
- package/.vitest/vitest-report-root-1794115633814500000.json +1 -0
- package/.vitest/vitest-report-root-1794115648756242000.json +1 -0
- package/.vitest/vitest-report-root-1794115873440741000.json +1 -0
- package/.vitest/vitest-report-root-1794115952930230000.json +1 -0
- package/.vitest/vitest-report-root-1794115963344701000.json +1 -0
- package/.vitest/vitest-report-root-1794116196067450000.json +1 -0
- package/.vitest/vitest-report-root-1794116254301280000.json +1 -0
- package/.vitest/vitest-report-root-1794116259342966000.json +1 -0
- package/.vitest/vitest-report-root-1794118178787879000.json +1 -0
- package/.vitest/vitest-report-root-1794137087891409000.json +1 -0
- package/.vitest/vitest-report-root-1794137100301214000.json +1 -0
- package/.vitest/vitest-report-root-1794137107377813000.json +1 -0
- package/.vitest/vitest-report-root-1794137171230704000.json +1 -0
- package/.vitest/vitest-report-root-1794137317761465000.json +1 -0
- package/.vitest/vitest-report-root-1794137320282368000.json +1 -0
- package/LICENSE +17 -0
- package/PACKAGE_PUBLICATIONS.md +26 -0
- package/builder-package.json +19 -0
- package/package.json +77 -3
- package/scripts/build-builder.ts +27 -0
- package/scripts/build-library-runtime.ts +9 -0
- package/scripts/build-static.ts +75 -0
- package/scripts/build.ts +6 -0
- package/scripts/check-fragment.ts +12 -0
- package/scripts/local-workspaces.test.ts +31 -0
- package/scripts/local-workspaces.ts +55 -0
- package/scripts/release-version-cli.test.ts +40 -0
- package/scripts/release-version.test.ts +29 -0
- package/scripts/release-version.ts +46 -0
- package/scripts/run-package-build.ts +8 -0
- package/scripts/serve-packages.ts +8 -0
- package/spikes/README.md +70 -0
- package/spikes/barrel-rewriting/README.md +97 -0
- package/spikes/barrel-rewriting/measure.ts +134 -0
- package/spikes/barrel-rewriting/readme.ts +174 -0
- package/spikes/barrel-rewriting/results.json +3440 -0
- package/spikes/barrel-rewriting/run.ts +330 -0
- package/spikes/barrel-rewriting/setup.ts +90 -0
- package/spikes/barrel-rewriting/sw.ts +148 -0
- package/spikes/barrel-rewriting/tenant.ts +91 -0
- package/spikes/barrel-rewriting/worker-config.ts +33 -0
- package/spikes/closure-fragments/README.md +157 -0
- package/spikes/closure-fragments/results.json +959 -0
- package/spikes/closure-fragments/run.ts +298 -0
- package/spikes/compiler/README.md +177 -0
- package/spikes/compiler/compile.test.ts +78 -0
- package/spikes/compiler/compile.ts +82 -0
- package/spikes/compiler/facet-redact.d.ts +5 -0
- package/spikes/compiler/markers.ts +88 -0
- package/spikes/compiler/pages.ts +43 -0
- package/spikes/compiler/readme.ts +116 -0
- package/spikes/compiler/reference.ts +81 -0
- package/spikes/compiler/render.ts +113 -0
- package/spikes/compiler/results.json +3310 -0
- package/spikes/compiler/run.ts +250 -0
- package/spikes/compiler/sucrase-parser.d.ts +8 -0
- package/spikes/compiler/sw.ts +62 -0
- package/spikes/diagram-readiness/README.md +134 -0
- package/spikes/diagram-readiness/analysis.test.ts +52 -0
- package/spikes/diagram-readiness/analysis.ts +35 -0
- package/spikes/diagram-readiness/browser.ts +209 -0
- package/spikes/diagram-readiness/readme.ts +65 -0
- package/spikes/diagram-readiness/results.json +30289 -0
- package/spikes/diagram-readiness/run.ts +103 -0
- package/spikes/diagram-readiness/server.ts +53 -0
- package/spikes/esm-sh/README.md +27 -0
- package/spikes/esm-sh/browser-client.ts +18 -0
- package/spikes/esm-sh/browser-server.ts +104 -0
- package/spikes/esm-sh/fixtures/copy-to-clipboard-entry.headers +15 -0
- package/spikes/esm-sh/fixtures/copy-to-clipboard-entry.mjs.txt +3 -0
- package/spikes/esm-sh/fixtures/copy-to-clipboard-module.headers +13 -0
- package/spikes/esm-sh/fixtures/copy-to-clipboard-module.mjs.txt +142 -0
- package/spikes/esm-sh/fixtures/react-copy-to-clipboard-entry.headers +15 -0
- package/spikes/esm-sh/fixtures/react-copy-to-clipboard-entry.mjs.txt +3 -0
- package/spikes/esm-sh/fixtures/react-copy-to-clipboard-module.headers +11 -0
- package/spikes/esm-sh/fixtures/react-copy-to-clipboard-module.mjs.txt +222 -0
- package/spikes/esm-sh/fixtures/toggle-selection-entry.headers +14 -0
- package/spikes/esm-sh/fixtures/toggle-selection-entry.mjs.txt +3 -0
- package/spikes/esm-sh/fixtures/toggle-selection-module.headers +11 -0
- package/spikes/esm-sh/fixtures/toggle-selection-module.mjs.txt +76 -0
- package/spikes/esm-sh/fixtures.ts +54 -0
- package/spikes/esm-sh/redact.ts +1 -0
- package/spikes/frame-commenting/README.md +183 -0
- package/spikes/frame-commenting/agent.ts +110 -0
- package/spikes/frame-commenting/hook.ts +1 -0
- package/spikes/frame-commenting/host.ts +66 -0
- package/spikes/frame-commenting/measure.ts +180 -0
- package/spikes/frame-commenting/model.test.ts +27 -0
- package/spikes/frame-commenting/model.ts +40 -0
- package/spikes/frame-commenting/readme.ts +61 -0
- package/spikes/frame-commenting/results.json +5320 -0
- package/spikes/frame-commenting/run.ts +73 -0
- package/spikes/frame-commenting/setup.ts +125 -0
- package/spikes/lib/barrels.test.ts +107 -0
- package/spikes/lib/barrels.ts +309 -0
- package/spikes/lib/cjs-export-names.mjs +22 -0
- package/spikes/lib/content-types.ts +28 -0
- package/spikes/lib/convert-commonjs.ts +168 -0
- package/spikes/lib/fragment.ts +108 -0
- package/spikes/lib/library-set.ts +194 -0
- package/spikes/lib/module-transform.test.ts +133 -0
- package/spikes/lib/module-transform.ts +351 -0
- package/spikes/lib/origin.ts +140 -0
- package/spikes/lib/pages.ts +290 -0
- package/spikes/lib/report.ts +23 -0
- package/spikes/lib/runtime-server.ts +282 -0
- package/spikes/lib/static-server.ts +82 -0
- package/spikes/lib/trace.ts +384 -0
- package/spikes/local-folder-link/README.md +85 -0
- package/spikes/local-folder-link/checkout.ts +132 -0
- package/spikes/local-folder-link/documents.ts +36 -0
- package/spikes/local-folder-link/readme.ts +42 -0
- package/spikes/local-folder-link/results.json +12815 -0
- package/spikes/local-folder-link/rewrite.test.ts +27 -0
- package/spikes/local-folder-link/rewrite.ts +38 -0
- package/spikes/local-folder-link/run.ts +123 -0
- package/spikes/local-folder-link/server.ts +100 -0
- package/spikes/local-folder-link/sw.ts +97 -0
- package/spikes/origin-isolation/README.md +426 -0
- package/spikes/origin-isolation/browsers.ts +43 -0
- package/spikes/origin-isolation/helper.ts +6 -0
- package/spikes/origin-isolation/host.ts +25 -0
- package/spikes/origin-isolation/measure.ts +118 -0
- package/spikes/origin-isolation/model.test.ts +45 -0
- package/spikes/origin-isolation/model.ts +49 -0
- package/spikes/origin-isolation/proxy.ts +35 -0
- package/spikes/origin-isolation/readme.ts +83 -0
- package/spikes/origin-isolation/results.json +3242 -0
- package/spikes/origin-isolation/run.ts +35 -0
- package/spikes/origin-isolation/server.ts +108 -0
- package/spikes/origin-isolation/sw.ts +28 -0
- package/spikes/origin-isolation/tenant.ts +165 -0
- package/spikes/react-runtime-set/README.md +48 -0
- package/spikes/react-runtime-set/convert.ts +118 -0
- package/spikes/react-runtime-set/export-names.mjs +8 -0
- package/spikes/react-runtime-set/page/page.js +46 -0
- package/spikes/react-runtime-set/results.json +84 -0
- package/spikes/react-runtime-set/run.ts +255 -0
- package/spikes/run.ts +15 -0
- package/spikes/sw-tenant-frame/README.md +95 -0
- package/spikes/sw-tenant-frame/results.json +1348 -0
- package/spikes/sw-tenant-frame/run.ts +373 -0
- package/spikes/sw-tenant-frame/site/frame.html +113 -0
- package/spikes/sw-tenant-frame/site/host.html +25 -0
- package/spikes/sw-tenant-frame/site/sw.js +10 -0
- package/spikes/tailwind-parity/README.md +78 -0
- package/spikes/tailwind-parity/compare.test.ts +70 -0
- package/spikes/tailwind-parity/compare.ts +91 -0
- package/spikes/tailwind-parity/facet-font-scale.d.ts +6 -0
- package/spikes/tailwind-parity/facet-styles.ts +77 -0
- package/spikes/tailwind-parity/results.json +885 -0
- package/spikes/tailwind-parity/run.ts +385 -0
- package/spikes/tailwind-parity/runtime-tailwind.ts +82 -0
- package/src/activity-schema.ts +91 -0
- package/src/activity.test.ts +57 -0
- package/src/build/README.md +94 -0
- package/src/build/barrels.test.ts +107 -0
- package/src/build/barrels.ts +306 -0
- package/src/build/base.ts +2 -0
- package/src/build/check-fragment.ts +45 -0
- package/src/build/cjs-export-names.mjs +24 -0
- package/src/build/commonjs-exports.ts +24 -0
- package/src/build/convert-commonjs.ts +183 -0
- package/src/build/dependencies.ts +4 -0
- package/src/build/dependency-barrels.ts +59 -0
- package/src/build/dependency-cache.ts +40 -0
- package/src/build/dependency-plugin.ts +58 -0
- package/src/build/dependency-runtime.test.ts +121 -0
- package/src/build/dependency-runtime.ts +147 -0
- package/src/build/errors.ts +9 -0
- package/src/build/fragment.ts +89 -0
- package/src/build/index.ts +7 -0
- package/src/build/library-runtime.test.ts +343 -0
- package/src/build/library-runtime.ts +98 -0
- package/src/build/module-utils.ts +11 -0
- package/src/build/recipe-dependencies.ts +14 -0
- package/src/build/runtime-entries.ts +10 -0
- package/src/build/trace.ts +429 -0
- package/src/design-schema.ts +25 -0
- package/src/dev/README.md +48 -0
- package/src/dev/catalog.ts +79 -0
- package/src/dev/cli.test.ts +12 -0
- package/src/dev/cli.ts +25 -0
- package/src/dev/index.ts +115 -0
- package/src/dev/packages.test.ts +175 -0
- package/src/editing.test.tsx +31 -0
- package/src/editing.ts +25 -0
- package/src/frame/activity.browser.ts +34 -0
- package/src/frame/activity.test.ts +27 -0
- package/src/frame/activity.ts +50 -0
- package/src/frame/agent/README.md +47 -0
- package/src/frame/agent/agent.browser.ts +127 -0
- package/src/frame/agent/design.ts +62 -0
- package/src/frame/agent/index.ts +148 -0
- package/src/frame/agent/overlay.test.ts +42 -0
- package/src/frame/agent/overlay.ts +91 -0
- package/src/frame/agent/owner.test.ts +78 -0
- package/src/frame/agent/owner.ts +58 -0
- package/src/frame/agent/provider.tsx +14 -0
- package/src/frame/agent/react-override.ts +55 -0
- package/src/frame/agent/review.browser.ts +65 -0
- package/src/frame/agent/review.ts +107 -0
- package/src/frame/agent/testing/callsite.tsx +5 -0
- package/src/frame/agent/testing/client.ts +99 -0
- package/src/frame/agent/testing/library.ts +3 -0
- package/src/frame/agent/testing/modal.tsx +5 -0
- package/src/frame/agent/testing/review-client.ts +43 -0
- package/src/frame/agent/testing/review-server.ts +31 -0
- package/src/frame/agent/testing/server.ts +72 -0
- package/src/frame/agent/testing/vocabulary-host.ts +20 -0
- package/src/frame/agent/testing/vocabulary.tsx +10 -0
- package/src/frame/agent/vitest.browser.config.ts +6 -0
- package/src/frame/agent/vocabulary.browser.ts +30 -0
- package/src/frame/agent/vocabulary.test.ts +36 -0
- package/src/frame/agent/vocabulary.ts +13 -0
- package/src/frame/agent.ts +2 -0
- package/src/frame/boot-bundle.test.ts +20 -0
- package/src/frame/boot-styles.test.ts +102 -0
- package/src/frame/boot-styles.ts +50 -0
- package/src/frame/boot.test.ts +108 -0
- package/src/frame/boot.ts +205 -0
- package/src/frame/bridge.ts +27 -0
- package/src/frame/devtools-hook.ts +1 -0
- package/src/frame/entry.ts +4 -0
- package/src/frame/export-compiler.test.ts +23 -0
- package/src/frame/export-compiler.ts +18 -0
- package/src/frame/export-page.ts +59 -0
- package/src/frame/export.test.ts +17 -0
- package/src/frame/export.ts +90 -0
- package/src/frame/index.ts +7 -0
- package/src/frame/local-runtime.browser.ts +36 -0
- package/src/frame/page-agent.ts +2 -0
- package/src/frame/readiness.ts +51 -0
- package/src/frame/review-integration.browser.ts +48 -0
- package/src/frame/runtime.browser.ts +71 -0
- package/src/frame/tailwind/README.md +49 -0
- package/src/frame/tailwind/boot-styles.browser.ts +18 -0
- package/src/frame/tailwind/cache.test.ts +53 -0
- package/src/frame/tailwind/cache.ts +20 -0
- package/src/frame/tailwind/load.test.ts +74 -0
- package/src/frame/tailwind/load.ts +66 -0
- package/src/frame/tailwind/recipe.ts +81 -0
- package/src/frame/tailwind/runtime-cache.test.ts +97 -0
- package/src/frame/tailwind/runtime.ts +113 -0
- package/src/frame/tailwind/store.test.ts +104 -0
- package/src/frame/tailwind/store.ts +55 -0
- package/src/frame/tailwind/stylesheets.ts +37 -0
- package/src/frame/tailwind/tailwind.browser.ts +71 -0
- package/src/frame/tailwind/tailwind.test.ts +119 -0
- package/src/frame/tailwind/testing/client.ts +132 -0
- package/src/frame/tailwind/testing/compare.ts +91 -0
- package/src/frame/tailwind/testing/pages.ts +14 -0
- package/src/frame/tailwind/testing/server.ts +89 -0
- package/src/frame/tailwind/vitest.browser.config.ts +7 -0
- package/src/frame/testing/boot-page.ts +3 -0
- package/src/frame/testing/host.ts +60 -0
- package/src/frame/testing/local-host.tsx +33 -0
- package/src/frame/testing/server.ts +120 -0
- package/src/host/BuildLog.test.tsx +40 -0
- package/src/host/BuildLog.tsx +27 -0
- package/src/host/PageFrame.test.tsx +39 -0
- package/src/host/PageFrame.tsx +41 -0
- package/src/host/RuntimeActivity.tsx +75 -0
- package/src/host/activity-state.test.ts +37 -0
- package/src/host/activity-state.ts +69 -0
- package/src/host/agent-source.test.ts +9 -0
- package/src/host/agent-source.ts +14 -0
- package/src/host/agent-validation.test.ts +40 -0
- package/src/host/agent-validation.ts +73 -0
- package/src/host/bridge-request.test.ts +87 -0
- package/src/host/bridge.test.ts +34 -0
- package/src/host/bridge.ts +55 -0
- package/src/host/build-log.test.ts +47 -0
- package/src/host/build-log.ts +29 -0
- package/src/host/clear-cache.test.ts +75 -0
- package/src/host/clear-cache.ts +66 -0
- package/src/host/design-validation.test.ts +38 -0
- package/src/host/design-validation.ts +96 -0
- package/src/host/index.ts +11 -0
- package/src/host/link/index.ts +66 -0
- package/src/host/link/transport.test.ts +10 -0
- package/src/host/link/transport.ts +67 -0
- package/src/host/link/watch.ts +62 -0
- package/src/host/message-values.ts +55 -0
- package/src/host/origin.test.ts +10 -0
- package/src/host/origin.ts +7 -0
- package/src/host/review/README.md +32 -0
- package/src/host/review/index.ts +42 -0
- package/src/host/review/remote.test.ts +21 -0
- package/src/host/review/source.test.ts +19 -0
- package/src/host/review/validation.test.ts +34 -0
- package/src/host/review/validation.ts +55 -0
- package/src/host/runtime-integration.test.ts +29 -0
- package/src/host/source-path.test.ts +14 -0
- package/src/host/validation.ts +111 -0
- package/src/host/vocabulary-validation.test.ts +60 -0
- package/src/link/README.md +115 -0
- package/src/link/barrels.ts +5 -0
- package/src/link/build-cli.ts +12 -0
- package/src/link/build.test.ts +25 -0
- package/src/link/build.ts +99 -0
- package/src/link/commonjs.test.ts +34 -0
- package/src/link/commonjs.ts +39 -0
- package/src/link/examples/server.ts +18 -0
- package/src/link/index.ts +6 -0
- package/src/link/link.browser.ts +66 -0
- package/src/link/local-relay.browser.ts +22 -0
- package/src/link/overrides.test.ts +103 -0
- package/src/link/overrides.ts +69 -0
- package/src/link/page-sources.test.ts +52 -0
- package/src/link/page-sources.ts +69 -0
- package/src/link/source.ts +25 -0
- package/src/link/storage.ts +32 -0
- package/src/link/testing/client.ts +96 -0
- package/src/link/testing/folder.ts +19 -0
- package/src/link/testing/local-client.ts +30 -0
- package/src/link/testing/local-server.ts +26 -0
- package/src/link/testing/local-worker.ts +17 -0
- package/src/link/testing/server.ts +128 -0
- package/src/link/testing/worker.ts +32 -0
- package/src/link/testing-cache.ts +20 -0
- package/src/link/testing-fixtures.ts +16 -0
- package/src/link/types.ts +27 -0
- package/src/link/validation.ts +44 -0
- package/src/link/vitest.browser.config.ts +3 -0
- package/src/markers.ts +18 -0
- package/src/publication/build.ts +27 -0
- package/src/publication/fixtures/build.mjs +2 -0
- package/src/publication/index.ts +3 -0
- package/src/publication/lock.ts +32 -0
- package/src/publication/manifest.ts +14 -0
- package/src/publication/publication.test.ts +89 -0
- package/src/publication/publish.ts +80 -0
- package/src/publication/runtime.ts +28 -0
- package/src/publication/schema.ts +13 -0
- package/src/review-schema.ts +17 -0
- package/src/schema.ts +149 -0
- package/src/storage/db.test.ts +52 -0
- package/src/storage/db.ts +64 -0
- package/src/sw/activity-router.test.ts +53 -0
- package/src/sw/activity.ts +66 -0
- package/src/sw/barrels.ts +44 -0
- package/src/sw/candidates.test.ts +9 -0
- package/src/sw/candidates.ts +14 -0
- package/src/sw/compile.test.ts +152 -0
- package/src/sw/compile.ts +92 -0
- package/src/sw/compiler-columns.ts +44 -0
- package/src/sw/compiler-internals.d.ts +8 -0
- package/src/sw/compiler-plugins.ts +18 -0
- package/src/sw/compiler.test.ts +51 -0
- package/src/sw/compiler.ts +86 -0
- package/src/sw/composition.test.ts +51 -0
- package/src/sw/composition.ts +86 -0
- package/src/sw/content-types.ts +28 -0
- package/src/sw/converted-resolver.test.ts +129 -0
- package/src/sw/converted-router.test.ts +91 -0
- package/src/sw/converted.browser.ts +31 -0
- package/src/sw/converted.test.ts +31 -0
- package/src/sw/converted.ts +64 -0
- package/src/sw/editable-sites.ts +42 -0
- package/src/sw/errors.test.ts +8 -0
- package/src/sw/errors.ts +17 -0
- package/src/sw/index.ts +7 -0
- package/src/sw/integrity.ts +10 -0
- package/src/sw/legacy-storage.ts +18 -0
- package/src/sw/link-activity.test.ts +126 -0
- package/src/sw/link-activity.ts +21 -0
- package/src/sw/link-cache.test.ts +15 -0
- package/src/sw/link-cache.ts +19 -0
- package/src/sw/link-compiler.ts +112 -0
- package/src/sw/link-folder.ts +29 -0
- package/src/sw/link-markdown.test.ts +52 -0
- package/src/sw/link-relay.ts +40 -0
- package/src/sw/link-route.test.ts +150 -0
- package/src/sw/link-route.ts +239 -0
- package/src/sw/link-source.test.ts +31 -0
- package/src/sw/link-source.ts +41 -0
- package/src/sw/markers.test.ts +33 -0
- package/src/sw/markers.ts +128 -0
- package/src/sw/module-transform.test.ts +131 -0
- package/src/sw/module-transform.ts +352 -0
- package/src/sw/package-generation.test.ts +33 -0
- package/src/sw/page-clients.test.ts +37 -0
- package/src/sw/page-clients.ts +45 -0
- package/src/sw/profile.test.ts +21 -0
- package/src/sw/profile.ts +88 -0
- package/src/sw/resolver.test.ts +183 -0
- package/src/sw/resolver.ts +220 -0
- package/src/sw/router-cache.test.ts +78 -0
- package/src/sw/router.ts +320 -0
- package/src/sw/runtime-module.test.ts +61 -0
- package/src/sw/runtime-module.ts +13 -0
- package/src/sw/source-hash.test.ts +7 -0
- package/src/sw/source-hash.ts +37 -0
- package/src/sw/storage.test.ts +108 -0
- package/src/sw/versions.ts +89 -0
- package/src/sw/worker.ts +87 -0
- package/static/README.md +15 -0
- package/static/profile.example.json +15 -0
- package/tsconfig.json +10 -0
- package/vitest.browser.config.ts +4 -0
- package/vitest.config.ts +9 -0
- package/README.md +0 -3
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { dirname, extname, isAbsolute, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { rolldown, type OutputAsset, type OutputChunk, type Plugin, type PreRenderedChunk } from "rolldown";
|
|
5
|
+
import { CommonJsConversionError } from "./errors.ts";
|
|
6
|
+
import { specifierKind } from "./module-utils.ts";
|
|
7
|
+
import { type ClosureTracer, type CommonJsEntry, createResolver, integrityOf, moduleFormat, packageName, packageOf, REQUIRE_CONDITIONS, resolveBrowser } from "./trace.ts";
|
|
8
|
+
|
|
9
|
+
export type ConversionStats = { entries: number; chunks: number; bytes: number; ms: number };
|
|
10
|
+
|
|
11
|
+
type ExportNames = Record<string, { names?: string[]; error?: string }>;
|
|
12
|
+
|
|
13
|
+
const ENTRY = "\0runtime-entry:";
|
|
14
|
+
const REQUIRE_EXTERNAL = "\0runtime-require:";
|
|
15
|
+
const EMPTY = "\0runtime-empty";
|
|
16
|
+
const IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
|
|
17
|
+
const JS_EXTENSIONS = new Set([".js", ".mjs", ".cjs"]);
|
|
18
|
+
// rolldown turns a require it cannot resolve into a call to its __require shim, which throws in a browser.
|
|
19
|
+
const LEFTOVER_REQUIRE = /(?<![\w$.])__require\s*\(/;
|
|
20
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
21
|
+
|
|
22
|
+
function exportNames(entries: CommonJsEntry[]): ExportNames {
|
|
23
|
+
const output = execFileSync(process.execPath, [join(here, "cjs-export-names.mjs")], {
|
|
24
|
+
input: JSON.stringify(entries.map((entry) => entry.path)),
|
|
25
|
+
env: { ...process.env, NODE_ENV: "development" },
|
|
26
|
+
encoding: "utf8",
|
|
27
|
+
stdio: ["pipe", "pipe", "ignore"],
|
|
28
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
29
|
+
timeout: 30_000,
|
|
30
|
+
});
|
|
31
|
+
const result = JSON.parse(output) as ExportNames;
|
|
32
|
+
for (const entry of entries) {
|
|
33
|
+
const item = result[entry.path];
|
|
34
|
+
if (!item?.names || item.error) throw new CommonJsConversionError(`${entry.pkg.name}: listing ${entry.specifier} exports threw: ${item?.error ?? "no export list returned"}`);
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** The ESM face of one CommonJS entry: its `module.exports` as the default export plus an explicit named-export list. */
|
|
40
|
+
function entrySource(entry: CommonJsEntry, names: string[]): string {
|
|
41
|
+
const exported = names.filter((name) => name !== "default" && name !== "__esModule");
|
|
42
|
+
const lines = [`import * as ns from ${JSON.stringify(entry.path)};`];
|
|
43
|
+
lines.push("export default ns.default;");
|
|
44
|
+
exported.forEach((name, index) => lines.push(`const __e${index} = ns[${JSON.stringify(name)}];`));
|
|
45
|
+
if (exported.length > 0) {
|
|
46
|
+
const specifiers = exported.map((name, index) => `__e${index} as ${IDENTIFIER.test(name) ? name : JSON.stringify(name)}`);
|
|
47
|
+
lines.push(`export { ${specifiers.join(", ")} };`);
|
|
48
|
+
}
|
|
49
|
+
return `${lines.join("\n")}\n`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Resolves cross-package `require`s through a CommonJS adapter that imports the shared ESM copy,
|
|
54
|
+
* preserving module.exports identity instead of converting an ESM namespace back to CommonJS.
|
|
55
|
+
*/
|
|
56
|
+
function runtimeSetPlugin(tracer: ClosureTracer, names: ExportNames): Plugin {
|
|
57
|
+
const { runtimeBase, inherits, topLevel } = tracer.spec;
|
|
58
|
+
if (!runtimeBase) throw new Error(`${tracer.spec.name} has no runtime set to convert CommonJS into`);
|
|
59
|
+
const requireResolver = createResolver(REQUIRE_CONDITIONS);
|
|
60
|
+
const external = (options: { source: string; kind: string; path?: string; owner?: string }) =>
|
|
61
|
+
options.kind === "require-call" ? `${REQUIRE_EXTERNAL}${JSON.stringify(options)}` : { id: options.source, external: true };
|
|
62
|
+
return {
|
|
63
|
+
name: "page-runtime-set",
|
|
64
|
+
resolveId(source, importer, { kind }) {
|
|
65
|
+
if (source === EMPTY || source.startsWith(ENTRY) || source.startsWith(REQUIRE_EXTERNAL)) return source;
|
|
66
|
+
if (!importer || importer.startsWith(ENTRY)) return null;
|
|
67
|
+
if (importer.startsWith(REQUIRE_EXTERNAL)) return { id: source, external: true };
|
|
68
|
+
const from = packageOf(importer);
|
|
69
|
+
const resolved = resolveBrowser({ resolver: kind === "require-call" ? requireResolver : tracer.resolver, fromDir: dirname(importer), specifier: source });
|
|
70
|
+
if (resolved.empty) return EMPTY;
|
|
71
|
+
if (resolved.builtin || (specifierKind(source) === "builtin" && !resolved.path)) {
|
|
72
|
+
tracer.fail(from.name, `CommonJS code in ${from.name}@${from.version} requires Node built-in ${resolved.builtin?.resolved ?? source}`);
|
|
73
|
+
return { id: source, external: true };
|
|
74
|
+
}
|
|
75
|
+
if (specifierKind(source) === "relative") return null;
|
|
76
|
+
const name = packageName(source);
|
|
77
|
+
if (inherits.includes(name)) {
|
|
78
|
+
tracer.inherit(source, runtimeBase);
|
|
79
|
+
return external({ source, kind, ...(resolved.path ? { path: resolved.path } : {}) });
|
|
80
|
+
}
|
|
81
|
+
if (topLevel.includes(name)) {
|
|
82
|
+
const url = tracer.provideTopLevel(source);
|
|
83
|
+
if (!url) throw new Error(`cannot resolve base-set entry ${source}`);
|
|
84
|
+
return external({ source, kind, ...(resolved.path ? { path: resolved.path } : {}) });
|
|
85
|
+
}
|
|
86
|
+
if (!resolved.path) {
|
|
87
|
+
tracer.fail(name, `CommonJS code in ${from.name}@${from.version} requires ${source}, which does not resolve (${resolved.error})`);
|
|
88
|
+
return { id: source, external: true };
|
|
89
|
+
}
|
|
90
|
+
if (!JS_EXTENSIONS.has(extname(resolved.path))) return resolved.path;
|
|
91
|
+
const url = tracer.target(resolved.path, source, "bare");
|
|
92
|
+
const owner = `${from.name}@${from.version}`;
|
|
93
|
+
if (url) tracer.mapInScope(`${runtimeBase}${owner}/`, source, url);
|
|
94
|
+
return external({ source, kind, path: resolved.path, owner });
|
|
95
|
+
},
|
|
96
|
+
load(id) {
|
|
97
|
+
if (id === EMPTY) return "module.exports = {};";
|
|
98
|
+
if (id.startsWith(ENTRY)) {
|
|
99
|
+
const entry = tracer.commonJs.get(id.slice(ENTRY.length));
|
|
100
|
+
if (!entry) throw new Error(`unknown runtime-set entry ${id}`);
|
|
101
|
+
const exported = names[entry.path]?.names;
|
|
102
|
+
if (!exported) throw new CommonJsConversionError(`${entry.specifier}: missing explicit export list`);
|
|
103
|
+
return entrySource(entry, exported);
|
|
104
|
+
}
|
|
105
|
+
if (id.startsWith(REQUIRE_EXTERNAL)) {
|
|
106
|
+
const { source, path } = JSON.parse(id.slice(REQUIRE_EXTERNAL.length)) as { source: string; path?: string };
|
|
107
|
+
const specifier = JSON.stringify(source);
|
|
108
|
+
const value = path && moduleFormat(path).format === "commonjs" ? "ns.default" : "ns";
|
|
109
|
+
return `import * as ns from ${specifier};\nmodule.exports = ${value};\n`;
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function chunkFileName(chunk: PreRenderedChunk): string {
|
|
117
|
+
const owners = new Set<string>();
|
|
118
|
+
for (const id of chunk.moduleIds) {
|
|
119
|
+
if (id.startsWith(REQUIRE_EXTERNAL)) {
|
|
120
|
+
const { owner } = JSON.parse(id.slice(REQUIRE_EXTERNAL.length)) as { owner?: string };
|
|
121
|
+
if (owner) owners.add(owner);
|
|
122
|
+
} else if (isAbsolute(id) && JS_EXTENSIONS.has(extname(id))) {
|
|
123
|
+
const pkg = packageOf(id);
|
|
124
|
+
owners.add(`${pkg.name}@${pkg.version}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (owners.size > 1) throw new CommonJsConversionError(`shared chunk ${chunk.name} combines dependency scopes ${[...owners].join(", ")}`);
|
|
128
|
+
const [owner] = owners;
|
|
129
|
+
return `${owner ? `${owner}/` : ""}_chunks/[name]-[hash].js`;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
async function build(tracer: ClosureTracer, names: ExportNames, outDir: string | null) {
|
|
133
|
+
const entries = [...tracer.commonJs.values()];
|
|
134
|
+
const bundle = await rolldown({
|
|
135
|
+
input: Object.fromEntries(entries.map((entry) => [entry.name, `${ENTRY}${entry.name}`])),
|
|
136
|
+
plugins: [runtimeSetPlugin(tracer, names)],
|
|
137
|
+
platform: "browser",
|
|
138
|
+
transform: { define: { "process.env.NODE_ENV": JSON.stringify("development") } },
|
|
139
|
+
logLevel: "silent",
|
|
140
|
+
});
|
|
141
|
+
const options = { format: "esm", entryFileNames: "[name].js", chunkFileNames: chunkFileName } as const;
|
|
142
|
+
try {
|
|
143
|
+
return (outDir ? await bundle.write({ ...options, dir: outDir }) : await bundle.generate(options)).output;
|
|
144
|
+
} finally {
|
|
145
|
+
await bundle.close();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function register(tracer: ClosureTracer, outDir: string, output: Array<OutputChunk | OutputAsset>): number {
|
|
150
|
+
const fileNames = new Set(output.map((item) => item.fileName));
|
|
151
|
+
let bytes = 0;
|
|
152
|
+
for (const item of output) {
|
|
153
|
+
if (item.type !== "chunk") throw new Error(`converting CommonJS emitted an asset: ${item.fileName}`);
|
|
154
|
+
const url = `${tracer.spec.runtimeBase}${item.fileName}`;
|
|
155
|
+
const leftover = item.code.split("\n").find((line) => LEFTOVER_REQUIRE.test(line));
|
|
156
|
+
if (leftover) {
|
|
157
|
+
const owners = [...new Set(item.moduleIds.filter((id) => !id.startsWith("\0")).map((id) => packageOf(id).name))];
|
|
158
|
+
tracer.fail(owners.join(", "), `${url} still calls require through rolldown's shim: ${leftover.trim().slice(0, 160)}`);
|
|
159
|
+
}
|
|
160
|
+
const bareImports = [...item.imports, ...item.dynamicImports].filter((id) => !fileNames.has(id));
|
|
161
|
+
tracer.files.set(url, { url, path: join(outDir, item.fileName), kind: "esm", integrity: integrityOf(item.code), bareImports });
|
|
162
|
+
bytes += Buffer.byteLength(item.code);
|
|
163
|
+
}
|
|
164
|
+
return bytes;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Converts every CommonJS-only entry the tracer found into the development runtime set. Converting
|
|
169
|
+
* can reach ESM packages, whose imports can reach more CommonJS entries, so discovery repeats until it is stable.
|
|
170
|
+
*/
|
|
171
|
+
export async function convertCommonJs(tracer: ClosureTracer, outDir: string): Promise<ConversionStats[]> {
|
|
172
|
+
if (tracer.commonJs.size === 0) return [];
|
|
173
|
+
for (let known = -1; known !== tracer.commonJs.size; ) {
|
|
174
|
+
known = tracer.commonJs.size;
|
|
175
|
+
await build(tracer, exportNames([...tracer.commonJs.values()]), null);
|
|
176
|
+
tracer.drain();
|
|
177
|
+
}
|
|
178
|
+
const started = performance.now();
|
|
179
|
+
const entries = [...tracer.commonJs.values()];
|
|
180
|
+
const output = await build(tracer, exportNames(entries), outDir);
|
|
181
|
+
const bytes = register(tracer, outDir, output);
|
|
182
|
+
return [{ entries: entries.length, chunks: output.length, bytes, ms: Math.round(performance.now() - started) }];
|
|
183
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { buildDependencyRuntime, type DependencyRuntime, type DependencyRuntimeOptions } from "./dependency-runtime.ts";
|
|
2
|
+
export { ensureDependencyRuntime, type CachedDependencyRuntime } from "./dependency-cache.ts";
|
|
3
|
+
export { dependencyRuntimePlugin } from "./dependency-plugin.ts";
|
|
4
|
+
export { runtimeEntries } from "./runtime-entries.ts";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join, relative, sep } from "node:path";
|
|
3
|
+
import { init } from "es-module-lexer";
|
|
4
|
+
import { ResolverFactory } from "rolldown/experimental";
|
|
5
|
+
import { parseSync } from "rolldown/utils";
|
|
6
|
+
import type { Plugin } from "rolldown";
|
|
7
|
+
import type { BarrelIndex } from "../schema.ts";
|
|
8
|
+
import { guardedBarrels } from "../sw/barrels.ts";
|
|
9
|
+
import { mergeBarrels } from "../sw/composition.ts";
|
|
10
|
+
import { transformModule } from "../sw/module-transform.ts";
|
|
11
|
+
import { packageOf } from "./trace.ts";
|
|
12
|
+
|
|
13
|
+
export function dependencyBarrels({ target, root }: { target: "node" | "browser"; root: string }): Plugin {
|
|
14
|
+
const resolver = new ResolverFactory({ conditionNames: [target, "import", "default"], mainFields: target === "browser" ? ["browser", "module", "main"] : ["module", "main"], extensions: [".mjs", ".js", ".cjs", ".json"], symlinks: true });
|
|
15
|
+
const loaded = new Set<string>();
|
|
16
|
+
const directories = new Map<string, string>();
|
|
17
|
+
let index: BarrelIndex = { modules: [], barrels: {} };
|
|
18
|
+
const canonical = (path: string) => {
|
|
19
|
+
const pkg = packageOf(path);
|
|
20
|
+
const key = `${pkg.name}@${pkg.version}`;
|
|
21
|
+
directories.set(key, pkg.dir);
|
|
22
|
+
if (!loaded.has(pkg.dir)) {
|
|
23
|
+
loaded.add(pkg.dir);
|
|
24
|
+
const file = join(pkg.dir, "dist/runtime/barrels.json");
|
|
25
|
+
if (existsSync(file)) {
|
|
26
|
+
const manifest = JSON.parse(readFileSync(join(pkg.dir, "package.json"), "utf8")) as { sideEffects?: boolean | string[] };
|
|
27
|
+
index = mergeBarrels([index, guardedBarrels({ index: JSON.parse(readFileSync(file, "utf8")) as BarrelIndex, name: pkg.name, version: pkg.version, sideEffects: manifest.sideEffects })]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return `/npm/${key}/${relative(pkg.dir, path).split(sep).join("/")}`;
|
|
31
|
+
};
|
|
32
|
+
const localPath = (url: string) => {
|
|
33
|
+
const match = /^\/npm\/((?:@[^/]+\/)?[^/]+)\/(.+)$/.exec(url);
|
|
34
|
+
const root = match && directories.get(match[1]!);
|
|
35
|
+
if (!match || !root) throw new Error(`Unknown compiled runtime module ${url}`);
|
|
36
|
+
return join(root, match[2]!);
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
name: "dependency-runtime-barrels",
|
|
40
|
+
async buildStart() { await init; },
|
|
41
|
+
resolveId(source) { return source.startsWith("/npm/") ? localPath(source) : null; },
|
|
42
|
+
transform(code, id) {
|
|
43
|
+
const entry = id.startsWith("\0entry:");
|
|
44
|
+
if (!entry && (id.startsWith("\0") || !/\.m?js$/.test(id))) return null;
|
|
45
|
+
const parsed = parseSync(id, code, { lang: "js", sourceType: "unambiguous" });
|
|
46
|
+
if (!parsed.module.hasModuleSyntax) return null;
|
|
47
|
+
const from = entry ? root : dirname(id);
|
|
48
|
+
const url = entry ? "/runtime-entry.js" : canonical(id);
|
|
49
|
+
for (const item of parsed.module.staticImports) {
|
|
50
|
+
const path = resolver.sync(from, item.moduleRequest.value).path;
|
|
51
|
+
if (path) canonical(path);
|
|
52
|
+
}
|
|
53
|
+
return transformModule(code, { url, barrels: index, known: () => false, resolveBare(source) {
|
|
54
|
+
const path = resolver.sync(from, source).path;
|
|
55
|
+
return path ? canonical(path) : null;
|
|
56
|
+
} }).code;
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { mkdir, open, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
4
|
+
import { join, resolve } from "node:path";
|
|
5
|
+
import { buildDependencyRuntime, type DependencyRuntime, type DependencyRuntimeOptions } from "./dependency-runtime.ts";
|
|
6
|
+
|
|
7
|
+
export type CachedDependencyRuntime = DependencyRuntime & { root: string };
|
|
8
|
+
|
|
9
|
+
export async function ensureDependencyRuntime(options: Omit<DependencyRuntimeOptions, "outDir"> & { cacheDir: string }): Promise<CachedDependencyRuntime> {
|
|
10
|
+
const identity = createHash("sha256").update(JSON.stringify({ root: resolve(options.root), target: options.target, entries: [...new Set(options.entries)].sort(), exports: options.exports, external: options.external, lock: readFileSync(join(options.root, "pnpm-lock.yaml"), "utf8"), compiler: readFileSync(new URL(import.meta.url)), abi: process.versions.modules })).digest("hex");
|
|
11
|
+
await mkdir(options.cacheDir, { recursive: true });
|
|
12
|
+
const pointer = join(options.cacheDir, `${identity}.json`);
|
|
13
|
+
const lock = `${pointer}.lock`;
|
|
14
|
+
const deadline = Date.now() + 300_000;
|
|
15
|
+
let handle;
|
|
16
|
+
while (!handle) {
|
|
17
|
+
try { handle = await open(lock, "wx"); }
|
|
18
|
+
catch (error) {
|
|
19
|
+
if ((error as NodeJS.ErrnoException).code !== "EEXIST") throw error;
|
|
20
|
+
if (Date.now() > deadline) throw new Error(`Timed out waiting for compiled runtime ${lock}`);
|
|
21
|
+
await new Promise(done => setTimeout(done, 25));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
if (existsSync(pointer)) {
|
|
26
|
+
const cached = JSON.parse(await readFile(pointer, "utf8")) as CachedDependencyRuntime;
|
|
27
|
+
if (Object.entries(cached.inputs).every(([path, hash]) => existsSync(path) && createHash("sha256").update(readFileSync(path)).digest("hex") === hash)) return cached;
|
|
28
|
+
}
|
|
29
|
+
const root = join(options.cacheDir, `${identity}-${randomUUID()}`);
|
|
30
|
+
const staging = `${root}.pending`;
|
|
31
|
+
try {
|
|
32
|
+
const runtime = await buildDependencyRuntime({ ...options, outDir: staging });
|
|
33
|
+
await rename(staging, root);
|
|
34
|
+
const result = { ...runtime, root };
|
|
35
|
+
await writeFile(`${pointer}.pending`, JSON.stringify(result));
|
|
36
|
+
await rename(`${pointer}.pending`, pointer);
|
|
37
|
+
return result;
|
|
38
|
+
} finally { await rm(staging, { recursive: true, force: true }); }
|
|
39
|
+
} finally { await handle.close(); await rm(lock); }
|
|
40
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { isBuiltin } from "node:module";
|
|
2
|
+
import { isAbsolute, join } from "node:path";
|
|
3
|
+
import type { Plugin } from "rolldown";
|
|
4
|
+
import { parseSync } from "rolldown/utils";
|
|
5
|
+
import { ensureDependencyRuntime, type CachedDependencyRuntime } from "./dependency-cache.ts";
|
|
6
|
+
import { moduleFormat } from "./trace.ts";
|
|
7
|
+
|
|
8
|
+
export function dependencyRuntimePlugin(options: { root: string; cacheDir: string; base: CachedDependencyRuntime }): Plugin {
|
|
9
|
+
const modules = new Map<string, { path: string; styles: string[] }>();
|
|
10
|
+
const external = Object.fromEntries(Object.entries(options.base.imports).map(([source, path]) => [source, join(options.base.root, path)]));
|
|
11
|
+
const pinned = new Set(Object.values(external));
|
|
12
|
+
const prefix = "\0page-runtime:";
|
|
13
|
+
const bindings = new Map<string, Map<string, Set<string> | null>>();
|
|
14
|
+
return {
|
|
15
|
+
name: "page-runtime-dependencies",
|
|
16
|
+
transform(code, id) {
|
|
17
|
+
if (id.startsWith("\0") || !/\.[cm]?[jt]sx?$/.test(id)) return null;
|
|
18
|
+
const lang = id.endsWith(".tsx") ? "tsx" : id.endsWith(".ts") ? "ts" : id.endsWith(".jsx") ? "jsx" : "js";
|
|
19
|
+
const parsed = parseSync(id, code, { lang, sourceType: "unambiguous" });
|
|
20
|
+
if (parsed.errors.length) throw new Error(`${id}: ${parsed.errors.map(error => error.message).join("\n")}`);
|
|
21
|
+
const imported = new Map<string, Set<string> | null>();
|
|
22
|
+
for (const item of parsed.module.staticImports) {
|
|
23
|
+
const source = item.moduleRequest.value;
|
|
24
|
+
if (imported.get(source) === null) continue;
|
|
25
|
+
const names = imported.get(source) ?? new Set<string>();
|
|
26
|
+
for (const entry of item.entries) {
|
|
27
|
+
if (entry.isType) continue;
|
|
28
|
+
if (entry.importName.kind === "NamespaceObject") { imported.set(source, null); break; }
|
|
29
|
+
names.add(entry.importName.kind === "Default" ? "default" : entry.importName.name!);
|
|
30
|
+
}
|
|
31
|
+
if (!imported.has(source) || imported.get(source) !== null) imported.set(source, names);
|
|
32
|
+
}
|
|
33
|
+
bindings.set(id, imported);
|
|
34
|
+
return null;
|
|
35
|
+
},
|
|
36
|
+
async resolveId(source, importer) {
|
|
37
|
+
if (source.startsWith(prefix)) return source;
|
|
38
|
+
if (pinned.has(source)) return { id: source, external: options.base.target === "node" };
|
|
39
|
+
if (!importer || source.startsWith(".") || source.startsWith("\0") || isAbsolute(source) || isBuiltin(source) || /^[a-z][a-z0-9+.-]*:/i.test(source) || /[?#]|\.(css|json)$/.test(source)) return null;
|
|
40
|
+
const names = bindings.get(importer)?.get(source);
|
|
41
|
+
const key = JSON.stringify([source, names ? [...names].sort() : null]);
|
|
42
|
+
if (!modules.has(key)) {
|
|
43
|
+
const runtime = external[source] ? options.base : await ensureDependencyRuntime({ root: options.root, cacheDir: options.cacheDir, entries: [source], target: options.base.target, external, ...(names?.size ? { exports: { [source]: [...names].sort() } } : {}) });
|
|
44
|
+
const path = join(runtime.root, runtime.imports[source]!);
|
|
45
|
+
pinned.add(path);
|
|
46
|
+
modules.set(key, { path, styles: runtime.styles.map(style => join(runtime.root, style)) });
|
|
47
|
+
}
|
|
48
|
+
return `${prefix}${key}`;
|
|
49
|
+
},
|
|
50
|
+
load(id) {
|
|
51
|
+
if (!id.startsWith(prefix)) return null;
|
|
52
|
+
const module = modules.get(id.slice(prefix.length));
|
|
53
|
+
if (!module) throw new Error(`Missing dependency runtime module ${id}`);
|
|
54
|
+
const hasDefault = moduleFormat(module.path).module.staticExports.some(item => item.entries.some(entry => entry.exportName.kind === "Default" || entry.exportName.name === "default"));
|
|
55
|
+
return [...module.styles.map(style => `import ${JSON.stringify(style)};`), `export * from ${JSON.stringify(module.path)};`, ...(hasDefault ? [`export { default } from ${JSON.stringify(module.path)};`] : [])].join("\n");
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { mkdtemp, mkdir, writeFile, rm, cp, readFile } from "node:fs/promises";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
5
|
+
import { afterEach, expect, test } from "vitest";
|
|
6
|
+
import { buildDependencyRuntime } from "./dependency-runtime.ts";
|
|
7
|
+
import { ensureDependencyRuntime } from "./dependency-cache.ts";
|
|
8
|
+
import { dependencyRuntimePlugin } from "./dependency-plugin.ts";
|
|
9
|
+
import { rolldown } from "rolldown";
|
|
10
|
+
|
|
11
|
+
const roots: string[] = [];
|
|
12
|
+
afterEach(async () => { await Promise.all(roots.splice(0).map(root => rm(root, { recursive: true, force: true }))); });
|
|
13
|
+
|
|
14
|
+
async function fixture() {
|
|
15
|
+
await mkdir(".tmp", { recursive: true });
|
|
16
|
+
const root = await mkdtemp(".tmp/dependency-runtime-");
|
|
17
|
+
roots.push(root);
|
|
18
|
+
await mkdir(join(root, "node_modules/example-lib"), { recursive: true });
|
|
19
|
+
await writeFile(join(root, "package.json"), JSON.stringify({ type: "module" }));
|
|
20
|
+
await writeFile(join(root, "pnpm-lock.yaml"), "lockfileVersion: '9.0'\n");
|
|
21
|
+
await writeFile(join(root, "node_modules/example-lib/package.json"), JSON.stringify({ name: "example-lib", version: "1.0.0", type: "module", exports: { ".": { browser: "./browser.js", node: "./node.js" }, "./data": "./data.cjs" } }));
|
|
22
|
+
await writeFile(join(root, "node_modules/example-lib/browser.js"), 'export const platform = "browser"; export { default as data } from "./data.cjs";');
|
|
23
|
+
await writeFile(join(root, "node_modules/example-lib/node.js"), 'export const platform = "node"; export { default as data } from "./data.cjs";');
|
|
24
|
+
await writeFile(join(root, "node_modules/example-lib/data.cjs"), 'module.exports = { value: "shared data" };');
|
|
25
|
+
return root;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
test.each(["node", "browser"] as const)("builds a relocatable %s closure with shared CommonJS identity", async target => {
|
|
29
|
+
const root = await fixture();
|
|
30
|
+
const runtime = await buildDependencyRuntime({ root, outDir: join(root, "compiled"), entries: ["example-lib", "example-lib/data"], target });
|
|
31
|
+
await cp(join(root, "compiled"), join(root, "relocated"), { recursive: true });
|
|
32
|
+
await rm(join(root, "node_modules"), { recursive: true });
|
|
33
|
+
const library = await import(pathToFileURL(join(process.cwd(), root, "relocated", runtime.imports["example-lib"]!)).href);
|
|
34
|
+
const data = await import(pathToFileURL(join(process.cwd(), root, "relocated", runtime.imports["example-lib/data"]!)).href);
|
|
35
|
+
expect({ platform: library.platform, data: library.data, same: library.data === data.default, value: data.value }).toEqual({ platform: target, data: { value: "shared data" }, same: true, value: "shared data" });
|
|
36
|
+
expect(Object.keys(runtime.integrity)).toContain(runtime.imports["example-lib"]);
|
|
37
|
+
expect(JSON.parse(await readFile(join(root, "compiled/runtime.json"), "utf8"))).toEqual(runtime);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test("reuses concurrent compilations and publishes a new generation for changed library code", async () => {
|
|
41
|
+
const root = await fixture();
|
|
42
|
+
const options = { root, cacheDir: join(root, "cache"), entries: ["example-lib"], target: "browser" as const };
|
|
43
|
+
const [first, second] = await Promise.all([ensureDependencyRuntime(options), ensureDependencyRuntime(options)]);
|
|
44
|
+
expect(first.root).toBe(second.root);
|
|
45
|
+
await writeFile(join(root, "node_modules/example-lib/browser.js"), 'export const platform = "changed";');
|
|
46
|
+
const changed = await ensureDependencyRuntime(options);
|
|
47
|
+
expect(changed.root).not.toBe(first.root);
|
|
48
|
+
expect((await import(pathToFileURL(join(process.cwd(), changed.root, changed.imports["example-lib"]!)).href)).platform).toBe("changed");
|
|
49
|
+
expect((await import(pathToFileURL(join(process.cwd(), first.root, first.imports["example-lib"]!)).href)).platform).toBe("browser");
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test("emits imported styles and preserves image assets", async () => {
|
|
53
|
+
const root = await fixture();
|
|
54
|
+
await writeFile(join(root, "node_modules/example-lib/style.css"), '.example { color: red; background: url("./image.svg"); }');
|
|
55
|
+
await writeFile(join(root, "node_modules/example-lib/image.svg"), '<svg xmlns="http://www.w3.org/2000/svg"/>');
|
|
56
|
+
await writeFile(join(root, "node_modules/example-lib/browser.js"), 'import "./style.css"; export const platform = "browser";');
|
|
57
|
+
const runtime = await buildDependencyRuntime({ root, outDir: join(root, "compiled"), entries: ["example-lib"], target: "browser" });
|
|
58
|
+
expect(runtime.styles).toHaveLength(1);
|
|
59
|
+
expect(await readFile(join(root, "compiled", runtime.styles[0]!), "utf8")).toContain("color: red");
|
|
60
|
+
expect(await readFile(join(root, "compiled/assets/example-lib@1.0.0/image.svg"), "utf8")).toContain("<svg");
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test("relocates assets referenced through import.meta.url", async () => {
|
|
64
|
+
const root = await fixture();
|
|
65
|
+
await writeFile(join(root, "node_modules/example-lib/image.svg"), '<svg xmlns="http://www.w3.org/2000/svg"/>');
|
|
66
|
+
await writeFile(join(root, "node_modules/example-lib/browser.js"), 'export const image = new URL("./image.svg", import.meta.url);');
|
|
67
|
+
const runtime = await buildDependencyRuntime({ root, outDir: join(root, "compiled"), entries: ["example-lib"], target: "browser" });
|
|
68
|
+
await cp(join(root, "compiled"), join(root, "relocated"), { recursive: true });
|
|
69
|
+
await rm(join(root, "node_modules"), { recursive: true });
|
|
70
|
+
const library = await import(pathToFileURL(join(process.cwd(), root, "relocated", runtime.imports["example-lib"]!)).href);
|
|
71
|
+
expect(existsSync(library.image)).toBe(true);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test("honors explicit browser:false mappings while rejecting undeclared builtins", async () => {
|
|
75
|
+
const root = await fixture();
|
|
76
|
+
await writeFile(join(root, "node_modules/example-lib/package.json"), JSON.stringify({ name: "example-lib", version: "1.0.0", type: "module", main: "./browser.js", browser: { fs: false } }));
|
|
77
|
+
await writeFile(join(root, "node_modules/example-lib/browser.js"), 'import fs from "fs"; export const disabled = Object.keys(fs).length === 0;');
|
|
78
|
+
const runtime = await buildDependencyRuntime({ root, outDir: join(root, "compiled"), entries: ["example-lib"], target: "browser" });
|
|
79
|
+
expect((await import(pathToFileURL(join(process.cwd(), root, "compiled", runtime.imports["example-lib"]!)).href)).disabled).toBe(true);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
test("compiles requested barrel bindings without pulling in unused optional peers", async () => {
|
|
83
|
+
const root = await fixture();
|
|
84
|
+
const library = join(root, "node_modules/example-lib");
|
|
85
|
+
await writeFile(join(library, "package.json"), JSON.stringify({ name: "example-lib", version: "1.0.0", type: "module", sideEffects: false, main: "./browser.js" }));
|
|
86
|
+
await mkdir(join(library, "dist/runtime"), { recursive: true });
|
|
87
|
+
await writeFile(join(library, "dist/runtime/barrels.json"), JSON.stringify({ modules: ["example-lib@1.0.0/leaf.js"], barrels: { "example-lib@1.0.0/browser.js": { value: 0 } } }));
|
|
88
|
+
await writeFile(join(library, "leaf.js"), 'export const value = "selected export";');
|
|
89
|
+
await writeFile(join(library, "browser.js"), 'export { value } from "./leaf.js"; export { missing } from "missing-optional-peer";');
|
|
90
|
+
const runtime = await buildDependencyRuntime({ root, outDir: join(root, "compiled"), entries: ["example-lib"], target: "browser", exports: { "example-lib": ["value"] } });
|
|
91
|
+
expect((await import(pathToFileURL(join(process.cwd(), root, "compiled", runtime.imports["example-lib"]!)).href)).value).toBe("selected export");
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test.each(["node", "browser"] as const)("shares base-module identity across new ESM and CommonJS dependency entries (%s)", async target => {
|
|
95
|
+
const root = resolve(await fixture());
|
|
96
|
+
await mkdir(join(root, "node_modules/shared"));
|
|
97
|
+
await writeFile(join(root, "node_modules/shared/package.json"), JSON.stringify({ name: "shared", version: "1.0.0", type: "module", main: "index.js" }));
|
|
98
|
+
await writeFile(join(root, "node_modules/shared/index.js"), "export const context = {};");
|
|
99
|
+
await writeFile(join(root, "node_modules/example-lib/node.js"), 'import {context} from "shared"; export {context}; export const platform = "node";');
|
|
100
|
+
await writeFile(join(root, "node_modules/example-lib/browser.js"), 'import {context} from "shared"; export {context}; export const platform = "browser";');
|
|
101
|
+
await writeFile(join(root, "node_modules/example-lib/data.cjs"), 'const {context} = require("shared"); module.exports = { context, value: "shared data" };');
|
|
102
|
+
const baseRoot = join(root, "base");
|
|
103
|
+
const base = { ...await buildDependencyRuntime({ root, outDir: baseRoot, entries: ["shared"], target }), root: baseRoot };
|
|
104
|
+
await writeFile(join(root, "template.js"), 'import {context as base} from "shared"; import {context, platform} from "example-lib"; import data from "example-lib/data"; export const result = {same: base === context && base === data.context, platform, data};');
|
|
105
|
+
const bundle = await rolldown({ input: join(root, "template.js"), plugins: [dependencyRuntimePlugin({ root, cacheDir: join(root, "cache"), base })] });
|
|
106
|
+
try {
|
|
107
|
+
await bundle.write({ dir: join(root, "template"), format: "esm", entryFileNames: "entry.mjs" });
|
|
108
|
+
const rendered = await import(pathToFileURL(join(root, "template/entry.mjs")).href);
|
|
109
|
+
expect(rendered.result).toEqual({ same: true, platform: target, data: { context: {}, value: "shared data" } });
|
|
110
|
+
if (target === "node") expect((await readFile(join(root, "template/entry.mjs"), "utf8")).includes("shared data")).toBe(false);
|
|
111
|
+
} finally { await bundle.close(); }
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
test("rejects browser builtins and unresolved imports without publishing metadata", async () => {
|
|
115
|
+
const root = await fixture();
|
|
116
|
+
await writeFile(join(root, "node_modules/example-lib/browser.js"), 'import { readFileSync } from "node:fs"; export { readFileSync };');
|
|
117
|
+
await expect(buildDependencyRuntime({ root, outDir: join(root, "compiled"), entries: ["example-lib"], target: "browser" })).rejects.toThrow(/node:fs/);
|
|
118
|
+
await expect(readFile(join(root, "compiled/runtime.json"))).rejects.toThrow();
|
|
119
|
+
await writeFile(join(root, "node_modules/example-lib/browser.js"), 'export { missing } from "missing-dependency";');
|
|
120
|
+
await expect(buildDependencyRuntime({ root, outDir: join(root, "compiled"), entries: ["example-lib"], target: "browser" })).rejects.toThrow(/missing-dependency/);
|
|
121
|
+
});
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { isBuiltin } from "node:module";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
5
|
+
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
6
|
+
import { rolldown, type Plugin } from "rolldown";
|
|
7
|
+
import { ClosureTracer, createResolver, IMPORT_CONDITIONS, moduleFormat, resolveBrowser } from "./trace.ts";
|
|
8
|
+
import { dependencyBarrels } from "./dependency-barrels.ts";
|
|
9
|
+
import { commonJsExportNames, type CommonJsExports } from "./commonjs-exports.ts";
|
|
10
|
+
|
|
11
|
+
export interface DependencyRuntimeOptions {
|
|
12
|
+
root: string;
|
|
13
|
+
outDir: string;
|
|
14
|
+
entries: string[];
|
|
15
|
+
target: "node" | "browser";
|
|
16
|
+
external?: Record<string, string>;
|
|
17
|
+
exports?: Record<string, string[]>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface DependencyRuntime {
|
|
21
|
+
schema: 1;
|
|
22
|
+
target: "node" | "browser";
|
|
23
|
+
imports: Record<string, string>;
|
|
24
|
+
integrity: Record<string, string>;
|
|
25
|
+
inputs: Record<string, string>;
|
|
26
|
+
styles: string[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function buildDependencyRuntime(options: DependencyRuntimeOptions): Promise<DependencyRuntime> {
|
|
30
|
+
if (!options.entries.length) throw new Error("A dependency runtime requires at least one entry");
|
|
31
|
+
const root = resolve(options.root);
|
|
32
|
+
const entries = [...new Set(options.entries)].sort();
|
|
33
|
+
const inputs: Record<string, string> = {};
|
|
34
|
+
const styles = new Set<string>();
|
|
35
|
+
const assets = new Set<string>();
|
|
36
|
+
const resolved = new Map<string, string>();
|
|
37
|
+
let commonJs: CommonJsExports = {};
|
|
38
|
+
const browserResolver = createResolver(IMPORT_CONDITIONS);
|
|
39
|
+
const plugin: Plugin = {
|
|
40
|
+
name: "dependency-runtime",
|
|
41
|
+
async buildStart() {
|
|
42
|
+
for (const entry of entries) {
|
|
43
|
+
const result = await this.resolve(entry, join(root, "package.json"), { skipSelf: true });
|
|
44
|
+
if (!result || result.external) throw new Error(`Cannot resolve runtime entry ${entry} from ${root}`);
|
|
45
|
+
resolved.set(entry, result.id);
|
|
46
|
+
}
|
|
47
|
+
const paths = [...new Set(resolved.values())].filter(path => moduleFormat(path).format === "commonjs");
|
|
48
|
+
commonJs = await commonJsExportNames(paths);
|
|
49
|
+
},
|
|
50
|
+
async resolveId(source, importer, extra) {
|
|
51
|
+
if (source.startsWith("\0external-require:")) return source;
|
|
52
|
+
if (options.external?.[source]) {
|
|
53
|
+
if (extra.kind !== "require-call") return { id: source, external: true };
|
|
54
|
+
const original = await this.resolve(source, join(root, "package.json"), { ...extra, skipSelf: true });
|
|
55
|
+
if (!original) throw new Error(`Cannot resolve shared runtime dependency ${source}`);
|
|
56
|
+
return `\0external-require:${JSON.stringify({ source, commonJs: moduleFormat(original.id).format === "commonjs" })}`;
|
|
57
|
+
}
|
|
58
|
+
if (isBuiltin(source)) {
|
|
59
|
+
if (options.target === "browser") {
|
|
60
|
+
const mapped = importer && resolveBrowser({ resolver: browserResolver, fromDir: dirname(importer), specifier: source });
|
|
61
|
+
if (mapped && mapped.empty) return "\0browser-empty";
|
|
62
|
+
if (mapped && mapped.path) return mapped.path;
|
|
63
|
+
throw new Error(`Browser runtime cannot import ${source} from ${importer}`);
|
|
64
|
+
}
|
|
65
|
+
return { id: source, external: true };
|
|
66
|
+
}
|
|
67
|
+
if (source.startsWith("\0entry:")) return source;
|
|
68
|
+
if (importer?.startsWith("\0entry:")) return this.resolve(source, join(root, "package.json"), { ...extra, skipSelf: true });
|
|
69
|
+
if (/^(react|react-dom|scheduler)(\/|$)/.test(source)) return this.resolve(source, join(root, "package.json"), { ...extra, skipSelf: true });
|
|
70
|
+
return null;
|
|
71
|
+
},
|
|
72
|
+
load(id) {
|
|
73
|
+
if (id === "\0browser-empty") return "export default {};";
|
|
74
|
+
if (id.startsWith("\0external-require:")) {
|
|
75
|
+
const { source, commonJs } = JSON.parse(id.slice("\0external-require:".length)) as { source: string; commonJs: boolean };
|
|
76
|
+
return `import * as ns from ${JSON.stringify(source)}; module.exports = ${commonJs ? "ns.default" : "ns"};`;
|
|
77
|
+
}
|
|
78
|
+
if (id.endsWith(".css")) {
|
|
79
|
+
const tracer = new ClosureTracer({ name: "dependency-styles", resolveFrom: root, entries: [], topLevel: [], inherits: [] });
|
|
80
|
+
tracer.target(id, id, "relative");
|
|
81
|
+
if (tracer.failures.length) throw new Error(tracer.failures.map(item => item.detail).join("\n"));
|
|
82
|
+
for (const file of tracer.files.values()) {
|
|
83
|
+
const fileName = `assets/${file.url}`;
|
|
84
|
+
const source = readFileSync(file.path);
|
|
85
|
+
inputs[file.path] = createHash("sha256").update(source).digest("hex");
|
|
86
|
+
if (file.path === id) styles.add(fileName);
|
|
87
|
+
if (!assets.has(fileName)) this.emitFile({ type: "asset", fileName, source });
|
|
88
|
+
assets.add(fileName);
|
|
89
|
+
}
|
|
90
|
+
return { code: "export {};", moduleType: "js" };
|
|
91
|
+
}
|
|
92
|
+
if (!id.startsWith("\0entry:")) return null;
|
|
93
|
+
const path = resolved.get(id.slice(7));
|
|
94
|
+
if (!path) throw new Error(`Missing resolved runtime entry ${id}`);
|
|
95
|
+
const names = commonJs[path]?.names;
|
|
96
|
+
const requested = options.exports?.[id.slice(7)];
|
|
97
|
+
if (!names) {
|
|
98
|
+
const source = JSON.stringify(id.slice(7));
|
|
99
|
+
if (requested) return `import { ${requested.map((name, index) => `${JSON.stringify(name)} as e${index}`).join(", ")} } from ${source}; export { ${requested.map((name, index) => `e${index} as ${JSON.stringify(name)}`).join(", ")} };`;
|
|
100
|
+
return `export * from ${source}; ${moduleFormat(path).module.staticExports.some(item => item.entries.some(entry => entry.exportName.kind === "Default" || entry.exportName.name === "default")) ? `export { default } from ${source};` : ""}`;
|
|
101
|
+
}
|
|
102
|
+
const exported = names.filter(name => name !== "default" && name !== "__esModule");
|
|
103
|
+
return [`import value from ${JSON.stringify(path)};`, "export default value;", ...exported.map((name, index) => `const e${index} = value[${JSON.stringify(name)}]; export { e${index} as ${JSON.stringify(name)} };`)].join("\n");
|
|
104
|
+
},
|
|
105
|
+
transform(code, id) {
|
|
106
|
+
if (!id.startsWith("\0") && !id.endsWith(".css")) inputs[id] = createHash("sha256").update(code).digest("hex");
|
|
107
|
+
if (id.startsWith("\0")) return null;
|
|
108
|
+
return code.replace(/new URL\(\s*(['"])(\.{1,2}\/[^'"]+)\1\s*,\s*import\.meta\.url\s*\)/g, (_match, _quote: string, reference: string) => {
|
|
109
|
+
const path = resolve(dirname(id), reference);
|
|
110
|
+
const source = readFileSync(path);
|
|
111
|
+
inputs[path] = createHash("sha256").update(source).digest("hex");
|
|
112
|
+
const asset = this.emitFile({ type: "asset", name: basename(path), source });
|
|
113
|
+
return `new URL(import.meta.ROLLUP_FILE_URL_${asset})`;
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
await rm(options.outDir, { recursive: true, force: true });
|
|
118
|
+
await mkdir(options.outDir, { recursive: true });
|
|
119
|
+
const bundle = await rolldown({
|
|
120
|
+
input: Object.fromEntries(entries.map((specifier, index) => [`entry-${index}`, `\0entry:${specifier}`])),
|
|
121
|
+
plugins: [plugin, dependencyBarrels({ target: options.target, root })],
|
|
122
|
+
platform: options.target,
|
|
123
|
+
resolve: { conditionNames: [options.target, "import", "default"], mainFields: options.target === "browser" ? ["browser", "module", "main"] : ["module", "main"], aliasFields: options.target === "browser" ? [["browser"]] : [] },
|
|
124
|
+
transform: { define: { "process.env.NODE_ENV": JSON.stringify("development") } },
|
|
125
|
+
onLog(level, log, handler) {
|
|
126
|
+
if (log.code === "UNRESOLVED_IMPORT") throw new Error(log.message);
|
|
127
|
+
// Page runtimes execute whole React trees; React Server Component boundaries do not apply.
|
|
128
|
+
if (log.code === "MODULE_LEVEL_DIRECTIVE") return;
|
|
129
|
+
handler(level, log);
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
try {
|
|
133
|
+
const paths = Object.fromEntries(Object.entries(options.external ?? {}).map(([specifier, path]) => {
|
|
134
|
+
const value = relative(options.outDir, path).split(sep).join("/");
|
|
135
|
+
return [specifier, value.startsWith(".") ? value : `./${value}`];
|
|
136
|
+
}));
|
|
137
|
+
const { output } = await bundle.write({ dir: options.outDir, format: "esm", entryFileNames: "[name].mjs", chunkFileNames: "[name]-[hash].mjs", paths, ...(options.target === "node" ? { banner: 'import { createRequire as __runtimeRequire } from "node:module"; const require = __runtimeRequire(import.meta.url);' } : {}) });
|
|
138
|
+
if (options.target === "browser") {
|
|
139
|
+
for (const item of output) if (item.type === "chunk" && /(?<![\w$.])__require\s*\(/.test(item.code)) throw new Error(`Browser dependency runtime ${item.fileName} still contains a dynamic require`);
|
|
140
|
+
}
|
|
141
|
+
const imports = Object.fromEntries(entries.map((specifier, index) => [specifier, `entry-${index}.mjs`]));
|
|
142
|
+
const integrity = Object.fromEntries(output.map(item => [item.fileName, createHash("sha256").update(readFileSync(join(options.outDir, item.fileName))).digest("hex")]));
|
|
143
|
+
const runtime: DependencyRuntime = { schema: 1, target: options.target, imports, integrity, inputs, styles: [...styles] };
|
|
144
|
+
await writeFile(join(options.outDir, "runtime.json"), JSON.stringify(runtime, null, 2));
|
|
145
|
+
return runtime;
|
|
146
|
+
} finally { await bundle.close(); }
|
|
147
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export class NodeBuiltinError extends Error {
|
|
2
|
+
override name = "NodeBuiltinError";
|
|
3
|
+
}
|
|
4
|
+
export class CommonJsConversionError extends Error {
|
|
5
|
+
override name = "CommonJsConversionError";
|
|
6
|
+
}
|
|
7
|
+
export class BaseSetRemapError extends Error {
|
|
8
|
+
override name = "BaseSetRemapError";
|
|
9
|
+
}
|