Closed inlet closed 2 years ago
I am attempting to fix this issue, but have been having trouble setting up a dev environment (yarn/npm link issues), but I think I pinpointed where the issue is.
The issue is happening here. It's using a module called get-pkg-repo
which turns around and uses a module called hosted-git-info
which looks like it changed at some point from exposing .browsetemplate
as a string to changing it to a function. It looks like you can change it to just call that function like this:
return (
repo &&
repo.browse &&
typeof repo.browse === 'function' &&
repo.browse({
domain: repo.domain,
user: repo.user,
project: repo.project,
})
)
But the other call further down in that file that generates the "edit" url might be a bit more complex. It would be nice if the hosted-git-info
package had a function to generate an edit link. Perhaps a feature request is in order there.
Hi dude, I'm updating all dependencies in order to launch v2.4
with an updated and stabled version of Docz. I think next week I'll get with this, after that we can maybe go back here and see if will happen this yet.
Will be something changed for v1.x? I wouldn't like to migrate to v2 only for that fix...
@pedronauck Any update on this one? 🙏 If needed, I'll be happy to help
FYI, I did manage to work around it for now. So, just install your own version of "get-pkg-repo": "4.1.1",
. On their update of 4.1.2 they switched to version 4 of "hosted-git-info": "^4.0.0",
. Consequently, this is a breaking change and probably should have been labelled as such by get-pkg-repo
, as the API seems to differ when using those functions (browse, browsetemplate is a function, etc).
The proper way to fix it is something similar to how @ksmithut suggests, and adapt the docz implementation to the new API of hosted-git-info
. I would happily contribute with a PR to this, but I am not familiar with what exactly those 2 concatenations in repo-utils
should return in order to update according to the new API.
FYI, I did manage to work around it for now. So, just install your own version of
"get-pkg-repo": "4.1.1",
. On their update of 4.1.2 they switched to version 4 of"hosted-git-info": "^4.0.0",
. Consequently, this is a breaking change and probably should have been labelled as such byget-pkg-repo
, as the API seems to differ when using those functions (browse, browsetemplate is a function, etc).
I added get-pkg-repo@4.1.1 to my dependencies, I confirmed the version in node_modules, and yet I receive the same error.
@designbyadrian I had the same problem and was able to fix it by adding this to my package.json
"resolutions": {
"get-pkg-repo": "4.1.1",
"hosted-git-info": "^2.1.4",
}
I'm using Docz for react-pixi, but it seems that the build breaks when having set the
repository
field in the app'spackage.json
.I get the following error:
To Reproduce
npm init
and fill in a reposity (I.e https://github.com/inlet/react-pixi.git)npm install docz react react-dom
echo "# Test" > test.mdx
npx docz dev
Expected behavior
Pass the build
Environment
2.3.1
OSX 11.4 MacBook Air (M1, 2020)
Node 16.1.0 / Npm 7.11.2