Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Template optionalPaths property #484

Merged
merged 3 commits into from
Aug 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion docs/specs/devcontainer-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ The properties of the file are as follows:
| `description` | string | Description of the Template. |
| `documentationURL` | string | Url that points to the documentation of the Template. |
| `licenseURL` | string | Url that points to the license of the Template. |
| `options` | object | A map of options that the supporting tools should use to populate different configuration options for the Template. |
| [`options`](#the-options-property) | object | A map of options that the supporting tools should use to populate different configuration options for the Template. |
| `platforms` | array | Languages and platforms supported by the Template. |
| `publisher` | string | Name of the publisher/maintainer of the Template. |
| `keywords` | array | List of strings relevant to a user that would search for this Template. |
| [`optionalPath`](#the-optionalpaths-property) | array | An array of files or directories that tooling may consider "optional" when applying a Template.

### The `options` property

Expand Down Expand Up @@ -66,6 +67,26 @@ The `options` property contains a map of option IDs and their related configurat

> `Note`: The `options` must be unique for every `devcontainer-template.json`

### The `optionalPaths` property

Before applying a Template, tooling must inspect the `optionalPaths` property of a Template and prompt the user on whether each file or folder should be included in the resulting output workspace folder.

An optional path is relative to the root of the Template source directory. For a directory, a trailing slash (`/`) should be appended to the path. Examples are shown below:

```json
{
"id": "cpp",
"version": "3.0.0",
"name": "C++",
"description": "Develop C++ applications",
"optionalPaths": [
"GETTING-STARTED.md",
"example-project-1/MyProject.csproj",
".github/"
joshspicer marked this conversation as resolved.
Show resolved Hide resolved
]
}
```

### Referencing a Template

The `id` format (`<oci-registry>/<namespace>/<template>[:<semantic-version>]`) dictates how a [supporting tool](https://containers.dev/supporting) will locate and download a given Template from an OCI registry. For example:
Expand Down