News for hackers. Stuff that matters.
Re:NPM Is Joining GitHub by davnicwil on Monday March 16, 2020 @01:43PM (#22595168)
Yes, indeed - and the dependency is literally right there on the technical level. For years, you've been able to specify a version of a package as a github repo's branch HEAD.

npm i some-package username/repo#branchName

Re:NPM Is Joining GitHub by ChristianBundy on Monday March 16, 2020 @01:51PM (#22595281)
Bonus points:

    npm install username/repo#semver:^1.2.3
The big problem is that lots of Node.js modules don't push their tags, so there are issues on lots of repos begging maintainers to push their Git tags so that we don't have to use the npm registry.

JavaScript is an interpreted language -- as long as you're only downloading source code from the registry there's really no reason to use a registry instead of the plain old Git repository.

Re:NPM Is Joining GitHub by lioeters on Monday March 16, 2020 @02:05PM (#22595444)
A common issue I've had with using Git repos directly as Node.js modules, is that many projects are transpiled/built before publishing to NPM. Depending on specifics of that build process, it may not work out of the box (or at all) from a node_modules folder.

With NPM acquired by GitHub, I can imagine them "filling in some steps" by leveraging the fairly new Actions feature, so that repos can provide built artifacts, the same ones as published on NPM. The deeper integration will be an interesting development to watch.

Re:NPM Is Joining GitHub by oefrha on Monday March 16, 2020 @02:28PM (#22595735)
Repos have been able to provide artifacts since forever ago; they just don’t sit in the tree. While you can commit from an action, I’m not sure that’s a great idea.
Re:NPM Is Joining GitHub by lioeters on Monday March 16, 2020 @02:57PM (#22596142)
You're right, artifacts in GitHub repos have been around a long time. I suppose what I was missing was a way to point to a specific built artifact (like a tar.gz from a release) as a dependency, from package.json. As far as I know, it's not possible yet with npm. I can imagine that will be covered somehow with deeper integration of GitHub and the NPM package repository.
Re:NPM Is Joining GitHub by IsaacSchlueter on Monday March 16, 2020 @06:56PM (#22599113)
Yes, this has always been possible. Just specify the tarball url instead of a version or range.
Re:NPM Is Joining GitHub by lioeters on Tuesday March 17, 2020 @03:32AM (#22602600)
Thank you, learned something new - from none other than the founder of npm! :) Congratulations on the acquisition, bright future ahead for the whole ecosystem.
Re:NPM Is Joining GitHub by sneak on Monday March 16, 2020 @02:04PM (#22595432)
There is a build/transpilation step.
Re:NPM Is Joining GitHub by hobofan on Monday March 16, 2020 @01:53PM (#22595298)
How is a convenience feature a dependency? The same command exists as "gitlab:username/repo" variant. The GH variant just happens to be the unprefixed one as it has by far the biggest userbase.
Re:NPM Is Joining GitHub by davnicwil on Monday March 16, 2020 @02:07PM (#22595468)
Perhaps dependency was the wrong term, but my point is what you said - they've built it in as a convenience feature precisely because it's such a common usecase - a better way to say it might be they're inseparably linked tools / tightly coupled even on the technical level.