mirror of
https://github.com/tiktok/sparo.git
synced 2024-11-23 15:48:16 -05:00
74 lines
No EOL
32 KiB
HTML
74 lines
No EOL
32 KiB
HTML
<!doctype html>
|
||
<html lang="en" dir="ltr" class="docs-wrapper plugin-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-index" data-has-hydrated="false">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="generator" content="Docusaurus v3.1.1">
|
||
<title data-rh="true">Overview | Sparo</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://tiktok.github.io/sparo/images/site/sparo-ograph.png"><meta data-rh="true" name="twitter:image" content="https://tiktok.github.io/sparo/images/site/sparo-ograph.png"><meta data-rh="true" property="og:url" content="https://tiktok.github.io/sparo/"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" property="og:locale:alternate" content="zh_cn"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Overview | Sparo"><meta data-rh="true" name="description" content="<ThemedImage"><meta data-rh="true" property="og:description" content="<ThemedImage"><link data-rh="true" rel="icon" href="/sparo/images/site/sparo-favicon.ico"><link data-rh="true" rel="canonical" href="https://tiktok.github.io/sparo/"><link data-rh="true" rel="alternate" href="https://tiktok.github.io/sparo/" hreflang="en"><link data-rh="true" rel="alternate" href="https://tiktok.github.io/sparo/zh-cn/" hreflang="zh-cn"><link data-rh="true" rel="alternate" href="https://tiktok.github.io/sparo/" hreflang="x-default"><script data-rh="true">function insertBanner(){var n=document.createElement("div");n.id="__docusaurus-base-url-issue-banner-container";n.innerHTML='\n<div id="__docusaurus-base-url-issue-banner" style="border: thick solid red; background-color: rgb(255, 230, 179); margin: 20px; padding: 20px; font-size: 20px;">\n <p style="font-weight: bold; font-size: 30px;">Your Docusaurus site did not load properly.</p>\n <p>A very common reason is a wrong site <a href="https://docusaurus.io/docs/docusaurus.config.js/#baseUrl" style="font-weight: bold;">baseUrl configuration</a>.</p>\n <p>Current configured baseUrl = <span style="font-weight: bold; color: red;">/sparo/</span> </p>\n <p>We suggest trying baseUrl = <span id="__docusaurus-base-url-issue-banner-suggestion-container" style="font-weight: bold; color: green;"></span></p>\n</div>\n',document.body.prepend(n);var e=document.getElementById("__docusaurus-base-url-issue-banner-suggestion-container"),s=window.location.pathname,o="/"===s.substr(-1)?s:s+"/";e.innerHTML=o}document.addEventListener("DOMContentLoaded",(function(){void 0===window.docusaurus&&insertBanner()}))</script><link rel="stylesheet" href="/sparo/assets/css/styles.391b5f94.css">
|
||
<script src="/sparo/assets/js/runtime~main.c5672b47.js" defer="defer"></script>
|
||
<script src="/sparo/assets/js/main.798c8c50.js" defer="defer"></script>
|
||
</head>
|
||
<body class="navigation-with-keyboard">
|
||
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const c=new URLSearchParams(window.location.search).entries();for(var[t,e]of c)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_LamT" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/sparo/"><div class="navbar__logo"><img src="/sparo/images/site/sparo-title.svg" alt="Sparo" class="themedComponent_tC9f themedComponent--light_jvOP"><img src="/sparo/images/site/sparo-title-dark.svg" alt="Sparo" class="themedComponent_tC9f themedComponent--dark_id3o"></div><b class="navbar__title text--truncate"></b></a><div class="navbar__item dropdown dropdown--hoverable"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link"><svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" class="iconLanguage_STns"><path fill="currentColor" d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path></svg>English</a><ul class="dropdown__menu"><li><a href="/sparo/" target="_self" rel="noopener noreferrer" class="dropdown__link dropdown__link--active" lang="en">English</a></li><li><a href="/sparo/zh-cn/" target="_self" rel="noopener noreferrer" class="dropdown__link" lang="zh-cn">中文(中国)</a></li></ul></div></div><div class="navbar__items navbar__items--right"><a class="navbar__item navbar__link" href="/sparo/pages/guide/getting_started/">Docs</a><a href="https://github.com/tiktok/sparo" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_AFhm"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><a class="navbar__item navbar__link" href="/sparo/pages/support/news/">News</a><a class="navbar__item navbar__link" href="/sparo/pages/support/help/">Help</a><div class="toggle_dsLe colorModeToggle_c7_9"><button class="clean-btn toggleButton_q0G2 toggleButtonDisabled_vKJd" type="button" disabled="" title="Switch between dark and light mode (currently light mode)" aria-label="Switch between dark and light mode (currently light mode)" aria-live="polite"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_ZA7w"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_BTHv"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="navbarSearchContainer_k7BV"><div class="navbar__search"><span aria-label="expand searchbar" role="button" class="search-icon" tabindex="0"></span><input id="search_input_react" type="search" placeholder="Loading..." aria-label="Search" class="navbar__search-input search-bar" disabled=""></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper__eEv"><div class="docsWrapper_yhQ2"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_nWl5" type="button"></button><div class="docRoot_uN8L"><aside class="theme-doc-sidebar-container docSidebarContainer_m9ih"><div class="sidebarViewport_lQsM"><div class="sidebar_u_rd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_tEKE"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--active">Introduction</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/sparo/">Overview</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/guide/getting_started/">Getting started</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/guide/sparo_profiles/">Sparo profiles</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link">Reference</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/reference/git_optimization/">Git optimization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/reference/skeleton_folders/">Skeleton folders</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/reference/security/">Security</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link">Config files</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/configs/profile_json/"><profile-name>.json</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link">Commands</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/commands/overview/">Overview</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/commands/sparo_auto-config/">sparo auto-config</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/commands/sparo_checkout/">sparo checkout</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/commands/sparo_clone/">sparo clone</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/commands/sparo_fetch/">sparo fetch</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/commands/sparo_pull/">sparo pull</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/commands/sparo_git-checkout/">sparo git-checkout</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/commands/sparo_git-clone/">sparo git-clone</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/commands/sparo_git-fetch/">sparo git-fetch</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/commands/sparo_git-pull/">sparo git-pull</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/commands/sparo_init-profile/">sparo init-profile</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/commands/sparo_list-profiles/">sparo list-profiles</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link">CI Commands</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/ci_commands/overview/">Overview</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/ci_commands/sparo-ci_checkout/">sparo-ci checkout</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/ci_commands/sparo-ci_clone/">sparo-ci clone</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link">Support</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/support/help/">Getting help</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/support/news/">What's new</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sparo/pages/support/contributing/">Contributing</a></li></ul></li></ul></nav></div></div></aside><main class="docMainContainer_rbFp"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_hig1"><div class="docItemContainer_BjA9"><article><div class="tocCollapsible_uNMm theme-doc-toc-mobile tocMobile_R8tC"><button type="button" class="clean-btn tocCollapsibleButton_IgjO">On this page</button></div><div class="theme-doc-markdown markdown"><div style="display:flex;justify-content:center;align-items:center"><div style="display:flex;justify-content:center;align-items:center"><img src="images/site/sparo-logo.svg" alt="Sparo" title="Sparo" style="width:380px;padding-top:30px"></div></div>
|
||
<h2 class="anchor anchorWithStickyNavbar_tnRO" id="clone-faster">Clone faster!<a href="#clone-faster" class="hash-link" aria-label="Direct link to Clone faster!" title="Direct link to Clone faster!"></a></h2>
|
||
<p>Sparo optimizes performance of Git operations for your large frontend monorepo.</p>
|
||
<h2 class="anchor anchorWithStickyNavbar_tnRO" id="key-features">Key features<a href="#key-features" class="hash-link" aria-label="Direct link to Key features" title="Direct link to Key features"></a></h2>
|
||
<ul>
|
||
<li>
|
||
<p><strong>Familiar interface:</strong> The <code>sparo</code> command-line interface (CLI) wrapper offers <strong>better defaults</strong> and <strong>performance suggestions</strong> without altering the familiar <code>git</code> syntax. (The native <code>git</code> CLI is also supported.)</p>
|
||
</li>
|
||
<li>
|
||
<p><strong>A proven solution:</strong> Git provides <a href="https://tiktok.github.io/sparo/pages/reference/git_optimization/" target="_blank" rel="noopener noreferrer">quite a lot of ingredients</a> for optimizing very large repos; Sparo is your recipe for combining these features intelligently.</p>
|
||
</li>
|
||
<li>
|
||
<p><strong>Simplified sparse checkout:</strong> Work with sparse checkout <a href="https://tiktok.github.io/sparo/pages/guide/sparo_profiles/" target="_blank" rel="noopener noreferrer">profiles</a> instead of confusing "cones" and globs</p>
|
||
</li>
|
||
<li>
|
||
<p><strong>Frontend integration:</strong> Sparo leverages <a href="https://rushjs.io/" target="_blank" rel="noopener noreferrer">Rush</a> and <a href="https://pnpm.io/" target="_blank" rel="noopener noreferrer">PNPM</a> workspace configurations, including the ability to automatically checkout project dependencies</p>
|
||
</li>
|
||
<li>
|
||
<p><strong>Dual workflows:</strong> The <code>sparo-ci</code> tool implements a specialized checkout model optimized for continuous integration (CI) pipelines</p>
|
||
</li>
|
||
<li>
|
||
<p><strong>Extra safeguards</strong>: Avoid common Git mistakes such as checkouts with staged files outside the active view</p>
|
||
</li>
|
||
<li>
|
||
<p><strong>Go beyond Git hooks:</strong> Optionally collect anonymized Git timing metrics in your monorepo, enabling your build team to set data-driven goals for <em>local</em> developer experience (not just CI!)</p>
|
||
<p><em>(Metrics are transmitted to your own service and are not accessible by any other party.)</em></p>
|
||
</li>
|
||
</ul>
|
||
<h2 class="anchor anchorWithStickyNavbar_tnRO" id="quick-demo">Quick demo<a href="#quick-demo" class="hash-link" aria-label="Direct link to Quick demo" title="Direct link to Quick demo"></a></h2>
|
||
<p>Try out Sparo in 5 easy steps:</p>
|
||
<ol>
|
||
<li>
|
||
<p><em><strong>Upgrade to the latest Git version!</strong></em> For macOS, we recommend to use <a href="https://git-scm.com/download/mac" target="_blank" rel="noopener noreferrer">brew install git</a>. For other operating systems, see the <a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git" target="_blank" rel="noopener noreferrer">Git documentation</a> for instructions.</p>
|
||
</li>
|
||
<li>
|
||
<p>For this demo, we'll use the Azure SDK which is a large public <a href="https://rushjs.io/" target="_blank" rel="noopener noreferrer">RushJS</a> monorepo from GitHub. The following command will check out the <a href="/sparo/pages/reference/skeleton_folders/">skeleton folders</a> but not the source code:</p>
|
||
<div class="language-shell codeBlockContainer_nK63 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_BFef"><pre tabindex="0" class="prism-code language-shell codeBlock_BUQB thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_dbG7"><span class="token-line" style="color:#393A34"><span class="token plain">sparo clone https://github.com/Azure/azure-sdk-for-js.git</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token builtin class-name">cd</span><span class="token plain"> azure-sdk-for-js</span><br></span></code></pre><div class="buttonGroup_z3hN"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_p991" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_DQfU"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_Yj5J"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<blockquote>
|
||
<p>💡 Support for PNPM and Yarn workspaces is planned but not implemented yet. Contributions welcome!</p>
|
||
</blockquote>
|
||
</li>
|
||
<li>
|
||
<p>Define a <a href="/sparo/pages/configs/profile_json/">Sparo profile</a> describing the subset of repository folders for Git sparse checkout.</p>
|
||
<div class="language-shell codeBlockContainer_nK63 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_BFef"><pre tabindex="0" class="prism-code language-shell codeBlock_BUQB thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_dbG7"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># Writes a template to common/sparo-profiles/my-team.json</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">sparo init-profile </span><span class="token parameter variable" style="color:#36acaa">--profile</span><span class="token plain"> my-team</span><br></span></code></pre><div class="buttonGroup_z3hN"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_p991" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_DQfU"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_Yj5J"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>Edit the created <strong>my-team.json</strong> file to add this selector:</p>
|
||
<p><strong>common/sparo-profiles/my-team.json</strong></p>
|
||
<div class="language-json codeBlockContainer_nK63 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_BFef"><pre tabindex="0" class="prism-code language-json codeBlock_BUQB thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_dbG7"><span class="token-line" style="color:#393A34"><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token property" style="color:#36acaa">"selections"</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token comment" style="color:#999988;font-style:italic">// This demo profile will check out the "@azure/arm-commerce" project</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token comment" style="color:#999988;font-style:italic">// and all of its dependencies:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token property" style="color:#36acaa">"selector"</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"--to"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token property" style="color:#36acaa">"argument"</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"@azure/arm-commerce"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><br></span></code></pre><div class="buttonGroup_z3hN"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_p991" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_DQfU"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_Yj5J"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>The <code>--to</code> <a href="https://rushjs.io/pages/developer/selecting_subsets/#--to" target="_blank" rel="noopener noreferrer">project selector</a> instructs Sparo to checkout all dependencies in the workspace that are required to build <code>my-rush-project</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>After saving your changes to <strong>my-team.json</strong>, now it's time to apply it:</p>
|
||
<div class="language-shell codeBlockContainer_nK63 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_BFef"><pre tabindex="0" class="prism-code language-shell codeBlock_BUQB thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_dbG7"><span class="token-line" style="color:#393A34"><span class="token plain">sparo checkout </span><span class="token parameter variable" style="color:#36acaa">--profile</span><span class="token plain"> my-team</span><br></span></code></pre><div class="buttonGroup_z3hN"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_p991" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_DQfU"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_Yj5J"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>Try it out! For example:</p>
|
||
<div class="language-shell codeBlockContainer_nK63 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_BFef"><pre tabindex="0" class="prism-code language-shell codeBlock_BUQB thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_dbG7"><span class="token-line" style="color:#393A34"><span class="token plain">rush </span><span class="token function" style="color:#d73a49">install</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># The build should succeed because Sparo ensured that dependency projects</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># were included in the sparse checkout:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">rush build </span><span class="token parameter variable" style="color:#36acaa">--to</span><span class="token plain"> @azure/arm-commerce</span><br></span></code></pre><div class="buttonGroup_z3hN"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_p991" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_DQfU"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_Yj5J"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>For everyday work, consider choosing <a href="/sparo/pages/commands/overview/">mirrored subcommands</a> such as <code>sparo revert</code> instead of <code>git revert</code>. The Sparo wrapper provides (1) better defaults, (2) suggestions for better performance, and (3) optional anonymized performance metrics.</p>
|
||
<p>Examples:</p>
|
||
<div class="language-shell codeBlockContainer_nK63 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_BFef"><pre tabindex="0" class="prism-code language-shell codeBlock_BUQB thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_dbG7"><span class="token-line" style="color:#393A34"><span class="token plain">sparo pull</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">sparo commit </span><span class="token parameter variable" style="color:#36acaa">-m</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"Example command"</span><br></span></code></pre><div class="buttonGroup_z3hN"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_p991" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_DQfU"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_Yj5J"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
</ol>
|
||
<p>👍👍 This concludes the <strong>Quick Demo.</strong> For a more detailed walkthrough, proceed to <a href="/sparo/pages/guide/getting_started/">Getting Started</a>.</p></div></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--next" href="/sparo/pages/guide/getting_started/"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Getting started</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_lG5c thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#clone-faster" class="table-of-contents__link toc-highlight">Clone faster!</a></li><li><a href="#key-features" class="table-of-contents__link toc-highlight">Key features</a></li><li><a href="#quick-demo" class="table-of-contents__link toc-highlight">Quick demo</a></li></ul></div></div></div></div></main></div></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2024 TikTok Pte. Ltd.</div></div></div></footer></div>
|
||
</body>
|
||
</html> |