From 8efafe3cf9768815d8290417f4551ba0408bc037 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Mon, 13 Nov 2023 17:06:25 +0530 Subject: [PATCH] init commit --- .editorconfig | 16 + .github/workflows/actionlint.yaml | 12 + .github/workflows/package-lint.yaml | 19 + .github/workflows/package-tests.yaml | 109 +++ .github/workflows/release.yaml | 79 ++ .github/workflows/validate-renovate.yaml | 29 + CONTRIBUTING.md | 736 ++++++++++++++++++ LICENSE | 174 +++++ README.md | 15 + SECURITY.md | 9 + packages/java-test/package.yaml | 31 + packages/jdtls/package.yaml | 42 + renovate.json5 | 102 +++ schemas/components/bin.json | 11 + schemas/components/deprecation.json | 17 + schemas/components/opt.json | 11 + schemas/components/schemas.json | 13 + schemas/components/share.json | 11 + schemas/components/source.json | 52 ++ schemas/components/sources/build.json | 38 + schemas/components/sources/cargo.json | 19 + schemas/components/sources/composer.json | 14 + schemas/components/sources/gem.json | 26 + schemas/components/sources/generic/build.json | 25 + .../components/sources/generic/download.json | 57 ++ .../components/sources/generic/generic.json | 12 + schemas/components/sources/github/build.json | 25 + schemas/components/sources/github/github.json | 12 + .../components/sources/github/release.json | 76 ++ schemas/components/sources/golang.json | 19 + schemas/components/sources/luarocks.json | 12 + schemas/components/sources/npm.json | 19 + schemas/components/sources/nuget.json | 12 + schemas/components/sources/opam.json | 12 + schemas/components/sources/pypi.json | 26 + schemas/enums/category.json | 6 + schemas/enums/language.json | 174 +++++ schemas/enums/platform.json | 37 + schemas/enums/spdx-license.json | 511 ++++++++++++ schemas/package.schema.json | 75 ++ 40 files changed, 2695 insertions(+) create mode 100644 .editorconfig create mode 100644 .github/workflows/actionlint.yaml create mode 100644 .github/workflows/package-lint.yaml create mode 100644 .github/workflows/package-tests.yaml create mode 100644 .github/workflows/release.yaml create mode 100644 .github/workflows/validate-renovate.yaml create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 SECURITY.md create mode 100644 packages/java-test/package.yaml create mode 100644 packages/jdtls/package.yaml create mode 100644 renovate.json5 create mode 100644 schemas/components/bin.json create mode 100644 schemas/components/deprecation.json create mode 100644 schemas/components/opt.json create mode 100644 schemas/components/schemas.json create mode 100644 schemas/components/share.json create mode 100644 schemas/components/source.json create mode 100644 schemas/components/sources/build.json create mode 100644 schemas/components/sources/cargo.json create mode 100644 schemas/components/sources/composer.json create mode 100644 schemas/components/sources/gem.json create mode 100644 schemas/components/sources/generic/build.json create mode 100644 schemas/components/sources/generic/download.json create mode 100644 schemas/components/sources/generic/generic.json create mode 100644 schemas/components/sources/github/build.json create mode 100644 schemas/components/sources/github/github.json create mode 100644 schemas/components/sources/github/release.json create mode 100644 schemas/components/sources/golang.json create mode 100644 schemas/components/sources/luarocks.json create mode 100644 schemas/components/sources/npm.json create mode 100644 schemas/components/sources/nuget.json create mode 100644 schemas/components/sources/opam.json create mode 100644 schemas/components/sources/pypi.json create mode 100644 schemas/enums/category.json create mode 100644 schemas/enums/language.json create mode 100644 schemas/enums/platform.json create mode 100644 schemas/enums/spdx-license.json create mode 100644 schemas/package.schema.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..41e7c3e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace=true +max_line_length = 120 +charset = utf-8 + +[*.yaml] +indent_size = 2 + +[*.md] +trim_trailing_whitespace=false diff --git a/.github/workflows/actionlint.yaml b/.github/workflows/actionlint.yaml new file mode 100644 index 0000000..68676fb --- /dev/null +++ b/.github/workflows/actionlint.yaml @@ -0,0 +1,12 @@ +--- +name: Actionlint + +on: + - pull_request + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: reviewdog/action-actionlint@v1 diff --git a/.github/workflows/package-lint.yaml b/.github/workflows/package-lint.yaml new file mode 100644 index 0000000..77849d0 --- /dev/null +++ b/.github/workflows/package-lint.yaml @@ -0,0 +1,19 @@ +--- +name: Package lint + +on: + - pull_request + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: | + mapfile -t EXTRA_FILES < <(find packages -type f -not -name package.yaml) + if [[ ${#EXTRA_FILES[@]} -gt 0 ]]; then + for file in "${EXTRA_FILES[@]}"; do + echo "::error file=${file},line=1::Only package.yaml files are allowed inside packages/." + done + exit 1 + fi diff --git a/.github/workflows/package-tests.yaml b/.github/workflows/package-tests.yaml new file mode 100644 index 0000000..73b5dcd --- /dev/null +++ b/.github/workflows/package-tests.yaml @@ -0,0 +1,109 @@ +--- +name: Package tests + +on: + pull_request: + workflow_dispatch: + inputs: + packages: + type: string + description: Space-separated list of package definitions to test. + required: true + +jobs: + package-diff: + name: Check package diffs + runs-on: ubuntu-latest + outputs: + all_changed_files: ${{ steps.changed-packages.outputs.all_changed_files }} + any_changed: ${{ steps.changed-packages.outputs.any_changed }} + + steps: + - uses: actions/checkout@v3 + - name: Get changed package definitions + id: changed-packages + uses: tj-actions/changed-files@v36 + with: + files: | + packages/**/package.yaml + + validate: + name: Validate package definitions + runs-on: ubuntu-latest + needs: package-diff + if: ${{ github.event.inputs.packages || needs.package-diff.outputs.any_changed == 'true' }} + steps: + - uses: actions/checkout@v3 + - uses: mason-org/actions/validate-schema@v1 + with: + packages: ${{ github.event.inputs.packages || needs.package-diff.outputs.all_changed_files }} + + tests: + name: Test packages + needs: [package-diff, validate] + if: ${{ github.event.inputs.packages || needs.package-diff.outputs.any_changed == 'true' }} + strategy: + fail-fast: false + matrix: + # If making changes remember to update the manual workflow as well. + target: + - darwin_arm64 + - darwin_x64 + - linux_arm + - linux_arm64 + - linux_arm64_gnu + - linux_arm_gnu + - linux_x64 + - linux_x64_gnu + - linux_x86 + - win_arm + - win_arm64 + - win_x64 + - win_x86 + + include: + - target: linux_x64 + runs-on: ubuntu-latest + - target: linux_x64_gnu + runs-on: ubuntu-latest + - target: linux_x86 + runs-on: ubuntu-latest + - target: linux_arm + runs-on: ubuntu-latest + - target: linux_arm_gnu + runs-on: ubuntu-latest + - target: linux_arm64 + runs-on: ubuntu-latest + - target: linux_arm64_gnu + runs-on: ubuntu-latest + - target: darwin_x64 + runs-on: macos-latest + - target: darwin_arm64 + runs-on: macos-latest + - target: win_x64 + runs-on: windows-latest + - target: win_x86 + runs-on: windows-latest + - target: win_arm64 + runs-on: windows-latest + - target: win_arm + runs-on: windows-latest + + runs-on: ${{ matrix.runs-on }} + steps: + - uses: actions/checkout@v3 + - uses: mason-org/actions/tests@v1 + with: + packages: ${{ github.event.inputs.packages || needs.package-diff.outputs.all_changed_files }} + target: ${{ matrix.target }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # This job is used for branch protection rule + # Add this job to `Status checks that are required` + status-check: + name: Status check + runs-on: ubuntu-latest + needs: tests + if: 'failure() || cancelled()' + steps: + - run: exit 1 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..c53915e --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,79 @@ +--- +name: Release + +on: + push: + tags: + - "**" + branches: + - main + +jobs: + tag: + name: Tag + runs-on: ubuntu-latest + permissions: + contents: write + outputs: + tag: ${{ steps.tag.outputs.tag }} + should-release: ${{ steps.tag.outputs.should-release }} + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + - id: adjnoun + uses: mason-org/actions/adj-noun-generator@v1 + - id: tag + name: Get/create tag + shell: bash + run: | + if [[ $GITHUB_REF =~ ^refs/tags ]]; then + echo "Releasing tag $GITHUB_REF_NAME" + printf "tag=%s\nshould-release=true" "$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT" + elif [[ $(git diff-tree --name-only --no-commit-id HEAD -- packages | wc -l) -gt 0 ]]; then + declare TAG + TAG=$(date +%Y-%m-%d)-$ADJNOUN + printf "tag=%s\nshould-release=true" "$TAG" >> "$GITHUB_OUTPUT" + echo "Tagging and pushing $TAG" + git tag "$TAG" HEAD + git push origin "$TAG" + else + echo "No tag was pushed, and no package definition was changed." + echo "should-release=false" >> "$GITHUB_OUTPUT" + fi + env: + GITHUB_REF: ${{ github.ref }} + GITHUB_REF_NAME: ${{ github.ref_name }} + ADJNOUN: ${{ steps.adjnoun.outputs.word }} + + release: + needs: [tag] + if: ${{ needs.tag.outputs.should-release == 'true' }} + name: Release + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v3 + - name: Set up yq + shell: bash + run: | + sudo curl -fL "https://github.com/mikefarah/yq/releases/download/v4.30.6/yq_linux_amd64" -o /usr/local/bin/yq + sudo chmod +x /usr/local/bin/yq + - name: Compile + shell: bash + run: | + yq ea '[.]' -o json packages/*/package.yaml > registry.json + zip -r registry.json.zip registry.json + sha256sum registry.json registry.json.zip > checksums.txt + - name: Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ needs.tag.outputs.tag }} + fail_on_unmatched_files: true + generate_release_notes: false + files: | + registry.json.zip + checksums.txt diff --git a/.github/workflows/validate-renovate.yaml b/.github/workflows/validate-renovate.yaml new file mode 100644 index 0000000..768f715 --- /dev/null +++ b/.github/workflows/validate-renovate.yaml @@ -0,0 +1,29 @@ +--- +name: Validate Renovate config + +on: + push: + branches: + - main + pull_request: + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Check for config changes + id: diff + uses: tj-actions/changed-files@v36 + with: + files: | + renovate.json5 + + - shell: bash + if: ${{ steps.diff.outputs.any_changed == 'true' }} + run: | + set +o pipefail + npx -y -p renovate -c renovate-config-validator \ + | tee /dev/stderr \ + | grep -Evz '(ERROR|could not be parsed)' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..bf70a51 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,736 @@ +# Contributing guide + +## Table of Contents + + +- [Contributing guide](#contributing-guide) + - [Table of Contents](#table-of-contents) +- [Brief](#brief) +- [Schema](#schema) +- [The anatomy of a package](#the-anatomy-of-a-package) +- [Package specification](#package-specification) + - [`name`](#name) + - [`description`](#description) + - [`homepage`](#homepage) + - [`licenses`](#licenses) + - [`languages`](#languages) + - [`categories`](#categories) + - [`source`](#source) + - [`bin`](#bin) + - [`share`](#share) + - [`opt`](#opt) +- [Expressions](#expressions) +- [Examples](#examples) + - [Common fields](#common-fields) + - [cargo](#cargo) + - [composer](#composer) + - [gem](#gem) + - [GitHub release assets](#github-release-assets) + - [GitHub build from source](#github-build-from-source) + - [golang](#golang) + - [luarocks](#luarocks) + - [npm](#npm) + - [nuget](#nuget) + - [opam](#opam) + - [pypi](#pypi) + + +> The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT +> RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [BCP 14][bcp14], +> [RFC2119][rfc2119], and [RFC8174][rfc8174] when, and only when, they appear in all capitals, as shown here. + +# Brief + +* Use the YAML language server combined with the [schemastore schema](https://json.schemastore.org/mason-registry.json) + to get diagnostics and autocompletion (see [Schema](#schema)). +* Make sure to follow the [naming guidelines](#name). +* Refer to the [common fields example](#common-fields) for a good starting point for a new package. +* Refer to the different [examples](#examples) and/or existing package definitions for further guidance. +* Testing a package locally is still a bit complicated, open a PR early to make use of the cross-platform CI suite! + +# Schema + +Package definitions are validated against a well-defined [JSON schema](./schemas/). The full schema is hosted on +. + + + Use b0o/SchemaStore.nvim and the YAML language server to + integrate these schemas in Neovim. This gives you diagnostics and autocompletion inside the editor when editing + package definitions: + + + + +# The anatomy of a package + +Packages are defined following a [well-defined specification](#package-specification). Package definitions are hosted as +separate YAML files that MUST be located at `packages//package.yaml`. + +Package sources are identified via a [purl][purl] identifier. Each package source (purl) MUST contain a version +component specifying the latest available version, e.g `pkg:github/rust-lang/rust-analyzer@2023-04-04`. + +Package versions are automatically kept up-to-date via [Renovate][renovate]. + +# Package specification + +The following is a rough outline of the package definition schema: + +```yaml +name: string +description: string +homepage: URL +licenses: SPDXLicense[] +languages: string[] +categories: Category[] + +source: + id: string + [key: string]: any + +bin?: + [executable: string]: string +share?: + [share_location: string]: string +opt?: + [opt_location: string]: string +``` + +## `name` + +The package name MUST be unique. The name of a package MUST follow the following naming scheme: + +1. If the upstream package name is sufficiently unambiguous, or otherwise widely recognized, that name MUST be used. +1. If the upstream package provides a single executable with a name that is sufficiently unambiguous, or otherwise + widely recognized, the name of the executable MUST be used. +1. If either the package or executable name is ambiguous, a name where a clarifying prefix or suffix is added SHOULD be + used. +1. As a last resort, the name of the package should be constructed to best convey its target language and scope, e.g. + `json-language-server` for a JSON language server. + +## `description` + +Short description of the package. The description SHOULD be sourced from the upstream package directly. + +## `homepage` + +The homepage of the package. The homepage SHOULD be a public website if available, otherwise it MUST be a URL to the +source code. + +The URL MUST be a [well-formed URL][rfc1738]. The URL scheme MUST be either `http` or `https`. + +## `licenses` + +List of licenses associated with this package. MUST contain at least one entry. + +The license MUST be a [SPDX-compatible](https://spdx.org/licenses/) license identifier. Should the package use a license +not available as a SPDX identifier, the license "proprietary" (all lower case) MUST be used. + +Examples: + +- `MIT` +- `Apache-2.0` +- `GPL-3.0-only` + +## `languages` + +The languages the package targets. MAY be empty. A language is an arbitrary string (e.g., `"Rust"`). The casing of the +string MUST be the same as other references to the same language in other package definitions, i.e. it's an error if +package A specifies `Javascript` and package B specifies `JavaScript`. + +## `categories` + +The categories the package belongs to. MAY be empty. If not empty, each entry MUST be one of: + +- `Compiler` +- `DAP` +- `Formatter` +- `LSP` +- `Linter` +- `Runtime` + +## `source` + +The source of the package. The `source` entry contains all necessary information to properly install the package. At the +very minimum it MUST contain an `id` property. The `id` property MUST be a [purl][purl]-compatible package identifier. +The purl identifier MUST contain a version component. + +The source object MAY contain additional properties to support installation. + +Examples: + +```yaml +source: + id: pkg:npm/typescript-language-server@2.0.0 +``` + +```yaml +source: + id: pkg:github/rust-lang/rust-analyzer@2022-12-05 +``` + +## `bin` + +The executables the package provides. The key is the canonical name of the executable, and the value is either (i) a +relative path to the executable from the package directory, or (ii) an expression that delegates path resolution (e.g., +`npm:typescript-language-server` or `cargo:rust-analyzer`), or (iii) an [expression](#expressions). + +On Unix systems, a symlink is created. On Windows, a wrapper batch `.cmd` executable is always created. + +Example: + +```yaml +bin: + typescript-language-server: npm:typescript-language-server + rust-analyzer: bin/rust-analyzer +``` + +## `share` + +The architecture independent files the package provides. + +The mapping MUST either (i) link a single target file to a single source file, or (ii) link a target directory to a +source directory, or (iii) an [expression](#expressions). + +This creates symlinks (`uv_fs_symlink`) on all platforms. + +Example: + +```yaml +share: + # Links $MASON/share/jdtls/lombok.jar -> /lombok.jar + jdtls/lombok.jar: lombok.jar + # Links $MASON/share/jdtls/plugins/ -> /plugins/**/* (i.e. all files within the target directory) + jdtls/plugins/: plugins/ +``` + +## `opt` + +The optional, add-on, contents of a package. This is for example useful in situations when a package provides auxiliary +binaries that should not be linked to the "global" Mason `bin/` directory. + +The mapping MUST either (i) link a single target file to a single source file, or (ii) link a target directory to a +source directory, or (iii) an [expression](#expressions). + +This creates symlinks (`uv_fs_symlink`) on all platforms. + +Example: + +```yaml +opt: + # Links $MASON/opt/solang/llvm15.0/LICENSE -> /doc/LICENSE + solang/llvm15.0/LICENSE: doc/LICENSE + # Links $MASON/opt/solang/llvm15.0/ -> /llvm15.0/**/* (i.e. all files within the target directory) + solang/llvm15.0/: llvm15.0/ +``` + +# Expressions + +When specified, a component of a package definition may include expressions. These expressions can only be used in +string values, and are denoted by `{{expr}}`. This allows for dynamically evaluating values, when needed. + +Example: + +```yaml +# ... +source: + id: pkg:github/rust-lang/rust-analyzer@v1.0.0 + asset: + - target: darwin_x64 + file: rust-analyzer-darwin_x64_{{ version | strip_prefix "v" }}.tar.gz + bin: rust-analyzer-darwin_x64 + some_other_bin: rust-fmt-darwin_x64 + - target: linux_x64 + file: rust-analyzer-linux_x64_{{ version | strip_prefix "v" }}.tar.gz + bin: rust-analyzer-linux_x64 + some_other_bin: rust-fmt-linux_x64 + +bin: + # This will be evaluated to either "rust-analyzer-darwin_x64" or "rust-analyzer-linux_x64", depending on which + # platform the package is being installed on. + rust-analyzer: "{{source.asset.bin}}" + rustfmt: "{{source.asset.some_other_bin}}" +``` + +Expressions use basic Lua syntax with the additional ability to pipe values to a limited set of transformation +functions. All expressions are evaluated in a context, where values are accessed through normal variable access. + +[bcp14]: https://tools.ietf.org/html/bcp14 +[purl]: https://github.com/package-url/purl-spec +[renovate]: https://github.com/renovatebot/renovate +[rfc1738]: https://www.rfc-editor.org/rfc/rfc1738 +[rfc2119]: https://tools.ietf.org/html/rfc2119 +[rfc8174]: https://tools.ietf.org/html/rfc8174 + +# Examples + +## Common fields + +The following fields are common for all packages and are subject to the same requirements. + +Refer to the following sections for a detailed description: + +- [`name`](#name) +- [`description`](#description) +- [`homepage`](#homepage) +- [`licenses`](#licenses) +- [`categories`](#categories) + +Example: + +```yaml +--- +name: lua-language-server +description: A language server that offers Lua language support - programmed in Lua. +homepage: https://github.com/LuaLS/lua-language-server +licenses: + - MIT +languages: + - Lua +categories: + - LSP +``` + +
Example: Longer descriptions + +Longer descriptions MUST be split on multiple lines, as to not exceed the max line length. + +Example: + +```yaml +description: | + Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur + mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. +``` + +
+ +--- + +## cargo + +Example: + +```yaml +source: + id: pkg:cargo/rnix-lsp@0.2.5 + +bin: + rnix-lsp: cargo:rnix-lsp +``` + +
Example: Specify features + +To specify the features to install, use the `features` qualifier. + +Example: + +```yaml +source: + id: pkg:cargo/flux-lsp@0.8.40?features=lsp,cli +``` + +
+ +
Example: Git source + +To install a cargo package from a git source you may specify the `repository_url` qualifier. This will by default target +tags in the provided git repository (i.e. `cargo install --tag `). To target commits instead (i.e. `cargo install --rev +`), provide an additional `&rev=true` qualifier. + +Example: + +```yaml +source: + id: pkg:cargo/flux-lsp@0.8.40?repository_url=https://github.com/influxdata/flux-lsp +``` + +
+ +
Example: Specify supported platforms + +You MUST provide the `supported_platforms` field if the package is only supported on certain platforms. + +Example: + +```yaml +source: + id: pkg:cargo/flux-lsp@0.8.40 + supported_platforms: + - linux_x64_gnu + - linux_arm64_gnu +``` + +
+ +--- + +## composer + +Example: + +```yaml +source: + id: pkg:composer/vimeo/psalm@5.4.0 + +bin: + psalm: composer:psalm + psalm-language-server: composer:psalm-language-server +``` + +--- + +## gem + +Example: + +```yaml +source: + id: pkg:gem/standard@1.26.0 + +bin: + standardrb: gem:standardrb +``` + +
Example: Specify supported platforms + +You MUST provide the `supported_platforms` field if the package is only supported on certain platforms. + +Example: + +```yaml +source: + id: pkg:gem/standard@1.26.0 + supported_platforms: + - linux_x64_gnu + - linux_arm64_gnu +``` + +
+ +--- + +## GitHub release assets + +Note: Downloaded release assets are automatically unpacked (e.g. if it's a `.tar` file it's unpacked in its download +location). + +
Example: Platform dependent release assets + +When multiple, platform dependent, release assets are provided you MUST register an entry for each applicable platform. +This is done by providing a list of assets. The ordering of this list is important as clients may be target to more than +one platform and entries appearing first in the list have precedence. + +When this source is parsed by the client, the list is "unwrapped" to the very first entry whose `target` applies to the +current system. + +Example: + +```yaml +source: + id: pkg:github/LuaLS/lua-language-server@3.6.18 + asset: + - target: darwin_arm64 + file: lua-language-server-{{version}}-darwin-arm64.tar.gz + - target: darwin_x64 + file: lua-language-server-{{version}}-darwin-x64.tar.gz + - target: linux_arm64_gnu + file: lua-language-server-{{version}}-linux-arm64.tar.gz + - target: linux_x64_gnu + file: lua-language-server-{{version}}-linux-x64.tar.gz + - target: win_x86 + file: lua-language-server-{{version}}-win32-ia32.zip + - target: win_x64 + file: lua-language-server-{{version}}-win32-x64.zip +``` + +It's common that platform-dependent assets contain different files and different folder structures. In order to +facilitate linking executables at a later stage you may provide additional, arbitrary, fields. The following example +adds a `bin` field to each entry, which is later used in a [expression](#expression) to link the executable. + +Example: + +```yaml +source: + id: pkg:github/LuaLS/lua-language-server@3.6.18 + asset: + - target: darwin_arm64 + file: lua-language-server-{{version}}-darwin-arm64.tar.gz + bin: lua-language-server + - target: win_x64 + file: lua-language-server-{{version}}-win32-x64.zip + bin: lua-language-server.exe + +bin: + lua-language-server: "{{source.asset.bin}}" +``` +
+ +
Example: Single, platform independent, release asset + +Example: + +```yaml +source: + id: pkg:github/Dart-Code/Dart-Code@v3.62.0 + asset: + file: dart-code-{{ version | strip_prefix "v" }}.vsix +``` +
+ +
Example: Downloading multiple assets + +Example: + +```yaml +source: + id: pkg:github/LuaLS/lua-language-server@3.6.18 + asset: + file: + - lua-language-server-{{version}} + - lua-language-server-{{version}}.sha256 + - LICENSE +``` +
+ +
Example: Change asset download location + +By default, assets are downloaded in the root directory of the package directory. You MAY change the download location +by appending it to the file name itself with a `:` prefix. + +If the download location ends with a `/` the file will be downloaded in that directory, otherwise it's a filename. + +Example: + +```yaml +source: + id: pkg:github/lua/lua@5.1.0 + asset: + file: + # download "lua-language-server-{{version}}" to "bin/lua-language-server-{{version}}" + - lua-language-server-{{version}}:bin/ + + # download "lua-formatter-{{version}}" to "bin/lua-format" + - lua-formatter-{{version}}:bin/lua-format + + # download "license" to "LICENSE.txt" + - license:LICENSE.txt +``` +
+ +--- + +## GitHub build from source + +Note: Build scripts run on the platform's default shell. On Unix this is `bash`, on Windows it's `pwsh`. + +Note: By default, Renovate is configured to look for new releases for `pkg:github` sources. However, when building from +source, the repository most likely doesn't provide GitHub releases, but instead uses normal git tags. To ensure that +Renovate picks up new versions, you MUST provide a datasource override via a comment (see example below). + +Example: + +```yaml +source: + # renovate:datasource=github-tags + id: pkg:github/stoplightio/vscode-spectral@v1.1.2 + build: + run: | + npm exec yarn@1 install + npm exec --package=yarn@1 'node make package' + +bin: + spectral-language-server: node:dist/server/index.js +``` + +
Example: Platform-dependent build scripts + +Sometimes the build script cannot be expressed in a shell-agnostic way. You MUST then provide a list of entries with the +appropriate targets. The ordering of this list is important as clients may be target to more than one platform and +entries appearing first in the list have precedence. + +When this source is parsed by the client, the list is "unwrapped" to the very first entry whose `target` applies to the +current system. + +Example: + +```yaml +source: + id: pkg:github/vala-lang/vala-language-server@1.0.0 + build: + - target: unix + run: | + meson -Dprefix="$PWD" build + ninja -C build install + - target: win + run: | + meson -Dprefix="($pwd).path" build + ninja -C build install +``` +
+ +--- + +## golang + +Example: + +```yaml +source: + id: pkg:golang/golang.org/x/tools/gopls@v0.11.0 + +bin: + gopls: golang:gopls +``` + +
Example: Specifying additional package path + +Use the subpath component to specify a sub-path of a golang package. + +Example: + +```yaml +source: + id: pkg:golang/golang.org/x/tools@v0.7.0#cmd/goimports +``` +
+ +--- + +## luarocks + +Example: + +```yaml +source: + id: pkg:luarocks/luacheck@1.1.0 + +bin: + luacheck: luarocks:luacheck +``` + +
Example: Specifying a server + +Use the `repository_url` qualifier to specify a different server (i.e. `luarocks install --server`). + +Example: + +```yaml +source: + id: pkg:luarocks/luaformatter@scm-1?repository_url=https://luarocks.org/dev +``` +
+ +
Example: dev target + +Use the `dev` qualifier to specify a dev target (i.e. `luarocks install --dev`). + +Example: + +```yaml +source: + id: pkg:luarocks/teal-language-server@dev-1?dev=true +``` +
+ +--- + +## npm + +Example: + +```yaml +source: + id: pkg:npm/typescript-language-server@3.3.1 + +bin: + typescript-language-server: npm:typescript-language-server +``` + +
Example: Additional npm dependencies + +Some packages may require additional npm dependencies to be installed in the same location. This can be achieved by +providing the `extra_packages` field. + +Example: + +```yaml +source: + id: pkg:npm/typescript-language-server@3.3.1 + extra_packages: + - typescript +``` + +Packages provided in `extra_packages` are passed as-is to npm, so they may require version constraints such as +`typescript@4`. +
+ +--- + +## nuget + +Example: + +```yaml +source: + id: pkg:nuget/fsautocomplete@0.58.2 + +bin: + fsautocomplete: nuget:fsautocomplete +``` + +--- + +## opam + +Example: + +```yaml +source: + id: pkg:opam/ocaml-lsp-server@1.10.2 + +bin: + ocamllsp: opam:ocamllsp +``` + +--- + +## pypi + +Example: + +```yaml +source: + id: pkg:pypi/yamllint@1.30.0 + +bin: + yamllint: pypi:yamllint +``` + +
Example: Adding extra specifiers + +To add "extra" specifiers to a pypi package (i.e. `pip install python-lsp-server[all]`), use the `extra` qualifier. + +Example: + +```yaml +source: + id: pkg:pypi/python-lsp-server@1.7.2?extra=all +``` +
+ +
Example: Additional pypi dependencies + +Some packages may require additional pypi dependencies to be installed in the same location. This can be achieved by +providing the `extra_packages` field. + +Example: + +```yaml +source: + id: pkg:pypi/yapf@0.32.0 + extra_packages: + - toml +``` + +Packages provided in `extra_packages` are passed as-is, so they may require version constraints such as `toml==4`. +
diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..dd5b3a5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,174 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/README.md b/README.md new file mode 100644 index 0000000..e4fbffc --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +![Linux](https://img.shields.io/badge/Linux-%23.svg?style=flat-square&logo=linux&color=FCC624&logoColor=black) +![macOS](https://img.shields.io/badge/macOS-%23.svg?style=flat-square&logo=apple&color=000000&logoColor=white) +![Windows](https://img.shields.io/badge/Windows-%23.svg?style=flat-square&logo=windows&color=0078D6&logoColor=white) +[![Package tests](https://img.shields.io/badge/CI-Package%20Tests-brightgreen?style=flat-square&logo=github)](https://github.com/mason-org/mason-registry/actions/workflows/package-tests.yaml) +[![Sponsors](https://img.shields.io/github/sponsors/williamboman?style=flat-square)](https://github.com/sponsors/williamboman) + +![mason-registry](https://user-images.githubusercontent.com/6705160/230374582-25c9c26a-7885-4e1e-960d-3ec6880fbcb4.png) + +

+ Core package registry for mason.nvim. +

+ +Refer to [CONTRIBUTING.md](./CONTRIBUTING.md) for contribution guidelines. + +Compiled registry contents are available via [releases](https://github.com/mason-org/mason-registry/releases). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..1880d06 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,9 @@ +# Security policy + +## Reporting a Vulnerability + +Please report any suspected security vulnerabilities [here][new-advisory]. If the issue is confirmed, we will release a +patch as soon as possible depending on complexity. Please follow [responsible disclosure +practices](https://en.wikipedia.org/wiki/Coordinated_vulnerability_disclosure). Thanks! + +[new-advisory]: https://github.com/mason-org/mason-registry/security/advisories/new diff --git a/packages/java-test/package.yaml b/packages/java-test/package.yaml new file mode 100644 index 0000000..65790df --- /dev/null +++ b/packages/java-test/package.yaml @@ -0,0 +1,31 @@ +--- +name: java-test +description: | + The Test Runner for Java works with java-debug-adapter to provide the following features: + - Run/Debug test cases + - Customize test configurations + - View test report + - View tests in Test Explorer + + Enables support for the following test frameworks: + + - JUnit 4 (v4.8.0+) + - JUnit 5 (v5.1.0+) + - TestNG (v6.8.0+) +homepage: https://github.com/microsoft/vscode-java-test +licenses: + - MIT +languages: + - Java +categories: + - DAP + +source: + id: pkg:github/microsoft/vscode-java-test@0.40.1 + build: + run: | + npm install + npm run build-plugin + +share: + java-test/: server/ diff --git a/packages/jdtls/package.yaml b/packages/jdtls/package.yaml new file mode 100644 index 0000000..2471ecd --- /dev/null +++ b/packages/jdtls/package.yaml @@ -0,0 +1,42 @@ +--- +name: jdtls +description: Java language server. +homepage: https://github.com/eclipse/eclipse.jdt.ls +licenses: + - EPL-2.0 +languages: + - Java +categories: + - LSP + +source: + # renovate:datasource=github-tags + id: pkg:generic/eclipse/eclipse.jdt.ls@v1.29.0 + download: + - target: [darwin_x64, darwin_arm64] + files: + jdtls.tar.gz: https://download.eclipse.org/jdtls/milestones/{{ version | strip_prefix "v" }}/jdt-language-server-{{ version | strip_prefix "v" }}-202310261436.tar.gz + lombok.jar: https://projectlombok.org/downloads/lombok.jar + config: config_mac/ + - target: linux + files: + jdtls.tar.gz: https://download.eclipse.org/jdtls/milestones/{{ version | strip_prefix "v" }}/jdt-language-server-{{ version | strip_prefix "v" }}-202310261436.tar.gz + lombok.jar: https://projectlombok.org/downloads/lombok.jar + config: config_linux/ + - target: win + files: + jdtls.tar.gz: https://download.eclipse.org/jdtls/milestones/{{ version | strip_prefix "v" }}/jdt-language-server-{{ version | strip_prefix "v" }}-202310261436.tar.gz + lombok.jar: https://projectlombok.org/downloads/lombok.jar + config: config_win/ + +schemas: + lsp: vscode:https://raw.githubusercontent.com/redhat-developer/vscode-java/master/package.json + +bin: + jdtls: python:bin/jdtls + +share: + jdtls/lombok.jar: lombok.jar + jdtls/plugins/: plugins/ + jdtls/plugins/org.eclipse.equinox.launcher.jar: plugins/org.eclipse.equinox.launcher_1.6.500.v20230717-2134.jar + jdtls/config/: "{{source.download.config}}" diff --git a/renovate.json5 b/renovate.json5 new file mode 100644 index 0000000..8e59537 --- /dev/null +++ b/renovate.json5 @@ -0,0 +1,102 @@ +{ + automerge: true, + dependencyDashboard: true, + platformAutomerge: true, + automergeType: "pr", + commitMessage: "bump({{decodeURIComponent depName}}): update {{commitMessageExtra}}", + separateMajorMinor: false, + prHourlyLimit: 0, + prConcurrentLimit: 0, + branchConcurrentLimit: 0, + rebaseWhen: "conflicted", + enabledManagers: ["regex"], + regexManagers: [ + { + fileMatch: "package\\.yaml$", + matchStringsStrategy: "combination", + matchStrings: [ + "\n id:\\s+pkg:github\\/(?.+)@(?[^\\s\\?#]+)", + "\nname: (?.+)", + "# renovate:datasource=git-refs[\\s\\S]*pkg:github\\/(?.+)@(?[^\\s\\?#]+)", + "# renovate:.*versioning=(?[^,\n]+)", + "# renovate:.*datasource=(?[^,\n]+)", + ], + datasourceTemplate: "{{#if datasource}}{{{datasource}}}{{else}}github-releases{{/if}}", + versioningTemplate: "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}", + packageNameTemplate: "{{#if (containsString datasource 'git-refs')}}https://github.com/{{{packageName}}}{{else}}{{{packageName}}}{{/if}}", + currentValueTemplate: "{{#if (containsString datasource 'git-refs')}}{{else}}{{currentValue}}{{/if}}", + }, + { + fileMatch: "package\\.yaml$", + matchStringsStrategy: "combination", + matchStrings: [ + "\nname: (?.+)", + "\n id:\\s+pkg:cargo\\/(?.+)@(?[^\\s\\?#]+)", + "\\?.*repository_url=(?https:\\/\\/github\\.com)\\/(?[^\\s&]+)", + "# renovate:.*versioning=(?[^,\n]+)", + ], + datasourceTemplate: "{{#if githubRepo}}github-tags{{else}}crate{{/if}}", + // In cargo versioning, "1.2.3" doesn't mean "exactly 1.2.3" but rather ">=1.2.3 <2.0.0". + // We on the other hand do want to treat versions as fixed - so we change versioning strategy. + versioningTemplate: "semver", + }, + { + fileMatch: "package\\.yaml$", + matchStringsStrategy: "combination", + matchStrings: [ + "\nname: (?.+)", + "\n id:\\s+pkg:golang\\/(?.+)@(?[^\\s\\?#]+)", + ], + datasourceTemplate: "go", + }, + { + fileMatch: "package\\.yaml$", + matchStringsStrategy: "combination", + matchStrings: [ + "\nname: (?.+)", + "\n id:\\s+pkg:gem\\/(?.+)@(?[^\\s\\?#]+)", + ], + datasourceTemplate: "rubygems", + }, + { + fileMatch: "package\\.yaml$", + matchStringsStrategy: "combination", + matchStrings: [ + "\nname: (?.+)", + "\n id:\\s+pkg:composer\\/(?.+)@(?[^\\s\\?#]+)", + ], + datasourceTemplate: "packagist", + }, + { + fileMatch: "package\\.yaml$", + matchStringsStrategy: "combination", + matchStrings: [ + "\nname: (?.+)", + "\n id:\\s+pkg:(?npm|pypi|nuget)\\/(?.+)@(?[^\\s\\?#]+)", + ], + datasourceTemplate: "{{datasource}}", + }, + { + fileMatch: "package\\.yaml$", + matchStringsStrategy: "combination", + matchStrings: [ + "\nname: (?.+)", + "\n id:\\s+pkg:generic\\/(?.+)@(?[^\\s\\?#]+)", + "# renovate:.*versioning=(?[^,\n]+)", + "# renovate:.*datasource=(?[^,\n]+)", + ], + datasourceTemplate: "{{{datasource}}}", + versioningTemplate: "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}", + }, + ], + packageRules: [ + { + matchDepNames: ["cucumber-language-server"], + allowedVersions: "!/^1\\.[34]\\.0/" + }, + { + matchDepNames: ["rustfmt"], + allowedVersions: "<=1.5.1" + } + ] +} diff --git a/schemas/components/bin.json b/schemas/components/bin.json new file mode 100644 index 0000000..eeabc3b --- /dev/null +++ b/schemas/components/bin.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/bin", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9_\\-\\.]+$": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/schemas/components/deprecation.json b/schemas/components/deprecation.json new file mode 100644 index 0000000..c5804fd --- /dev/null +++ b/schemas/components/deprecation.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/deprecation", + "type": "object", + "additionalProperties": false, + "required": ["since", "message"], + "properties": { + "message": { + "type": "string", + "description": "Deprecation message shown to users. Should include alternative installation methods if available." + }, + "since": { + "type": "string", + "description": "The version number when the deprecation was made." + } + } +} diff --git a/schemas/components/opt.json b/schemas/components/opt.json new file mode 100644 index 0000000..ac79bb0 --- /dev/null +++ b/schemas/components/opt.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/opt", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9_\\-\\./]+$": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/schemas/components/schemas.json b/schemas/components/schemas.json new file mode 100644 index 0000000..026c4cd --- /dev/null +++ b/schemas/components/schemas.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/schemas", + "type": "object", + "additionalProperties": false, + "properties": { + "lsp": { + "type": "string", + "description": "A URL to where the LSP JSON schema can be downloaded from. If the provided URL is a VSCode package.json you MUST prefix the url with vscode:", + "pattern": "^(vscode:)?https://" + } + } +} diff --git a/schemas/components/share.json b/schemas/components/share.json new file mode 100644 index 0000000..75be7d7 --- /dev/null +++ b/schemas/components/share.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/share", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9_\\-\\./]+$": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/schemas/components/source.json b/schemas/components/source.json new file mode 100644 index 0000000..7bc1758 --- /dev/null +++ b/schemas/components/source.json @@ -0,0 +1,52 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/source", + "$defs": { + "Source": { + "oneOf": [ + { "$ref": "sources/cargo" }, + { "$ref": "sources/composer" }, + { "$ref": "sources/gem" }, + { "$ref": "sources/generic" }, + { "$ref": "sources/github" }, + { "$ref": "sources/golang" }, + { "$ref": "sources/luarocks" }, + { "$ref": "sources/npm" }, + { "$ref": "sources/nuget" }, + { "$ref": "sources/opam" }, + { "$ref": "sources/pypi" } + ] + } + }, + "allOf": [ + { + "type": "object", + "properties": { + "version_overrides": { + "type": "array", + "items": { + "type": "object", + "allOf": [ + { + "type": "object", + "required": ["constraint"], + "properties": { + "constraint": { + "type": "string", + "pattern": "^semver:(<=)?v?\\d+\\.\\d+\\.\\d+" + } + } + }, + { + "$ref": "#/$defs/Source" + } + ] + } + } + } + }, + { + "$ref": "#/$defs/Source" + } + ] +} diff --git a/schemas/components/sources/build.json b/schemas/components/sources/build.json new file mode 100644 index 0000000..ac1a7d6 --- /dev/null +++ b/schemas/components/sources/build.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/build", + "type": "object", + "required": ["run"], + "properties": { + "target": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "/mason-registry.json/enums/platform" + } + }, + { + "$ref": "/mason-registry.json/enums/platform" + } + ] + }, + "run": { + "type": "string", + "description": "The shell script to run. Platform sensitive (bash on Unix, powershell on Windows)." + }, + "env": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^[A-Z0-9_]+$": { + "type": "string" + } + } + }, + "staged": { + "type": "boolean", + "description": "Whether to run the build script in a staging location (defaults to true)." + } + } +} diff --git a/schemas/components/sources/cargo.json b/schemas/components/sources/cargo.json new file mode 100644 index 0000000..227a051 --- /dev/null +++ b/schemas/components/sources/cargo.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/cargo", + "type": "object", + "required": ["id"], + "properties": { + "id": { + "type": "string", + "pattern": "^pkg:cargo/.+@.+" + }, + "supported_platforms": { + "type": "array", + "description": "List of platforms supported by the cargo package.", + "items": { + "$ref": "/mason-registry.json/enums/platform" + } + } + } +} diff --git a/schemas/components/sources/composer.json b/schemas/components/sources/composer.json new file mode 100644 index 0000000..dad1938 --- /dev/null +++ b/schemas/components/sources/composer.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/composer", + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^pkg:composer/.+/.+@.+" + } + } +} diff --git a/schemas/components/sources/gem.json b/schemas/components/sources/gem.json new file mode 100644 index 0000000..651deb8 --- /dev/null +++ b/schemas/components/sources/gem.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/gem", + "type": "object", + "required": ["id"], + "properties": { + "id": { + "type": "string", + "pattern": "^pkg:gem/.+@.+" + }, + "extra_packages": { + "type": "array", + "description": "Extra gem packages required by the main package to function.", + "items": { + "type": "string" + } + }, + "supported_platforms": { + "type": "array", + "description": "List of platforms supported by the gem package.", + "items": { + "$ref": "/mason-registry.json/enums/platform" + } + } + } +} diff --git a/schemas/components/sources/generic/build.json b/schemas/components/sources/generic/build.json new file mode 100644 index 0000000..66922cb --- /dev/null +++ b/schemas/components/sources/generic/build.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/generic/build", + "type": "object", + "required": ["id", "build"], + "properties": { + "id": { + "type": "string", + "pattern": "^pkg:generic/.+@.+" + }, + "build": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "/mason-registry.json/components/sources/build" + } + }, + { + "$ref": "/mason-registry.json/components/sources/build" + } + ] + } + } +} diff --git a/schemas/components/sources/generic/download.json b/schemas/components/sources/generic/download.json new file mode 100644 index 0000000..fb26dec --- /dev/null +++ b/schemas/components/sources/generic/download.json @@ -0,0 +1,57 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/generic/download", + "type": "object", + "$defs": { + "Download": { + "type": "object", + "required": ["files"], + "additionalProperties": true, + "properties": { + "target": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "/mason-registry.json/enums/platform" + } + }, + { + "$ref": "/mason-registry.json/enums/platform" + } + ] + }, + "files": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9_\\-\\.]+$": { + "type": "string", + "pattern": "^https?://" + } + }, + "additionalProperties": false + } + } + } + }, + "required": ["id", "download"], + "properties": { + "id": { + "type": "string", + "pattern": "^pkg:generic/.+@.+" + }, + "download": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/$defs/Download" + } + }, + { + "$ref": "#/$defs/Download" + } + ] + } + } +} diff --git a/schemas/components/sources/generic/generic.json b/schemas/components/sources/generic/generic.json new file mode 100644 index 0000000..e5a4f97 --- /dev/null +++ b/schemas/components/sources/generic/generic.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/generic", + "oneOf": [ + { + "$ref": "generic/download" + }, + { + "$ref": "generic/build" + } + ] +} diff --git a/schemas/components/sources/github/build.json b/schemas/components/sources/github/build.json new file mode 100644 index 0000000..7f6b17d --- /dev/null +++ b/schemas/components/sources/github/build.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/github/build", + "type": "object", + "required": ["id", "build"], + "properties": { + "id": { + "type": "string", + "pattern": "^pkg:github/.+/.+@.+" + }, + "build": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "/mason-registry.json/components/sources/build" + } + }, + { + "$ref": "/mason-registry.json/components/sources/build" + } + ] + } + } +} diff --git a/schemas/components/sources/github/github.json b/schemas/components/sources/github/github.json new file mode 100644 index 0000000..86b7456 --- /dev/null +++ b/schemas/components/sources/github/github.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/github", + "oneOf": [ + { + "$ref": "github/release" + }, + { + "$ref": "github/build" + } + ] +} diff --git a/schemas/components/sources/github/release.json b/schemas/components/sources/github/release.json new file mode 100644 index 0000000..5774193 --- /dev/null +++ b/schemas/components/sources/github/release.json @@ -0,0 +1,76 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/github/release", + "type": "object", + "$defs": { + "Asset": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "object", + "required": ["target", "file"], + "additionalProperties": true, + "properties": { + "target": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "/mason-registry.json/enums/platform" + } + }, + { + "$ref": "/mason-registry.json/enums/platform" + } + ] + }, + "file": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + } + } + } + }, + { + "type": "object", + "required": ["file"], + "properties": { + "file": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + } + } + } + ] + } + }, + "required": ["id", "asset"], + "properties": { + "id": { + "type": "string", + "pattern": "^pkg:github/.+/.+@.+" + }, + "asset": { + "$ref": "#/$defs/Asset" + } + } +} diff --git a/schemas/components/sources/golang.json b/schemas/components/sources/golang.json new file mode 100644 index 0000000..65873c6 --- /dev/null +++ b/schemas/components/sources/golang.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/golang", + "type": "object", + "required": ["id"], + "properties": { + "id": { + "type": "string", + "pattern": "^pkg:golang/.+/.+@.+" + }, + "extra_packages": { + "type": "array", + "description": "Extra golang packages required by the main package to function.", + "items": { + "type": "string" + } + } + } +} diff --git a/schemas/components/sources/luarocks.json b/schemas/components/sources/luarocks.json new file mode 100644 index 0000000..9f9ab8b --- /dev/null +++ b/schemas/components/sources/luarocks.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/luarocks", + "type": "object", + "required": ["id"], + "properties": { + "id": { + "type": "string", + "pattern": "^pkg:luarocks/.+@.+" + } + } +} diff --git a/schemas/components/sources/npm.json b/schemas/components/sources/npm.json new file mode 100644 index 0000000..1ad81d3 --- /dev/null +++ b/schemas/components/sources/npm.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/npm", + "type": "object", + "required": ["id"], + "properties": { + "id": { + "type": "string", + "pattern": "^pkg:npm/.+@.+" + }, + "extra_packages": { + "type": "array", + "description": "Extra npm packages required by the main package to function.", + "items": { + "type": "string" + } + } + } +} diff --git a/schemas/components/sources/nuget.json b/schemas/components/sources/nuget.json new file mode 100644 index 0000000..b0b6496 --- /dev/null +++ b/schemas/components/sources/nuget.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/nuget", + "type": "object", + "required": ["id"], + "properties": { + "id": { + "type": "string", + "pattern": "^pkg:nuget/.+@.+" + } + } +} diff --git a/schemas/components/sources/opam.json b/schemas/components/sources/opam.json new file mode 100644 index 0000000..ae325c5 --- /dev/null +++ b/schemas/components/sources/opam.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/opam", + "type": "object", + "required": ["id"], + "properties": { + "id": { + "type": "string", + "pattern": "^pkg:opam/.+@.+" + } + } +} diff --git a/schemas/components/sources/pypi.json b/schemas/components/sources/pypi.json new file mode 100644 index 0000000..243f823 --- /dev/null +++ b/schemas/components/sources/pypi.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/components/sources/pypi", + "type": "object", + "required": ["id"], + "properties": { + "id": { + "type": "string", + "pattern": "^pkg:pypi/.+@.+" + }, + "extra_packages": { + "type": "array", + "description": "Extra pypi packages required by the main package to function.", + "items": { + "type": "string" + } + }, + "supported_platforms": { + "type": "array", + "description": "List of platforms supported by the pypi package.", + "items": { + "$ref": "/mason-registry.json/enums/platform" + } + } + } +} diff --git a/schemas/enums/category.json b/schemas/enums/category.json new file mode 100644 index 0000000..54c6e07 --- /dev/null +++ b/schemas/enums/category.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/enums/category", + "type": "string", + "enum": ["Compiler", "DAP", "Formatter", "LSP", "Linter", "Runtime"] +} diff --git a/schemas/enums/language.json b/schemas/enums/language.json new file mode 100644 index 0000000..843c888 --- /dev/null +++ b/schemas/enums/language.json @@ -0,0 +1,174 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/enums/language", + "type": "string", + "enum": [ + ".NET", + "1ะก:Enterprise", + "AWK", + "Ada", + "Angular", + "Ansible", + "Antlers", + "Apex", + "Arduino", + "Assembly", + "Astro", + "Azure Pipelines", + "Bash", + "Bazel", + "Beancount", + "Bicep", + "Blade", + "BrighterScript", + "C", + "C#", + "C++", + "CMake", + "CQL", + "CSS", + "Cairo", + "Clarity", + "Clojure", + "ClojureScript", + "CloudFormation", + "CodeQL", + "Crystal", + "Csh", + "Cucumber", + "Cue", + "Cypher", + "D", + "DOT", + "Dart", + "Dhall", + "Django", + "Docker", + "Drools", + "Elixir", + "Elm", + "Ember", + "Emmet", + "Erg", + "Erlang", + "F#", + "Fennel", + "Flow", + "Flux", + "Fortran", + "GDScript", + "Gleam", + "Glimmer", + "Go", + "Gradle", + "GraphQL", + "Groovy", + "HAML", + "HTML", + "HTMX", + "Handlebars", + "Haskell", + "Haxe", + "Helm", + "Hoon", + "IPython", + "JSON", + "JSON-LD", + "JSX", + "Java", + "JavaScript", + "Jinja", + "Jq", + "Jsonnet", + "Julia", + "KCL", + "Kotlin", + "Ksh", + "Kubernetes", + "LESS", + "LaTeX", + "Lean 3", + "Lelwel", + "Liquid", + "Lua", + "Luau", + "MDX", + "Markdown", + "Matlab", + "Meson", + "Metamath Zero", + "Mksh", + "Move", + "Mustache", + "Nginx", + "Nickel", + "Nim", + "Nix", + "Nunjucks", + "OCaml", + "Odin", + "OneScript", + "OpenAPI", + "OpenCL", + "OpenEdge", + "OpenFOAM", + "OpenSCAD", + "PHP", + "PICO-8", + "Perl", + "Pest", + "PowerShell", + "Prisma", + "Progress", + "Protobuf", + "Puppet", + "PureScript", + "Python", + "R", + "Raku", + "ReScript", + "Reason", + "Robot Framework", + "Ruby", + "Rust", + "SCSS", + "SQL", + "Salt", + "Sass", + "Scala", + "Sh", + "Shell", + "Slang", + "Slint", + "Smithy", + "Snakemake", + "Snyk", + "Solidity", + "Sphinx", + "Standard ML", + "Starlark", + "Stylelint", + "Svelte", + "SystemVerilog", + "TOML", + "Teal", + "Terraform", + "Text", + "Thrift", + "Twig", + "TypeScript", + "Typst", + "V", + "Vala", + "Veryl", + "VimScript", + "Visualforce", + "Vue", + "WGSL", + "XML", + "YAML", + "YARA", + "Zig", + "Zsh" + ] +} diff --git a/schemas/enums/platform.json b/schemas/enums/platform.json new file mode 100644 index 0000000..ef6da9a --- /dev/null +++ b/schemas/enums/platform.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/enums/platform", + "type": "string", + "enum": [ + "unix", + "darwin", + "darwin_arm64", + "darwin_x64", + "linux", + "linux_arm", + "linux_arm64", + "linux_arm64_gnu", + "linux_arm64_musl", + "linux_arm64_openbsd", + "linux_arm_gnu", + "linux_armv6_gnu", + "linux_armv6l", + "linux_armv7_gnu", + "linux_armv7l", + "linux_x64", + "linux_x64_gnu", + "linux_x64_musl", + "linux_x64_openbsd", + "linux_x86", + "linux_x86_gnu", + "linux_x86_musl", + "linux_x86_openbsd", + "win", + "win_arm", + "win_arm64", + "win_armv6l", + "win_armv7l", + "win_x64", + "win_x86" + ] +} diff --git a/schemas/enums/spdx-license.json b/schemas/enums/spdx-license.json new file mode 100644 index 0000000..f678389 --- /dev/null +++ b/schemas/enums/spdx-license.json @@ -0,0 +1,511 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json/enums/spdx-license", + "$comment": "SPDX license list; releaseDate=2022-12-15; source=https://raw.githubusercontent.com/spdx/license-list-data/master/json/licenses.json", + "enum": [ + "proprietary", + "0BSD", + "AAL", + "Abstyles", + "Adobe-2006", + "Adobe-Glyph", + "ADSL", + "AFL-1.1", + "AFL-1.2", + "AFL-2.0", + "AFL-2.1", + "AFL-3.0", + "Afmparse", + "AGPL-1.0", + "AGPL-1.0-only", + "AGPL-1.0-or-later", + "AGPL-3.0", + "AGPL-3.0-only", + "AGPL-3.0-or-later", + "Aladdin", + "AMDPLPA", + "AML", + "AMPAS", + "ANTLR-PD", + "ANTLR-PD-fallback", + "Apache-1.0", + "Apache-1.1", + "Apache-2.0", + "APAFML", + "APL-1.0", + "App-s2p", + "APSL-1.0", + "APSL-1.1", + "APSL-1.2", + "APSL-2.0", + "Arphic-1999", + "Artistic-1.0", + "Artistic-1.0-cl8", + "Artistic-1.0-Perl", + "Artistic-2.0", + "Baekmuk", + "Bahyph", + "Barr", + "Beerware", + "Bitstream-Vera", + "BitTorrent-1.0", + "BitTorrent-1.1", + "blessing", + "BlueOak-1.0.0", + "Borceux", + "BSD-1-Clause", + "BSD-2-Clause", + "BSD-2-Clause-FreeBSD", + "BSD-2-Clause-NetBSD", + "BSD-2-Clause-Patent", + "BSD-2-Clause-Views", + "BSD-3-Clause", + "BSD-3-Clause-Attribution", + "BSD-3-Clause-Clear", + "BSD-3-Clause-LBNL", + "BSD-3-Clause-Modification", + "BSD-3-Clause-No-Military-License", + "BSD-3-Clause-No-Nuclear-License", + "BSD-3-Clause-No-Nuclear-License-2014", + "BSD-3-Clause-No-Nuclear-Warranty", + "BSD-3-Clause-Open-MPI", + "BSD-4-Clause", + "BSD-4-Clause-Shortened", + "BSD-4-Clause-UC", + "BSD-Protection", + "BSD-Source-Code", + "BSL-1.0", + "BUSL-1.1", + "bzip2-1.0.5", + "bzip2-1.0.6", + "C-UDA-1.0", + "CAL-1.0", + "CAL-1.0-Combined-Work-Exception", + "Caldera", + "CATOSL-1.1", + "CC-BY-1.0", + "CC-BY-2.0", + "CC-BY-2.5", + "CC-BY-2.5-AU", + "CC-BY-3.0", + "CC-BY-3.0-AT", + "CC-BY-3.0-DE", + "CC-BY-3.0-IGO", + "CC-BY-3.0-NL", + "CC-BY-3.0-US", + "CC-BY-4.0", + "CC-BY-NC-1.0", + "CC-BY-NC-2.0", + "CC-BY-NC-2.5", + "CC-BY-NC-3.0", + "CC-BY-NC-3.0-DE", + "CC-BY-NC-4.0", + "CC-BY-NC-ND-1.0", + "CC-BY-NC-ND-2.0", + "CC-BY-NC-ND-2.5", + "CC-BY-NC-ND-3.0", + "CC-BY-NC-ND-3.0-DE", + "CC-BY-NC-ND-3.0-IGO", + "CC-BY-NC-ND-4.0", + "CC-BY-NC-SA-1.0", + "CC-BY-NC-SA-2.0", + "CC-BY-NC-SA-2.0-FR", + "CC-BY-NC-SA-2.0-UK", + "CC-BY-NC-SA-2.5", + "CC-BY-NC-SA-3.0", + "CC-BY-NC-SA-3.0-DE", + "CC-BY-NC-SA-3.0-IGO", + "CC-BY-NC-SA-4.0", + "CC-BY-ND-1.0", + "CC-BY-ND-2.0", + "CC-BY-ND-2.5", + "CC-BY-ND-3.0", + "CC-BY-ND-3.0-DE", + "CC-BY-ND-4.0", + "CC-BY-SA-1.0", + "CC-BY-SA-2.0", + "CC-BY-SA-2.0-UK", + "CC-BY-SA-2.1-JP", + "CC-BY-SA-2.5", + "CC-BY-SA-3.0", + "CC-BY-SA-3.0-AT", + "CC-BY-SA-3.0-DE", + "CC-BY-SA-4.0", + "CC-PDDC", + "CC0-1.0", + "CDDL-1.0", + "CDDL-1.1", + "CDL-1.0", + "CDLA-Permissive-1.0", + "CDLA-Permissive-2.0", + "CDLA-Sharing-1.0", + "CECILL-1.0", + "CECILL-1.1", + "CECILL-2.0", + "CECILL-2.1", + "CECILL-B", + "CECILL-C", + "CERN-OHL-1.1", + "CERN-OHL-1.2", + "CERN-OHL-P-2.0", + "CERN-OHL-S-2.0", + "CERN-OHL-W-2.0", + "checkmk", + "ClArtistic", + "CNRI-Jython", + "CNRI-Python", + "CNRI-Python-GPL-Compatible", + "COIL-1.0", + "Community-Spec-1.0", + "Condor-1.1", + "copyleft-next-0.3.0", + "copyleft-next-0.3.1", + "CPAL-1.0", + "CPL-1.0", + "CPOL-1.02", + "Crossword", + "CrystalStacker", + "CUA-OPL-1.0", + "Cube", + "curl", + "D-FSL-1.0", + "diffmark", + "DL-DE-BY-2.0", + "DOC", + "Dotseqn", + "DRL-1.0", + "DSDP", + "dvipdfm", + "ECL-1.0", + "ECL-2.0", + "eCos-2.0", + "EFL-1.0", + "EFL-2.0", + "eGenix", + "Elastic-2.0", + "Entessa", + "EPICS", + "EPL-1.0", + "EPL-2.0", + "ErlPL-1.1", + "etalab-2.0", + "EUDatagrid", + "EUPL-1.0", + "EUPL-1.1", + "EUPL-1.2", + "Eurosym", + "Fair", + "FDK-AAC", + "Frameworx-1.0", + "FreeBSD-DOC", + "FreeImage", + "FSFAP", + "FSFUL", + "FSFULLR", + "FSFULLRWD", + "FTL", + "GD", + "GFDL-1.1", + "GFDL-1.1-invariants-only", + "GFDL-1.1-invariants-or-later", + "GFDL-1.1-no-invariants-only", + "GFDL-1.1-no-invariants-or-later", + "GFDL-1.1-only", + "GFDL-1.1-or-later", + "GFDL-1.2", + "GFDL-1.2-invariants-only", + "GFDL-1.2-invariants-or-later", + "GFDL-1.2-no-invariants-only", + "GFDL-1.2-no-invariants-or-later", + "GFDL-1.2-only", + "GFDL-1.2-or-later", + "GFDL-1.3", + "GFDL-1.3-invariants-only", + "GFDL-1.3-invariants-or-later", + "GFDL-1.3-no-invariants-only", + "GFDL-1.3-no-invariants-or-later", + "GFDL-1.3-only", + "GFDL-1.3-or-later", + "Giftware", + "GL2PS", + "Glide", + "Glulxe", + "GLWTPL", + "gnuplot", + "GPL-1.0", + "GPL-1.0-only", + "GPL-1.0-or-later", + "GPL-1.0+", + "GPL-2.0", + "GPL-2.0-only", + "GPL-2.0-or-later", + "GPL-2.0-with-autoconf-exception", + "GPL-2.0-with-bison-exception", + "GPL-2.0-with-classpath-exception", + "GPL-2.0-with-font-exception", + "GPL-2.0-with-GCC-exception", + "GPL-2.0+", + "GPL-3.0", + "GPL-3.0-only", + "GPL-3.0-or-later", + "GPL-3.0-with-autoconf-exception", + "GPL-3.0-with-GCC-exception", + "GPL-3.0+", + "gSOAP-1.3b", + "HaskellReport", + "Hippocratic-2.1", + "HPND", + "HPND-sell-variant", + "HTMLTIDY", + "IBM-pibs", + "ICU", + "IJG", + "ImageMagick", + "iMatix", + "Imlib2", + "Info-ZIP", + "Intel", + "Intel-ACPI", + "Interbase-1.0", + "IPA", + "IPL-1.0", + "ISC", + "Jam", + "JasPer-2.0", + "JPNIC", + "JSON", + "Knuth-CTAN", + "LAL-1.2", + "LAL-1.3", + "Latex2e", + "Leptonica", + "LGPL-2.0", + "LGPL-2.0-only", + "LGPL-2.0-or-later", + "LGPL-2.0+", + "LGPL-2.1", + "LGPL-2.1-only", + "LGPL-2.1-or-later", + "LGPL-2.1+", + "LGPL-3.0", + "LGPL-3.0-only", + "LGPL-3.0-or-later", + "LGPL-3.0+", + "LGPLLR", + "Libpng", + "libpng-2.0", + "libselinux-1.0", + "libtiff", + "libutil-David-Nugent", + "LiLiQ-P-1.1", + "LiLiQ-R-1.1", + "LiLiQ-Rplus-1.1", + "Linux-man-pages-copyleft", + "Linux-OpenIB", + "LOOP", + "LPL-1.0", + "LPL-1.02", + "LPPL-1.0", + "LPPL-1.1", + "LPPL-1.2", + "LPPL-1.3a", + "LPPL-1.3c", + "LZMA-SDK-9.11-to-9.20", + "LZMA-SDK-9.22", + "MakeIndex", + "Minpack", + "MirOS", + "MIT", + "MIT-0", + "MIT-advertising", + "MIT-CMU", + "MIT-enna", + "MIT-feh", + "MIT-Modern-Variant", + "MIT-open-group", + "MITNFA", + "Motosoto", + "mpi-permissive", + "mpich2", + "MPL-1.0", + "MPL-1.1", + "MPL-2.0", + "MPL-2.0-no-copyleft-exception", + "mplus", + "MS-LPL", + "MS-PL", + "MS-RL", + "MTLL", + "MulanPSL-1.0", + "MulanPSL-2.0", + "Multics", + "Mup", + "NAIST-2003", + "NASA-1.3", + "Naumen", + "NBPL-1.0", + "NCGL-UK-2.0", + "NCSA", + "Net-SNMP", + "NetCDF", + "Newsletr", + "NGPL", + "NICTA-1.0", + "NIST-PD", + "NIST-PD-fallback", + "NLOD-1.0", + "NLOD-2.0", + "NLPL", + "Nokia", + "NOSL", + "Noweb", + "NPL-1.0", + "NPL-1.1", + "NPOSL-3.0", + "NRL", + "NTP", + "NTP-0", + "Nunit", + "O-UDA-1.0", + "OCCT-PL", + "OCLC-2.0", + "ODbL-1.0", + "ODC-By-1.0", + "OFL-1.0", + "OFL-1.0-no-RFN", + "OFL-1.0-RFN", + "OFL-1.1", + "OFL-1.1-no-RFN", + "OFL-1.1-RFN", + "OGC-1.0", + "OGDL-Taiwan-1.0", + "OGL-Canada-2.0", + "OGL-UK-1.0", + "OGL-UK-2.0", + "OGL-UK-3.0", + "OGTSL", + "OLDAP-1.1", + "OLDAP-1.2", + "OLDAP-1.3", + "OLDAP-1.4", + "OLDAP-2.0", + "OLDAP-2.0.1", + "OLDAP-2.1", + "OLDAP-2.2", + "OLDAP-2.2.1", + "OLDAP-2.2.2", + "OLDAP-2.3", + "OLDAP-2.4", + "OLDAP-2.5", + "OLDAP-2.6", + "OLDAP-2.7", + "OLDAP-2.8", + "OML", + "OpenSSL", + "OPL-1.0", + "OPUBL-1.0", + "OSET-PL-2.1", + "OSL-1.0", + "OSL-1.1", + "OSL-2.0", + "OSL-2.1", + "OSL-3.0", + "Parity-6.0.0", + "Parity-7.0.0", + "PDDL-1.0", + "PHP-3.0", + "PHP-3.01", + "Plexus", + "PolyForm-Noncommercial-1.0.0", + "PolyForm-Small-Business-1.0.0", + "PostgreSQL", + "PSF-2.0", + "psfrag", + "psutils", + "Python-2.0", + "Python-2.0.1", + "Qhull", + "QPL-1.0", + "Rdisc", + "RHeCos-1.1", + "RPL-1.1", + "RPL-1.5", + "RPSL-1.0", + "RSA-MD", + "RSCPL", + "Ruby", + "SAX-PD", + "Saxpath", + "SCEA", + "SchemeReport", + "Sendmail", + "Sendmail-8.23", + "SGI-B-1.0", + "SGI-B-1.1", + "SGI-B-2.0", + "SHL-0.5", + "SHL-0.51", + "SimPL-2.0", + "SISSL", + "SISSL-1.2", + "Sleepycat", + "SMLNJ", + "SMPPL", + "SNIA", + "Spencer-86", + "Spencer-94", + "Spencer-99", + "SPL-1.0", + "SSH-OpenSSH", + "SSH-short", + "SSPL-1.0", + "StandardML-NJ", + "SugarCRM-1.1.3", + "SWL", + "Symlinks", + "TAPR-OHL-1.0", + "TCL", + "TCP-wrappers", + "TMate", + "TORQUE-1.1", + "TOSL", + "TU-Berlin-1.0", + "TU-Berlin-2.0", + "UCL-1.0", + "Unicode-DFS-2015", + "Unicode-DFS-2016", + "Unicode-TOU", + "Unlicense", + "UPL-1.0", + "Vim", + "VOSTROM", + "VSL-1.0", + "W3C", + "W3C-19980720", + "W3C-20150513", + "Watcom-1.0", + "Wsuipa", + "WTFPL", + "wxWindows", + "X11", + "X11-distribute-modifications-variant", + "Xerox", + "XFree86-1.1", + "xinetd", + "Xnet", + "xpp", + "XSkat", + "YPL-1.0", + "YPL-1.1", + "Zed", + "Zend-2.0", + "Zimbra-1.3", + "Zimbra-1.4", + "Zlib", + "zlib-acknowledgement", + "ZPL-1.1", + "ZPL-2.0", + "ZPL-2.1" + ], + "type": "string" +} diff --git a/schemas/package.schema.json b/schemas/package.schema.json new file mode 100644 index 0000000..065b2c8 --- /dev/null +++ b/schemas/package.schema.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json.schemastore.org/mason-registry.json", + "title": "Mason Registry package schema", + "description": "Schema for package definitions.", + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The package name. MUST be unique within the registry it belongs to." + }, + "description": { + "type": "string", + "description": "The description of the package. Usually sourced upstream." + }, + "homepage": { + "type": "string", + "format": "uri", + "pattern": "^https?://", + "description": "A URL to the package's homepage." + }, + "licenses": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "mason-registry.json/enums/spdx-license" + } + }, + "languages": { + "type": "array", + "items": { + "$ref": "mason-registry.json/enums/language" + } + }, + "categories": { + "type": "array", + "items": { + "$ref": "mason-registry.json/enums/category" + } + }, + "deprecation": { + "$ref": "mason-registry.json/components/deprecation" + }, + "source": { + "$ref": "mason-registry.json/components/source" + }, + "schemas": { + "$ref": "mason-registry.json/components/schemas" + }, + "bin": { + "$ref": "mason-registry.json/components/bin" + }, + "share": { + "$ref": "mason-registry.json/components/share" + }, + "opt": { + "$ref": "mason-registry.json/components/opt" + }, + "ci_skip": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "$ref": "mason-registry.json/enums/platform" + } + } + ] + } + }, + "required": ["name", "description", "homepage", "licenses", "languages", "categories", "source"] +}