Schema for asset.json - makesites/three-asset GitHub Wiki

(heavily inspired by Node.js's package.json)

This document is all you need to know about what's required in your package.json manifest file(s). It must be actual JSON, not just a JavaScript object literal.

Fields

Required Fields

Optional Fields

The most important things in your manifest file are the name and version fields. The name and version together form an identifier that is assumed to be completely unique. Changes to the plugin should come along with changes to the version.

The name is what your thing is called. Some tips:

  • Don't put spaces in the name. It's assumed that the name is a url-safe and can be used to generate URLs
  • The name should be short, but also reasonably descriptive.

The most important things in your manifest file are the name and version fields. The name and version together form an identifier that is assumed to be completely unique. Changes to the plugin should come along with changes to the version. Version number must be a valid semantic version number per node-semver.

See Specifying Versions.

A nice complete and pretty title of your plugin. This will be used for the page title and top-level heading on your application's page. Include spaces and mixed case, unlike name.

One person.

See People Fields.

Array of licenses under which the plugin is provided. Each license is a hash with a url property linking to the actual text and an optional "type" property specifying the type of license. If the license is one of the official open source licenses, the official license name or its abbreviation may be explicated with the "type" property.

"licenses": [
   {
       "type": "GPLv2",
       "url": "http://www.example.com/licenses/gpl.html"
   }
]

This is the version of Unity 3D you require to run the application.

You must list at least one engine unity (note that it's lower-case).

Dependencies are specified with a simple hash of package name to version range. The version range is EITHER a string which has one or more space-separated descriptors, OR a range like "fromVersion - toVersion".

If a package that you depend on uses other packages as dependencies that your application uses as well, we recommend you list those also. In the event that the depended list on the package is altered, your apps dependency tree won't be affected.

The Unity3D version you are using should not be listed in the dependencies. Instead it is a required field of its own (mentioned above).

Put a description in it. It's a string. This helps people discover your application, as it's listed on the am.i-ga.me site.

Put keywords in it. It's an array of strings. This helps people discover your application as it's listed on the am.i-ga.me site. Keywords may only contain letters, numbers, hyphens, and dots.

The url to the plugin homepage.

The url to the plugin documentation.

The url to the application's demo or demos.

The url to download the application. A download URL will be automatically generated based on the tag in GitHub, but you can specify a custom URL if you'd prefer to send users to your own site.

The url to the bug tracker for the plugin.

An array of people.

See People Fields.

A "person" is an object with a "name" field and optionally "url" and "email", like this:

{
  "name" : "John Doe",
  "email" : "[email protected]",
  "url" : "http://johndoe.tumblr.com/"
}

Both the email and url are optional.

Version range descriptors may be any of the following styles, where "version" is a semver compatible version identifier.

  • version Must match version exactly
  • =version Same as just version
  • >version Must be greater than version
  • >=version etc
  • <version
  • <=version
  • ~version See 'Tilde Version Ranges' below
  • 1.2.x See 'X Version Ranges' below
  • http://... See 'URLs as Dependencies' below
  • * Matches any version
  • "" (just an empty string) Same as *
  • version1 - version2 Same as >=version1 <=version2.
  • range1 || range2 Passes if either range1 or range2 are satisfied.

For example, these are all valid:

{ "dependencies" :
  {
    "foo" : "1.0.0 - 2.9999.9999",
    "bar" : ">=1.0.2 <2.1.2",
    "baz" : ">1.0.2 <=2.3.4",
    "boo" : "2.0.1",
    "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0",
    "asd" : "http://asdf.com/asdf.tar.gz",
    "til" : "~1.2",
    "elf" : "~1.2.3",
    "two" : "2.x",
    "thr" : "3.3.x"
  }
}

A range specifier starting with a tilde ~ character is matched against a version in the following fashion.

  • The version must be at least as high as the range.
  • The version must be less than the next major revision above the range.

For example, the following are equivalent:

  • "~1.2.3" = ">=1.2.3 <1.3.0"
  • "~1.2" = ">=1.2.0 <2.0.0"
  • "~1" = ">=1.0.0 <2.0.0"

An "x" in a version range specifies that the version number must start with the supplied digits, but any digit may be used in place of the x.

The following are equivalent:

  • "1.2.x" = ">=1.2.0 <1.3.0"
  • "1.x.x" = ">=1.0.0 <2.0.0"
  • "1.2" = "1.2.x"
  • "1.x" = "1.x.x"
  • "1" = "1.x.x"

You may not supply a comparator with a version containing an x. Any digits after the first "x" are ignored.

package.json

{
    "name": "awesomeer",
    "version": "1.1.3",
    "title": "Awesomeer in 3D",
    "author": {
        "name": "Makis Tracend",
        "url": "https://github.com/tracend"
    },
    "licenses": [
        {
            "type": "MIT",
            "url": "http://en.wikipedia.org/wiki/MIT_License"
        },
        {
            "type": "GPLv2",
            "url": "http://en.wikipedia.org/wiki/GNU_General_Public_License"
        }
    ],
    "engine": {
        "unity": ">=3.4"
    },
    "dependencies": {
        "easyroads3d": ">=1.X"
    },
    "description": "This is my first game in Unity3D...",
    "keywords": [
        "game",
        "free",
        "fps"
    ],
    "homepage": "https://github.com/amigame/",
    "contributors": [
        {
            "name": "Lyndel Thomas",
            "url": "https://github.com/ryndel"
        }
    ]
}
⚠️ **GitHub.com Fallback** ⚠️