"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[578],{3420:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>t,default:()=>p,frontMatter:()=>o,metadata:()=>i,toc:()=>d});var r=s(678),c=s(4738);const o={title:"\u9aa8\u67b6\u6587\u4ef6\u5939"},t=void 0,i={id:"pages/reference/skeleton_folders",title:"\u9aa8\u67b6\u6587\u4ef6\u5939",description:'\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0csparo clone \u4f1a\u521d\u59cb\u5316\u4e00\u4e2a\u7a00\u758f\u68c0\u51fa\uff0c\u4e0d\u5305\u542b\u4efb\u4f55 Sparo \u914d\u7f6e\u6587\u4ef6\u9009\u62e9\uff0c\u4f46\u4f1a\u5305\u542b\u5305\u542b\u57fa\u672c\u914d\u7f6e\u6587\u4ef6\u7684\u6587\u4ef6\u5939\uff0c\u5982 package-lock.yaml \u548c package.json\u3002\u6211\u4eec\u5c06\u8fd9\u4e2a\u8d77\u70b9\u79f0\u4e3a\u68c0\u51fa\u7684 "\u9aa8\u67b6"\uff0c\u56e0\u4e3a\u5b83\u663e\u793a\u4e86 monorepo \u4e2d\u6240\u6709\u9879\u76ee\u6587\u4ef6\u5939\u7684\u5b8c\u6574\u6811\u7ed3\u6784\uff0c\u4f46\u6ca1\u6709\u5b83\u4eec\u7684\u6e90\u4ee3\u7801\u5b50\u6587\u4ef6\u5939\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5c3d\u7ba1\u6bcf\u4e2a\u9879\u76ee\u7684\u6e90\u6587\u4ef6\u88ab\u6392\u9664\u5728\u5916\uff0c\u4f46\u9aa8\u67b6\u4ecd\u7136\u5141\u8bb8\u5de5\u7a0b\u5e08\u4e86\u89e3\u5176\u4ed6\u56e2\u961f\u7684\u9879\u76ee\uff0c\u4ee5\u53ca\u4ed6\u4eec\u81ea\u5df1\u7684\u9879\u76ee\u4e0e\u8fd9\u4e9b\u5176\u4ed6\u9879\u76ee\u7684\u5173\u7cfb\u3002\u8fd9\u6709\u52a9\u4e8e\u907f\u514d\u201c\u96a7\u9053\u89c6\u91ce\u201d\uff08\u5de5\u7a0b\u5e08\u5047\u88c5\u4ed6\u4eec\u7684\u9879\u76ee\u662f\u4ed3\u5e93\u4e2d\u552f\u4e00\u7684\u9879\u76ee\uff09\uff0c\u540c\u65f6\u4ecd\u7136\u786e\u4fdd Git \u7684\u9ad8\u6548\u6027\u80fd\u3002',source:"@site/i18n/zh-cn/docusaurus-plugin-content-docs/current/pages/reference/skeleton_folders.md",sourceDirName:"pages/reference",slug:"/pages/reference/skeleton_folders",permalink:"/sparo/zh-cn/pages/reference/skeleton_folders",draft:!1,unlisted:!1,editUrl:"https://github.com/tiktok/sparo/tree/main/apps/website/docs/pages/reference/skeleton_folders.md",tags:[],version:"current",frontMatter:{title:"\u9aa8\u67b6\u6587\u4ef6\u5939"},sidebar:"docsSidebar",previous:{title:"Git \u4f18\u5316",permalink:"/sparo/zh-cn/pages/reference/git_optimization"},next:{title:"\u5b89\u5168\u6027",permalink:"/sparo/zh-cn/pages/reference/security"}},l={},d=[{value:"\u9aa8\u67b6\u89c4\u8303",id:"\u9aa8\u67b6\u89c4\u8303",level:2},{value:"\u5d4c\u5957\u9879\u76ee\u7684\u5904\u7406",id:"\u5d4c\u5957\u9879\u76ee\u7684\u5904\u7406",level:2}];function a(e){const n={code:"code",h2:"h2",li:"li",p:"p",strong:"strong",ul:"ul",...(0,c.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",(0,r.jsx)(n.code,{children:"sparo clone"})," \u4f1a\u521d\u59cb\u5316\u4e00\u4e2a\u7a00\u758f\u68c0\u51fa\uff0c\u4e0d\u5305\u542b\u4efb\u4f55 Sparo \u914d\u7f6e\u6587\u4ef6\u9009\u62e9\uff0c\u4f46\u4f1a\u5305\u542b\u5305\u542b\u57fa\u672c\u914d\u7f6e\u6587\u4ef6\u7684\u6587\u4ef6\u5939\uff0c\u5982 ",(0,r.jsx)(n.strong,{children:"package-lock.yaml"})," \u548c ",(0,r.jsx)(n.strong,{children:"package.json"}),"\u3002\u6211\u4eec\u5c06\u8fd9\u4e2a\u8d77\u70b9\u79f0\u4e3a\u68c0\u51fa\u7684 ",(0,r.jsx)(n.strong,{children:'"\u9aa8\u67b6"'}),"\uff0c\u56e0\u4e3a\u5b83\u663e\u793a\u4e86 monorepo \u4e2d\u6240\u6709\u9879\u76ee\u6587\u4ef6\u5939\u7684\u5b8c\u6574\u6811\u7ed3\u6784\uff0c\u4f46\u6ca1\u6709\u5b83\u4eec\u7684\u6e90\u4ee3\u7801\u5b50\u6587\u4ef6\u5939\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5c3d\u7ba1\u6bcf\u4e2a\u9879\u76ee\u7684\u6e90\u6587\u4ef6\u88ab\u6392\u9664\u5728\u5916\uff0c\u4f46\u9aa8\u67b6\u4ecd\u7136\u5141\u8bb8\u5de5\u7a0b\u5e08\u4e86\u89e3\u5176\u4ed6\u56e2\u961f\u7684\u9879\u76ee\uff0c\u4ee5\u53ca\u4ed6\u4eec\u81ea\u5df1\u7684\u9879\u76ee\u4e0e\u8fd9\u4e9b\u5176\u4ed6\u9879\u76ee\u7684\u5173\u7cfb\u3002\u8fd9\u6709\u52a9\u4e8e\u907f\u514d\u201c\u96a7\u9053\u89c6\u91ce\u201d\uff08\u5de5\u7a0b\u5e08\u5047\u88c5\u4ed6\u4eec\u7684\u9879\u76ee\u662f\u4ed3\u5e93\u4e2d\u552f\u4e00\u7684\u9879\u76ee\uff09\uff0c\u540c\u65f6\u4ecd\u7136\u786e\u4fdd Git \u7684\u9ad8\u6548\u6027\u80fd\u3002"]}),"\n",(0,r.jsx)(n.p,{children:"\u7531\u4e8e Sparo \u542f\u7528\u4e86 Git \u7a00\u758f\u68c0\u51fa\u7684\u201c\u9525\u5f62\u6a21\u5f0f\u201d\u4f18\u5316\uff0c\u9aa8\u67b6\u4f7f\u7528 glob \u6a21\u5f0f\u6765\u5339\u914d\u6574\u4e2a\u6587\u4ef6\u5939\uff0c\u800c\u4e0d\u662f\u5355\u4e2a\u6587\u4ef6\u3002"}),"\n",(0,r.jsx)(n.h2,{id:"\u9aa8\u67b6\u89c4\u8303",children:"\u9aa8\u67b6\u89c4\u8303"}),"\n",(0,r.jsx)(n.p,{children:"\u5305\u542b\u7684\u6587\u4ef6\u5939\u5982\u4e0b\uff1a"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\u6574\u4e2a ",(0,r.jsx)(n.code,{children:"common/**"})," \u6587\u4ef6\u5939\uff0c\u901a\u5e38\u5305\u62ec\u6240\u6709\u91cd\u8981\u7684\u914d\u7f6e\u6587\u4ef6\u548c Rush \u64cd\u4f5c\u7684\u81ea\u52a8\u5b89\u88c5\u7a0b\u5e8f\u3002"]}),"\n",(0,r.jsxs)(n.li,{children:["\u5bf9\u4e8e ",(0,r.jsx)(n.strong,{children:"rush.json"})," \u4e2d\u5b9a\u4e49\u7684\u6bcf\u4e2a\u9879\u76ee\uff0c\u9876\u7ea7\u9879\u76ee\u6587\u4ef6\u5939\u7684\u5185\u5bb9\u3002\u4f8b\u5982\uff0c",(0,r.jsx)(n.strong,{children:"packages/my-app/package.json"})," \u548c ",(0,r.jsx)(n.strong,{children:"packages/my-app/README.md"})," \u5c06\u88ab\u5305\u542b\uff0c\u4f46 ",(0,r.jsx)(n.strong,{children:"packages/my-app/src/index.ts"})," \u4e0d\u4f1a\u88ab\u5305\u542b\u3002"]}),"\n",(0,r.jsxs)(n.li,{children:["\u9876\u7ea7\u6587\u4ef6\u5939 ",(0,r.jsx)(n.code,{children:"scripts/**"})," \u548c ",(0,r.jsx)(n.code,{children:"plugins/**"}),"\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u540d\u79f0\u901a\u5e38\u7528\u4e8e\u5176\u4ed6\u91cd\u8981\u9879\u76ee\u3002"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["\u5f53\u9009\u62e9\u4e86\u4e00\u4e2a Sparo \u914d\u7f6e\u6587\u4ef6\uff08\u4f8b\u5982\u4f7f\u7528 ",(0,r.jsx)(n.code,{children:"sparo checkout --profile my-team"}),"\uff09\u65f6\uff0c\u5b83\u5c06\u5f15\u5165\u6240\u9009\u5de5\u4f5c\u533a\u9879\u76ee\u4e0b\u7684\u6240\u6709\u6e90\u4ee3\u7801\u5b50\u6587\u4ef6\u5939\u3002"]}),"\n",(0,r.jsx)(n.h2,{id:"\u5d4c\u5957\u9879\u76ee\u7684\u5904\u7406",children:"\u5d4c\u5957\u9879\u76ee\u7684\u5904\u7406"}),"\n",(0,r.jsx)(n.p,{children:"\u5728\u53e6\u4e00\u4e2a\u5de5\u4f5c\u533a\u9879\u76ee\u4e0b\u5d4c\u5957\u4e00\u4e2a\u5de5\u4f5c\u533a\u9879\u76ee\u5e76\u4e0d\u662f\u6700\u4f73\u5b9e\u8df5\u3002\u4f8b\u5982\uff0c\u5e94\u907f\u514d\u4ee5\u4e0b\u6587\u4ef6\u5939\u7ec4\u7ec7\u65b9\u5f0f\uff1a"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.strong,{children:"packages/x/package.json"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.strong,{children:"packages/x/src/index.ts"})}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"packages/x/y/package.json"})," \uff08\u9879\u76ee ",(0,r.jsx)(n.code,{children:"y"})," \u5d4c\u5957\u5728\u9879\u76ee ",(0,r.jsx)(n.code,{children:"x"})," \u5185\u2014\u2014\u8bf7\u907f\u514d\u8fd9\u6837\u505a\uff09"]}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.strong,{children:"packages/x/y/src/index.ts"})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["\u7136\u800c\uff0cSparo \u53ef\u4ee5\u6b63\u786e\u652f\u6301\u8fd9\u79cd\u573a\u666f\u3002\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u62e9\u4e86 ",(0,r.jsx)(n.code,{children:"x"})," \u800c\u672a\u9009\u62e9 ",(0,r.jsx)(n.code,{children:"y"}),"\uff0c\u90a3\u4e48\u68c0\u51fa\u5c06\u5305\u542b ",(0,r.jsx)(n.strong,{children:"x/src/index.ts"}),"\uff0c\u4f46\u4e0d\u5305\u542b ",(0,r.jsx)(n.strong,{children:"x/y/src/index.ts"}),"\u3002"]})]})}function p(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},4738:(e,n,s)=>{s.d(n,{R:()=>t,x:()=>i});var r=s(6166);const c={},o=r.createContext(c);function t(e){const n=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:t(e.components),r.createElement(o.Provider,{value:n},e.children)}}}]);