tiktok-sparo/assets/js/45779d82.8ccdbcbd.js

1 line
10 KiB
JavaScript
Raw Normal View History

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[421],{9917:(e,s,r)=>{r.r(s),r.d(s,{assets:()=>l,contentTitle:()=>i,default:()=>p,frontMatter:()=>t,metadata:()=>c,toc:()=>a});var o=r(678),n=r(4738);const t={title:"Getting started"},i=void 0,c={id:"pages/guide/getting_started",title:"Getting started",description:"In this tutorial we'll revisit the Quick Demo steps, but this time examining the Sparo workflow in more detail.",source:"@site/docs/pages/guide/getting_started.md",sourceDirName:"pages/guide",slug:"/pages/guide/getting_started",permalink:"/sparo/pages/guide/getting_started",draft:!1,unlisted:!1,editUrl:"https://github.com/tiktok/sparo/tree/main/apps/website/docs/pages/guide/getting_started.md",tags:[],version:"current",frontMatter:{title:"Getting started"},sidebar:"docsSidebar",previous:{title:"Overview",permalink:"/sparo/"},next:{title:"Sparo profiles",permalink:"/sparo/pages/guide/sparo_profiles"}},l={},a=[{value:"Step 1: Upgrade Git",id:"step-1-upgrade-git",level:2},{value:"Step 2: Clone your Rush monorepo",id:"step-2-clone-your-rush-monorepo",level:2},{value:"Step 3: Create a sparse profile",id:"step-3-create-a-sparse-profile",level:2},{value:"Step 4: Check out your Sparo profile",id:"step-4-check-out-your-sparo-profile",level:2},{value:"Step 5: Use the mirrored subcommands",id:"step-5-use-the-mirrored-subcommands",level:2}];function d(e){const s={a:"a",blockquote:"blockquote",code:"code",em:"em",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,n.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(s.p,{children:["In this tutorial we'll revisit the ",(0,o.jsx)(s.a,{href:"/sparo/#quick-demo",children:"Quick Demo"})," steps, but this time examining the Sparo workflow in more detail."]}),"\n",(0,o.jsx)(s.h2,{id:"step-1-upgrade-git",children:"Step 1: Upgrade Git"}),"\n",(0,o.jsx)(s.p,{children:"Remember to upgrade to the latest Git version! Many Git optimizations are relatively new and not available in older versions of the software."}),"\n",(0,o.jsxs)(s.p,{children:["For macOS, we recommend to use ",(0,o.jsx)(s.a,{href:"https://git-scm.com/download/mac",children:"brew install git"}),". For other operating systems, see the ",(0,o.jsx)(s.a,{href:"https://git-scm.com/book/en/v2/Getting-Started-Installing-Git",children:"Git documentation"})," for instructions."]}),"\n",(0,o.jsx)(s.h2,{id:"step-2-clone-your-rush-monorepo",children:"Step 2: Clone your Rush monorepo"}),"\n",(0,o.jsxs)(s.p,{children:["Clone your ",(0,o.jsx)(s.a,{href:"https://rushjs.io/",children:"RushJS"})," monorepo:"]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-shell",children:"sparo clone https://github.com/my-company/my-monorepo.git\r\n\r\ncd my-monorepo\n"})}),"\n",(0,o.jsxs)(s.p,{children:["\ud83d\udc49 ",(0,o.jsx)(s.em,{children:"For a real world demo, try cloning this repo:"}),"\r\n",(0,o.jsx)(s.a,{href:"https://github.com/Azure/azure-sdk-for-js.git",children:"https://github.com/Azure/azure-sdk-for-js.git"})]}),"\n",(0,o.jsx)(s.p,{children:(0,o.jsx)(s.strong,{children:'How "sparo clone" optimizes:'})}),"\n",(0,o.jsxs)(s.ul,{children:["\n",(0,o.jsxs)(s.li,{children:["\n",(0,o.jsxs)(s.p,{children:["Only the default branch is fetched (typically the ",(0,o.jsx)(s.code,{children:"main"})," branch). This significantly reduces the download size."]}),"\n"]}),"\n",(0,o.jsxs)(s.li,{children:["\n",(0,o.jsxs)(s.p,{children:["Git blobless ",(0,o.jsx)(s.a,{href:"/sparo/pages/reference/git_optimization",children:"partial clone"})," is enabled to postpone downloading file contents."]}),"\n"]}),"\n",(0,o.jsxs)(s.li,{children:["\n",(0,o.jsxs)(s.p,{children:["Git ",(0,o.jsx)(s.a,{href:"https://git-scm.com/docs/git-sparse-checkout",children:"sparse checkout"})," is used to clone only the ",(0,o.jsx)(s.a,{href:"/sparo/pages/reference/skeleton_folders",children:'"skeleton" folders'}),", which includes all workspace ",(0,o.jsx)(s.strong,{children:"package.json"})," files, but excludes the source code subfolders."]}),"\n"]}),"\n",(0,o.jsxs)(s.li,{children:["\n",(0,o.jsxs)(s.p,{chi