hyperframes 0.8.181 → 0.8.184
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/bin/hyperframes.mjs +3 -1
- package/dist/{add-AWQ2EGBU.js → add-5ZTD3MUZ.js} +22 -22
- package/dist/{animatedGifPrep-SENXJ7TN.js → animatedGifPrep-AGASIWVA.js} +14 -13
- package/dist/api.js +29 -28
- package/dist/{asset-XBH3MN3Y.js → asset-LSTEMPIB.js} +3 -3
- package/dist/{assetCataloger-KH4X2CRO.js → assetCataloger-BKBMNL3A.js} +16 -13
- package/dist/{audio-Q7I473UN.js → audio-KGK44XE4.js} +31 -30
- package/dist/{auth-I7CBTEUS.js → auth-MJWKYK77.js} +4 -4
- package/dist/{autoUpdate-KY5TLSN7.js → autoUpdate-2GGDKYR2.js} +2 -2
- package/dist/{backgroundChecks-4Q3VVK5W.js → backgroundChecks-7GRX5VQY.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-3AYDQRBI.js → batchRender-BCV2LELR.js} +7 -7
- package/dist/{beats-P4LENNVT.js → beats-7BCFRBAL.js} +12 -12
- package/dist/{benchmark-AXOAECN3.js → benchmark-2R6CN5MQ.js} +24 -24
- package/dist/{browser-XZKB5HGJ.js → browser-6AFGOI7G.js} +20 -20
- package/dist/{bundleWithLocalizedFonts-2WCR57IN.js → bundleWithLocalizedFonts-2EGPA5ZO.js} +2 -2
- package/dist/{capture-NWARHRHR.js → capture-HA2UHLIU.js} +8 -5
- package/dist/{capture-4RN4APDF.js → capture-HOIAW6MO.js} +50 -41
- package/dist/{captureCompositionFrame-QOF5BRF4.js → captureCompositionFrame-4236FVWJ.js} +22 -20
- package/dist/{captureTimeout-K2JNVVCI.js → captureTimeout-RIMG6IYH.js} +1 -1
- package/dist/{catalog-CRPOPVD5.js → catalog-A6CZAWW4.js} +42 -42
- package/dist/{catch-up-MHWGUQ42.js → catch-up-TNA4DJOA.js} +15 -15
- package/dist/check-5E5U2EQZ.js +117 -0
- package/dist/checkBrowser-FNINXBMZ.js +118 -0
- package/dist/{chunk-OJTDUF4W.js → chunk-2PVE4WS2.js} +1 -1
- package/dist/{checkBrowser-VES2NF3K.js → chunk-2ULXZ4PG.js} +187 -114
- package/dist/{chunk-WITHUCCB.js → chunk-2XA7KXQO.js} +2 -2
- package/dist/{chunk-HODBPO4A.js → chunk-3MDJIWOV.js} +626 -328
- package/dist/{chunk-JBCU6NR5.js → chunk-3QVMJ7GX.js} +56 -55
- package/dist/{chunk-OR5WCFWZ.js → chunk-3TXNNBI2.js} +2 -2
- package/dist/{chunk-IZM562YJ.js → chunk-4KKKBEP3.js} +4 -4
- package/dist/{chunk-XEWHUPFS.js → chunk-4N4P3ZWL.js} +2 -2
- package/dist/{chunk-537IYAEE.js → chunk-4UMPIPCQ.js} +9 -1
- package/dist/{chunk-J4L5TPLS.js → chunk-5UDRPPN2.js} +48 -6
- package/dist/{chunk-L3YOGIPG.js → chunk-66LREXGS.js} +1 -1
- package/dist/{chunk-6I7V6Q7F.js → chunk-74JMKLVU.js} +103 -20
- package/dist/{chunk-3PULCIY5.js → chunk-7HJALUIO.js} +5 -5
- package/dist/{chunk-GZVP4TWN.js → chunk-7JAD4MEW.js} +1 -1
- package/dist/{chunk-NAMGMP3R.js → chunk-7KVVNF7B.js} +1 -1
- package/dist/{chunk-TO6JNTML.js → chunk-7MB2ZAQF.js} +13 -8
- package/dist/{chunk-55IG255C.js → chunk-7NRI7HYX.js} +1 -1
- package/dist/{chunk-VAJIPSN6.js → chunk-ABZYYUUH.js} +1 -1
- package/dist/{chunk-GK2FIKIQ.js → chunk-ADDHW2FS.js} +214 -37
- package/dist/{chunk-ZUOSILUE.js → chunk-BCHSTE7U.js} +1 -1
- package/dist/{chunk-AOWDVB2T.js → chunk-CXABAXB3.js} +1 -1
- package/dist/{chunk-E24HSMZV.js → chunk-CYBXXSC4.js} +65 -14
- package/dist/{chunk-NZZYJOMJ.js → chunk-CZUAX3BV.js} +6 -5
- package/dist/{chunk-GV5R5B7Q.js → chunk-DGECWPTL.js} +1 -1
- package/dist/{chunk-BRHI7EIA.js → chunk-DKPNNYBZ.js} +4 -0
- package/dist/{chunk-UIDZRCBG.js → chunk-DWUGKEHR.js} +1 -1
- package/dist/{chunk-D3ZWBHZP.js → chunk-DYAPHNV6.js} +3 -2
- package/dist/{chunk-T7UHTUUE.js → chunk-E32ZQ2WO.js} +9 -9
- package/dist/{chunk-RGHQID2E.js → chunk-EHSBBBR2.js} +5 -3
- package/dist/{chunk-DJJ7SK4F.js → chunk-EM7C7H7S.js} +8 -8
- package/dist/{chunk-XSRUVMXK.js → chunk-ES426XRJ.js} +4 -4
- package/dist/chunk-FG4BBFZI.js +122 -0
- package/dist/{chunk-JMFJI26U.js → chunk-FGJEUV4S.js} +2 -2
- package/dist/{check-DJCUOUDI.js → chunk-GDEV42FA.js} +198 -142
- package/dist/{chunk-RXQHSGAQ.js → chunk-HR23IKLZ.js} +2 -2
- package/dist/{chunk-KMAAOHLO.js → chunk-HRPWRZGF.js} +1 -1
- package/dist/{chunk-UPFUC4DB.js → chunk-HTIUNMTP.js} +1 -1
- package/dist/{chunk-V2UNZ7QP.js → chunk-ICJEAFPD.js} +25 -14
- package/dist/{chunk-EOADENKV.js → chunk-IWTNTUPQ.js} +16 -14
- package/dist/chunk-IZCW2NKT.js +29 -0
- package/dist/{chunk-XFCLWWL3.js → chunk-J36JVBLR.js} +11 -4
- package/dist/{chunk-LBQFLUIY.js → chunk-J3QM7AHP.js} +9 -49
- package/dist/{chunk-DUN63LHY.js → chunk-JB6ARMQS.js} +2 -2
- package/dist/{chunk-5E5EYPZO.js → chunk-JIUTXKWA.js} +7 -7
- package/dist/{chunk-YJDB4FLT.js → chunk-JQYJXUJW.js} +1 -1
- package/dist/{chunk-PBN6GBJE.js → chunk-JVBRJMOP.js} +14 -1
- package/dist/{chunk-RHWJKSGH.js → chunk-KANNRHY7.js} +1 -1
- package/dist/{chunk-IL3GTCQY.js → chunk-KN46TGHV.js} +72 -140
- package/dist/{chunk-OFY6JTZC.js → chunk-LLC4CS6I.js} +2 -2
- package/dist/{chunk-OJDXABUF.js → chunk-LRGYPXHF.js} +2 -2
- package/dist/{chunk-GNE57O7U.js → chunk-MFAETWIF.js} +1 -1
- package/dist/{chunk-32GKETR7.js → chunk-MMQ52NIZ.js} +74 -0
- package/dist/chunk-MOEGCMKI.js +180 -0
- package/dist/{chunk-E6RPWJVC.js → chunk-NAUKCKCJ.js} +5 -1
- package/dist/{chunk-B4VT6YU2.js → chunk-OLZENUPI.js} +50 -7
- package/dist/{chunk-H4YZZ2VQ.js → chunk-PFD25NAC.js} +1 -1
- package/dist/{chunk-XH262OWN.js → chunk-PFYWVUHA.js} +1 -1
- package/dist/{chunk-S3RYRF3W.js → chunk-PSKEKWVU.js} +1 -1
- package/dist/{chunk-N5SXQCJL.js → chunk-Q33P4EAC.js} +3 -3
- package/dist/{chunk-3DKN5WKL.js → chunk-QH3T4WI2.js} +77 -6
- package/dist/{chunk-O5AE7HOP.js → chunk-QL2PNIXC.js} +37 -33
- package/dist/{chunk-WUUCEFL5.js → chunk-R2BFTECP.js} +5 -5
- package/dist/chunk-R2SQBPMH.js +3805 -0
- package/dist/{chunk-YPBIAONI.js → chunk-RGXVEYHI.js} +230 -162
- package/dist/{chunk-YMS6CJCD.js → chunk-SAX7HQ5E.js} +1 -1
- package/dist/{chunk-KIO3R4QN.js → chunk-SN7KI5JA.js} +27 -14
- package/dist/{chunk-4USWWI2Y.js → chunk-TE427YID.js} +2 -2
- package/dist/{chunk-ICMXC3MI.js → chunk-U6RXZNZE.js} +31 -18
- package/dist/{chunk-X7CCSMRR.js → chunk-UJKUB2LH.js} +16 -16
- package/dist/{chunk-K26FR4SM.js → chunk-UKOTVJFV.js} +12 -12
- package/dist/{chunk-4OT3FWVV.js → chunk-UNNXFKVG.js} +2 -2
- package/dist/{chunk-PF7OWVTL.js → chunk-VDM3FEDP.js} +2 -2
- package/dist/{chunk-Y5GY6Y7A.js → chunk-VNVQGDPC.js} +2 -2
- package/dist/{chunk-22QHO26F.js → chunk-W64L7IFS.js} +1 -1
- package/dist/{chunk-Y2RXRPL2.js → chunk-WHPN2TIT.js} +5 -5
- package/dist/{chunk-65WIUIHL.js → chunk-WTFUDNW2.js} +7 -15
- package/dist/{chunk-3XDOGSRD.js → chunk-X3CG5YQA.js} +3 -3
- package/dist/{chunk-UZOZ2W2E.js → chunk-XGHHVYC7.js} +96 -34
- package/dist/{chunk-4IEH6EAC.js → chunk-YALM6XN4.js} +203 -58
- package/dist/{chunk-B6JLCPT3.js → chunk-YOZPQCSR.js} +6 -6
- package/dist/{chunk-5JMZLQT6.js → chunk-YWHCXIMD.js} +16 -16
- package/dist/{chunk-UVEQLDKB.js → chunk-YWNJTZGN.js} +3 -2
- package/dist/{chunk-WUQUR33W.js → chunk-ZOCHDXDG.js} +1 -1
- package/dist/{chunk-IWTRHPTP.js → chunk-ZRHO6YMM.js} +8 -8
- package/dist/{clean-GJNDVVDI.js → clean-HGASSMWI.js} +41 -40
- package/dist/cli.js +68 -64
- package/dist/{cloud-JCWNMKXC.js → cloud-JPDVNXHN.js} +4 -4
- package/dist/{cloudrun-2BKGY53X.js → cloudrun-AMMGSDRP.js} +8 -8
- package/dist/commands/layout-audit.browser.js +15 -4
- package/dist/commands/motion-signature.browser.js +52 -0
- package/dist/{compare-XWM7FAYM.js → compare-LHHVHUN3.js} +51 -47
- package/dist/{compiler-U3W6CJW7.js → compiler-Q3N6QXMT.js} +6 -6
- package/dist/{component-CBRAE325.js → component-D72J32Q7.js} +4 -4
- package/dist/{compositions-EZYJEHQ3.js → compositions-UQRJ5ROG.js} +29 -29
- package/dist/{contactSheet-27SRU7A4.js → contactSheet-CAGMKI3E.js} +3 -1
- package/dist/{delete-JWWMOITI.js → delete-P42VIDDA.js} +9 -9
- package/dist/{deploy-UGOV76OH.js → deploy-WZTH57O4.js} +11 -11
- package/dist/{destroy-QBLMYDBF.js → destroy-4B5HW5FH.js} +5 -5
- package/dist/{deterministicFonts-L7YEEFGI.js → deterministicFonts-VQ5UBMXY.js} +2 -2
- package/dist/{dist-VO7OXOFK.js → dist-DYS24AMA.js} +5 -5
- package/dist/{dist-2FMTAVGL.js → dist-SENYPQGW.js} +4 -4
- package/dist/{docs-MPOM3PHH.js → docs-UEWLIP6D.js} +1 -1
- package/dist/{doctor-XSKSZRR7.js → doctor-KEJIG2SK.js} +28 -27
- package/dist/{events-RGS4MAH4.js → events-CYKSNR7N.js} +6 -6
- package/dist/{events-AIZODZMP.js → events-UZXFQPMT.js} +9 -9
- package/dist/{feedback-GE3VDZOH.js → feedback-LXNQF7CA.js} +35 -35
- package/dist/{ffmpeg-SCXZTR6X.js → ffmpeg-BYHON577.js} +16 -15
- package/dist/{figma-3R4XST4Y.js → figma-EIQ35PS6.js} +3 -3
- package/dist/fontLocalizeCli.js +24 -23
- package/dist/{get-4FKJP6IM.js → get-CC2YL7QO.js} +9 -9
- package/dist/{gpuPolicy-4NNXESM7.js → gpuPolicy-VFSACUQV.js} +14 -13
- package/dist/{grade-compare-FAYVPXUR.js → grade-compare-TUQL7IV2.js} +56 -50
- package/dist/{help-C3UQMYXK.js → help-ROROO5K6.js} +1 -1
- package/dist/{history-LDGQ2IZJ.js → history-PNELYLXX.js} +15 -15
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +59 -59
- package/dist/hyperframes-player.global.js +8 -3
- package/dist/{info-KMXFLD3Q.js → info-4FZTH6AS.js} +20 -20
- package/dist/{init-D7GYHSX5.js → init-I43GHHVP.js} +69 -68
- package/dist/{inspect-CUKWHCGS.js → inspect-IT4TYIZ3.js} +46 -44
- package/dist/{installer-EPRSH6QI.js → installer-CWOJVK5K.js} +7 -7
- package/dist/{keyframes-XCUPHBW3.js → keyframes-3FBOGVD4.js} +16 -16
- package/dist/{lambda-IMORFJHN.js → lambda-H3V32I7M.js} +15 -15
- package/dist/{layout-JD2IOBMS.js → layout-BZ5LYJ5C.js} +46 -44
- package/dist/{lint-FHLER36Y.js → lint-ZTNSGP2S.js} +23 -23
- package/dist/{lintProject-ARKJXDQF.js → lintProject-C2ONSH2U.js} +4 -4
- package/dist/{list-MGCFG5MA.js → list-XM4GWJYY.js} +10 -10
- package/dist/{login-QX6M4UTR.js → login-H6HYKMWX.js} +7 -7
- package/dist/{logout-DKJANASY.js → logout-DDC4QLVK.js} +3 -3
- package/dist/{manager-IETAVBZS.js → manager-TWVDSJXO.js} +17 -16
- package/dist/{manager-V2QCCPOJ.js → manager-UHWEKPXC.js} +8 -3
- package/dist/{media-treatment-MDAQRITV.js → media-treatment-N7MY5NXB.js} +34 -33
- package/dist/{media-use-4XXGABIL.js → media-use-JBN57JE3.js} +1 -1
- package/dist/{models-NZAOSI5A.js → models-WEMIMYBD.js} +25 -24
- package/dist/{motionShot-6ZDUM2K4.js → motionShot-RHICTVPU.js} +29 -26
- package/dist/{normalize-audio-7PRYX6QM.js → normalize-audio-ZFUZCJE3.js} +12 -12
- package/dist/{open-I254NY5J.js → open-IBJ4FL3G.js} +24 -24
- package/dist/{parakeetRunner-TL3TOGUS.js → parakeetRunner-XXO4WSLR.js} +26 -25
- package/dist/{pipeline-YPERVOQM.js → pipeline-6ML3LUVK.js} +19 -18
- package/dist/{play-MYI7BYKS.js → play-RV4NAVF5.js} +40 -38
- package/dist/{policies-5NTZOHJA.js → policies-XXNGXWHV.js} +1 -1
- package/dist/{preflight-HRCSZ52D.js → preflight-R3DEFMLA.js} +19 -18
- package/dist/{present-WYXQDV4Q.js → present-5TBJGE6B.js} +34 -33
- package/dist/{preview-535HTWQO.js → preview-FLKZ5CXJ.js} +56 -55
- package/dist/{producer-C76CRJ5O.js → producer-7XYSPVKH.js} +1 -1
- package/dist/{progress-I37JB7R4.js → progress-NHJIHAAG.js} +2 -2
- package/dist/{projectConfig-5QCNTGQT.js → projectConfig-TBU2VWZX.js} +9 -9
- package/dist/{publication-2QT7VVE2.js → publication-CWWUJYJ5.js} +5 -5
- package/dist/{publish-53EBL7OO.js → publish-FSNE4FEB.js} +28 -27
- package/dist/{refresh-MGCVWX56.js → refresh-RXTOPRBB.js} +3 -3
- package/dist/{remove-background-OBYHMPD4.js → remove-background-MDFWRWCT.js} +32 -31
- package/dist/render-DBGQZAZT.js +1516 -0
- package/dist/{render-3MELF6Y3.js → render-F4JQ553X.js} +102 -96
- package/dist/{render-75CRB3BW.js → render-LWZKXCLY.js} +8 -8
- package/dist/{render-batch-CEVWUYBP.js → render-batch-PU7NMLIJ.js} +8 -8
- package/dist/renderSetupWorker.js +12 -9
- package/dist/{resolver-4ICE2AT6.js → resolver-RUBGFXPC.js} +7 -7
- package/dist/{screenshotCapture-HXEZ3TNJ.js → screenshotCapture-UBY6TT75.js} +33 -6
- package/dist/{sherpa-L4UACXT3.js → sherpa-X2TBNO6P.js} +25 -24
- package/dist/{sites-3ZBYB5X4.js → sites-MAVH57MO.js} +2 -2
- package/dist/skills/hyperframes/references/review-loop.md +1 -1
- package/dist/{skills-DXTQPCAO.js → skills-WHKMWO2D.js} +17 -17
- package/dist/{skillsUpdateCheck-ULXRGLDU.js → skillsUpdateCheck-XQGZGJJG.js} +3 -3
- package/dist/{snapshot-PWFHQU5E.js → snapshot-M4NUUSNU.js} +73 -71
- package/dist/{src-RDSWHMJS.js → src-4UYM2K3S.js} +34 -26
- package/dist/{src-S7NVL5VF.js → src-6MSC62U2.js} +23 -19
- package/dist/{state-KAXGHF77.js → state-ORRPOLMQ.js} +2 -2
- package/dist/{staticProjectServer-GYPUQGI7.js → staticProjectServer-ERDTFP45.js} +21 -20
- package/dist/{status-BV7QAUQD.js → status-CM7IQTU2.js} +6 -6
- package/dist/studio/assets/{hyperframes-player-DcD3NXpX.js → hyperframes-player-DEncBxR7.js} +7 -2
- package/dist/studio/assets/{index-CFrZAwKo.js → index-BABXr78Q.js} +4 -4
- package/dist/studio/assets/{index-BIDKYk0h.js → index-Cc22mgvY.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-IXGX5ZFI.js → studio-api-SAKD3VKC.js} +18 -17
- package/dist/{studioServer-LA5Z7RSS.js → studioServer-IRI7EVOM.js} +91 -84
- package/dist/{telemetry-STEMAMAX.js → telemetry-F4XADVAF.js} +10 -10
- package/dist/{telemetry-CQYHCCPL.js → telemetry-QG5AANZ4.js} +1 -1
- package/dist/{timeline-KLD24EN6.js → timeline-5I444RRE.js} +42 -41
- package/dist/{tokens-ICLORAA4.js → tokens-LRRYM35A.js} +3 -3
- package/dist/{transcribe-A6IKK7VS.js → transcribe-44XDFNVU.js} +48 -47
- package/dist/{transcribe-CTHZLRXF.js → transcribe-WHYHWAB2.js} +20 -19
- package/dist/{tts-EDK3QS7M.js → tts-A2WILYGN.js} +6 -6
- package/dist/{updateCheck-FHCAAAXA.js → updateCheck-7CPH3CAZ.js} +2 -2
- package/dist/{upgrade-7EV4F2R7.js → upgrade-WW4GQ2RI.js} +3 -3
- package/dist/{urlDownloader-MIMGVASJ.js → urlDownloader-OHLLP45A.js} +13 -12
- package/dist/{validate-LZF46W3V.js → validate-VNCDH2LW.js} +40 -38
- package/dist/{video-ZC47NFOL.js → video-5OHTLL2D.js} +17 -14
- package/dist/warmCheck.js +228 -0
- package/dist/warmCheckClient.js +139 -0
- package/package.json +4 -2
- package/dist/chunk-BAZ5LCR3.js +0 -3805
- package/dist/hyperframe-runtime.js +0 -1125
- package/dist/render-5BXTEEG7.js +0 -719
- package/dist/{synthesize-I2C24XJ5.js → synthesize-PKTB5ATG.js} +1 -1
|
@@ -830,6 +830,72 @@ function validateColorGradingContract(value) {
|
|
|
830
830
|
return issues;
|
|
831
831
|
}
|
|
832
832
|
|
|
833
|
+
// ../parsers/dist/mediaTiming.js
|
|
834
|
+
var COMPOSITION_ATTRIBUTES2 = Object.freeze({
|
|
835
|
+
start: "data-start",
|
|
836
|
+
duration: "data-duration",
|
|
837
|
+
trackIndex: "data-track-index",
|
|
838
|
+
derivedEnd: "data-end",
|
|
839
|
+
legacyTrack: "data-layer"
|
|
840
|
+
});
|
|
841
|
+
var CANONICAL_AUTHORED_TIMING_ATTRIBUTES2 = Object.freeze([
|
|
842
|
+
COMPOSITION_ATTRIBUTES2.start,
|
|
843
|
+
COMPOSITION_ATTRIBUTES2.duration,
|
|
844
|
+
COMPOSITION_ATTRIBUTES2.trackIndex
|
|
845
|
+
]);
|
|
846
|
+
var DERIVED_TIMING_ATTRIBUTES2 = Object.freeze([
|
|
847
|
+
COMPOSITION_ATTRIBUTES2.derivedEnd
|
|
848
|
+
]);
|
|
849
|
+
var LEGACY_TIMING_ATTRIBUTES2 = Object.freeze([
|
|
850
|
+
COMPOSITION_ATTRIBUTES2.derivedEnd,
|
|
851
|
+
COMPOSITION_ATTRIBUTES2.legacyTrack
|
|
852
|
+
]);
|
|
853
|
+
function parseNumeric2(value) {
|
|
854
|
+
if (value == null || value.trim() === "") return null;
|
|
855
|
+
const parsed = Number(value);
|
|
856
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
857
|
+
}
|
|
858
|
+
var nonNegative = (raw) => {
|
|
859
|
+
const value = parseNumeric2(raw);
|
|
860
|
+
return value !== null && value >= 0 ? value : null;
|
|
861
|
+
};
|
|
862
|
+
function readMediaOffsetSeconds(getAttr) {
|
|
863
|
+
return nonNegative(getAttr("data-playback-start")) ?? nonNegative(getAttr("data-media-start")) ?? 0;
|
|
864
|
+
}
|
|
865
|
+
var MEDIA_START_BASIS_ATTR = "data-hf-media-start-basis";
|
|
866
|
+
function readMediaStartBasis(value) {
|
|
867
|
+
return value?.trim().toLowerCase() === "global" ? "global" : "local";
|
|
868
|
+
}
|
|
869
|
+
function resolveAbsoluteMediaStartSeconds(input) {
|
|
870
|
+
return readMediaStartBasis(input.basis) === "global" ? input.authoredStart : input.hostStart + input.authoredStart;
|
|
871
|
+
}
|
|
872
|
+
function resolveMediaStartSeconds(input) {
|
|
873
|
+
if (!hasLiteralNestedStart(input)) return input.ordinaryStart();
|
|
874
|
+
return resolveAbsoluteMediaStartSeconds({
|
|
875
|
+
authoredStart: input.authoredStart,
|
|
876
|
+
hostStart: input.hostStart,
|
|
877
|
+
basis: input.basis
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
function isRootGlobalMediaStart(input) {
|
|
881
|
+
return hasLiteralNestedStart(input) && readMediaStartBasis(input.basis) === "global";
|
|
882
|
+
}
|
|
883
|
+
function hasLiteralNestedStart(input) {
|
|
884
|
+
return !input.hasAutoStart && input.authoredStart != null && input.hostStart !== 0;
|
|
885
|
+
}
|
|
886
|
+
function hostInPointSeconds(host) {
|
|
887
|
+
return readMediaOffsetSeconds((name) => host.getAttribute(name));
|
|
888
|
+
}
|
|
889
|
+
function compositionOriginSeconds(hostStart, host) {
|
|
890
|
+
return hostStart - hostInPointSeconds(host);
|
|
891
|
+
}
|
|
892
|
+
function cutToHostSlots(span, hosts) {
|
|
893
|
+
return hosts.reduce((kept, host) => {
|
|
894
|
+
const start = Math.max(kept.start, host.start);
|
|
895
|
+
return { start, end: Math.max(start, Math.min(kept.end, host.end)) };
|
|
896
|
+
}, span);
|
|
897
|
+
}
|
|
898
|
+
|
|
833
899
|
// ../parsers/dist/timeSpans.js
|
|
834
900
|
var instantTolerance = (time) => 4 * Number.EPSILON * Math.max(1, Math.abs(time));
|
|
835
901
|
function sameInstant(a, b) {
|
|
@@ -875,6 +941,14 @@ export {
|
|
|
875
941
|
COLOR_GRADING_LUT_KEYS,
|
|
876
942
|
isColorGradingVariableRef,
|
|
877
943
|
validateColorGradingContract,
|
|
944
|
+
MEDIA_START_BASIS_ATTR,
|
|
945
|
+
readMediaStartBasis,
|
|
946
|
+
resolveAbsoluteMediaStartSeconds,
|
|
947
|
+
resolveMediaStartSeconds,
|
|
948
|
+
isRootGlobalMediaStart,
|
|
949
|
+
hostInPointSeconds,
|
|
950
|
+
compositionOriginSeconds,
|
|
951
|
+
cutToHostSlots,
|
|
878
952
|
sameInstant,
|
|
879
953
|
spansOverlap,
|
|
880
954
|
spansShareTime,
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { createRequire as __hf_createRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __hf_fileURLToPath } from "node:url";
|
|
3
|
+
import { dirname as __hf_dirname } from "node:path";
|
|
4
|
+
var require = __hf_createRequire(import.meta.url);
|
|
5
|
+
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __hf_dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
isDegradableEvaluateTimeoutError,
|
|
9
|
+
isNavigationTimeoutError,
|
|
10
|
+
withRemainingBudget
|
|
11
|
+
} from "./chunk-EHSBBBR2.js";
|
|
12
|
+
|
|
13
|
+
// src/capture/navigateForCapture.ts
|
|
14
|
+
var NETWORK_IDLE_ATTEMPT_MS = 3e4;
|
|
15
|
+
function networkIdleAttemptTimeoutMs(totalTimeoutMs) {
|
|
16
|
+
return Math.min(NETWORK_IDLE_ATTEMPT_MS, Math.max(0, totalTimeoutMs));
|
|
17
|
+
}
|
|
18
|
+
async function navigateForCapture(page, url, totalTimeoutMs) {
|
|
19
|
+
const networkIdleTimeoutMs = networkIdleAttemptTimeoutMs(totalTimeoutMs);
|
|
20
|
+
try {
|
|
21
|
+
const response2 = await page.goto(url, {
|
|
22
|
+
waitUntil: "networkidle2",
|
|
23
|
+
timeout: networkIdleTimeoutMs
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
response: response2,
|
|
27
|
+
waitUntil: "networkidle2",
|
|
28
|
+
networkIdleTimeoutMs,
|
|
29
|
+
fellBackFromNetworkIdle: false
|
|
30
|
+
};
|
|
31
|
+
} catch (err) {
|
|
32
|
+
if (!isNavigationTimeoutError(err) || networkIdleTimeoutMs >= totalTimeoutMs) {
|
|
33
|
+
throw err;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const fallbackTimeoutMs = totalTimeoutMs - networkIdleTimeoutMs;
|
|
37
|
+
const response = await page.goto(url, {
|
|
38
|
+
waitUntil: "domcontentloaded",
|
|
39
|
+
timeout: fallbackTimeoutMs
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
response,
|
|
43
|
+
waitUntil: "domcontentloaded",
|
|
44
|
+
networkIdleTimeoutMs,
|
|
45
|
+
fellBackFromNetworkIdle: true
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
async function waitForPageReady(page, options = {}) {
|
|
49
|
+
const { timeoutMs = 15e3, networkIdle = "always" } = options;
|
|
50
|
+
const deadline = Date.now() + timeoutMs;
|
|
51
|
+
const remaining = () => Math.max(0, deadline - Date.now());
|
|
52
|
+
const idle = async () => {
|
|
53
|
+
try {
|
|
54
|
+
await page.waitForNetworkIdle?.({
|
|
55
|
+
idleTime: 500,
|
|
56
|
+
timeout: remaining(),
|
|
57
|
+
concurrency: 2
|
|
58
|
+
});
|
|
59
|
+
} catch {
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
if (networkIdle === "always" && remaining() > 0) await idle();
|
|
63
|
+
let waitedOutLoad = false;
|
|
64
|
+
while (remaining() > 0) {
|
|
65
|
+
let timer;
|
|
66
|
+
const loading = await Promise.race([
|
|
67
|
+
page.evaluate(() => document.readyState === "loading").catch((err) => {
|
|
68
|
+
if (isDegradableEvaluateTimeoutError(err)) throw err;
|
|
69
|
+
return true;
|
|
70
|
+
}),
|
|
71
|
+
new Promise((resolve) => {
|
|
72
|
+
timer = setTimeout(() => resolve(true), Math.max(1, remaining()));
|
|
73
|
+
})
|
|
74
|
+
]).finally(() => {
|
|
75
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
76
|
+
});
|
|
77
|
+
if (loading !== true) break;
|
|
78
|
+
waitedOutLoad = true;
|
|
79
|
+
if (remaining() > 0) {
|
|
80
|
+
await new Promise((resolve) => setTimeout(resolve, Math.min(500, remaining())));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (waitedOutLoad && remaining() > 0) await idle();
|
|
84
|
+
}
|
|
85
|
+
var PUPPETEER_LAUNCH_DEFAULT_TIMEOUT_MS = 3e4;
|
|
86
|
+
var PAGE_LOAD_BLOCKING_TYPES = /* @__PURE__ */ new Set(["Document", "Script", "Stylesheet"]);
|
|
87
|
+
var NAMED_BLOCKING_REQUESTS = 3;
|
|
88
|
+
var SENT_OR_ANSWERED_WITHOUT_NETWORK = [
|
|
89
|
+
"Network.requestWillBeSentExtraInfo",
|
|
90
|
+
"Network.responseReceived"
|
|
91
|
+
];
|
|
92
|
+
async function gotoWhenSent(page, url, timeoutMs, coldChromeFirstRequestTimeoutMs = PUPPETEER_LAUNCH_DEFAULT_TIMEOUT_MS) {
|
|
93
|
+
const { TimeoutError } = await import("puppeteer-core");
|
|
94
|
+
const cdp = await page.createCDPSession();
|
|
95
|
+
try {
|
|
96
|
+
await cdp.send("Network.enable");
|
|
97
|
+
const sent = documentRequestSent(cdp);
|
|
98
|
+
const unfinished = unfinishedPageLoadRequests(cdp);
|
|
99
|
+
const navigation = page.goto(url, { waitUntil: "domcontentloaded", timeout: 0 });
|
|
100
|
+
const navigationAwaitedBelow = navigation.catch(() => void 0);
|
|
101
|
+
await withRemainingBudget(
|
|
102
|
+
Promise.race([sent, navigationAwaitedBelow]),
|
|
103
|
+
coldChromeFirstRequestTimeoutMs,
|
|
104
|
+
"sending the page request",
|
|
105
|
+
() => new TimeoutError(
|
|
106
|
+
`Navigation timeout: Chrome did not send the page request within ${coldChromeFirstRequestTimeoutMs} ms`
|
|
107
|
+
)
|
|
108
|
+
);
|
|
109
|
+
return await withRemainingBudget(
|
|
110
|
+
navigation,
|
|
111
|
+
timeoutMs,
|
|
112
|
+
"loading the page",
|
|
113
|
+
() => new TimeoutError(pageLoadTimeoutMessage(timeoutMs, url, unfinished()))
|
|
114
|
+
);
|
|
115
|
+
} finally {
|
|
116
|
+
await cdp.detach().catch(() => void 0);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function documentRequestSent(cdp) {
|
|
120
|
+
const documents = /* @__PURE__ */ new Set();
|
|
121
|
+
const sent = /* @__PURE__ */ new Set();
|
|
122
|
+
return new Promise((resolve) => {
|
|
123
|
+
const settle = (requestId) => {
|
|
124
|
+
if (documents.has(requestId) && sent.has(requestId)) resolve();
|
|
125
|
+
};
|
|
126
|
+
cdp.on("Network.requestWillBeSent", ({ requestId, type }) => {
|
|
127
|
+
if (type === "Document") documents.add(requestId);
|
|
128
|
+
settle(requestId);
|
|
129
|
+
});
|
|
130
|
+
for (const event of SENT_OR_ANSWERED_WITHOUT_NETWORK) {
|
|
131
|
+
cdp.on(event, ({ requestId }) => {
|
|
132
|
+
sent.add(requestId);
|
|
133
|
+
settle(requestId);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function unfinishedPageLoadRequests(cdp) {
|
|
139
|
+
const unfinished = /* @__PURE__ */ new Map();
|
|
140
|
+
cdp.on("Network.requestWillBeSent", ({ requestId, request, type }) => {
|
|
141
|
+
if (type && PAGE_LOAD_BLOCKING_TYPES.has(type)) unfinished.set(requestId, request.url);
|
|
142
|
+
});
|
|
143
|
+
for (const event of ["Network.loadingFinished", "Network.loadingFailed"]) {
|
|
144
|
+
cdp.on(event, ({ requestId }) => unfinished.delete(requestId));
|
|
145
|
+
}
|
|
146
|
+
return () => [...unfinished.values()];
|
|
147
|
+
}
|
|
148
|
+
function urlWithoutSecrets(raw) {
|
|
149
|
+
try {
|
|
150
|
+
const url = new URL(raw);
|
|
151
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") return `${url.protocol}\u2026`;
|
|
152
|
+
return `${url.origin}${url.pathname}${url.search ? "?\u2026" : ""}`;
|
|
153
|
+
} catch {
|
|
154
|
+
return "(unreadable URL)";
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function originOf(raw) {
|
|
158
|
+
try {
|
|
159
|
+
return new URL(raw).origin;
|
|
160
|
+
} catch {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function pageLoadTimeoutMessage(timeoutMs, pageUrl, waitingOn) {
|
|
165
|
+
const exceeded = `Navigation timeout of ${timeoutMs} ms exceeded`;
|
|
166
|
+
if (waitingOn.length === 0) return exceeded;
|
|
167
|
+
const named = waitingOn.slice(0, NAMED_BLOCKING_REQUESTS).map(urlWithoutSecrets).join(", ");
|
|
168
|
+
const unnamed = waitingOn.length - NAMED_BLOCKING_REQUESTS;
|
|
169
|
+
const more = unnamed > 0 ? ` and ${unnamed} more` : "";
|
|
170
|
+
const pageOrigin = new URL(pageUrl).origin;
|
|
171
|
+
const fromAnotherServer = waitingOn.some((request) => originOf(request) !== pageOrigin);
|
|
172
|
+
const advice = fromAnotherServer ? " A <script> or stylesheet from another server holds the page until it arrives; serve it from the project instead." : "";
|
|
173
|
+
return `${exceeded} while the page was still loading ${named}${more}.${advice}`;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export {
|
|
177
|
+
navigateForCapture,
|
|
178
|
+
waitForPageReady,
|
|
179
|
+
gotoWhenSent
|
|
180
|
+
};
|
|
@@ -7,9 +7,11 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
writeCaptureFileSync
|
|
9
9
|
} from "./chunk-MRF4AMKD.js";
|
|
10
|
+
import {
|
|
11
|
+
loadSharp
|
|
12
|
+
} from "./chunk-QH3T4WI2.js";
|
|
10
13
|
|
|
11
14
|
// src/capture/contactSheet.ts
|
|
12
|
-
import sharp from "sharp";
|
|
13
15
|
import { readdirSync, readFileSync, unlinkSync, existsSync } from "fs";
|
|
14
16
|
import { join, extname, basename, dirname } from "path";
|
|
15
17
|
async function createContactSheet(imagePaths, outputPath, opts = {}) {
|
|
@@ -25,6 +27,7 @@ async function createContactSheet(imagePaths, outputPath, opts = {}) {
|
|
|
25
27
|
if ((opts.remainingMs?.() ?? 1) <= 0) return null;
|
|
26
28
|
const files = imagePaths.slice(0, maxImages);
|
|
27
29
|
if (files.length === 0) return null;
|
|
30
|
+
const sharp = await loadSharp("contact sheets");
|
|
28
31
|
const firstMeta = await sharp(files[0]).metadata();
|
|
29
32
|
const srcW = firstMeta.width || 1920;
|
|
30
33
|
const srcH = firstMeta.height || 1080;
|
|
@@ -157,6 +160,7 @@ async function createSvgContactSheet(svgsDir, outputPath, assetsRootDir, budget
|
|
|
157
160
|
}
|
|
158
161
|
}
|
|
159
162
|
if (svgPaths.length === 0) return [];
|
|
163
|
+
const sharp = await loadSharp("contact sheets");
|
|
160
164
|
const svgFileNames = svgPaths.map((p) => p.split("/").pop());
|
|
161
165
|
const thumbSize = 200;
|
|
162
166
|
const tmpDir = dirname(outputPath);
|
|
@@ -4,13 +4,13 @@ import { dirname as __hf_dirname } from "node:path";
|
|
|
4
4
|
var require = __hf_createRequire(import.meta.url);
|
|
5
5
|
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
EMBEDDED_FONT_DATA
|
|
9
|
+
} from "./chunk-FI4I7CME.js";
|
|
7
10
|
import {
|
|
8
11
|
SYSTEM_FONT_SIZE_LIMIT,
|
|
9
12
|
locateSystemFontVariants
|
|
10
13
|
} from "./chunk-7FMUTGOH.js";
|
|
11
|
-
import {
|
|
12
|
-
EMBEDDED_FONT_DATA
|
|
13
|
-
} from "./chunk-FI4I7CME.js";
|
|
14
14
|
import {
|
|
15
15
|
FONT_ALIAS_MAP,
|
|
16
16
|
resolveAliasDisplayName
|
|
@@ -3132,7 +3132,7 @@ var require_wawoff2 = __commonJS({
|
|
|
3132
3132
|
|
|
3133
3133
|
// ../core/dist/fonts/deterministicFonts.js
|
|
3134
3134
|
import { createHash as createHash2 } from "crypto";
|
|
3135
|
-
import { existsSync as existsSync2, mkdirSync as mkdirSync2, mkdtempSync as mkdtempSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
3135
|
+
import { existsSync as existsSync2, mkdirSync as mkdirSync2, mkdtempSync as mkdtempSync2, readFileSync as readFileSync2, renameSync as renameSync2, rmSync as rmSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
3136
3136
|
import { homedir as homedir2, tmpdir as tmpdir2 } from "os";
|
|
3137
3137
|
import { join as join2 } from "path";
|
|
3138
3138
|
import postcss2 from "postcss";
|
|
@@ -4252,8 +4252,38 @@ async function ensureWoff2DataUri(cachePath, woff2Url, familyName, weight, style
|
|
|
4252
4252
|
return `data:font/woff2;base64,${readFileSync2(cachePath).toString("base64")}`;
|
|
4253
4253
|
}
|
|
4254
4254
|
var googleFontCssCache = /* @__PURE__ */ new Map();
|
|
4255
|
+
var GOOGLE_FONT_CSS_CACHE_DIR = "_css";
|
|
4255
4256
|
function _clearGoogleFontCssCacheForTests() {
|
|
4256
4257
|
googleFontCssCache.clear();
|
|
4258
|
+
rmSync2(join2(resolveFontCacheRoot(), GOOGLE_FONT_CSS_CACHE_DIR), { recursive: true, force: true });
|
|
4259
|
+
}
|
|
4260
|
+
function googleFontCssCachePath(url) {
|
|
4261
|
+
return join2(fontCacheDir(GOOGLE_FONT_CSS_CACHE_DIR), `${createHash2("sha256").update(url).digest("hex")}.json`);
|
|
4262
|
+
}
|
|
4263
|
+
function readCachedGoogleFontCss(url) {
|
|
4264
|
+
let cached;
|
|
4265
|
+
try {
|
|
4266
|
+
cached = JSON.parse(readFileSync2(googleFontCssCachePath(url), "utf8"));
|
|
4267
|
+
} catch {
|
|
4268
|
+
return null;
|
|
4269
|
+
}
|
|
4270
|
+
if (typeof cached !== "object" || cached === null)
|
|
4271
|
+
return null;
|
|
4272
|
+
const body = Reflect.get(cached, "body");
|
|
4273
|
+
const status = Reflect.get(cached, "status");
|
|
4274
|
+
return typeof body === "string" && typeof status === "number" ? { ok: true, body, status } : null;
|
|
4275
|
+
}
|
|
4276
|
+
function writeCachedGoogleFontCss(url, body, status) {
|
|
4277
|
+
if (!/@font-face/i.test(body))
|
|
4278
|
+
return;
|
|
4279
|
+
const path = googleFontCssCachePath(url);
|
|
4280
|
+
const partial = `${path}.${process.pid}.tmp`;
|
|
4281
|
+
try {
|
|
4282
|
+
writeFileSync2(partial, JSON.stringify({ status, body }), { mode: 420 });
|
|
4283
|
+
renameSync2(partial, path);
|
|
4284
|
+
} catch {
|
|
4285
|
+
rmSync2(partial, { force: true });
|
|
4286
|
+
}
|
|
4257
4287
|
}
|
|
4258
4288
|
function raceAgainstAbort(promise, signal) {
|
|
4259
4289
|
if (!signal)
|
|
@@ -4270,11 +4300,18 @@ function fetchGoogleFontCss(url, familyName, options, attempt) {
|
|
|
4270
4300
|
const mode = options.failClosedFontFetch ? `closed${options.retryPolicy.maxAttempts}` : "open";
|
|
4271
4301
|
const key = `${mode}:${url}`;
|
|
4272
4302
|
let shared = googleFontCssCache.get(key);
|
|
4303
|
+
const cached = shared ? null : readCachedGoogleFontCss(url);
|
|
4304
|
+
if (cached) {
|
|
4305
|
+
shared = Promise.resolve(cached);
|
|
4306
|
+
googleFontCssCache.set(key, shared);
|
|
4307
|
+
}
|
|
4273
4308
|
attempt.cssCache = shared ? "hit" : "fresh";
|
|
4274
4309
|
if (!shared) {
|
|
4275
4310
|
shared = fetchFontResource(url, { headers: { "User-Agent": WOFF2_USER_AGENT } }, (response) => response.text(), familyName, "Google Fonts CSS", { ...options, abortSignal: void 0 }).then((result) => {
|
|
4276
|
-
if (result.ok)
|
|
4311
|
+
if (result.ok) {
|
|
4312
|
+
writeCachedGoogleFontCss(url, result.body, result.response.status);
|
|
4277
4313
|
return { ok: true, body: result.body, status: result.response.status };
|
|
4314
|
+
}
|
|
4278
4315
|
if (isRetryableFontFetchStatus(result.response.status))
|
|
4279
4316
|
googleFontCssCache.delete(key);
|
|
4280
4317
|
return { ok: false, status: result.response.status };
|
|
@@ -4492,8 +4529,14 @@ function extractGoogleFontsText(html) {
|
|
|
4492
4529
|
const decodedBodyText = document2.body?.textContent ?? "";
|
|
4493
4530
|
const locales = collectLangAttributes(document2);
|
|
4494
4531
|
const uniqueCharacters = /* @__PURE__ */ new Set();
|
|
4495
|
-
|
|
4496
|
-
|
|
4532
|
+
const seen = /* @__PURE__ */ new Set();
|
|
4533
|
+
for (const text of [html, decodedBodyText]) {
|
|
4534
|
+
for (const character of text) {
|
|
4535
|
+
if (seen.has(character))
|
|
4536
|
+
continue;
|
|
4537
|
+
seen.add(character);
|
|
4538
|
+
addCaseClosure(uniqueCharacters, character, locales);
|
|
4539
|
+
}
|
|
4497
4540
|
}
|
|
4498
4541
|
if (hasTextTransformKeyword(html, FULL_WIDTH_KEYWORD_RE))
|
|
4499
4542
|
addFullwidthVariants(uniqueCharacters);
|
|
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
failCommand
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JVBRJMOP.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/lambda/state.ts
|
|
12
12
|
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
@@ -7,14 +7,14 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
trackLintReport,
|
|
9
9
|
trackLintRuleStreak
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JIUTXKWA.js";
|
|
11
11
|
import {
|
|
12
12
|
shouldTrack
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UKOTVJFV.js";
|
|
14
14
|
import {
|
|
15
15
|
LINT_RULE_COUNT,
|
|
16
16
|
LINT_RULE_GROUP_COUNTS
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ADDHW2FS.js";
|
|
18
18
|
|
|
19
19
|
// src/telemetry/lintStreaks.ts
|
|
20
20
|
import { createHash } from "crypto";
|
|
@@ -34,8 +34,12 @@ var PINNED_PACKAGES = {
|
|
|
34
34
|
"sherpa-onnx-node": "1.13.8"
|
|
35
35
|
};
|
|
36
36
|
var CACHE_DIR = join(homedir(), ".cache", "hyperframes", "optional");
|
|
37
|
+
var SHARP_VERSION = "0.35.3";
|
|
37
38
|
function optionalPackageDir(name, cacheDir = CACHE_DIR) {
|
|
38
|
-
return join(cacheDir, `${name.replace("/", "__")}@${
|
|
39
|
+
return join(cacheDir, `${name.replace("/", "__")}@${versionOf(name)}`);
|
|
40
|
+
}
|
|
41
|
+
function versionOf(name) {
|
|
42
|
+
return name === "sharp" ? SHARP_VERSION : OPTIONAL_PACKAGES[name];
|
|
39
43
|
}
|
|
40
44
|
function installedOptionalPackageVersion(name, cacheDir = CACHE_DIR, cliUrl = import.meta.url) {
|
|
41
45
|
if (pinnedPackageBesideCli(name, cliUrl)?.resolution === "entry") return OPTIONAL_PACKAGES[name];
|
|
@@ -44,14 +48,78 @@ function installedOptionalPackageVersion(name, cacheDir = CACHE_DIR, cliUrl = im
|
|
|
44
48
|
return JSON.parse(readFileSync(manifestPath(dir, name), "utf-8")).version;
|
|
45
49
|
}
|
|
46
50
|
function loadInstalledOptionalPackage(name, deps = defaultDeps) {
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
return loadPresent(name, deps);
|
|
52
|
+
}
|
|
53
|
+
function loadPresent(name, deps) {
|
|
54
|
+
return deps.loadBesideCli(name) ?? deps.loadInstalled(optionalPackageDir(name, deps.cacheDir), name);
|
|
49
55
|
}
|
|
50
56
|
async function loadOptionalPackage(name, feature, deps = defaultDeps) {
|
|
51
|
-
|
|
57
|
+
return await loadOrInstall(name, feature, deps);
|
|
58
|
+
}
|
|
59
|
+
async function loadSharp(feature, deps = defaultDeps, besideCli = requireSharpBesideCli) {
|
|
60
|
+
return besideCli(feature) ?? sharpExport(await loadOrInstall("sharp", feature, deps));
|
|
61
|
+
}
|
|
62
|
+
var backgroundSharpInstall;
|
|
63
|
+
async function loadSharpInBackground(feature, deps = defaultDeps, besideCli = requireSharpBesideCli) {
|
|
64
|
+
const present = loadInstalledSharp(feature, deps, besideCli);
|
|
52
65
|
if (present !== null) return present;
|
|
66
|
+
const install2 = loadOrInstall("sharp", feature, deps);
|
|
67
|
+
if (backgroundSharpInstall !== install2) {
|
|
68
|
+
backgroundSharpInstall = install2;
|
|
69
|
+
install2.catch((err) => deps.log(err.message));
|
|
70
|
+
}
|
|
71
|
+
const notYet = /* @__PURE__ */ Symbol("installing");
|
|
72
|
+
const settled = await Promise.race([install2, notYet]);
|
|
73
|
+
if (settled === notYet)
|
|
74
|
+
throw new Error(`sharp is not installed yet; installing it once for ${feature}`);
|
|
75
|
+
return sharpExport(settled);
|
|
76
|
+
}
|
|
77
|
+
function loadInstalledSharp(feature, deps = defaultDeps, besideCli = requireSharpBesideCli) {
|
|
78
|
+
const found = besideCli(feature) ?? loadPresent("sharp", deps);
|
|
79
|
+
return found === null ? null : sharpExport(found);
|
|
80
|
+
}
|
|
81
|
+
function requireSharpBesideCli(feature, cliUrl = import.meta.url) {
|
|
82
|
+
const req = createRequire(cliUrl);
|
|
83
|
+
let entry;
|
|
84
|
+
try {
|
|
85
|
+
entry = req.resolve("sharp");
|
|
86
|
+
} catch {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
return sharpExport(req(entry));
|
|
91
|
+
} catch (err) {
|
|
92
|
+
throw new Error(
|
|
93
|
+
`${feature} needs sharp, which is installed but could not load (${err.message}). Reinstall hyperframes with optional dependencies enabled, or run: npm i sharp`
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function sharpExport(module) {
|
|
98
|
+
const m = module;
|
|
99
|
+
return m.default ?? m;
|
|
100
|
+
}
|
|
101
|
+
function installTurnedOff(name) {
|
|
102
|
+
const value = process.env["HYPERFRAMES_NO_OPTIONAL_INSTALL"]?.trim() ?? "";
|
|
103
|
+
return value === "1" || value.split(",").some((entry) => entry.trim() === name);
|
|
104
|
+
}
|
|
105
|
+
var installs = /* @__PURE__ */ new WeakMap();
|
|
106
|
+
function loadOrInstall(name, feature, deps) {
|
|
107
|
+
const present = loadPresent(name, deps);
|
|
108
|
+
if (present !== null) return Promise.resolve(present);
|
|
109
|
+
let pending = installs.get(deps);
|
|
110
|
+
if (!pending) installs.set(deps, pending = /* @__PURE__ */ new Map());
|
|
111
|
+
let install2 = pending.get(name);
|
|
112
|
+
if (!install2) pending.set(name, install2 = installAndLoad(name, feature, deps));
|
|
113
|
+
return install2;
|
|
114
|
+
}
|
|
115
|
+
async function installAndLoad(name, feature, deps) {
|
|
53
116
|
const dir = optionalPackageDir(name, deps.cacheDir);
|
|
54
|
-
const version =
|
|
117
|
+
const version = versionOf(name);
|
|
118
|
+
if (installTurnedOff(name)) {
|
|
119
|
+
throw new Error(
|
|
120
|
+
`${name} is not installed, and HYPERFRAMES_NO_OPTIONAL_INSTALL turns off installing it; ${feature} needs it.`
|
|
121
|
+
);
|
|
122
|
+
}
|
|
55
123
|
deps.log(`installing ${name} for ${feature}, once`);
|
|
56
124
|
try {
|
|
57
125
|
await deps.install(dir, name, version);
|
|
@@ -179,7 +247,7 @@ async function install(dir, name, version, run = runNpm) {
|
|
|
179
247
|
}
|
|
180
248
|
var defaultDeps = {
|
|
181
249
|
cacheDir: CACHE_DIR,
|
|
182
|
-
loadBesideCli: (name) => loadBesideCli(name),
|
|
250
|
+
loadBesideCli: (name) => name === "sharp" ? null : loadBesideCli(name),
|
|
183
251
|
loadInstalled,
|
|
184
252
|
install,
|
|
185
253
|
log: (line) => console.error(line)
|
|
@@ -192,6 +260,9 @@ export {
|
|
|
192
260
|
installedOptionalPackageVersion,
|
|
193
261
|
loadInstalledOptionalPackage,
|
|
194
262
|
loadOptionalPackage,
|
|
263
|
+
loadSharp,
|
|
264
|
+
loadSharpInBackground,
|
|
265
|
+
loadInstalledSharp,
|
|
195
266
|
isInstalled,
|
|
196
267
|
installedPackagePath,
|
|
197
268
|
pinnedPackageBesideCli,
|