Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c9b872f
feat(mock): serve the downloads a browser build's services declare
Oct 24, 2026
ef1cb1f
refactor(mock): name the base64 decoder for what it does
Oct 24, 2026
b57bbb7
test(mock): cover the byte and header paths of the browser host
Oct 24, 2026
1afdcd5
fix(mock): keep the Buffer decoder on the views a service derives
Oct 24, 2026
8eb1e44
fix(mock): decode hex and base64 the way node does
Oct 24, 2026
66b3336
fix(mock): match node on Buffer ranges, serialisation and bad input
Oct 24, 2026
cc01ead
fix(mock): refuse a write node refuses, and report a corrupt byte entry
Oct 24, 2026
e4bf36e
fix(mock): report a byte body only when bytes are the body, and cover…
Oct 24, 2026
f217755
fix(mock): tell a marker-like text value from a byte entry, and honou…
Oct 24, 2026
7f9116e
fix(mock): take readFileSync's options object, and unescape the webout
Oct 24, 2026
3929fba
fix(mock): measure text in bytes, and keep an accented download filename
Oct 24, 2026
c5eb3b6
fix(mock): pass a header value through as the bytes node writes
Oct 24, 2026
c25d477
fix(mock): decode the url-safe base64 alphabet, and keep a utf16 BOM
Oct 25, 2026
a9dd227
fix(mock): honour Buffer.from's offset and length, and count bytes in…
Oct 25, 2026
096cb32
fix(mock): take the page-side drive total from the worker
Oct 25, 2026
332f625
test(mock): cover the page-side stats error path
Oct 25, 2026
17d9ed8
fix(mock): close the node-fidelity gaps in the Buffer shim, writes an…
Oct 25, 2026
23d7e85
test(mock): cover the seed's escape for marker-like text
Oct 25, 2026
51b11b6
fix(mock): encode ascii the way node does, as latin1
Oct 25, 2026
911c48a
fix(mock): keep a tab in a header value, as HTTP allows it
Oct 25, 2026
a0612a5
fix(mock): report a corrupt drive entry wherever it is read
Oct 25, 2026
d737599
refactor(mock): let one place own the corrupt-entry error
Oct 25, 2026
b16f7ad
fix(mock): validate the byte body, and let a prelude collision be a r…
Oct 25, 2026
76a495c
perf(mock): measure a byte entry without decoding it
Oct 25, 2026
cb38605
fix(mock): bound the bytes the seed carries, and refuse a stats reply…
Oct 25, 2026
1eabbd8
perf(mock): budget the whole seed, and cache an entry's measured size
Oct 25, 2026
e9bdf03
fix(mock): spend the seed budget in path order
Oct 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/commands/build/internal/mockSite/assets/persist.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,18 @@
writeFiles,
clear: clearAll,
snapshot: () => askWorker({ type: 'sasjs-snapshot' }, 'sasjs-snapshot'),
/**
* The drive total in bytes, measured by the worker: it owns the stored
* representation, so the figure stays the one `statSync` reports rather than
* the length of the strings this store happens to hold - which would count
* the base64 expansion and the marker of a byte entry.
*/
stats: async () => {
const files = await readAll()
const paths = Object.keys(files)
return {
files: paths.length,
bytes: paths.reduce((t, p) => t + files[p].length, 0)
}
const answer = await askWorker({ type: 'sasjs-stats' }, 'sasjs-stats')
// a worker that cannot report fails the read, as the other drive reads
// do: a caller destructuring { files, bytes } must not be handed NaN
if (answer.error) throw new Error(answer.error)
return answer.stats
},
/**
* Downloads the current drive as `mock-snapshot.json`. Drop that file in the
Expand Down
Loading
Loading