"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[742],{8228:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>c,contentTitle:()=>t,default:()=>h,frontMatter:()=>o,metadata:()=>l,toc:()=>a});var s=r(678),i=r(6655);const o={title:"Overview",hide_title:!0,custom_edit_url:null},t=void 0,l={id:"index",title:"Overview",description:"Clone faster!",source:"@site/docs/index.md",sourceDirName:".",slug:"/",permalink:"/sparo/",draft:!1,unlisted:!1,editUrl:null,tags:[],version:"current",frontMatter:{title:"Overview",hide_title:!0,custom_edit_url:null},sidebar:"docsSidebar",next:{title:"Getting Started",permalink:"/sparo/pages/guide/getting_started"}},c={},a=[{value:"Clone faster!",id:"clone-faster",level:2},{value:"Key features",id:"key-features",level:2},{value:"Quick demo",id:"quick-demo",level:2}];function d(e){const n={a:"a",blockquote:"blockquote",code:"code",em:"em",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,s.jsx)("img",{src:"images/site/sparo-logo.svg",alt:"Sparo",title:"Sparo",style:{width:"380px",paddingTop:"30px"}})}),"\n",(0,s.jsx)(n.h2,{id:"clone-faster",children:"Clone faster!"}),"\n",(0,s.jsx)(n.p,{children:"Sparo optimizes performance of Git operations for your large frontend monorepo."}),"\n",(0,s.jsx)(n.h2,{id:"key-features",children:"Key features"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Familiar interface:"})," The ",(0,s.jsx)(n.code,{children:"sparo"})," command-line interface (CLI) wrapper offers ",(0,s.jsx)(n.strong,{children:"better defaults"})," and ",(0,s.jsx)(n.strong,{children:"performance suggestions"})," without altering the familiar ",(0,s.jsx)(n.code,{children:"git"})," syntax. (The native ",(0,s.jsx)(n.code,{children:"git"})," CLI is also supported.)"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"A proven solution:"})," Git provides ",(0,s.jsx)(n.a,{href:"/sparo/pages/reference/git_optimization",children:"quite a lot of ingredients"})," for optimizing very large repos; Sparo is your recipe for combining these features intelligently."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Simplified sparse checkout:"})," Work with sparse checkout ",(0,s.jsx)(n.a,{href:"/sparo/pages/guide/sparo_profiles",children:"profiles"}),' instead of confusing "cones" and globs']}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Frontend integration:"})," Sparo leverages ",(0,s.jsx)(n.a,{href:"https://rushjs.io/",children:"Rush"})," and ",(0,s.jsx)(n.a,{href:"https://pnpm.io/",children:"PNPM"})," workspace configurations, including the ability to automatically checkout project dependencies"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Dual workflows:"})," The ",(0,s.jsx)(n.code,{children:"sparo-ci"})," tool implements a specialized checkout model optimized for continuous integration (CI) pipelines"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Extra safeguards"}),": Avoid common Git mistakes such as checkouts with staged files outside the active view"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Go beyond Git hooks:"})," Optionally collect anonymized Git timing metrics in your monorepo, enabling your build team to set data-driven goals for ",(0,s.jsx)(n.em,{children:"local"})," developer experience (not just CI!)"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.em,{children:"(Metrics are transmitted to your own service and are not accessible by any other party.)"})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"quick-demo",children:"Quick demo"}),"\n",(0,s.jsx)(n.p,{children:"Try out Sparo in 5 easy steps:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Ensure you are using the latest Git version. For macOS, we recommend to use ",(0,s.jsx)(n.a,{href:"https://git-scm.com/download/mac",children:"brew install git"}),". For other operating systems, see the ",(0,s.jsx)(n.a,{href:"https://git-scm.com/book/en/v2/Getting-Started-Installing-Git",children:"Git documentation"})," for instructions."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Clone your ",(0,s.jsx)(n.a,{href:"https://rushjs.io/",children:"RushJS"})," monorepo:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-shell",children:"sparo clone https://github.com/my-company/my-monorepo.git\n"})}),"\n",(0,s.jsxs)(n.p,{children:["\ud83d\udc49 ",(0,s.jsx)(n.em,{children:"For a real world demo, try this repo:"}),"\r\n",(0,s.jsx)(n.a,{href:"https://github.com/Azure/azure-sdk-for-js.git",children:"https://github.com/Azure/azure-sdk-for-js.git"})]}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:"\ud83d\udca1 Support for PNPM and Yarn workspaces is planned but not implemented yet. Contributions welcome!"}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Define a ",(0,s.jsx)(n.a,{href:"/sparo/pages/configs/profile_json",children:"Sparo profile"})," describing the subset of repository folders for Git sparse checkout. Here is a basic example:"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"common/sparo-profiles/my-team.json"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'{\r\n "selections": [\r\n {\r\n "selector": "--to",\r\n "argument": "my-rush-project"\r\n }\r\n ]\r\n}\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"--to"})," ",(0,s.jsx)(n.a,{href:"https://rushjs.io/pages/developer/selecting_subsets/#--to",children:"project selector"})," instructs Sparo to checkout all dependencies in the workspace that are required to build ",(0,s.jsx)(n.code,{children:"my-rush-project"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["\ud83d\udc49 ",(0,s.jsxs)(n.em,{children:["If you're demoing ",(0,s.jsx)(n.strong,{children:"azure-sdk-for-js"}),", replace ",(0,s.jsx)(n.code,{children:"my-rush-project"})," with ",(0,s.jsx)(n.code,{children:"@azure/arm-commerce"}),"."]})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Check out your Sparo profile:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-shell",children:"sparo checkout --profile my-team\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["For everyday work, consider choosing ",(0,s.jsx)(n.a,{href:"/sparo/pages/commands/overview",children:"mirrored subcommands"})," such as ",(0,s.jsx)(n.code,{children:"sparo revert"})," instead of ",(0,s.jsx)(n.code,{children:"git revert"}),". The Sparo wrapper provides (1) better defaults, (2) suggestions for better performance, and (3) optional anonymized performance metrics."]}),"\n",(0,s.jsx)(n.p,{children:"Examples:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-shell",children:'sparo pull\r\n\r\nsparo commit -m "Example command"\n'})}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},6655:(e,n,r)=>{r.d(n,{R:()=>t,x:()=>l});var s=r(6166);const i={},o=s.createContext(i);function t(e){const n=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:t(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]);