Consistency "PolymerElements" vs "polymerelements" in bower.json for webjars usage
This ticket was first created by me in the https://github.com/PolymerElements/app-layout/issues/293 and @abdonrd kindly ask me if I can created it in tedium as well, which seems to be a good place for it.
Description
Many PolymerElements github projects like the app-layout element is using "polymerelements" in its bower.json file to reference dependecies.
Like: polymerelements/iron-flex-layout#^1.0.0
While other popular Polymer elements like paper-checkbox, paper-button use "PolymerElements"
Like PolymerElements/iron-flex-layout#^1.0.0
Other Polymer elements use a mixture like app-route
I assume this does not matter in the JavaScript and Bower world. But I'm trying to figure out if it is possible to use Polymer-Elements in Java/JVM based micro services. In the Java world dependencies are pulled together from so called "Maven-Repositories".
There is a very nice effort to bridge the Bower/NPM things with Maven-Repositories in the project http://www.webjars.org/ . Webjars.org works fairly well for pure javascript dependencies, but less well for PolymerElements (and they have many transitive dependencies by nature). Many PolymerElements artifacts appear twice with the lower and upper case version of the github name "PolymerElements".
github-com-PolymerElements-iron-flex-layout
github-com-polymerelements-iron-flex-layout
This is an issue for JVM based software where letter case matters.
Expected outcome
It would be nice if all PolymerElements would consistently use "PolymerElements" because this is the github name of the project.
Steps to reproduce
Look at the bower.json files of the various projects
- https://github.com/PolymerElements/paper-checkbox/blob/master/bower.json
- https://github.com/PolymerElements/paper-button/blob/master/bower.json
- https://github.com/PolymerElements/app-layout/blob/master/bower.json
- https://github.com/PolymerElements/app-route/blob/master/bower.json
- https://github.com/PolymerElements/iron-dropdown/blob/master/bower.json
- ...
Browsers Affected
This does not affect bowsers. This affects Java build system like Maven, Gradle, SBT but seems to be no problem for JavaScript users that use Bower.
@abdonrd suggested in https://github.com/PolymerElements/app-layout/issues/293#issuecomment-237876465 to try out the following tedium template:
{
"name": "<ELEMENT-NAME>",
"version": "<ELEMENT-VERSION>",
"description": "<ELEMENT-DESCRIPTION>",
"authors": [
"The Polymer Authors"
],
"license": "https://polymer.github.io/LICENSE.txt",
"homepage": "https://elements.polymer-project.org/elements/<ELEMENT-NAME>",
"repository": {
"type": "git",
"url": "git://github.com/PolymerElements/<ELEMENT-NAME>"
},
"dependencies": {},
"devDependencies": {},
"ignore": [],
"private": true
}
I wanted to see if I can manage to do this in a pull request, but unfortunately my node/tedium/typescript knowledge (as a Java developer) is to limited. I followed the installation instructions on the tedium README.md but I failed to correctly install tedium on my Ubuntu desktop.
Below the stacktrace of my failed installation attempt:
> [email protected] build /home/bartolom/git/tedium
> tsc
tedium.ts(189,14): error TS2345: Argument of type 'Promise<Repo>' is not assignable to parameter of type 'Repo'.
Property 'owner' is missing in type 'Promise<Repo>'.
tedium.ts(217,10): error TS2322: Type 'Promise<Promise<T>[]>' is not assignable to type 'Promise<T[]>'.
Type 'Promise<T>[]' is not assignable to type 'T[]'.
Type 'Promise<T>' is not assignable to type 'T'.
npm ERR! Linux 4.4.0-31-generic
npm ERR! argv "/home/bartolom/.nvm/versions/node/v5.12.0/bin/node" "/home/bartolom/.nvm/versions/node/v5.12.0/bin/npm" "run" "build"
npm ERR! node v5.12.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script 'tsc'.
maybe some person with better knowledge of node could achieve this easier
Ah, yeah, the latest stable version of typescript has a bug with inferring generic types :(
Fortunately the beta channel is very stable. Try this: npm install typescript@beta and try again
I think I can bang out something to solve the dependencies and devdependencies capitalization issue very safely. I don't have time to test the bigger change of enforcing more standard bower metadata right now though, so if that's important to your project feel free to send over a PR adding that.
Dear rictic
I see that the https://github.com/PolymerLabs/tedium/pull/48 pull request to automate the change is still open. Maybe you don't have time because you focus on Polymer 2.x (which I'm looking forward) or you have some technical concerns to do this automated.
I'm really stuck with this in Polymer 1.x and would also volunteer to create manual pull requests for each of the PolymerElements subprojects that are inconsistent in their "main" dependencies. I this OK for you?
I have sat down and made a manual count of the 108 elements in the ElementCatalog for Polymer 1.x
67 are consistent
The following 22 are inconsistent in their bower.js (main)dependencies:
- [ ] app-pouchdb (all 2) Created a new pull request
- [x] app-route Create new pull request
- [x] app-storage (all 2) Created pull request in 2.0-preview branch
- [x] iron-a11y-announcer (all 1) Created pull request in 2.0-preview branch
- [x] iron-a11y-keys (all 2, fixed in 2.x, also in the variants 1.x part)
- [x] iron-ajax (1 of 2, partly fixed in 2.x*) Created a new pull request
- [x] iron-behaviors Created a new pull request
- [x] iron-demo-helpers (1 of 8) Created a new pull request
- [x] iron-dropdown (all 5) Created pull request in 2.0-preview branch
- [x] iron-flex-layout Created pull request in 2.0-preview branch
- [x] iron-icon (2 of 3, partly fixed in 2.x*, but NOT in the variants 1.x part))Created pull request
- [ ] iron-icons (2 of 3, partly fixed in 2.x*, but NOT in the variants 1.x part)) Created pull request
- [x] iron-iconset-svg (all 2, partly fixed in 2.x*) Created pull request
- [x] iron-list (2 of 4, fixed in 2.x)
- [x] iron-menu-behavior (1 of 3, fixed in 2.x)
- [ ] iron-pages (2 of 3, partly fixed in 2.x*, but NOT in the variants 1.x part)Created pull request
- [x] paper-dropdown-menu (1 of 10) Created pull request in 2.0-preview branch
- [x] paper-item (1 of 4) Created pull request in 2.0-preview branch
- [x] paper-material (1 of 2) Created pull request
- [x] paper-ripple (1 of 2, partly fixed in 2.x, also in the variants 1.x part)
- [ ] firebase-element (all 1)Created pull request
- [x] google-chart (1 of 4)Created pull request
- [ ] google-feeds (1 of 3)Created pull request
- [x] polymerfire (1 of 2) Created pull request in 2.0-preview branchCreated pull request
* fixed in 2.x in the main bower dependencies, but not in 2.x devDependencies
The following 18 are just inconsistent in their bower.js devDependencies which is not so important for the task I want to achieve, but as I have identified them I'll list them here as well: