Help us shape the future of Go! Take the 2026 Go Developer Survey

js

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 18 Imported by: 0

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. It also bundles the renderer that draws mods' interfaces in the player's game.

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 downloads the library built for its release.

Index

Constants

View Source
const Archive = "modlock-library.tar.gz"

Archive is the release asset that holds the built library.

View Source
const Renderer = "ui.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.

Variables

View Source
var Files = []string{"index.js", "index.d.ts", "globals.d.ts", "host.gen.d.ts", "entities.js", "entities.d.ts", "console.js", "console.d.ts", "ui.d.ts", "bits.d.ts", "spot.d.ts", "dropper.d.ts"}

Files are the built library's files, which modlock build installs into each script project.

Functions

func Build

func Build(ctx context.Context, source, out string) error

Build builds the library and renderer from the Modlock source into out.

func Library

func Library(ctx context.Context) (string, error)

Library returns a directory holding the built library and renderer, building or downloading it into the user cache the first time.

func Pack

func Pack(ctx context.Context, source, archive string) error

Pack writes the library and renderer built from source as the gzipped tar archive a release publishes.

func Source

func Source() string

Source returns the root of the Modlock source on disk, or empty when this build has none: the checkout or module cache directory this package was compiled from, or else the module cache entry of the linked version.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL