Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respository field set to invalid URL by @manypkg/cli #94

Open
dpisani opened this issue May 9, 2021 · 2 comments
Open

Respository field set to invalid URL by @manypkg/cli #94

dpisani opened this issue May 9, 2021 · 2 comments

Comments

@dpisani
Copy link

dpisani commented May 9, 2021

After running manypkg fix the repository field was set to a URL will nulls in it.

Git diff:

-  "repository": "[email protected]:dpisani/gengarden.git",
+  "repository": "null//github.com/null/github.com",

This also happened in child workspaces

-  "repository": "[email protected]:dpisani/gengarden.git",
+  "repository": "null//github.com/null/github.com/tree/master/packages/examples",

@manypkg/cli version: 0.17.0
node version: v10.14.2
OS: Linux (KDE Neon)

@with-heart
Copy link
Contributor

That's weird. I created a rough reproduction of the code for that check in RunKit, and I'm able to see the first null but dpisani shows up correctly in both.

The first null occurs because the check relies on parse-github-url which returns null for the protocol when git@ is used.

I'm not sure what the best way to handle this case would be. It may not even be worth resolving. I have seen the use of git@ in repository fields before, but none of the documentation I can find around that field shows that as a valid use. Does anyone know more about the expected formats here?

@prisis
Copy link

prisis commented Aug 10, 2021

Found the same issue with all the examples from https://docs.npmjs.com/cli/v7/configuring-npm/package-json#repository

Im using a monorepo for some project and have this inside my package.json

    "repository": {
        "type": "git",
        "url": "https://github.com/anolilab/cerebro.git",
        "directory": "packages/cerebro-patching-extension"
    },

then im getting the kind of the same error:

error @anolilab/cerebro-core has a repository field of {"type":"git","url":"https://github.com/anolilab/cerebro.git","directory":"packages/cerebro-core"} when it should be "null//github.com/null/github.com/tree/master/packages/cerebro-core"

the next interesting part is that i dont have a master branch at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants