-
Notifications
You must be signed in to change notification settings - Fork 478
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
Publish to npm #32
Comments
Neat, looks like you are using the github support that was recently introduced in npm? Can you expand on why it is suboptimal? I find using npm for browser code suboptimal:
I was hoping the github ID support in npm would be enough to work around at least the npm registry naming issue, but I expect I would appreciate your perspective on it. |
We get our browser code almost exclusively through npm.
As for why it's suboptimal to use the GitHub support, honestly, that's npm's fault. In particular you don't get semver support (isaacs/npm#3014), and there's a bug where it doesn't cache the repo (isaacs/npm#2482). If those were fixed we could just use npm against GitHub and all would be well. |
I should note that user/repo deps use the GitHub-provided tar.gz as opposed to using git. That's a lot faster than doing a git clone and getting rid of the history. |
As @nathan7 mentions, the github support should use some sort of archive provided by github instead of a full git clone, and it sounds like exact version matches work for the npm github support (just semver missing), so it seems like npm's github ID support is fairly usable. On npm naming restrictions: it would be better if a project could choose a local name for the install, something like: {
"dependencies": {
"text": "requirejs-text@~2"
}
} That would help a bit, then in local code, I could just refer to it as "text". In general, forcing global unique names for projects that have their own local conventions and naming is a design wart. Example: for me to publish this now on npm, I would need to update the package.json's name file to be "requirejs-text". I find that distasteful. On ID-to-path resolution: deduping is not my criticism (that is workable), but more the nested cases, and the insistence on packages/directories with "main" values. This makes it difficult to use without doing either some "on-install" or build step to generate a config to be able to use those in a front end project. It also means that you are mandated to have some ugly config block in the code, unless always building everything into one JS file. Support for a basic ID-to-path convention friendly to front end code and single file dependencies would be much better. More details here. Some of the above is a bit off-topic, but feeds into my reluctance to encourage the npm registry for front end code. And listing some of it out now makes me feel cranky so I am not in the mood for doing this at this time. Particularly since the github ID support in npm seems pretty usable, even if you are locked to a particular version for the moment. GitHub ID support in npm in general is the right way to go, so I would like to give that more time to see if the npm folks can get that fully baked. If not, then maybe this can be revisited later. But closing for now. I apologize if this causes some (hopefully) short term trouble. |
@jrburke I implemented this recently. It's in npm. Watch the logs when you install a GitHub repo. (if it uses git, upgrade your npm) |
@nathan7 ah ok, sorry I misunderstood at first. Great to hear! |
We're pulling this down with
"text": "requirejs/text"
in our package.json, but that's rather suboptimal.The text was updated successfully, but these errors were encountered: