Documentation
¶
Overview ¶
Package js builds the modlock library that TypeScript and JavaScript mods import: one ES module holding the calls into the game and its protobuf runtime, the entity classes as a second module that imports the first, and their declarations. Beside them it keeps the library's TypeScript source and the protobuf runtime's, which scriptc compiles with a mod. It also bundles the renderer that draws mods' interfaces in the player's game, the preview page that draws them in a browser, and Modlock Studio's page.
A script project installs only the declarations, so editors and the type checker see one modlock package and neither compiler mistakes it for an npm dependency; each compiler resolves modlock to its own copy here.
Library builds from the Modlock source when it is on disk: a checkout, or the module cache of the build that links this package. A release build has no source on disk and carries the library it was built with.
Index ¶
Constants ¶
const Built = "built"
Built is the directory under js that the release build fills with the built library before it builds the command line, which embeds it.
const LayoutLibrary = "layout.js"
LayoutLibrary is the built library a mod's layout script includes to read its data and routes, which a client content package installs as scripts/modlock/layout.js beside the renderer. Its bundle defines the global Modlock.
const Preview = "preview"
Preview is the directory of the built library that holds the preview page modlock dev serves.
const Renderer = "renderer.js"
Renderer is the built renderer's file name, which a client content package installs as scripts/modlock/ui.js beside the layout in panorama/layout. It is not ui.js, since the library's declarations include ui.d.ts: a mod that imported modlock/ui would type check and then run the renderer on the server.
const Scriptc = "scriptc"
Scriptc is the directory of the built library that holds the source scriptc compiles: the library under js/src and the generated messages it imports, as in the Modlock source, and the protobuf runtime under protobuf-es-lite.
const ScriptcProtobuf = "protobuf-es-lite"
ScriptcProtobuf is the protobuf runtime's source directory under Scriptc.
const Studio = "studio"
Studio is the directory of the built library that holds Modlock Studio's page, which modlock studio serves.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.