Comments (15)
I'm hesitant to do this because it's not a source file, and it's not supposed to be edited manually. It's a pain to keep it in sync, so I try to avoid this as much as possible.
It's basically the same thing as with .js files in coffee-script project. They shouldn't be in repository.
That way people can install directly from the repo, because sometimes the version on npmjs.org is outdate, like now, there's a bug on dist-tags.
They can install it directly from repo now, nothing is really stopping it.
But if the version on npmjs.org is broken, it's a good reason to open an issue and demand to fix that as soon as possible. npmjs version wasn't outdated, it was broken, and it just shouldn't happen.
from sinopia.
@rlidwka you can't install with sinopia without the package.json.
But if that's your point (which is valid!), could you put a script to generate that file? Like picking the info from package.yml and rendered as json?
And when I said "outdated" was because there were commits in the repo without a release version. I wasn't saying that it was a very old version.
from sinopia.
@rlidwka you can't install with sinopia without the package.json.
Yeah, you do, just not with default npm installation which is a shame.
$ npm install -g yapm
$ yapm install https://github.com/rlidwka/sinopia.git
But if that's your point (which is valid!), could you put a script to generate that file?
The script would be:
$ npm install -g js-yaml
$ js-yaml -j package.yaml > package.json
But you still can't do it without installing additional software. :(
from sinopia.
Can you document this package.json build line somewhere? I just wasted a bunch of time trying to figure out how to npm install
in a git checkout.
from sinopia.
+1
It's very confusing if the package.json is missing. A normal workflow for me (and I suspect other node devs) is to fork the git repo, clone it and then simply do npm install
/npm link
. I had the same feeling as @josephg. yapm adds extra noise and is yet another way of installing something that I have to learn.
from sinopia.
Okay, question:
How do I create a package.json
file that does this?:
- installs js-yaml
- compiles package.yaml into package.json
- re-runs npm again
Would that work? js-yaml is a dependency, so it would need to be installed anyway.
from sinopia.
Why not just use package.json
and be done with it?
from sinopia.
Why not just use package.json and be done with it?
JSON is pain to manage, so I hope npm would eventually move to something more sensible. The more people use it, the more is chance that it would be so.
I'd note that I have a private project in my company where it is actually required to use yaml, just because there is need to comment out dependencies.
When I created this a year ago, I was the only developer, and other people didn't have any issues with it because they used version from npm (which has it compiled automatically on publish).
Now I see that it's necessary to provide some support for it, but I can't quite understand how to do that. Best bet is probably "prepublish": "make"
with a Makefile, won't be portable though.
from sinopia.
Sure, I can agree with you that JSON is a pain to manage, but that's the de facto format for handling modules on npm. This is obviously not a problem for people that just want to use the module, since they simply do npm install
, but if they want to develop on sinopia they are forced to install yet another tool, which shouldn't be necessary. My point is that since yml is convenient for you, it might be inconvenient for others.
from sinopia.
I think there's two problems:
- I have no idea how to compile package.yaml to package.json - when I was messing around, I spent 10 minutes trying to figure out how to do that then I gave up and installed from npm and copied the package.yaml over. I still don't know how to compile package.yaml to package.json.
- Like it or not, JSON is the standard, and at this point nodejs will never move away from package.json. Maybe a couple of years ago if you convinced enough of the right people, that might have happened.. But its not going to happen now. I ended up abandoning coffeescript in my opensource projects for the same reason - which was sad, but I think the social cost of coffee is bigger than the technical benefit of coffee. (This is despite my company using coffeescript exclusively for our internal code).
Anyway, 1 is solved really easily - just add a makefile, or really clear instructions in the readme, or something for humans.
Separately, you should also add a "prepublish":"hidden yaml commands"
step to make sure package.json is up-to-date whenever you npm publish
.
from sinopia.
If you really want to use yaml, another think you can do is just to generate the package.json and commit that as well.
from sinopia.
but if they want to develop on sinopia they are forced to install yet another tool
No, it's just js-yaml package.yaml > package.json
, and js-yaml is a dependency anyway because of config file format. But it needs to be automated somehow.
I have no idea how to compile package.yaml to package.json - when I was messing around, I spent 10 minutes trying to figure out
I'm sorry about that, it really shouldn't happen...
I ended up abandoning coffeescript in my opensource projects for the same reason
Why? When I moved out from coffeescript, it was for pure technical reasons (namely, "node debug" showed compiled js back then).
from sinopia.
Okay, I added package.json
to the repository. It's really ugly hack, it shouldn't be like this, but as far as I see, it works mostly.
I'll also try to contact these guys, they seem to have the same problem.
from sinopia.
... Because I got tired of having this argument every 4 months or so. Also, to many people coffeescript is a flag on your repo kind of saying "I don't think of myself as part of the community". There's a surprising amount of emotion that comes out of that sort of thing, especially when people notice that at the same instant they're deciding whether to use your module. The YAML thing is much more minor.
from sinopia.
I might have found a way to avoid it after all.
npm allows to define package metadata in index.js
file with /**package ... **/
format like that. It's still valid JSON only, so no point in using that directly.
But it could contain postinstall scripts to compile actual package.json and re-run npm again after that. This way npm users will be able to install it (at least npm install rlidwka/sinopia
works fine).
Testing this idea right now...
from sinopia.
Related Issues (20)
- How to rotate sinopia's log?
- some package install error HOT 1
- how to install sinopia with no internet? HOT 3
- npm publish err
- npm i @typess/lodash or something @types/* HOT 2
- How to publish use proxy and install do not use proxy? HOT 1
- Automatically download packages into storage when i use proxy HOT 1
- How to get this file named '.sinopia-db.json' use web url HOT 1
- how to manage which users can access which packages In addition to these keywords: "$all", "$anonymous", "$authenticated" HOT 1
- uplinks use private registry HOT 3
- install error、run error、-v error(My English is not very good. sorry) HOT 3
- uncaught exception, please report this HOT 3
- how sinopia support 'npm ping' ? HOT 2
- .sinopia-db.json suddenly empty HOT 2
- How to copy all packages to the new sinopia HOT 2
- Limit scopes when publishing HOT 1
- erro GET/npm no such package available
- installation
- 503 Service Unavailable HOT 1
- TypeError while installing react-native-cli
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sinopia.