Builtin Library
README.md
zeromind.freshCheck
Check in one call that a package installs clean into a fresh world and that its README example runs there, or how this world opens fresh, the way a player's engine opens it.
zero zeromind freshCheck 8dd92b2a-ce71-4bdb-ac92-ac5ee8f66a51
zero zeromind freshCheck "40356f26-f9f2-4a8b-be89-e5f92e7a64b0@release-check"
zero zeromind freshCheck # this world, opened fresh
From Luau, with the README example run on the opened world:
tools.use("zeromind", "freshCheck", { "8dd92b2a-ce71-4bdb-ac92-ac5ee8f66a51" }, {
code = "return require('rng').new(7):int(6)",
play = 5,
})
Assets into a fresh world
With assets named, the check runs in a world made for it, in a sub-client of this editor started on that world:
- a private world is made (
fresh-<id> <guid> (scratch)), and a sub-client starts on it, on its main branch and startup scene; - each asset is installed there in the order given: a guid installs the
version its world ships,
guid@refthe version a branch, tag or commit of that world holds, so a package pushed to a branch is checked before it is published; - the world is opened fresh, every module each install names is required,
coderuns andplayseconds of play mode follow; - the sub-client is deleted, and the world with it unless
keepis set: a kept world is named innote, with the call that starts a sub-client on it (zero client create <id> --world <guid> --wait) to play and drive it further.zeromind.deleteWorlddeletes it once that sub-client is deleted and its engine has closed; a delete ZeroMind refuses withENGINE_ON_WORLDmeanwhile succeeds sent again a few seconds later.
Your own sub-client and the user's client stay on this world throughout. On
an engine that hosts no sub-client (a browser or Android engine) this client
runs the check itself: it moves to the check's world, runs the same steps and
moves back before the world is deleted, so the world on screen changes while
the check runs. ranIn names which (subClient or thisClient). A client
that could not move back is named in note, with the call that returns it,
and the world stays until it has.
This world, opened fresh
With no assets, this world is reloaded from the top in the client the call
runs in (your own sub-client unless the call names another): its content is
taken cold, its entrypoint and startup scene run and its components wake
once, as when a player opens it. code and play then run on it. The reload
ends every task the world's content started in that client, so run it where
nothing of the session needs keeping. A client in play leaves it first through
the guarded flip: while its play session holds changes nobody accepted, the
check does not run and names them, with the calls that keep or drop them.
One check runs in a client at a time: a second call while one runs is refused, naming that.
The report
clean: true when the open finished, every install and require succeeded with no problem stated and every installed file read back, every shader of the world compiled, the code and the play asked for ran, and the world's own and installed code logged no error. Errors the engine and its built-in library logged meanwhile are counted apart and leavecleanas it is.installs: per asset, itsoutcome,version,files,deps,problems,pending(files that had not read back, which leaves the check unclean),notices,requiresandseconds.requires: each module required on the opened world, and its error.shaders: the world's own and installed shaders, each compiled and read whether or not anything draws with it:checked,failedCount,failed(at most 5, each with its compiler error) andpending(no outcome after 60 s, which leaves the check unclean).code:{ ok, result }or{ ok = false, error }.openSeconds,scene,playedSeconds, andplayError: why the play asked for did not run (the engine refuses play for a script error in the world's content) or why the world did not go back to edit, which leaves the check unclean.errorscounts every line logged at error level while the check ran,contentErrorsthose about the world's own or installed content (a line naming one of its files, or raised by a Luau chunk of it or ofcode),engineErrorsthose only the engine and its built-in library raised;warningscounts the warnings.loggedlists the distinct messages, each withfrom(contentorengine), errors first, content before engine, at most 10 error and 5 warning messages; entity ids readent_*, so one message about many entities is one row.mode(assetsorthisWorld),checkWorld,ranIn,checkClient,worldDeleted,startSecondsandseconds.