Skip to content

Latest commit

 

History

History
94 lines (74 loc) · 3.12 KB

File metadata and controls

94 lines (74 loc) · 3.12 KB

Configuration

Out of the box, mucklet-script won't require you to use a config file, but will look for a mucklet.config.js file in the root of the project.

You can also change the configuration file using the --config flag:

package.json

"scripts": {
	"build:castle": "mucklet-script build --config=castle.config.js"
}

The configuration file should be a Javascript ES6 module with a default export of either:

mucklet.config.js

const config = {
	output: {
		dir: "build",
		outFile: "[name].wasm",
		textFile: "[name].wat",
	},
	realm: {
		apiUrl: "wss://api.test.mucklet.com",
	},
	scripts: [
		{
			name: "example",
			path: "scripts/index.ts",
			room: "c2d1ml0t874bj4eva85g",
			active: true,
		},
	],
};
export default config;

Tip

You can set up a new project with a default configuration using:

mucklet-script init myproject

MuckletConfig : object

Mucklet configuration object.

Property Type Description
output OutputConfig Output configuration.
realm RealmConfig Realm configuration.
scripts Array.<ScriptConfig> Script configurations.

OutputConfig : object

Output configuration object.

Property Type Description
dir string Directory to put build artifacts relative to the config file. Defaults to ./ if not set.
outFile string Name of wasm build files. Available placeholders:
- [name] is replaced with the script name.
- [room] is replaced with the script room ID or "noroom" if unset.
Defaults to "[name].wasm" if not set.
textFile string Name of wat build files. Available placeholders:
- [name] is replaced with the script name.
- [room] is replaced with the script room ID or "noroom" if unset.
Defaults to "[name].wat" if not set.

RealmConfig : object

Realm configuration object.

Property Type Description
apiUrl string URL to the realm API WebSocket endpoint, including scheme. E.g. "wss://api.test.mucklet.com"

ScriptConfig : object

Script configuration object.

Property Type Description
name string Script name. Is used as keyword on deploy.
path string Path to the script file relative to the config file.
[room] string Room ID to deploy to.
[active] boolean Active status. If not set, active status is not changed.
[testPath] string Path to the script test file.