ThirdPartyPackageManifest

Parses and creates UPM-style package.json manifests for third-party packages. Automatically discovers existing manifests from Third-Party/ folders at editor startup and provides static lookup by package name or path.

Definition

Namespace: Paragon.Editor.ThirdPartyPackageImporter Assembly: Paragon.Editor.dll

internal class ThirdPartyPackageManifest

Remarks

ThirdPartyPackageManifest wraps a JObject (Newtonsoft.Json) to read and write package.json fields. It serves two purposes:

  1. Discovery — The static constructor scans Third-Party/ and Assets/Third-Party/ for all existing package.json files, parses them, validates them, and stores them in a static dictionary keyed by package name.

  2. CreationCreateAtPath() generates a new manifest with standard UPM fields and writes it to disk.

Discovery Process

spinner

Manifest Fields

All properties are backed by JObject key lookups using nameof(), mapping directly to standard package.json fields:

Property
JSON Key
Example

name

"name"

"com.third-party.synty-polygon"

displayName

"displayName"

"POLYGON Fantasy"

version

"version"

"1.0.0"

versionString

"versionString"

"1.0"

unity

"unity"

"2022.3"

description

"description"

"Low poly fantasy asset pack"

category

"category"

"Tool"

author

"author"."name"

"Third-Party"

Quick Lookup

Goal
How

Check if a manifest exists by name

ThirdPartyPackageManifest.TryGetManifest("com.pkg.name", out manifest)

Check if a manifest exists at path

ThirdPartyPackageManifest.TryGetManifestAtPath(fullPath, out manifest)

Create a new manifest

ThirdPartyPackageManifest.CreateAtPath(path, name, displayName, ...)

Validate a manifest

ThirdPartyPackageManifest.IsValid(manifest)

Get the manifest's folder

manifest.GetManifestFolderPath()

Properties

Property
Type
Access
Description

name

string

public get / private set

UPM package name (e.g., com.third-party.package)

displayName

string

public get / private set

Human-readable display name

version

string

public get / private set

SemVer version string

versionString

string

public get / private set

Shortened version string

unity

string

public get / private set

Minimum Unity version (e.g., "2022.3")

description

string

public get / private set

Package description

category

string

public get / private set

Package category

author

string

public get / private set

Author name (nested under "author"."name" in JSON)

Static Methods

CreateAtPath

Creates a new manifest at the specified path, adds it to the static dictionary, and writes it to disk.

Parameter
Type
Description

path

string

Directory path where package.json will be created

name

string

UPM package name

displayName

string

Human-readable display name

version

string

SemVer version

versionString

string

Shortened version string

description

string

Package description

circle-info

unity is auto-populated from Application.unityVersion (major.minor only). category defaults to "Tool" and author defaults to "Third-Party".

TryGetManifest

Looks up a manifest by its UPM package name.

Parameter
Type
Description

packageName

string

The name field of the manifest (e.g., "com.third-party.synty")

manifest

out ThirdPartyPackageManifest

The found manifest, or null

TryGetManifestAtPath

Looks up a manifest by its folder path (linear scan).

Parameter
Type
Description

path

string

Full path to the manifest's folder

manifest

out ThirdPartyPackageManifest

The found manifest, or null

IsValid

Validates that all required fields are non-null and non-empty.

Required fields: name, displayName, version, versionString, unity, description, category, author.

Instance Methods

GetManifestFolderPath

Returns the directory path containing this manifest's package.json.

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation
circle-exclamation

See Also

Last updated