From 33b7fd162d380ffbb84834cd11e17697af5e8fdc Mon Sep 17 00:00:00 2001
From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com>
Date: Mon, 4 Mar 2024 21:54:23 -0800
Subject: [PATCH 1/5] Enable trailingSlash=true for GitHub Pages
---
apps/website/docs/pages/guide/sparo_profiles.md | 2 +-
apps/website/docusaurus.config.js | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/apps/website/docs/pages/guide/sparo_profiles.md b/apps/website/docs/pages/guide/sparo_profiles.md
index 474a6a2..bb08572 100644
--- a/apps/website/docs/pages/guide/sparo_profiles.md
+++ b/apps/website/docs/pages/guide/sparo_profiles.md
@@ -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.
diff --git a/apps/website/docusaurus.config.js b/apps/website/docusaurus.config.js
index 54d295c..812999a 100644
--- a/apps/website/docusaurus.config.js
+++ b/apps/website/docusaurus.config.js
@@ -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',
From 6e06b262a03f9f78e41ac11e2a5e368436864f48 Mon Sep 17 00:00:00 2001
From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com>
Date: Mon, 4 Mar 2024 22:09:54 -0800
Subject: [PATCH 2/5] Update image URL now that website is live
---
apps/sparo/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/sparo/README.md b/apps/sparo/README.md
index 8ddf0c8..8b9085d 100644
--- a/apps/sparo/README.md
+++ b/apps/sparo/README.md
@@ -3,7 +3,7 @@
From 65590f32db51ee7113593f406c0d4ec74f2c6709 Mon Sep 17 00:00:00 2001
From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com>
Date: Mon, 4 Mar 2024 22:10:17 -0800
Subject: [PATCH 3/5] Use the website to host Sparo's JSON schema
---
.../static/schemas/sparo-profile.schema.json | 52 +++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100644 apps/website/static/schemas/sparo-profile.schema.json
diff --git a/apps/website/static/schemas/sparo-profile.schema.json b/apps/website/static/schemas/sparo-profile.schema.json
new file mode 100644
index 0000000..b4072f1
--- /dev/null
+++ b/apps/website/static/schemas/sparo-profile.schema.json
@@ -0,0 +1,52 @@
+{
+ "$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",
+
+ "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 project selection definition",
+ "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",
+ "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:",
+ "type": "string"
+ }
+ }
+ }
+ },
+
+ "includeFolders": {
+ "description": "A list of folders expand the sparse checkout cone, adding more include folders.",
+ "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",
+ "type": "array",
+ "items": {
+ "description": "A relative path from the root of monorepo",
+ "type": "string"
+ }
+ }
+ }
+}
From 41c752b3f41696c8fc5080d12168f85885951799 Mon Sep 17 00:00:00 2001
From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com>
Date: Mon, 4 Mar 2024 22:28:05 -0800
Subject: [PATCH 4/5] Improve the JSON schema docs
---
apps/sparo-lib/assets/sparo-profile.json | 12 ++++++++----
.../src/schemas/sparo-profile.schema.json | 17 +++++++----------
apps/website/docs/pages/configs/profile_json.md | 15 +++++++++------
.../static/schemas/sparo-profile.schema.json | 17 +++++++----------
4 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/apps/sparo-lib/assets/sparo-profile.json b/apps/sparo-lib/assets/sparo-profile.json
index 11ba267..e4a3f3c 100644
--- a/apps/sparo-lib/assets/sparo-profile.json
+++ b/apps/sparo-lib/assets/sparo-profile.json
@@ -1,3 +1,7 @@
+/**
+ * OWNER:
+ * PURPOSE:
+ */
{
"$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": [
diff --git a/apps/sparo-lib/src/schemas/sparo-profile.schema.json b/apps/sparo-lib/src/schemas/sparo-profile.schema.json
index b4072f1..3ee3a34 100644
--- a/apps/sparo-lib/src/schemas/sparo-profile.schema.json
+++ b/apps/sparo-lib/src/schemas/sparo-profile.schema.json
@@ -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"
}
}
diff --git a/apps/website/docs/pages/configs/profile_json.md b/apps/website/docs/pages/configs/profile_json.md
index 6e67835..076ff79 100644
--- a/apps/website/docs/pages/configs/profile_json.md
+++ b/apps/website/docs/pages/configs/profile_json.md
@@ -6,6 +6,10 @@ To initialize a new Sparo profile, you can copy and paste the contents of this t
**common/sparo-profiles/<profile-name>.json**
```js
+/**
+ * OWNER:
+ * PURPOSE:
+ */
{
"$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": [
diff --git a/apps/website/static/schemas/sparo-profile.schema.json b/apps/website/static/schemas/sparo-profile.schema.json
index b4072f1..3ee3a34 100644
--- a/apps/website/static/schemas/sparo-profile.schema.json
+++ b/apps/website/static/schemas/sparo-profile.schema.json
@@ -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"
}
}
From 8a4bafd63821a0212277e9c8c90b289a05e9131c Mon Sep 17 00:00:00 2001
From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com>
Date: Mon, 4 Mar 2024 22:29:44 -0800
Subject: [PATCH 5/5] rush change
---
.../octogonz-website-fixes2_2024-03-05-06-29.json | 10 ++++++++++
1 file changed, 10 insertions(+)
create mode 100644 common/changes/sparo/octogonz-website-fixes2_2024-03-05-06-29.json
diff --git a/common/changes/sparo/octogonz-website-fixes2_2024-03-05-06-29.json b/common/changes/sparo/octogonz-website-fixes2_2024-03-05-06-29.json
new file mode 100644
index 0000000..d2e21ef
--- /dev/null
+++ b/common/changes/sparo/octogonz-website-fixes2_2024-03-05-06-29.json
@@ -0,0 +1,10 @@
+{
+ "changes": [
+ {
+ "packageName": "sparo",
+ "comment": "Improve the \"sparo init-profile\" template comments",
+ "type": "none"
+ }
+ ],
+ "packageName": "sparo"
+}
\ No newline at end of file