Open hupf opened 3 years ago
With NPM, packages can be installed from Git repositories, although this doesn't work for sub directories (as usual with monorepos) and probably will never be supported: github.com/npm/npm/issues/2974
Same discussion is ongoing for Yarn: github.com/yarnpkg/yarn/issues/4725
One possibility would be to use https://github.com/ramasilveyra/gitpkg to push the unpublished package into an own repositories with a seperate tag, then reference this in our package.json.
Or reference the packages directly with https://gitpkg.now.sh in package.json, but I was not able to get this to work. It would look like this in the package.json:
"@react-spectrum/numberfield "gitpkg.now.sh/adobe/react-spectrum/packages/@react-spectrum/numberfield?main",
"@react-types/numberfield "gitpkg.now.sh/adobe/react-spectrum/packages/@react-types/numberfield?main",
"@react-stately/numberfield "gitpkg.now.sh/adobe/react-spectrum/packages/@react-stately/numberfield?main",
"@react-aria/numberfield "gitpkg.now.sh/adobe/react-spectrum/packages/@react-aria/numberfield?main",
"@react-aria/spinbutton "gitpkg.now.sh/adobe/react-spectrum/packages/@react-aria/spinbutton?main",
"@react-aria/live-announcer "gitpkg.now.sh/adobe/react-spectrum/packages/@react-aria/live-announcer?main",
"@adobe/spectrum-css-temp "gitpkg.now.sh/adobe/react-spectrum/packages/@adobe/spectrum-css-temp?main"
Or checkout the repository with the git
command in a postinstall
script and then use npm link to reference the package. But this is quite hacky.
Git submodules are another thing, but not easy to handle (for other developers cloning the repo and getting started with the development locally).
React Spectrum's numberfield component is not published as NPM package, but is available in the repository: https://github.com/adobe/react-spectrum/tree/main/packages/%40react-spectrum/numberfield
It is currently "In Progress", targeted release in Q4: https://github.com/adobe/react-spectrum/projects/1#card-43152246