tiktok-sparo/assets/js/c377a04b.1ddb53a9.js
2024-03-01 00:59:14 -08:00

1 line
No EOL
8 KiB
JavaScript

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