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
|
@@ -6,14 +6,14 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
refreshIfNeeded
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HRPWRZGF.js";
|
|
10
10
|
import {
|
|
11
11
|
buildAuthHeaders,
|
|
12
12
|
envCredentialVar,
|
|
13
13
|
isAuthError,
|
|
14
14
|
isTokenExpired,
|
|
15
15
|
tryResolveCredential
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7KVVNF7B.js";
|
|
17
17
|
import {
|
|
18
18
|
CSS_URL_RE,
|
|
19
19
|
isNonRelativeUrl,
|
|
@@ -107,7 +107,15 @@ function writeTeamProject(projectDir, team) {
|
|
|
107
107
|
|
|
108
108
|
// src/utils/publishProject.ts
|
|
109
109
|
import { basename, dirname, join as join2, posix, relative, resolve as resolve2 } from "path";
|
|
110
|
-
import {
|
|
110
|
+
import {
|
|
111
|
+
closeSync,
|
|
112
|
+
existsSync as existsSync2,
|
|
113
|
+
fstatSync,
|
|
114
|
+
openSync,
|
|
115
|
+
readdirSync,
|
|
116
|
+
readFileSync as readFileSync2,
|
|
117
|
+
statSync
|
|
118
|
+
} from "fs";
|
|
111
119
|
import AdmZip from "adm-zip";
|
|
112
120
|
import ignore from "ignore";
|
|
113
121
|
var IGNORED_DIRS = /* @__PURE__ */ new Set([".git", "node_modules", "dist", ".next", "coverage"]);
|
|
@@ -182,18 +190,19 @@ function getUploadHeaders(data, uploadUrl, contentType, archiveByteLength) {
|
|
|
182
190
|
}
|
|
183
191
|
}
|
|
184
192
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
if (signedHeaders?.split(";").includes("x-amz-server-side-encryption") && !Object.keys(headers).some((key) => key.toLowerCase() === "x-amz-server-side-encryption")) {
|
|
190
|
-
headers["x-amz-server-side-encryption"] = "AES256";
|
|
193
|
+
setHeaderIfAbsent(headers, "content-type", contentType);
|
|
194
|
+
const signedHeaders = new URL(uploadUrl).searchParams.get("X-Amz-SignedHeaders")?.split(";") ?? [];
|
|
195
|
+
if (signedHeaders.includes("x-amz-server-side-encryption")) {
|
|
196
|
+
setHeaderIfAbsent(headers, "x-amz-server-side-encryption", "AES256");
|
|
191
197
|
}
|
|
192
|
-
if (signedHeaders
|
|
193
|
-
headers
|
|
198
|
+
if (signedHeaders.includes("content-length")) {
|
|
199
|
+
setHeaderIfAbsent(headers, "content-length", String(archiveByteLength));
|
|
194
200
|
}
|
|
195
201
|
return headers;
|
|
196
202
|
}
|
|
203
|
+
function setHeaderIfAbsent(headers, name, value) {
|
|
204
|
+
if (!Object.keys(headers).some((key) => key.toLowerCase() === name)) headers[name] = value;
|
|
205
|
+
}
|
|
197
206
|
async function readJson(response) {
|
|
198
207
|
return response.clone().json().catch(() => null);
|
|
199
208
|
}
|
|
@@ -330,6 +339,43 @@ function collectProjectFiles(rootDir, currentDir, paths, matcher) {
|
|
|
330
339
|
}
|
|
331
340
|
}
|
|
332
341
|
var EXT_ASSETS_PREFIX = "_ext";
|
|
342
|
+
var TEXT_FILE_EXTS = /\.(html?|css|m?js|cjs|json|svg|xml|txt)$/i;
|
|
343
|
+
function stagedSize(file) {
|
|
344
|
+
return Buffer.isBuffer(file) ? file.byteLength : file.size;
|
|
345
|
+
}
|
|
346
|
+
function assertSame(file, now) {
|
|
347
|
+
if (now?.size !== file.size || now.mtimeMs !== file.mtimeMs) {
|
|
348
|
+
throw new Error(`${file.absPath} changed on disk while it was being prepared. Run it again.`);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
function assertUnchanged(file) {
|
|
352
|
+
assertSame(file, statSync(file.absPath, { throwIfNoEntry: false }));
|
|
353
|
+
}
|
|
354
|
+
function readChecked(path, check) {
|
|
355
|
+
const fd = openSync(path, "r");
|
|
356
|
+
try {
|
|
357
|
+
check(fstatSync(fd));
|
|
358
|
+
const bytes = readFileSync2(fd);
|
|
359
|
+
check(fstatSync(fd));
|
|
360
|
+
return bytes;
|
|
361
|
+
} finally {
|
|
362
|
+
closeSync(fd);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
function readStaged(file) {
|
|
366
|
+
if (Buffer.isBuffer(file)) return file;
|
|
367
|
+
return readChecked(file.absPath, (stat) => assertSame(file, stat));
|
|
368
|
+
}
|
|
369
|
+
function stageFile(absPath, onDiskMinBytes) {
|
|
370
|
+
const fd = openSync(absPath, "r");
|
|
371
|
+
try {
|
|
372
|
+
const { size, mtimeMs } = fstatSync(fd);
|
|
373
|
+
if (size < onDiskMinBytes || TEXT_FILE_EXTS.test(absPath)) return readFileSync2(fd);
|
|
374
|
+
return { absPath, size, mtimeMs };
|
|
375
|
+
} finally {
|
|
376
|
+
closeSync(fd);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
333
379
|
function addExternalAsset(ctx, absPath) {
|
|
334
380
|
const existing = ctx.externalMap.get(absPath);
|
|
335
381
|
if (existing) return existing;
|
|
@@ -343,7 +389,7 @@ function addExternalAsset(ctx, absPath) {
|
|
|
343
389
|
while (ctx.usedArchivePaths.has(`${base}_${i}${ext}`)) i++;
|
|
344
390
|
archivePath = `${base}_${i}${ext}`;
|
|
345
391
|
}
|
|
346
|
-
ctx.fileContents.set(archivePath,
|
|
392
|
+
ctx.fileContents.set(archivePath, stageFile(absPath, ctx.onDiskMinBytes));
|
|
347
393
|
ctx.externalMap.set(absPath, archivePath);
|
|
348
394
|
ctx.usedArchivePaths.add(archivePath);
|
|
349
395
|
return archivePath;
|
|
@@ -359,13 +405,16 @@ function tryResolveExternal(ctx, rawPath, referrerAbsDir) {
|
|
|
359
405
|
}
|
|
360
406
|
return addExternalAsset(ctx, absPath);
|
|
361
407
|
}
|
|
362
|
-
function
|
|
408
|
+
function referenceFrom(entryPath, target) {
|
|
409
|
+
return isNonRelativeUrl(target) ? target : posix.relative(posix.dirname(entryPath), target);
|
|
410
|
+
}
|
|
411
|
+
function rewriteCssUrls(css, referrerAbsDir, entryPath, resolveTarget) {
|
|
363
412
|
let modified = false;
|
|
364
413
|
const rewritten = css.replace(CSS_URL_RE, (full, quote, rawUrl) => {
|
|
365
|
-
const
|
|
366
|
-
if (!
|
|
414
|
+
const target = resolveTarget((rawUrl || "").trim(), referrerAbsDir);
|
|
415
|
+
if (!target) return full;
|
|
367
416
|
modified = true;
|
|
368
|
-
return `url(${quote || ""}${
|
|
417
|
+
return `url(${quote || ""}${referenceFrom(entryPath, target)}${quote || ""})`;
|
|
369
418
|
});
|
|
370
419
|
return { css: rewritten, modified };
|
|
371
420
|
}
|
|
@@ -377,20 +426,20 @@ function rewriteHtmlAttributes(document, referrerAbsDir, entryPath, resolveTarge
|
|
|
377
426
|
for (const attr of attrs) {
|
|
378
427
|
const val = (el.getAttribute(attr) || "").trim();
|
|
379
428
|
if (!val) continue;
|
|
380
|
-
const
|
|
381
|
-
if (!
|
|
382
|
-
el.setAttribute(attr,
|
|
429
|
+
const target = resolveTarget(val, referrerAbsDir);
|
|
430
|
+
if (!target) continue;
|
|
431
|
+
el.setAttribute(attr, referenceFrom(entryPath, target));
|
|
383
432
|
modified = true;
|
|
384
433
|
}
|
|
385
434
|
}
|
|
386
435
|
return modified;
|
|
387
436
|
}
|
|
388
|
-
function rewriteStyleBlocks(
|
|
437
|
+
function rewriteStyleBlocks(document, referrerAbsDir, entryPath, resolveTarget) {
|
|
389
438
|
let modified = false;
|
|
390
439
|
for (const styleEl of document.querySelectorAll("style")) {
|
|
391
440
|
const css = styleEl.textContent || "";
|
|
392
441
|
if (!css.includes("url(")) continue;
|
|
393
|
-
const result = rewriteCssUrls(
|
|
442
|
+
const result = rewriteCssUrls(css, referrerAbsDir, entryPath, resolveTarget);
|
|
394
443
|
if (result.modified) {
|
|
395
444
|
styleEl.textContent = result.css;
|
|
396
445
|
modified = true;
|
|
@@ -399,7 +448,7 @@ function rewriteStyleBlocks(ctx, document, referrerAbsDir, entryPath) {
|
|
|
399
448
|
for (const el of document.querySelectorAll("[style]")) {
|
|
400
449
|
const style = el.getAttribute("style") || "";
|
|
401
450
|
if (!style.includes("url(")) continue;
|
|
402
|
-
const result = rewriteCssUrls(
|
|
451
|
+
const result = rewriteCssUrls(style, referrerAbsDir, entryPath, resolveTarget);
|
|
403
452
|
if (result.modified) {
|
|
404
453
|
el.setAttribute("style", result.css);
|
|
405
454
|
modified = true;
|
|
@@ -410,13 +459,9 @@ function rewriteStyleBlocks(ctx, document, referrerAbsDir, entryPath) {
|
|
|
410
459
|
function localizeHtmlEntry(ctx, entryPath, content) {
|
|
411
460
|
const referrerAbsDir = resolve2(ctx.absProjectDir, dirname(entryPath));
|
|
412
461
|
const { document } = parseHTML(content.toString("utf-8"));
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
entryPath,
|
|
417
|
-
(val, dir) => tryResolveExternal(ctx, val, dir)
|
|
418
|
-
);
|
|
419
|
-
const stylesChanged = rewriteStyleBlocks(ctx, document, referrerAbsDir, entryPath);
|
|
462
|
+
const resolveTarget = (val, dir) => tryResolveExternal(ctx, val, dir);
|
|
463
|
+
const attrsChanged = rewriteHtmlAttributes(document, referrerAbsDir, entryPath, resolveTarget);
|
|
464
|
+
const stylesChanged = rewriteStyleBlocks(document, referrerAbsDir, entryPath, resolveTarget);
|
|
420
465
|
if (attrsChanged || stylesChanged) {
|
|
421
466
|
ctx.fileContents.set(entryPath, Buffer.from(document.toString(), "utf-8"));
|
|
422
467
|
}
|
|
@@ -425,20 +470,26 @@ function localizeCssEntry(ctx, entryPath, content) {
|
|
|
425
470
|
const referrerAbsDir = resolve2(ctx.absProjectDir, dirname(entryPath));
|
|
426
471
|
const css = content.toString("utf-8");
|
|
427
472
|
if (!css.includes("url(")) return;
|
|
428
|
-
const result = rewriteCssUrls(
|
|
473
|
+
const result = rewriteCssUrls(
|
|
474
|
+
css,
|
|
475
|
+
referrerAbsDir,
|
|
476
|
+
entryPath,
|
|
477
|
+
(val, dir) => tryResolveExternal(ctx, val, dir)
|
|
478
|
+
);
|
|
429
479
|
if (result.modified) {
|
|
430
480
|
ctx.fileContents.set(entryPath, Buffer.from(result.css, "utf-8"));
|
|
431
481
|
}
|
|
432
482
|
}
|
|
433
|
-
function localizeExternalAssets(absProjectDir, fileContents) {
|
|
483
|
+
function localizeExternalAssets(absProjectDir, fileContents, onDiskMinBytes = Infinity) {
|
|
434
484
|
const ctx = {
|
|
435
485
|
absProjectDir,
|
|
436
486
|
fileContents,
|
|
487
|
+
onDiskMinBytes,
|
|
437
488
|
externalMap: /* @__PURE__ */ new Map(),
|
|
438
489
|
usedArchivePaths: /* @__PURE__ */ new Set()
|
|
439
490
|
};
|
|
440
491
|
for (const [entryPath, content] of [...fileContents.entries()]) {
|
|
441
|
-
if (entryPath.startsWith(EXT_ASSETS_PREFIX + "/")) continue;
|
|
492
|
+
if (entryPath.startsWith(EXT_ASSETS_PREFIX + "/") || !Buffer.isBuffer(content)) continue;
|
|
442
493
|
if (entryPath.endsWith(".html") || entryPath.endsWith(".htm")) {
|
|
443
494
|
localizeHtmlEntry(ctx, entryPath, content);
|
|
444
495
|
} else if (entryPath.endsWith(".css")) {
|
|
@@ -448,6 +499,9 @@ function localizeExternalAssets(absProjectDir, fileContents) {
|
|
|
448
499
|
return ctx.externalMap.size;
|
|
449
500
|
}
|
|
450
501
|
function buildPublishFileMap(projectDir) {
|
|
502
|
+
return stagePublishFiles(projectDir, Infinity);
|
|
503
|
+
}
|
|
504
|
+
function stagePublishFiles(projectDir, onDiskMinBytes) {
|
|
451
505
|
const absProjectDir = resolve2(projectDir);
|
|
452
506
|
const filePaths = [];
|
|
453
507
|
collectProjectFiles(absProjectDir, absProjectDir, filePaths, createProjectIgnore(absProjectDir));
|
|
@@ -458,9 +512,9 @@ function buildPublishFileMap(projectDir) {
|
|
|
458
512
|
}
|
|
459
513
|
const fileContents = /* @__PURE__ */ new Map();
|
|
460
514
|
for (const filePath of filePaths) {
|
|
461
|
-
fileContents.set(filePath,
|
|
515
|
+
fileContents.set(filePath, stageFile(join2(absProjectDir, filePath), onDiskMinBytes));
|
|
462
516
|
}
|
|
463
|
-
localizeExternalAssets(absProjectDir, fileContents);
|
|
517
|
+
localizeExternalAssets(absProjectDir, fileContents, onDiskMinBytes);
|
|
464
518
|
return fileContents;
|
|
465
519
|
}
|
|
466
520
|
var ARCHIVE_ENTRY_TIME = new Date(1980, 0, 1, 0, 0, 0, 0);
|
|
@@ -637,8 +691,16 @@ export {
|
|
|
637
691
|
readTeamProject,
|
|
638
692
|
writeTeamProject,
|
|
639
693
|
resolvePublishCredential,
|
|
694
|
+
TEXT_FILE_EXTS,
|
|
695
|
+
stagedSize,
|
|
696
|
+
assertUnchanged,
|
|
697
|
+
readChecked,
|
|
698
|
+
readStaged,
|
|
699
|
+
rewriteCssUrls,
|
|
640
700
|
rewriteHtmlAttributes,
|
|
701
|
+
rewriteStyleBlocks,
|
|
641
702
|
buildPublishFileMap,
|
|
703
|
+
stagePublishFiles,
|
|
642
704
|
zipPublishFileMap,
|
|
643
705
|
getPublishApiBaseUrl,
|
|
644
706
|
publishProjectArchive
|