Skip to content

Commit

Permalink
Update docs, remove plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
finestructure committed Mar 19, 2024
1 parent 8a20b12 commit 6b592dc
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 88 deletions.
7 changes: 0 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,12 @@ let package = Package(
products: [
.executable(name: "validate-spi-manifest", targets: ["validate-spi-manifest"]),
.library(name: "SPIManifest", targets: ["SPIManifest"]),
.plugin(name: "SPIManifestValidatorPlugin", targets: ["ValidatorPlugin"])
],
dependencies: [
.package(url: "https://github.com/jpsim/Yams.git", "4.0.0"..<"6.0.0"),
],
targets: [
.executableTarget(name: "validate-spi-manifest", dependencies: ["SPIManifest"]),
.plugin(
name: "ValidatorPlugin",
capability: .command(intent: .custom(verb: "validate-spi-manifest",
description: "Validate a .spi.yml file")),
dependencies: ["validate-spi-manifest"]
),
.target(name: "SPIManifest", dependencies: ["Yams"]),
.testTarget(name: "SPIManifestTests", dependencies: ["SPIManifest"]),
]
Expand Down
1 change: 0 additions & 1 deletion Sources/SPIManifest/Documentation.docc/CommonUseCases.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ The contents of a `.spi.yml` file allow package authors to configure their packa

The following are some common use cases.


## Host DocC documentation in the Swift Package Index

Package authors can configure their package's documentation to be hosted on the Swift Package Index. In order to do so, add a `.spi.yml` file with the following content to the root of your package repository listing one or more targets you want to generate documentation for:
Expand Down
49 changes: 49 additions & 0 deletions Sources/SPIManifest/Documentation.docc/ManifestValidation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Manifest Validation

How to validate `.spi.yml` files.

## Overview

The easiest way to validate a `.spi.yml` is via the [Online Validator](https://swiftpackageindex.com/validate-spi-manifest) on the [Swift Package Index website](https://swiftpackageindex.com).

You can also use the `validate-spi-manifest` executable to validate your `.spi.yml` file.

### Online Validator

The [Online Validator](https://swiftpackageindex.com/validate-spi-manifest) is a simple web form where you can submit your sample `.spi.yml` file and it will run the exact same parser as during package processing.

The validator will display the parsed result or error messages if it fails.

![](online-validator.png)

### Validation Executable

#### Installation

You can build and install the validation executable by cloning this package and running `make install`:

```sh
git clone https://github.com/SwiftPackageIndex/SPIManifest.git && cd SPIManifest
make install
```

This will copy the executable to `/usr/local/bin/`. To uninstall it, run

```sh
make uninstall
```

You can also install it using [Mint](https://swiftpackageindex.com/yonaskolb/Mint):

```sh
mint install SwiftPackageIndex/SPIManifest
```

#### Validation with the Executable

Once installed, you can run the executable with the path to an `.spi.yml` to validate it:

```sh
❯ validate-spi-manifest ~/Projects/MyPackage/.spi.yml
✅ The file is valid.
```
5 changes: 3 additions & 2 deletions Sources/SPIManifest/Documentation.docc/SPIManifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Here are some examples of things that can be configured by this file:

### Validation

This package comes with an executable to validate your `.spi.yml` for correctness. See
Swift Package Index manifests can be validated for correctness via the [Online Validator](https://swiftpackageindex.com/validate-spi-manifest) or via an executable that comes with this package. See

- <doc:Validation>
- <doc:ManifestValidation>

for more details.

Expand All @@ -29,5 +29,6 @@ for more details.
### Essentials

- <doc:CommonUseCases>
- <doc:ManifestValidation>
- <doc:Validation>
- ``Manifest``
78 changes: 0 additions & 78 deletions Sources/SPIManifest/Documentation.docc/Validation.md

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6b592dc

Please sign in to comment.