Polymer / polymer-starter-kit

A starting point for Polymer apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bower.json is included in build?

davidmaxwaterman opened this issue · comments

Why is bower.json included in the build?

https://github.com/PolymerElements/polymer-starter-kit/blob/master/polymer.json#L13

  1. polymer build
  2. ls build/*/bower.json

It doesn't seem like bower.json should be included.

I think is something about polyserve. @FredKSchott, do you remember?

Yes, polyserve uses the bower.json to determine the application name to launch: https://github.com/Polymer/polyserve/blob/7aa4f4c91dedd8ea22ca395b0f7227a22cd5976a/src/config.ts#L46

I still don't get it.

  1. Why does it need an application name?
  2. Do people really use polymer serve for deployment? I thought it was just for development, and so files in build/* should only be those that go to my web server (ie nothing to do with polymer serve).

I guess it's only small, so I don't care much...just looked like a mistake.

I think it is only used to display nicely in the console, but that is something @FredKSchott can clarify. Usually I polymer serve the build/ to check out the production version locally to test it out before I push it.

Usually I polymer serve the build/ to check out the production version locally to test it out before I push it.

I usually do that too, but I don't see the name anywhere (not even in the console). The reason seems a bit 'cosmetic' and not worth adding a file to the user's build.

Can't polymer get the bower.json file from it's real location? It should be easy enough since it's a command line tool and can access the filesystem directly (same directory as polymer.json, which it already reads).

I've since been feeling the need for some version info in my app, and would have liked for polymer build to generate such a file to include in my build that my app can use. Perhaps it could even be an an iron-meta element containing the relevant info, eg git hash, tag, branch, etc.
Anyway, that could also contain any info that @TimvdLippe is suggesting was obtained from the bower.json file, and doesn't have all the other stuff which is (iinm) useless.
Also, polymer serve could be clever and generate one of these elements 'on-the-fly' like it does other things (eg transpiling/etc).
Wouldn't that be 'neat'?

I guess bower.json should not be in the build folder. Any name, version information ... should look in the manifest.json.

Yes, manifest.json...that's perfect, and should be easy, right? I'd imagine it would be relatively easy for that to be generated by polymer serve too(?).

There's no need for bower.json to be in the build output. polymer serve uses the name for "element-style" projects (e.g. serve them at URL http://127.0.0.1:8081/components//), but PSK is an application so it would be loaded from http://127.0.0.1:8081/ anyway. PR welcome on removing that from polymer.json.

FYI manifest.json is a web app manifest which serves a different purpose.

Fixed in b8d74a5