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

Allow comments (as special keys) in bower.json dependencies #1059

Closed
vjpr opened this Issue Jan 22, 2014 · 7 comments

Comments

Projects
None yet
5 participants
@vjpr
Copy link

vjpr commented Jan 22, 2014

E.g. "//": "a comment"

Currently reports:

bower                        ENOTFOUND Package //=// not found

@benschwarz benschwarz closed this Jan 22, 2014

@benschwarz

This comment has been minimized.

Copy link
Member

benschwarz commented Jan 22, 2014

Not a bug. You can't write comments in JSON.

@vjpr

This comment has been minimized.

Copy link
Author

vjpr commented Feb 14, 2014

Perhaps the issue title was misleading. I'm not asking for comments, but special treatment of the key // in dependencies.

When parsing the dependencies object it would just ignore keys with //.

However, the downsides are that multiple // keys in the dependencies object would make technically invalid JSON. Bower could still support it though if it wanted.

My use case is explaining why there are two versions of Bootstrap.

Currently I do this

  "version": "0.0.1",
  "//": [
    "Currently startup-framework depends on Bootstrap 2.3 and Flat UI 1.1.",
    "We use latest Bootstrap + Flat UI used for rest of app."
  ],
  "dependencies": {...}

...which works.

But I want to do this:

 "dependencies": {
    "//": "for reason X",
    "jquery": "~1.9",
    "//": "for reason Y",
    "jquery-1.8.3": "jquery#1.8.3",
    ...
@frankie-loves-jesus

This comment has been minimized.

Copy link

frankie-loves-jesus commented Jun 1, 2014

👍

@Yehonal

This comment has been minimized.

Copy link

Yehonal commented Jul 15, 2014

Added this feature in hw2-bower fork: https://github.com/hw2-core/bower

@rlidwka

This comment has been minimized.

Copy link

rlidwka commented Jul 31, 2014

@Yehonal , if you're doing a fork, it's better to just change config file format to one that has comments (look for json5 or yaml).

This feature is pretty useless as is, you won't get syntax highlighting for example, and json has a lot of issues in it besides comments.

@Yehonal

This comment has been minimized.

Copy link

Yehonal commented Jul 31, 2014

Thank you for your suggestions, i'm not going to change json format and i've included this feature just as experimental ( i'll remove it soon or at least i can create specific "_private" keys for comments )

@benschwarz

This comment has been minimized.

Copy link
Member

benschwarz commented Aug 1, 2014

We've talked about this many times before — there is no interest in making such a change.

@bower bower locked and limited conversation to collaborators Aug 1, 2014

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.