neovim / packspec

ALPHA package dependencies spec
http://packspec.org/
Apache License 2.0
218 stars 2 forks source link

Add a JSON Schema #10

Closed lewis6991 closed 2 years ago

lewis6991 commented 2 years ago

We can define a jsonschema to:

Would look something of the form:

(presented as yaml, but can be written in json or lua)

$schema: "https://json-schema.org/draft/2020-12/schema"
title: "PlugSpec"
description: "A PlugSpec for a Neovim plugin"
type: object
properties:
  "package":
    description: "The name of the package"
    type: "string"
  "version":
    description: "Version of the package"
    # TODO: specify format
    type: "string"
  "specification_version":
    # TODO: specify format
    type: "string"
  "source":
    description: "Version of the package"
    type: "object"
    properties:
      "url":
        type: string
  "description":
    description: "Description of the package"
    type: object
    properties:
      "summary": {type: string}
      "detailed": {type: string}
      "homepage": {type: string}
      "license": {type: string}
  "dependencies":
    patternProperties:
      ".*":
        type: object
        properties:
          "version":
            # TODO: specify format
            type: string
          "url":
            type: string
  "external_dependencies":
    description: |
      Like dependencies, this specifies packages which are required for the
      package but should not be managed by the neovim package manager, such as
      gcc or cmake
    patternProperties:
      ".*":
        type: object
        properties:
          "version":
            type: string

required:
  - "package"
  - "source"

JSON Schema implementations we can use: