import{n as e}from"./chunk-BneVvdWh.js";import{t}from"./jsx-runtime-C2wGStra.js";import{l as n,o as r}from"./iframe-D-oZzXNK.js";import{r as i}from"./react-B8jdHdWa.js";import{t as a}from"./mdx-react-shim-8vvjMMnP.js";function o(e){let t={a:`a`,code:`code`,h1:`h1`,h2:`h2`,h3:`h3`,li:`li`,p:`p`,pre:`pre`,strong:`strong`,ul:`ul`,...i(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r,{title:`Guides/Installation/Libraries`}),`
`,(0,c.jsx)(t.h1,{id:`installation-libraries`,children:`Installation: Libraries`}),`
`,(0,c.jsxs)(t.p,{children:[`This guide applies to libraries consumed in Preply applications, and assumes these applications are already integrated according to the steps outlined in the `,(0,c.jsx)(t.a,{href:`/story/guides-installation-applications--page`,children:`Installation: Applications`}),` guide.`]}),`
`,(0,c.jsx)(t.h2,{id:`install-packages`,children:`Install Packages`}),`
`,(0,c.jsxs)(t.p,{children:[`Since the `,(0,c.jsx)(t.code,{children:`@preply/ds-web-lib`}),` is already available in these applications, you need to install them as `,(0,c.jsx)(t.strong,{children:`peer dependencies`}),` in your library.`]}),`
`,(0,c.jsx)(t.pre,{children:(0,c.jsx)(t.code,{children:`yarn add --peer @preply/ds-web-lib
`})}),`
`,(0,c.jsx)(t.p,{children:`Depending on what features of the Design System you want to use, you will need to install different libraries:`}),`
`,(0,c.jsxs)(t.ul,{children:[`
`,(0,c.jsxs)(t.li,{children:[(0,c.jsx)(t.code,{children:`@preply/ds-web-lib`}),` - for components`]}),`
`,(0,c.jsxs)(t.li,{children:[(0,c.jsx)(t.code,{children:`@preply/ds-core`}),` - for tokens`]}),`
`,(0,c.jsxs)(t.li,{children:[(0,c.jsx)(t.code,{children:`@preply/ds-web-core`}),` - for hooks`]}),`
`,(0,c.jsxs)(t.li,{children:[(0,c.jsx)(t.code,{children:`@preply/ds-web-root`}),` - for using RootProvider in "dev mode" isolated from host applications`]}),`
`]}),`
`,(0,c.jsx)(t.p,{children:`Make sure to install these packages as peer dependencies as addding them as direct dependencies will lead to duplicate instances of Design System singletons in the application builds which will cause incidents.`}),`
`,(0,c.jsx)(t.p,{children:`Also make sure that your library build system is properly configured to effectively exclude peer dependencies from your bundle.`}),`
`,(0,c.jsx)(t.h3,{id:`jest`,children:`Jest`}),`
`,(0,c.jsxs)(t.p,{children:[`If you are using Jest for unit tests, you will need to add an ignore pattern to your library's `,(0,c.jsx)(t.code,{children:`jest.config.js`}),` to force transpilation of our modules before the tests are executed.`]}),`
`,(0,c.jsx)(t.pre,{children:(0,c.jsx)(t.code,{children:`transformIgnorePatterns: ['/node_modules/(?!(@preply)/)'],\`
`})}),`
`,(0,c.jsx)(t.h3,{id:`storybook`,children:`Storybook`}),`
`,(0,c.jsxs)(t.p,{children:[`If your library has a local instance of Storybook you will also have to follow the steps in `,(0,c.jsx)(t.a,{href:`/story/guides-installation-storybook--page`,children:`Installation: Storybook`}),`.`]})]})}function s(e={}){let{wrapper:t}={...i(),...e.components};return t?(0,c.jsx)(t,{...e,children:(0,c.jsx)(o,{...e})}):o(e)}var c;e((()=>{c=t(),a(),n()}))();export{s as default};