Skip to main content

MoonBit's Build System Configuration

JSON schema for Moonbit moon.mod.json files

A module of Moonbit lang

$schemahttp://json-schema.org/draft-07/schema#

Properties

NameType
nameString
versionString
depsObject
readmeString
repositoryString
licenseString

name

DescriptionName of the module
TypeString
RequiredYes

version

DescriptionVersion of the module, following Semantic Versioning 2.0.0
TypeString
RequiredNo

deps

DescriptionThird-party dependencies of the module
TypeObject
RequiredNo

readme

DescriptionPath to module's README file
TypeString
RequiredNo

repository

DescriptionURL to module's repository
TypeString
RequiredNo
Formaturi

license

DescriptionLicense of the module, an SPDX identifier
TypeString
RequiredNo

Schema

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "JSON schema for Moonbit moon.mod.json files",
"description": "A module of Moonbit lang",
"type": "object",
"properties": {
"name": {
"description": "Name of the module",
"type": "string"
},
"version": {
"description": "Version of the module, following Semantic Versioning 2.0.0",
"type": "string"
},
"deps": {
"description": "Third-party dependencies of the module",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"readme": {
"description": "Path to module's README file",
"type": "string"
},
"repository": {
"description": "URL to module's repository",
"type": "string",
"format": "uri"
},
"license": {
"description": "License of the module, an SPDX identifier",
"type": "string"
}
},
"required": [
"name"
]
}

JSON schema for Moonbit moon.pkg.json files

A package in Moonbit lang

$schemahttp://json-schema.org/draft-07/schema#

Properties

NameType
nameString
is-mainBoolean
importOne of:Object
Array
linkOne of:Boolean
Object

name

DescriptionName of the package (Deprecated)
TypeString
RequiredNo

is-main

DescriptionSpecify whether this package is a main package or not
TypeBoolean
RequiredNo

import

DescriptionImported packages of the package
TypeOne of:Object
Array
RequiredNo

import.0

TitleObject form
TypeObject

import.1

TitleArray form
TypeArray
TypeOne of:Boolean
Object
RequiredNo

link.0

TitleBuild this package
TypeBoolean

link.1

TitleBuild configuration
DescriptionConfigure the build for each backend
TypeObject

link.1.wasm

TypeObject

link.1.wasm.exports

DescriptionExported functions of the package
TypeArray

link.1.wasm.export-memory-name

DescriptionName of the exported memory, or no memory will be exported
TypeString

link.1.wasm.flags

DescriptionFlags for the compilation of the package
TypeArray

link.1.wasm-gc

TypeObject

link.1.wasm-gc.exports

DescriptionExported functions of the package
TypeArray

link.1.wasm-gc.export-memory-name

DescriptionName of the exported memory, or no memory will be exported
TypeString

link.1.wasm-gc.flags

DescriptionFlags for the compilation of the package
TypeArray

link.1.js

TypeObject

link.1.js.exports

DescriptionExported functions of the package
TypeArray

link.1.js.format

DescriptionFormat of the output JavaScript file
Enum
  • esm
  • cjs
  • iife

Schema

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "JSON schema for Moonbit moon.pkg.json files",
"description": "A package in Moonbit lang",
"type": "object",
"properties": {
"name": {
"description": "Name of the package (Deprecated)",
"type": "string"
},
"is-main": {
"description": "Specify whether this package is a main package or not",
"type": "boolean",
"default": false
},
"import": {
"description": "Imported packages of the package",
"oneOf": [
{
"title": "Object form",
"type": "object",
"additionalProperties": {
"description": "Path and alias of an imported package",
"type": [
"string",
"null"
]
}
},
{
"title": "Array form",
"type": "array",
"items": {
"oneOf": [
{
"title": "Package without alias",
"description": "Path of an imported package",
"type": "string"
},
{
"title": "Package with alias",
"description": "Path and alias of an imported package",
"type": "object",
"properties": {
"path": {
"description": "Path of an imported package",
"type": "string"
},
"alias": {
"description": "Alias of an imported package",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"path",
"alias"
]
}
]
}
}
]
},
"link": {
"oneOf": [
{
"title": "Build this package",
"type": "boolean"
},
{
"title": "Build configuration",
"description": "Configure the build for each backend",
"type": "object",
"properties": {
"wasm": {
"type": "object",
"properties": {
"exports": {
"description": "Exported functions of the package",
"type": "array",
"items": {
"description": "Name of an exported function, or followed by a colon and the alias name",
"type": "string"
}
},
"export-memory-name": {
"description": "Name of the exported memory, or no memory will be exported",
"type": "string"
},
"flags": {
"description": "Flags for the compilation of the package",
"type": "array",
"items": {
"type": "string",
"enum": [
"-no-block-params"
]
}
}
},
"additionalProperties": false
},
"wasm-gc": {
"type": "object",
"properties": {
"exports": {
"description": "Exported functions of the package",
"type": "array",
"items": {
"description": "Name of an exported function, or followed by a colon and the alias name",
"type": "string"
}
},
"export-memory-name": {
"description": "Name of the exported memory, or no memory will be exported",
"type": "string"
},
"flags": {
"description": "Flags for the compilation of the package",
"type": "array",
"items": {
"type": "string",
"enum": [
"-no-block-params"
]
}
}
},
"additionalProperties": false
},
"js": {
"type": "object",
"properties": {
"exports": {
"description": "Exported functions of the package",
"type": "array",
"items": {
"description": "Name of an exported function, or followed by a colon and the alias name",
"type": "string"
}
},
"format": {
"description": "Format of the output JavaScript file",
"enum": [
"esm",
"cjs",
"iife"
]
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
]
}
},
"required": []
}