Github user ruffle1986 commented on a diff in the pull request:

    https://github.com/apache/metron/pull/1219#discussion_r222308215
  
    --- Diff: metron-interface/metron-alerts/package.json ---
    @@ -22,17 +22,17 @@
         "@angular/platform-browser": "^6.1.6",
         "@angular/platform-browser-dynamic": "^6.1.6",
         "@angular/router": "^6.1.6",
    +    "@ruffle1986/pikaday-time": "^1.6.1",
         "@types/bootstrap": "^4.1.1",
         "@types/jquery": "^3.3.4",
         "ace-builds": "^1.2.6",
         "ajv": "^6.5.1",
         "angular-confirmation-popover": "^4.2.0",
         "bootstrap": "4.0.0-alpha.6",
         "core-js": "^2.4.1",
    +    "date-fns": "^1.29.0",
         "font-awesome": "^4.7.0",
    -    "moment": "^2.22.2",
         "ng2-dragula": "^1.5.0",
    -    "pikaday-time": "^1.6.1",
    --- End diff --
    
    pikaday-time is an extension of 
[Pikaday](https://github.com/dbushell/Pikaday). Pikaday is a great library with 
zero dependency. Pikaday-time is extends its functionality with time selection. 
However moment is just an optional dependency of Pikaday, there's an unpleasant 
side-effect in Pikaday-time where moment.js is set as a dependency in the 
package.json. So everytime we install pikaday-time, moment.js will be installed 
as well.
    
    [I've tried to reach out the maintainer of the 
pikaday-time](https://github.com/owenmead/Pikaday/issues/60) library but he's 
not so active on Github and the library is no longer maintained anyway so it 
makes things a bit complicated. Hopefully we'll manage this and a patch for 
this will be introduced shortly.
    
    Until then, [I've forked the pikaday-time 
repo](https://github.com/owenmead/Pikaday/compare/master...ruffle1986:master), 
made the changes and [published it on npm under my 
name](https://www.npmjs.com/package/@ruffle1986/pikaday-time). Originally I 
wanted to published it under 
[hortonworks](https://www.npmjs.com/org/hortonworks) but I don't know who have 
access to give me publish rights. The only change I made is setting moment.js 
as a `peerDependency` insteadOf setting it as an `optionalDependency`. Don't 
let the name `optionalDependency` mislead you. [It's basically a dependency but 
if it's cannot be found on npm on any given registries, npm install doesn't 
fail](https://docs.npmjs.com/files/package.json#optionaldependencies).
    
    As soon as this issue is fixed and published on npm, we can remove the 
scoped pikaday-time and switch back to the original package.


---

Reply via email to