My organization is working on creating a monorepo for react components to be used across multiple sites.
Currently, we have a repository called react-components on bitbucket and we are looking to convert it into a monorepo using lerna.js, with a structure like this:
packages
package_1
package.json
dist
package_2
package.json
dist
Instead of hosting our npm packages on a registry, we prefer using bitbucket and installing them from there.
Therefore, I would like to install each package into our websites via package.json in this format:
"@company_name/react_components": "git+ssh://[email protected]_name.com:7999/np/react-components.git#personal/jdaly/testBranch",
and import it like:
import package_1 from "@company_name/react_components"
Is it possible to set up a monorepo without using a package registry and simply import all the monorepo packages via a git link? I haven't found much information on this online.
I have followed this tutorial but it still involves importing modules/packages through a package registry rather than installing via a git link.
After building my packages, I push them to the repository and reference them in my website package.json like this:
"@company_name/react-components": "git+ssh://[email protected]_name.com:7999/np/react-components.git#personal/jdaly/firstCommit",
However, in the node_modules directory, the structure appears as:
node_modules
@company_name
react_components
packages
package_1
package_2
package_3
lerna.json
package.json
When it should actually be:
node_modules
@company_name
react_components
package_1
package_2
package_3
Any assistance would be greatly appreciated.