@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,128 @@
|
|
|
1
|
+
import { createServer, type Server, type IncomingMessage, type ServerResponse } from "node:http";
|
|
2
|
+
import { mkdir, mkdtemp, cp, symlink, readFile, writeFile, rename } from "node:fs/promises";
|
|
3
|
+
import { dirname, isAbsolute, join, resolve, sep } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { build } from "rolldown";
|
|
6
|
+
import { ResolverFactory } from "rolldown/experimental";
|
|
7
|
+
import type { PageLock, RuntimeProfile } from "../../schema.ts";
|
|
8
|
+
import { buildLinkRuntime } from "../build.ts";
|
|
9
|
+
import { composeLinkOverrides } from "../overrides.ts";
|
|
10
|
+
import { integrityOf, packageOf } from "../../build/trace.ts";
|
|
11
|
+
import { moduleUrl } from "../../sw/compiler.ts";
|
|
12
|
+
|
|
13
|
+
export type LinkRecord = { marker: string; at: number; elapsed: number; compiled: string[]; controlLoads: number; reactInstances: number; reactEvaluations: number; restored: boolean; deniedWithoutOverrides: boolean; folderTransport: boolean };
|
|
14
|
+
const root = resolve(dirname(fileURLToPath(import.meta.url)), "../../../../..");
|
|
15
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
|
|
17
|
+
async function listen(server: Server): Promise<string> {
|
|
18
|
+
await new Promise<void>((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
19
|
+
const address = server.address(); if (!address || typeof address === "string") throw new Error("No server port");
|
|
20
|
+
return `http://127.0.0.1:${address.port}`;
|
|
21
|
+
}
|
|
22
|
+
async function bundle(entry: string): Promise<string> {
|
|
23
|
+
const result = await build({ input: entry, platform: "browser", resolve: { conditionNames: ["worker", "browser", "import", "default"] }, transform: { define: { "process.env.NODE_ENV": JSON.stringify("development"), "process.env": "{}" } }, output: { format: "iife" }, write: false });
|
|
24
|
+
const chunk = result.output.find((file) => file.type === "chunk"); if (!chunk || chunk.type !== "chunk") throw new Error("Missing test bundle"); return chunk.code;
|
|
25
|
+
}
|
|
26
|
+
function serve(handle: (request: IncomingMessage, response: ServerResponse) => Promise<void>): Server {
|
|
27
|
+
return createServer((request, response) => { void handle(request, response).catch((error: unknown) => { response.statusCode = 500; response.end(String(error)); }); });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export async function startLinkTestServer() {
|
|
31
|
+
await mkdir(join(root, ".tmp/H-link"), { recursive: true });
|
|
32
|
+
const checkout = await mkdtemp(join(root, ".tmp/H-link/checkout-"));
|
|
33
|
+
await cp(join(root, "packages/ui/src"), join(checkout, "src"), { recursive: true });
|
|
34
|
+
await symlink(join(root, "packages/ui/node_modules"), join(checkout, "node_modules"), "dir");
|
|
35
|
+
await writeFile(join(checkout, "package.json"), JSON.stringify({ name: "@flanksource/clicky-ui", version: "9.0.0", type: "module", sideEffects: ["**/*.css"], exports: { "./data": "./dist/Version.js" } }));
|
|
36
|
+
const original = 'import * as __linkProbeReact from "react";\n' + await readFile(join(checkout, "src/data/Version.tsx"), "utf8") + '\nexport const linkedVersionReact = __linkProbeReact.default;\n';
|
|
37
|
+
const tablePath = join(checkout, "src/data/DataTable.tsx");
|
|
38
|
+
await writeFile(tablePath, 'import * as __linkProbeReact from "react";\n' + await readFile(tablePath, "utf8") + '\nexport const linkedTableReact = __linkProbeReact.default;\n');
|
|
39
|
+
const edit = async (revision: number) => {
|
|
40
|
+
const path = join(checkout, "src/data/Version.tsx");
|
|
41
|
+
const marker = '<span data-link-edit>revision-' + revision + '</span>';
|
|
42
|
+
await writeFile(path + ".next", original.replace("{parts.length > 0 &&", marker + "{parts.length > 0 &&"));
|
|
43
|
+
await rename(path + ".next", path);
|
|
44
|
+
};
|
|
45
|
+
await edit(0);
|
|
46
|
+
await writeFile(join(checkout, "src/link-data.ts"), 'export { Version, linkedVersionReact } from "./data/Version"; export { DataTable, linkedTableReact } from "./data/DataTable";');
|
|
47
|
+
const dist = await build({ input: join(checkout, "src/link-data.ts"), platform: "browser", external: (source) => !source.startsWith(".") && !isAbsolute(source), output: { dir: join(checkout, "dist"), format: "es", preserveModules: true, preserveModulesRoot: join(checkout, "src"), entryFileNames: "[name].js" } });
|
|
48
|
+
const entry = dist.output.find((file) => file.type === "chunk" && file.isEntry);
|
|
49
|
+
if (!entry) throw new Error("Missing Version dist fixture");
|
|
50
|
+
await writeFile(join(checkout, "package.json"), JSON.stringify({ name: "@flanksource/clicky-ui", version: "9.0.0", type: "module", sideEffects: ["**/*.css"], exports: { "./data": `./dist/${entry.fileName}` } }));
|
|
51
|
+
const built = await buildLinkRuntime({ libraryDir: checkout, outDir: join(checkout, "dist/runtime"), entries: { "@flanksource/clicky-ui/data": "src/link-data.ts" }, defines: { __CLICKY_COMMIT__: "checkout-commit", __CLICKY_TAG__: "local", __CLICKY_DATE__: "2026-01-01", __CLICKY_DIRTY__: false } });
|
|
52
|
+
const target = built.fragment.imports.react!;
|
|
53
|
+
const path = join(checkout, target.slice(`${built.library}@${built.version}/`.length));
|
|
54
|
+
const code = "globalThis.__LINK_REACT_EVALUATIONS__ = (globalThis.__LINK_REACT_EVALUATIONS__ ?? 0) + 1;\n" + await readFile(path, "utf8");
|
|
55
|
+
await writeFile(path, code); built.fragment.integrity[target] = integrityOf(code);
|
|
56
|
+
await writeFile(join(checkout, "dist/runtime/link.json"), JSON.stringify(built));
|
|
57
|
+
const source = serve(async (request, response) => {
|
|
58
|
+
response.setHeader("access-control-allow-origin", "*"); response.setHeader("cache-control", "no-store");
|
|
59
|
+
const path = resolve(checkout, "." + decodeURIComponent(new URL(request.url!, "http://localhost").pathname));
|
|
60
|
+
if (!path.startsWith(checkout + sep)) { response.statusCode = 403; response.end("outside checkout"); return; }
|
|
61
|
+
try { response.end(await readFile(path)); } catch (error) { response.statusCode = 404; response.end(String(error)); }
|
|
62
|
+
});
|
|
63
|
+
const sourceOrigin = await listen(source);
|
|
64
|
+
let hostOrigin = ""; let runtimeOrigin = "";
|
|
65
|
+
const profile: RuntimeProfile = { runtimeDomain: "127.0.0.1", embedders: [], packageOrigin: "http://127.0.0.1", registry: "http://127.0.0.1/registry", managed: {}, policy: { dependencies: "strict" }, minReleaseAgeDays: 0, network: { allow: [] }, csp: { add: {} }, links: "allow", sources: ["host"], readinessTimeoutMs: 15000 };
|
|
66
|
+
const baseLock: PageLock = { lock: 2, packageOrigin: profile.packageOrigin, page: "page.tsx", versions: { "@flanksource/clicky-ui": "1.0.0" }, map: { imports: {}, scopes: {} }, integrity: {}, remaps: {}, barrels: { modules: [], barrels: {} } };
|
|
67
|
+
const lock = composeLinkOverrides({ lock: baseLock, links: [{ id: "checkout", build: built, source: { kind: "server", url: sourceOrigin } }], profile, developerOverrides: true });
|
|
68
|
+
const resolver = new ResolverFactory({ conditionNames: ["browser", "import", "module", "default"], extensions: [".js", ".mjs"], symlinks: true });
|
|
69
|
+
const runtimeFiles = new Map<string, string>();
|
|
70
|
+
// Transitive packages are only resolvable from the packages that depend on them, so each one is looked up
|
|
71
|
+
// from the checkout and every package directory found so far, and must match the traced version.
|
|
72
|
+
const packageDirs = [checkout];
|
|
73
|
+
const pending = Object.keys(built.fragment.integrity).filter((path) => !path.startsWith(`${built.library}@${built.version}/`));
|
|
74
|
+
while (pending.length) {
|
|
75
|
+
const found = pending.filter((path) => {
|
|
76
|
+
const match = /^(@[^/]+\/[^@]+|[^@]+)@([^/]+)\/(.*)$/.exec(path); if (!match) throw new Error(`Invalid package path ${path}`);
|
|
77
|
+
for (const base of packageDirs) {
|
|
78
|
+
const result = resolver.sync(base, match[1]!);
|
|
79
|
+
if (!result.path) continue;
|
|
80
|
+
const pkg = packageOf(result.path);
|
|
81
|
+
if (pkg.version !== match[2]) continue;
|
|
82
|
+
runtimeFiles.set(path, join(pkg.dir, match[3]!));
|
|
83
|
+
if (!packageDirs.includes(pkg.dir)) packageDirs.push(pkg.dir);
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
});
|
|
88
|
+
if (!found.length) throw new Error(`Missing dependency manifests: ${pending.join(", ")}`);
|
|
89
|
+
for (const path of found) pending.splice(pending.indexOf(path), 1);
|
|
90
|
+
}
|
|
91
|
+
const workerCode = await bundle(join(here, "worker.ts"));
|
|
92
|
+
const clientCode = await bundle(join(here, "client.ts"));
|
|
93
|
+
const runtime = serve(async (request, response) => {
|
|
94
|
+
const url = new URL(request.url!, runtimeOrigin); response.setHeader("cache-control", "no-store");
|
|
95
|
+
if (url.pathname === "/worker.js") { response.setHeader("content-type", "text/javascript"); response.end(workerCode); return; }
|
|
96
|
+
if (url.pathname === "/profile.json") { response.setHeader("content-type", "application/json"); response.end(JSON.stringify(profile)); return; }
|
|
97
|
+
if (url.pathname.startsWith("/packages/")) { const file = runtimeFiles.get(decodeURIComponent(url.pathname.slice(10))); if (!file) throw new Error(`Missing package ${url.pathname}`); response.end(await readFile(file)); return; }
|
|
98
|
+
response.setHeader("content-type", "text/html");
|
|
99
|
+
if (url.pathname === "/setup") { response.end(`<!doctype html><script>navigator.serviceWorker.addEventListener("message",e=>parent.postMessage(e.data,${JSON.stringify(hostOrigin)}));window.addEventListener("message",e=>{if(e.source!==parent||e.origin!==${JSON.stringify(hostOrigin)})return;navigator.serviceWorker.controller.postMessage(e.data,e.ports)});(async()=>{await navigator.serviceWorker.register("/worker.js");await navigator.serviceWorker.ready;if(!navigator.serviceWorker.controller)await new Promise(r=>navigator.serviceWorker.addEventListener("controllerchange",r,{once:true}));parent.postMessage("runtime-ready",${JSON.stringify(hostOrigin)})})()</script>`); return; }
|
|
100
|
+
if (url.pathname === "/control") { response.end(`<!doctype html><p>Unlinked control</p><script>parent.postMessage("control-ready",${JSON.stringify(hostOrigin)})</script>`); return; }
|
|
101
|
+
if (url.pathname === "/test-frame") {
|
|
102
|
+
const map = { imports: Object.fromEntries(Object.entries(lock.map.imports).map(([name, target]) => [name, moduleUrl(target)])), scopes: Object.fromEntries(Object.entries(lock.map.scopes).map(([scope, table]) => [scope, Object.fromEntries(Object.entries(table).map(([name, target]) => [name, moduleUrl(target)]))])) };
|
|
103
|
+
response.end(`<!doctype html><html><head><script type="importmap">${JSON.stringify(map)}</script></head><body><div id="root"></div><script type="module">try{await import("/src/page.tsx?page=page.tsx");const ready=()=>{const marker=document.querySelector("[data-link-edit]");if(marker&&document.querySelectorAll("tbody tr").length===2)requestAnimationFrame(()=>requestAnimationFrame(()=>parent.postMessage({marker:marker.textContent,at:performance.timeOrigin+performance.now(),reactInstances:globalThis.reactInstances,reactEvaluations:globalThis.__LINK_REACT_EVALUATIONS__},${JSON.stringify(hostOrigin)})));else requestAnimationFrame(ready)};ready()}catch(e){parent.postMessage({error:String(e)},${JSON.stringify(hostOrigin)})}</script></body></html>`); return;
|
|
104
|
+
}
|
|
105
|
+
response.statusCode = 404; response.end("missing runtime test page");
|
|
106
|
+
});
|
|
107
|
+
runtimeOrigin = await listen(runtime); profile.packageOrigin = `${runtimeOrigin}/packages`;
|
|
108
|
+
baseLock.packageOrigin = profile.packageOrigin; lock.packageOrigin = profile.packageOrigin;
|
|
109
|
+
const records: LinkRecord[] = []; const errors: string[] = [];
|
|
110
|
+
const host = serve(async (request, response) => {
|
|
111
|
+
if (request.url === "/client.js") { response.setHeader("content-type", "text/javascript"); response.end(clientCode); return; }
|
|
112
|
+
if (request.url === "/record") { const chunks = []; for await (const chunk of request) chunks.push(chunk); const record = JSON.parse(Buffer.concat(chunks).toString()); if (record.error) errors.push(record.error); else records.push(record); response.end("ok"); return; }
|
|
113
|
+
response.setHeader("content-type", "text/html"); response.end(`<!doctype html><h1>Linked checkout</h1><button id="folder">Link folder</button><p id="status">File-server link</p><iframe id="setup" hidden></iframe><iframe id="linked" style="width:900px;height:400px"></iframe><iframe id="control"></iframe><script type="application/json" id="config">${JSON.stringify({ runtimeOrigin, sourceOrigin, profile, lock: baseLock, build: built }).replaceAll("<", "\\u003c")}</script><script src="/client.js"></script>`);
|
|
114
|
+
});
|
|
115
|
+
hostOrigin = await listen(host); profile.embedders = [hostOrigin];
|
|
116
|
+
return { hostOrigin, checkout, edit, async next(): Promise<LinkRecord> {
|
|
117
|
+
const deadline = Date.now() + 30000;
|
|
118
|
+
while (!records.length) { if (errors.length) throw new Error(errors.join("\n")); if (Date.now() > deadline) throw new Error("Timed out waiting for linked frame"); await new Promise((resolve) => setTimeout(resolve, 25)); }
|
|
119
|
+
return records.shift()!;
|
|
120
|
+
}, async close() { await Promise.all([host, runtime, source].map((server) => new Promise<void>((resolve, reject) => server.close((error) => error ? reject(error) : resolve())))); } };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
124
|
+
const server = await startLinkTestServer();
|
|
125
|
+
process.stdout.write(`Link verification host: ${server.hostOrigin}\nFolder to select: ${server.checkout}\n`);
|
|
126
|
+
process.once("SIGINT", () => { void server.close(); });
|
|
127
|
+
process.once("SIGTERM", () => { void server.close(); });
|
|
128
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createRouter } from "../../sw/router.ts";
|
|
2
|
+
import { BASE_PLUGINS } from "../../sw/compiler.ts";
|
|
3
|
+
import { createPageClients } from "../../sw/page-clients.ts";
|
|
4
|
+
import type { RuntimeProfile } from "../../schema.ts";
|
|
5
|
+
|
|
6
|
+
const worker = self as unknown as {
|
|
7
|
+
location: Location; skipWaiting(): Promise<void>;
|
|
8
|
+
clients: { claim(): Promise<void>; get(id: string): Promise<{ id: string; url: string } | undefined>; matchAll(options?: { type: "all"; includeUncontrolled: boolean }): Promise<Array<{ id: string; postMessage(value: unknown): void }>> };
|
|
9
|
+
addEventListener(type: string, listener: (event: { request: Request; clientId: string; resultingClientId: string; data: { stats?: boolean; message?: unknown }; ports: MessagePort[]; waitUntil(promise: Promise<unknown>): void; respondWith(promise: Promise<Response>): void }) => void): void;
|
|
10
|
+
};
|
|
11
|
+
const router = fetch("/profile.json").then(async (response) => createRouter({ origin: worker.location.origin, version: "link-browser", profile: await response.json() as RuntimeProfile, caches, plugins: BASE_PLUGINS }));
|
|
12
|
+
const pageClients = createPageClients({ origin: worker.location.origin, clients: worker.clients });
|
|
13
|
+
let compiled: string[] = [];
|
|
14
|
+
worker.addEventListener("install", (event) => event.waitUntil(worker.skipWaiting()));
|
|
15
|
+
worker.addEventListener("activate", (event) => event.waitUntil(worker.clients.claim()));
|
|
16
|
+
worker.addEventListener("message", (event) => event.waitUntil((async () => {
|
|
17
|
+
try {
|
|
18
|
+
if (event.data.stats) { event.ports[0]!.postMessage({ compiled }); compiled = []; }
|
|
19
|
+
else { await (await router).message(event.data.message); event.ports[0]!.postMessage({ ok: true }); }
|
|
20
|
+
} catch (error) { event.ports[0]!.postMessage({ error: String(error) }); }
|
|
21
|
+
})()));
|
|
22
|
+
worker.addEventListener("fetch", (event) => {
|
|
23
|
+
const url = new URL(event.request.url);
|
|
24
|
+
if (url.origin !== worker.location.origin || !/^\/(src|link|npm|frame)\//.test(url.pathname)) return;
|
|
25
|
+
event.respondWith((async () => {
|
|
26
|
+
const { request, owner } = await pageClients.request(event);
|
|
27
|
+
const response = await (await router).route(request, { onError: (error) => { void worker.clients.matchAll().then((clients) => { for (const client of clients) client.postMessage({ error: `${error.phase}: ${error.file}: ${error.message}` }); }); } });
|
|
28
|
+
if (response.headers.get("x-link-compiled") === "1") compiled.push(url.pathname);
|
|
29
|
+
event.waitUntil(pageClients.served({ event, owner, response }));
|
|
30
|
+
return response;
|
|
31
|
+
})());
|
|
32
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StoredLink } from "./types.ts";
|
|
2
|
+
import type { createLinkStore } from "./storage.ts";
|
|
3
|
+
|
|
4
|
+
export function memoryLinkStorage(): ReturnType<typeof createLinkStore> {
|
|
5
|
+
const links = new Map<string, StoredLink>();
|
|
6
|
+
return { async get(id) { const link = links.get(id); if (!link) throw new Error(`Unknown library link ${id}`); return structuredClone(link); }, async put(link) { links.set(link.id, structuredClone(link)); }, async list() { return [...links.values()].map((link) => structuredClone(link)); }, async remove(id) { links.delete(id); }, async close() {} };
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function memoryCaches(): CacheStorage {
|
|
10
|
+
const stores = new Map<string, Map<string, Response>>();
|
|
11
|
+
const address = (key: RequestInfo | URL) => typeof key === "string" ? key : key instanceof URL ? key.href : key.url;
|
|
12
|
+
return {
|
|
13
|
+
async open(name: string) {
|
|
14
|
+
const entries = stores.get(name) ?? new Map<string, Response>(); stores.set(name, entries);
|
|
15
|
+
return { async put(key: RequestInfo | URL, response: Response) { entries.set(address(key), response.clone()); }, async match(key: RequestInfo | URL) { return entries.get(address(key))?.clone(); }, async keys() { return [...entries.keys()].map((key) => new Request(key)); }, async delete(key: RequestInfo | URL) { return entries.delete(address(key)); } };
|
|
16
|
+
},
|
|
17
|
+
async keys() { return [...stores.keys()]; },
|
|
18
|
+
async delete(name: string) { return stores.delete(name); },
|
|
19
|
+
} as unknown as CacheStorage;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LibraryLink } from "./types.ts";
|
|
2
|
+
import type { PageLock } from "../schema.ts";
|
|
3
|
+
|
|
4
|
+
export function exampleLink(): LibraryLink {
|
|
5
|
+
return { id: "checkout", source: { kind: "server", url: "http://127.0.0.1:9000/" }, build: {
|
|
6
|
+
link: 1, library: "@flanksource/clicky-ui", version: "2.0.0",
|
|
7
|
+
fragment: { fragment: 1, name: "@flanksource/clicky-ui", imports: { react: "@flanksource/clicky-ui@2.0.0/dist/runtime/react.js", "@flanksource/clicky-ui": "@flanksource/clicky-ui@2.0.0/dist/index.js" }, scopes: {}, inherits: [], aliases: {}, remaps: {}, integrity: { "@flanksource/clicky-ui@2.0.0/dist/runtime/react.js": "sha384-react" } },
|
|
8
|
+
entries: { "@flanksource/clicky-ui": "src/index.ts" },
|
|
9
|
+
modules: { "src/index.ts": { resolutions: { "./Counter": "src/Counter.tsx" } }, "src/Counter.tsx": { resolutions: {} }, "src/untouched.ts": { resolutions: {} } },
|
|
10
|
+
barrels: { modules: ["src/Counter.tsx"], barrels: { "src/index.ts": { Counter: 0 } } }, defines: { __CHECKOUT__: "local-commit" }, generated: {},
|
|
11
|
+
} };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function exampleLock(): PageLock {
|
|
15
|
+
return { lock: 2, packageOrigin: "https://packages.example", page: "page.tsx", versions: { "@flanksource/clicky-ui": "1.0.0" }, map: { imports: { react: "/npm/react@18/index.js", "@flanksource/clicky-ui": "/npm/@flanksource/clicky-ui@1.0.0/index.js" }, scopes: { "/npm/@acme/facet@1/": { react: "/npm/react@18/index.js" } } }, integrity: {}, remaps: {}, barrels: { modules: [], barrels: {} } };
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BarrelIndex, Fragment } from "../schema.ts";
|
|
2
|
+
export type CommonJsSource = { hash: string; target: string };
|
|
3
|
+
|
|
4
|
+
export type LinkBuild = {
|
|
5
|
+
link: 1;
|
|
6
|
+
library: string;
|
|
7
|
+
version: string;
|
|
8
|
+
fragment: Fragment;
|
|
9
|
+
entries: Record<string, string>;
|
|
10
|
+
modules: Record<string, { resolutions: Record<string, string> }>;
|
|
11
|
+
barrels: BarrelIndex;
|
|
12
|
+
defines: Record<string, string | boolean | number>;
|
|
13
|
+
generated: Record<string, string>;
|
|
14
|
+
pageSources?: Array<Omit<import("./page-sources.ts").PageSourceRoot, "link">>;
|
|
15
|
+
commonjs?: Record<string, CommonJsSource>;
|
|
16
|
+
package?: { dependencies?: Record<string, string>; peerDependencies?: Record<string, string> };
|
|
17
|
+
};
|
|
18
|
+
export type LinkSource = { kind: "server"; url: string } | { kind: "folder"; session?: string };
|
|
19
|
+
export type LibraryLink = { id: string; build: LinkBuild; source: LinkSource };
|
|
20
|
+
export type StoredLink = LibraryLink & { directory?: FileSystemDirectoryHandle };
|
|
21
|
+
export type LinkCommand =
|
|
22
|
+
| { type: "install"; link: StoredLink }
|
|
23
|
+
| { type: "remove"; id: string }
|
|
24
|
+
| { type: "files"; id: string }
|
|
25
|
+
| { type: "invalidate"; id: string; paths: string[] };
|
|
26
|
+
export type LinkReply = { ok: true; files?: Record<string, string> };
|
|
27
|
+
export type LinkFrame = { id: string; links: readonly string[]; reload(): void | Promise<void> };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { RuntimeProfile } from "../schema.ts";
|
|
2
|
+
import { validateSourcePath } from "../host/validation.ts";
|
|
3
|
+
import type { LibraryLink } from "./types.ts";
|
|
4
|
+
import { validatePageSources } from "./page-sources.ts";
|
|
5
|
+
import { BASE_PACKAGES } from "../sw/composition.ts";
|
|
6
|
+
|
|
7
|
+
export function assertLinksAllowed(options: { profile: Pick<RuntimeProfile, "links">; developerOverrides: boolean }): void {
|
|
8
|
+
if (options.profile.links !== "allow" || options.developerOverrides !== true) throw new Error("Library links require links: allow and host developer overrides");
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function linkUrl(id: string, path: string): string {
|
|
12
|
+
if (!/^[A-Za-z0-9_-]+$/.test(id)) throw new Error(`Invalid link id ${id}`);
|
|
13
|
+
validateSourcePath(path);
|
|
14
|
+
return `/link/${id}/${path.split("/").map(encodeURIComponent).join("/")}`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function validateLink(link: LibraryLink): void {
|
|
18
|
+
linkUrl(link.id, "package.json");
|
|
19
|
+
const build = link.build;
|
|
20
|
+
if (BASE_PACKAGES.includes(build.library)) throw new Error(`${build.library}: singleton checkouts must be supplied by the clicky-ui runtime set`);
|
|
21
|
+
if (build.pageSources !== undefined) validatePageSources(build.pageSources.map((root) => ({ ...root, link: link.id })));
|
|
22
|
+
if (build.link !== 1 || !build.library || !build.version || build.fragment.fragment !== 1 || build.fragment.name !== build.library) throw new Error("Invalid checkout link manifest; rebuild with buildLinkRuntime (buildLibraryRuntime)");
|
|
23
|
+
if (link.source.kind === "server") {
|
|
24
|
+
const url = new URL(link.source.url);
|
|
25
|
+
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || url.search || url.hash) throw new Error(`Invalid link server URL ${url}`);
|
|
26
|
+
} else if (link.source.kind !== "folder") throw new Error("Unknown link source kind");
|
|
27
|
+
if (!Object.keys(build.entries).length) throw new Error(`${build.library}: link must declare source entry points`);
|
|
28
|
+
for (const [specifier, path] of Object.entries(build.entries)) {
|
|
29
|
+
if (specifier !== build.library && !specifier.startsWith(`${build.library}/`)) throw new Error(`Link entry ${specifier} is outside ${build.library}`);
|
|
30
|
+
validateSourcePath(path);
|
|
31
|
+
if (!Object.hasOwn(build.modules, path)) throw new Error(`Link entry ${specifier}: missing source module ${path}`);
|
|
32
|
+
}
|
|
33
|
+
for (const path of [...Object.keys(build.modules), ...Object.keys(build.generated)]) validateSourcePath(path);
|
|
34
|
+
for (const [path, conversion] of Object.entries(build.commonjs ?? {})) {
|
|
35
|
+
validateSourcePath(path); validateSourcePath(conversion.target);
|
|
36
|
+
if (!build.modules[path] || !/^[a-f0-9]{12}$/.test(conversion.hash) || !build.fragment.integrity[`${build.library}@${build.version}/${conversion.target}`]) throw new Error(`Invalid CommonJS conversion metadata for ${path}`);
|
|
37
|
+
}
|
|
38
|
+
for (const name of Object.keys(build.defines)) if (!/^[A-Za-z_$][\w$]*$/.test(name)) throw new Error(`Invalid checkout constant ${name}`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function missingLinkFile(link: LibraryLink, path: string): Error {
|
|
42
|
+
const command = link.build.generated[path] ?? (link.build.library === "@flanksource/clicky-ui" && path.startsWith("src/icons") ? "pnpm --filter @flanksource/clicky-ui build:icons" : undefined);
|
|
43
|
+
return new Error(`${link.build.library}: missing checkout file ${path}; ${command ? `run \`${command}\`` : "rebuild the checkout with buildLinkRuntime (buildLibraryRuntime)"}`);
|
|
44
|
+
}
|
package/src/markers.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type EditableSourceMarker = { file: string; line: number; column: number; ordinal: number; hash: string };
|
|
2
|
+
export const EDITABLE_SOURCE_ATTRIBUTE = "data-source";
|
|
3
|
+
const MARKER = /^(.+):(\d+):(\d+)#(\d+)@([0-9a-f]{12})$/;
|
|
4
|
+
|
|
5
|
+
export function formatEditableSource({ file, line, column, ordinal, hash }: EditableSourceMarker): string {
|
|
6
|
+
if (!file || /["\\\r\n]/.test(file)) throw new Error(`cannot mark editable source in ${JSON.stringify(file)}: unsupported file name`);
|
|
7
|
+
if (![line, column].every((value) => Number.isSafeInteger(value) && value > 0) || !Number.isSafeInteger(ordinal) || ordinal < 0) throw new Error("invalid editable source position or ordinal");
|
|
8
|
+
if (!/^[0-9a-f]{12}$/.test(hash)) throw new Error(`invalid source hash ${JSON.stringify(hash)}`);
|
|
9
|
+
return `${file}:${line}:${column}#${ordinal}@${hash}`;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function parseEditableSource(value: string): EditableSourceMarker {
|
|
13
|
+
const match = MARKER.exec(value);
|
|
14
|
+
if (!match) throw new Error(`malformed ${EDITABLE_SOURCE_ATTRIBUTE} ${JSON.stringify(value)}; expected <file>:<line>:<column>#<ordinal>@<hash>`);
|
|
15
|
+
const marker = { file: match[1]!, line: Number(match[2]), column: Number(match[3]), ordinal: Number(match[4]), hash: match[5]! };
|
|
16
|
+
formatEditableSource(marker);
|
|
17
|
+
return marker;
|
|
18
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { createPublication, type Publication } from "./publish.ts";
|
|
3
|
+
import { withPackageLock } from "./lock.ts";
|
|
4
|
+
|
|
5
|
+
export async function runPackageBuild(options: { libraryDir: string; command: string; args: string[] }): Promise<Publication> {
|
|
6
|
+
return withPackageLock({ libraryDir: options.libraryDir, run: async () => {
|
|
7
|
+
await new Promise<void>((done, fail) => {
|
|
8
|
+
const child = spawn(options.command, options.args, { cwd: options.libraryDir, stdio: "inherit", detached: process.platform !== "win32" });
|
|
9
|
+
const signal = (value: NodeJS.Signals) => {
|
|
10
|
+
if (process.platform === "win32") { child.kill(value); return; }
|
|
11
|
+
if (child.pid) {
|
|
12
|
+
try { process.kill(-child.pid, value); }
|
|
13
|
+
catch (error) { if ((error as NodeJS.ErrnoException).code !== "ESRCH") throw error; }
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const term = () => signal("SIGTERM");
|
|
17
|
+
const int = () => signal("SIGINT");
|
|
18
|
+
process.once("SIGTERM", term); process.once("SIGINT", int);
|
|
19
|
+
child.once("error", fail);
|
|
20
|
+
child.once("close", (code, signal) => {
|
|
21
|
+
process.off("SIGTERM", term); process.off("SIGINT", int);
|
|
22
|
+
if (code === 0) done(); else fail(new Error(`Package build failed: ${signal ?? code}`));
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
return createPublication({ libraryDir: options.libraryDir });
|
|
26
|
+
} });
|
|
27
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { mkdir, readFile, realpath, rm, writeFile } from "node:fs/promises";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { setTimeout } from "node:timers/promises";
|
|
4
|
+
|
|
5
|
+
export async function withPackageLock<T>(options: { libraryDir: string; run: () => Promise<T> }): Promise<T> {
|
|
6
|
+
const root = resolve(await realpath(options.libraryDir), ".tmp/package-publications");
|
|
7
|
+
const lock = resolve(root, "build.lock");
|
|
8
|
+
await mkdir(root, { recursive: true });
|
|
9
|
+
let missingOwner = 0;
|
|
10
|
+
for (;;) {
|
|
11
|
+
try { await mkdir(lock); break; }
|
|
12
|
+
catch (error) { if ((error as NodeJS.ErrnoException).code !== "EEXIST") throw error; }
|
|
13
|
+
try {
|
|
14
|
+
const owner = JSON.parse(await readFile(resolve(lock, "owner.json"), "utf8")) as { pid: number };
|
|
15
|
+
missingOwner = 0;
|
|
16
|
+
if (!Number.isInteger(owner.pid) || owner.pid <= 0) throw new Error(`Invalid package build lock: ${lock}`);
|
|
17
|
+
try { process.kill(owner.pid, 0); }
|
|
18
|
+
catch (error) {
|
|
19
|
+
if ((error as NodeJS.ErrnoException).code !== "ESRCH") throw error;
|
|
20
|
+
throw new Error(`Interrupted build left a lock at ${lock}; its owner ${owner.pid} has stopped. Remove that lock before rebuilding.`);
|
|
21
|
+
}
|
|
22
|
+
} catch (error) {
|
|
23
|
+
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
|
|
24
|
+
if (++missingOwner > 20) throw new Error(`Package build lock has no owner: ${lock}. Confirm no build is running before removing it.`);
|
|
25
|
+
}
|
|
26
|
+
await setTimeout(250);
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
await writeFile(resolve(lock, "owner.json"), JSON.stringify({ pid: process.pid, started: new Date().toISOString() }));
|
|
30
|
+
return await options.run();
|
|
31
|
+
} finally { await rm(lock, { recursive: true, force: true }); }
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
|
|
4
|
+
export type PackageManifest = Record<string, unknown> & { name: string; version: string };
|
|
5
|
+
export function validateManifest(value: unknown): PackageManifest {
|
|
6
|
+
if (!value || typeof value !== "object") throw new Error("Package manifest must be an object");
|
|
7
|
+
const manifest = value as PackageManifest;
|
|
8
|
+
if (typeof manifest.name !== "string" || !/^(?:@[a-z0-9._-]+\/)?[a-z0-9._-]+$/.test(manifest.name)) throw new Error("Invalid package name");
|
|
9
|
+
if (typeof manifest.version !== "string" || !/^\d+\.\d+\.\d+(?:-[\da-zA-Z.-]+)?(?:\+[\da-zA-Z.-]+)?$/.test(manifest.version)) throw new Error("Invalid package version");
|
|
10
|
+
return manifest;
|
|
11
|
+
}
|
|
12
|
+
export async function readManifest(directory: string): Promise<PackageManifest> {
|
|
13
|
+
return validateManifest(JSON.parse(await readFile(resolve(directory, "package.json"), "utf8")));
|
|
14
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { mkdir, mkdtemp, readFile, rm, symlink, writeFile } from "node:fs/promises";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
5
|
+
import { publishPackage, runPackageBuild } from "./index.ts";
|
|
6
|
+
import { withPackageLock } from "./lock.ts";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
|
|
9
|
+
describe("package publication", { timeout: 30000 }, () => {
|
|
10
|
+
let root: string;
|
|
11
|
+
const source = "export const version = 'first';";
|
|
12
|
+
const manifest = { name: "@acme/ui", version: "1.2.3", type: "module", files: ["dist"], exports: { ".": "./dist/index.js", "./runtime/*": "./dist/runtime/*" } };
|
|
13
|
+
async function runtime(code: string) {
|
|
14
|
+
await writeFile(resolve(root, "dist/index.js"), code);
|
|
15
|
+
await writeFile(resolve(root, "dist/runtime/importmap.json"), JSON.stringify({ fragment: 1, name: manifest.name, imports: { [manifest.name]: "@acme/ui@1.2.3/dist/index.js" }, scopes: {}, remaps: {}, aliases: {}, inherits: [], integrity: { "@acme/ui@1.2.3/dist/index.js": `sha384-${createHash("sha384").update(code).digest("base64")}` } }));
|
|
16
|
+
await writeFile(resolve(root, "dist/runtime/barrels.json"), JSON.stringify({ modules: ["/npm/@acme/ui@1.2.3/dist/index.js"], barrels: {} }));
|
|
17
|
+
}
|
|
18
|
+
beforeEach(async () => {
|
|
19
|
+
await mkdir(resolve(".tmp/publication"), { recursive: true });
|
|
20
|
+
root = await mkdtemp(resolve(".tmp/publication/package-"));
|
|
21
|
+
await mkdir(resolve(root, "dist/runtime"), { recursive: true });
|
|
22
|
+
await writeFile(resolve(root, "package.json"), JSON.stringify(manifest));
|
|
23
|
+
await runtime(source);
|
|
24
|
+
});
|
|
25
|
+
afterEach(async () => { await rm(root, { recursive: true, force: true }); });
|
|
26
|
+
|
|
27
|
+
it("keeps the published package readable after the live build directory is deleted", async () => {
|
|
28
|
+
const published = await publishPackage({ libraryDir: root });
|
|
29
|
+
await rm(resolve(root, "dist"), { recursive: true });
|
|
30
|
+
expect(await readFile(resolve(published.directory, "dist/index.js"), "utf8")).toBe(source);
|
|
31
|
+
expect(JSON.parse(await readFile(resolve(root, ".tmp/package-publications/current.json"), "utf8"))).toMatchObject({ build: published.build });
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("publishes packages whose temporary directory is a filesystem link", async () => {
|
|
35
|
+
await mkdir(resolve(root, "cache"));
|
|
36
|
+
await symlink("cache", resolve(root, ".tmp"));
|
|
37
|
+
const publication = await publishPackage({ libraryDir: root });
|
|
38
|
+
expect(await readFile(resolve(publication.directory, "dist/index.js"), "utf8")).toBe(source);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("deduplicates identical builds and retains immutable earlier generations", async () => {
|
|
42
|
+
const first = await publishPackage({ libraryDir: root });
|
|
43
|
+
expect(await publishPackage({ libraryDir: root })).toEqual(first);
|
|
44
|
+
const next = "export const version = 'second';";
|
|
45
|
+
await runtime(next);
|
|
46
|
+
const second = await publishPackage({ libraryDir: root });
|
|
47
|
+
expect(second.build).not.toBe(first.build);
|
|
48
|
+
expect(await readFile(resolve(first.directory, "dist/index.js"), "utf8")).toBe(source);
|
|
49
|
+
expect(await readFile(resolve(second.directory, "dist/index.js"), "utf8")).toBe(next);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("rejects incomplete or inconsistent runtime output without replacing the current publication", async () => {
|
|
53
|
+
const first = await publishPackage({ libraryDir: root });
|
|
54
|
+
await writeFile(resolve(root, "dist/index.js"), "export const broken = true;");
|
|
55
|
+
await expect(publishPackage({ libraryDir: root })).rejects.toThrow(/integrity/);
|
|
56
|
+
expect(JSON.parse(await readFile(resolve(root, ".tmp/package-publications/current.json"), "utf8"))).toMatchObject({ build: first.build });
|
|
57
|
+
await rm(resolve(root, "dist/runtime/barrels.json"));
|
|
58
|
+
await expect(publishPackage({ libraryDir: root })).rejects.toThrow(/barrels/);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("uses the native publishable file list with lifecycle scripts disabled", async () => {
|
|
62
|
+
await writeFile(resolve(root, "private.txt"), "not published");
|
|
63
|
+
await writeFile(resolve(root, "package.json"), JSON.stringify({ ...manifest, scripts: { prepack: "exit 19" } }));
|
|
64
|
+
const published = await publishPackage({ libraryDir: root });
|
|
65
|
+
await expect(readFile(resolve(published.directory, "private.txt"))).rejects.toMatchObject({ code: "ENOENT" });
|
|
66
|
+
expect(JSON.parse(await readFile(resolve(published.directory, "package.json"), "utf8"))).toMatchObject({ name: manifest.name, version: manifest.version });
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it.each(["fail", "interrupt"])("keeps the last successful publication when a build ends with %s", async mode => {
|
|
70
|
+
const first = await publishPackage({ libraryDir: root });
|
|
71
|
+
await expect(runPackageBuild({ libraryDir: root, command: process.execPath, args: [fileURLToPath(new URL("./fixtures/build.mjs", import.meta.url)), mode] })).rejects.toThrow(/Package build failed/);
|
|
72
|
+
expect(JSON.parse(await readFile(resolve(root, ".tmp/package-publications/current.json"), "utf8"))).toMatchObject({ build: first.build });
|
|
73
|
+
expect(await publishPackage({ libraryDir: root })).toEqual(first);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("serializes concurrent builds and publications for the same package", async () => {
|
|
77
|
+
const events: string[] = [];
|
|
78
|
+
let release!: () => void;
|
|
79
|
+
let entered!: () => void;
|
|
80
|
+
const started = new Promise<void>(resolve => { entered = resolve; });
|
|
81
|
+
const gate = new Promise<void>(resolve => { release = resolve; });
|
|
82
|
+
const first = withPackageLock({ libraryDir: root, run: async () => { events.push("first started"); entered(); await gate; events.push("first complete"); } });
|
|
83
|
+
await started;
|
|
84
|
+
const second = withPackageLock({ libraryDir: root, run: async () => { events.push("second started"); } });
|
|
85
|
+
release();
|
|
86
|
+
await Promise.all([first, second]);
|
|
87
|
+
expect(events).toEqual(["first started", "first complete", "second started"]);
|
|
88
|
+
});
|
|
89
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
3
|
+
import { lstat, mkdir, mkdtemp, readFile, realpath, rename, rm, writeFile } from "node:fs/promises";
|
|
4
|
+
import { dirname, resolve, sep } from "node:path";
|
|
5
|
+
import { promisify } from "node:util";
|
|
6
|
+
import { readManifest } from "./manifest.ts";
|
|
7
|
+
import { validateRuntime } from "./runtime.ts";
|
|
8
|
+
import { BUILD_ID, type PackageBuild } from "./schema.ts";
|
|
9
|
+
import { withPackageLock } from "./lock.ts";
|
|
10
|
+
|
|
11
|
+
export type Publication = PackageBuild & { directory: string };
|
|
12
|
+
export const publicationRoot = (libraryDir: string): string => resolve(libraryDir, ".tmp/package-publications");
|
|
13
|
+
export async function atomicJson(file: string, value: unknown): Promise<void> {
|
|
14
|
+
await mkdir(dirname(file), { recursive: true });
|
|
15
|
+
const temporary = `${file}.${randomUUID()}`;
|
|
16
|
+
try { await writeFile(temporary, JSON.stringify(value)); await rename(temporary, file); }
|
|
17
|
+
finally { await rm(temporary, { force: true }); }
|
|
18
|
+
}
|
|
19
|
+
export async function readPublication(libraryDir: string): Promise<Publication> {
|
|
20
|
+
const root = publicationRoot(libraryDir);
|
|
21
|
+
const current = JSON.parse(await readFile(resolve(root, "current.json"), "utf8")) as PackageBuild;
|
|
22
|
+
if (typeof current.build !== "string" || !BUILD_ID.test(current.build)) throw new Error(`${libraryDir}: invalid published build`);
|
|
23
|
+
const directory = await realpath(resolve(root, "generations", current.build, "package"));
|
|
24
|
+
const manifest = await readManifest(directory);
|
|
25
|
+
if (manifest.name !== current.name || manifest.version !== current.version) throw new Error(`${libraryDir}: publication identity mismatch`);
|
|
26
|
+
return { ...current, directory };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function copyPublishable(libraryDir: string, directory: string): Promise<string[]> {
|
|
30
|
+
const archive = resolve(directory, "..", "package.tgz");
|
|
31
|
+
const { stdout } = await promisify(execFile)("pnpm", ["--config.ignoreScripts=true", "pack", "--json", "--out", archive], { cwd: libraryDir, env: process.env, maxBuffer: 16 * 1024 * 1024 });
|
|
32
|
+
const packed = JSON.parse(stdout) as { files: { path: string }[] };
|
|
33
|
+
if (!Array.isArray(packed.files) || !packed.files.length) throw new Error(`${libraryDir}: native package file list is empty`);
|
|
34
|
+
const files = packed.files.map(file => file.path).sort();
|
|
35
|
+
for (const path of files) {
|
|
36
|
+
if (typeof path !== "string" || path.startsWith("/") || path.split(/[\\/]/).includes("..")) throw new Error(`Invalid publishable path: ${path}`);
|
|
37
|
+
}
|
|
38
|
+
const listed = await promisify(execFile)("tar", ["-tzf", archive], { maxBuffer: 16 * 1024 * 1024 });
|
|
39
|
+
for (const path of listed.stdout.trim().split("\n")) if (!path.startsWith("package/") || path.split("/").includes("..")) throw new Error(`Invalid archive path: ${path}`);
|
|
40
|
+
await promisify(execFile)("tar", ["-xzf", archive, "-C", dirname(directory)]);
|
|
41
|
+
await rm(archive);
|
|
42
|
+
for (const path of files) {
|
|
43
|
+
const file = resolve(directory, path);
|
|
44
|
+
if (!(await lstat(file)).isFile() || !(await realpath(file)).startsWith(`${directory}${sep}`)) throw new Error(`Invalid published file: ${path}`);
|
|
45
|
+
}
|
|
46
|
+
return files;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function exportedPaths(value: unknown): string[] {
|
|
50
|
+
if (typeof value === "string") return value.startsWith("./") && !value.includes("*") ? [value.slice(2)] : [];
|
|
51
|
+
return value && typeof value === "object" ? Object.values(value).flatMap(exportedPaths) : [];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export async function publishPackage(options: { libraryDir: string }): Promise<Publication> {
|
|
55
|
+
return withPackageLock({ ...options, run: () => createPublication(options) });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export async function createPublication(options: { libraryDir: string }): Promise<Publication> {
|
|
59
|
+
const libraryDir = await realpath(options.libraryDir);
|
|
60
|
+
const root = publicationRoot(libraryDir);
|
|
61
|
+
await mkdir(resolve(root, "generations"), { recursive: true });
|
|
62
|
+
const staging = await realpath(await mkdtemp(resolve(root, "staging-")));
|
|
63
|
+
const directory = resolve(staging, "package");
|
|
64
|
+
try {
|
|
65
|
+
const files = await copyPublishable(libraryDir, directory);
|
|
66
|
+
const manifest = await readManifest(directory);
|
|
67
|
+
for (const path of exportedPaths(manifest.exports)) if (!files.includes(path)) throw new Error(`${manifest.name}: missing exported file ${path}`);
|
|
68
|
+
await validateRuntime({ directory, manifest, files: new Set(files) });
|
|
69
|
+
const hash = createHash("sha256");
|
|
70
|
+
for (const path of files) hash.update(JSON.stringify([path, createHash("sha256").update(await readFile(resolve(directory, path))).digest("hex")]));
|
|
71
|
+
const build = hash.digest("hex");
|
|
72
|
+
const entry = { name: manifest.name, version: manifest.version, build };
|
|
73
|
+
await writeFile(resolve(staging, "publication.json"), JSON.stringify(entry));
|
|
74
|
+
try { await rename(staging, resolve(root, "generations", build)); }
|
|
75
|
+
catch (error) { if (!["ENOTEMPTY", "EEXIST"].includes((error as NodeJS.ErrnoException).code ?? "")) throw error; }
|
|
76
|
+
await atomicJson(resolve(root, "current.json"), entry);
|
|
77
|
+
return { ...entry, directory: await realpath(resolve(root, "generations", build, "package")) };
|
|
78
|
+
} finally { await rm(staging, { recursive: true, force: true }); }
|
|
79
|
+
}
|
|
80
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import type { BarrelIndex, Fragment } from "../schema.ts";
|
|
5
|
+
import type { PackageManifest } from "./manifest.ts";
|
|
6
|
+
|
|
7
|
+
export async function validateRuntime(options: { directory: string; manifest: PackageManifest; files: Set<string> }): Promise<void> {
|
|
8
|
+
const { directory, manifest, files } = options;
|
|
9
|
+
const expected = manifest.exports !== undefined && JSON.stringify(manifest.exports).includes("dist/runtime/");
|
|
10
|
+
if (!expected && !files.has("dist/runtime/importmap.json")) return;
|
|
11
|
+
if (!files.has("dist/runtime/importmap.json") || !files.has("dist/runtime/barrels.json")) throw new Error(`${manifest.name}: runtime importmap.json and barrels.json must both exist`);
|
|
12
|
+
const fragment = JSON.parse(await readFile(resolve(directory, "dist/runtime/importmap.json"), "utf8")) as Fragment;
|
|
13
|
+
const barrels = JSON.parse(await readFile(resolve(directory, "dist/runtime/barrels.json"), "utf8")) as BarrelIndex;
|
|
14
|
+
if (fragment.fragment !== 1 || fragment.name !== manifest.name || !fragment.integrity || !fragment.imports || !fragment.scopes || !fragment.remaps || !fragment.aliases || !Array.isArray(fragment.inherits)) throw new Error(`${manifest.name}: invalid runtime fragment`);
|
|
15
|
+
if (!Array.isArray(barrels.modules) || barrels.modules.some(value => typeof value !== "string") || !barrels.barrels || typeof barrels.barrels !== "object") throw new Error(`${manifest.name}: invalid barrel index`);
|
|
16
|
+
for (const table of Object.values(barrels.barrels)) for (const value of Object.values(table)) {
|
|
17
|
+
const index = Array.isArray(value) ? value[0] : value;
|
|
18
|
+
if (!Number.isInteger(index) || index < 0 || index >= barrels.modules.length) throw new Error(`${manifest.name}: invalid barrel module index`);
|
|
19
|
+
}
|
|
20
|
+
const prefix = `${manifest.name}@${manifest.version}/`;
|
|
21
|
+
for (const [url, integrity] of Object.entries(fragment.integrity)) {
|
|
22
|
+
if (!url.startsWith(prefix)) continue;
|
|
23
|
+
const path = url.slice(prefix.length);
|
|
24
|
+
if (!files.has(path)) throw new Error(`${manifest.name}: missing integrity file ${path}`);
|
|
25
|
+
const hash = `sha384-${createHash("sha384").update(await readFile(resolve(directory, path))).digest("base64")}`;
|
|
26
|
+
if (hash !== integrity) throw new Error(`${manifest.name}: integrity mismatch for ${path}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type PackageBuild = { name: string; version: string; build: string };
|
|
2
|
+
export type PackageCatalog = { revision: string; packages: Record<string, PackageBuild> };
|
|
3
|
+
export const BUILD_ID = /^[a-f0-9]{64}$/;
|
|
4
|
+
|
|
5
|
+
export function validateCatalog(value: unknown): PackageCatalog {
|
|
6
|
+
if (!value || typeof value !== "object") throw new Error("Invalid package catalog");
|
|
7
|
+
const catalog = value as PackageCatalog;
|
|
8
|
+
if (!BUILD_ID.test(catalog.revision) || !catalog.packages || typeof catalog.packages !== "object" || Array.isArray(catalog.packages)) throw new Error("Invalid package catalog revision or packages");
|
|
9
|
+
for (const [name, entry] of Object.entries(catalog.packages)) {
|
|
10
|
+
if (!entry || entry.name !== name || typeof entry.version !== "string" || !BUILD_ID.test(entry.build)) throw new Error(`Invalid package catalog entry ${name}`);
|
|
11
|
+
}
|
|
12
|
+
return catalog;
|
|
13
|
+
}
|