Merge pull request #49 from tiktok/octogonz/website-fixes2

Publish sparo-profile.schema.json on the website
This commit is contained in:
Pete Gonzalez 2024-03-04 22:35:32 -08:00 committed by GitHub
commit 12ddfb4710
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 86 additions and 22 deletions

View file

@ -1,3 +1,7 @@
/**
* OWNER: <your team name>
* PURPOSE: <what you use this profile for>
*/
{
"$schema": "https://tiktok.github.io/sparo/schemas/sparo-profile.schema.json",
@ -28,16 +32,16 @@
],
/**
* A list of arbitrary additional folders to be included, not necessarily
* corresponding to any workspace project.
* A list of arbitrary additional folders to be included for checkout,
* not necessarily corresponding to any workspace project.
*/
"includeFolders": [
// "path/to/include"
],
/**
* A list of folders to be excluded. This field takes precedence over
* the "includeFolders" and "selections" fields, guaranteeing that the
* A list of folders to be excluded from the checkout. This field takes precedence
* over the "includeFolders" and "selections" fields, guaranteeing that the
* specified path will definitely not be included.
*/
"excludeFolders": [

View file

@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Profile for Sparo tool.",
"description": "For use with the sparo tool, this file provides the scope of folders in the sparse checkout cone",
"title": "A sparse checkout profile for use with the Sparo tool",
"description": "This config file is used by the Sparo tool that optimizes performance of Git operations for a large frontend monorepo.\n\nhttps://tiktok.github.io/sparo/",
"type": "object",
"additionalProperties": false,
@ -12,19 +12,18 @@
},
"selections": {
"description": "A list of project selection definition",
"description": "A list of Rush project selectors indicating the project folders to be included for sparse checkout. The selectors will be combined to make the union superset of projects.\n\nSee the Rush selector documentation for details:\nhttps://rushjs.io/pages/developer/selecting_subsets/",
"type": "array",
"items": {
"description": "A definition of project selector parameter. See https://rushjs.io/pages/developer/selecting_subsets/",
"type": "object",
"additionalProperties": false,
"properties": {
"selector": {
"description": "The selector",
"description": "A RushJS project selector such as \"--to\", \"--from\", \"--impacted-by\".\n\nSee the Rush selector documentation for details:\nhttps://rushjs.io/pages/developer/selecting_subsets/",
"type": "string"
},
"argument": {
"description": "The argument of selector, it can be one project name, tagged projects prefixes with tag:, and modified projects prefixes with git:",
"description": "The selector argument, for example a project name or an expression such as \"tag:my-tag\".",
"type": "string"
}
}
@ -32,19 +31,17 @@
},
"includeFolders": {
"description": "A list of folders expand the sparse checkout cone, adding more include folders.",
"description": "A list of arbitrary additional folders to be included for checkout, not necessarily corresponding to any workspace project.",
"type": "array",
"items": {
"description": "A relative path from the root of monorepo",
"type": "string"
}
},
"excludeFolders": {
"description": "A list of folders will be excluded in the sparse checkout cone. The exclude folders overrides include folders and the result of selection",
"description": "A list of folders to be excluded from the checkout. This field takes precedence over the \"includeFolders\" and \"selections\" fields, guaranteeing that the specified path will definitely not be included.",
"type": "array",
"items": {
"description": "A relative path from the root of monorepo",
"type": "string"
}
}

View file

@ -3,7 +3,7 @@
<div>
<br />
<a href="https://tiktok.github.io/sparo/">
<img width="380" src="../../common/assets/sparo-380.png" alt="Sparo" />
<img width="380" src="https://tiktok.github.io/sparo/images/site/sparo-logo.svg" alt="Sparo" />
</a>
<p />
</div>

View file

@ -6,6 +6,10 @@ To initialize a new Sparo profile, you can copy and paste the contents of this t
**common/sparo-profiles/&lt;profile-name&gt;.json**
```js
/**
* OWNER: <your team name>
* PURPOSE: <what you use this profile for>
*/
{
"$schema": "https://tiktok.github.io/sparo/schemas/sparo-profile.schema.json",
@ -24,7 +28,6 @@ To initialize a new Sparo profile, you can copy and paste the contents of this t
// "selector": "--to",
// "argument": "tag:my-team"
// },
/**
* For example, include the project called "my-library", as well as all
* projects that are impacted by changes to it, as well as the dependency
@ -37,16 +40,16 @@ To initialize a new Sparo profile, you can copy and paste the contents of this t
],
/**
* A list of arbitrary additional folders to be included, not necessarily
* corresponding to any workspace project.
* A list of arbitrary additional folders to be included for checkout,
* not necessarily corresponding to any workspace project.
*/
"includeFolders": [
// "path/to/include"
],
/**
* A list of folders to be excluded. This field takes precedence over
* the "includeFolders" and "selections" fields, guaranteeing that the
* A list of folders to be excluded from the checkout. This field takes precedence
* over the "includeFolders" and "selections" fields, guaranteeing that the
* specified path will definitely not be included.
*/
"excludeFolders": [

View file

@ -93,7 +93,7 @@ sparo checkout --no-profile
## Querying profiles
Users can discover available profiles in the current branch by invoking the [sparo list-profiles](../commands/sparo_list-profiles) command. The `--project` parameter enables you to query relevant profiles for a given project. For example:
Users can discover available profiles in the current branch by invoking the [sparo list-profiles](../commands/sparo_list-profiles.md) command. The `--project` parameter enables you to query relevant profiles for a given project. For example:
```shell
# Suppose you need to make a fix for the "example-app" project.

View file

@ -22,6 +22,7 @@ const config = {
// If you aren't using GitHub pages, you don't need these.
organizationName: 'tiktok', // Usually your GitHub org/user name.
projectName: 'sparo', // Usually your repo name.
trailingSlash: true,
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',

View file

@ -0,0 +1,49 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "A sparse checkout profile for use with the Sparo tool",
"description": "This config file is used by the Sparo tool that optimizes performance of Git operations for a large frontend monorepo.\n\nhttps://tiktok.github.io/sparo/",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": {
"description": "Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.",
"type": "string"
},
"selections": {
"description": "A list of Rush project selectors indicating the project folders to be included for sparse checkout. The selectors will be combined to make the union superset of projects.\n\nSee the Rush selector documentation for details:\nhttps://rushjs.io/pages/developer/selecting_subsets/",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"selector": {
"description": "A RushJS project selector such as \"--to\", \"--from\", \"--impacted-by\".\n\nSee the Rush selector documentation for details:\nhttps://rushjs.io/pages/developer/selecting_subsets/",
"type": "string"
},
"argument": {
"description": "The selector argument, for example a project name or an expression such as \"tag:my-tag\".",
"type": "string"
}
}
}
},
"includeFolders": {
"description": "A list of arbitrary additional folders to be included for checkout, not necessarily corresponding to any workspace project.",
"type": "array",
"items": {
"type": "string"
}
},
"excludeFolders": {
"description": "A list of folders to be excluded from the checkout. This field takes precedence over the \"includeFolders\" and \"selections\" fields, guaranteeing that the specified path will definitely not be included.",
"type": "array",
"items": {
"type": "string"
}
}
}
}

View file

@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "sparo",
"comment": "Improve the \"sparo init-profile\" template comments",
"type": "none"
}
],
"packageName": "sparo"
}