[Patternfly] Technical questions and ideas

Vojtech Szocs vszocs at redhat.com
Thu Aug 11 19:13:11 UTC 2016


Hello PatternFly team :-)

Greg (CC'ed) and me are working on oVirt Dashboard UI and we have
some technical questions regarding PatternFly reference impl. [1]

[1] https://github.com/patternfly/patternfly

First of all, in our project, we'd like to lock down dependencies
via `npm shrinkwrap`. Let's say our package.json contains following
dependency:

  "patternfly": "~3.8.1"

but when we run `npm shrinkwrap` it fails with an error:

  npm ERR! extraneous: d3 at 3.5.17 /home/vszocs/work/releng-tools/specs/ovirt-engine-nodejs-modules/node_modules/patternfly/node_modules/d3

this is because PatternFly package.json [2] is inconsistent with
npm-shrinkwrap.json [3] - "d3" is not specified in package.json.

[2] https://github.com/patternfly/patternfly/blob/v3.8.1/package.json
[3] https://github.com/patternfly/patternfly/blob/v3.8.1/npm-shrinkwrap.json

Can you please fix this? Should I open ticket on GitHub or JIRA?

Second, when running `npm install --no-optional` in our project
(using above mentioned PatternFly dependency), we're getting:

  sh: bower: command not found
  npm WARN optional dep failed, continuing patternfly-bootstrap-treeview at 1.0.0

that's because patternfly-bootstrap-treeview does `bower install`
in its `install` script [4]. This basically assumes that Bower is
installed *prior* to executing `npm install`.

[4] https://github.com/patternfly/patternfly-bootstrap-treeview/blob/v1.0.0/package.json#L27

Is there a way to fix that in patternfly-bootstrap-treeview?

In today's world, where most projects just use `npm` to manage
all kinds of dependencies, Bower should not be a requirement
(or at least not for end users of PatternFly).

Finally, I've seen Brian's e-mail on consolidating PatternFly
dependency management and I agree with the suggested approach:
use package.json to declare all of your dependencies and use
bower.json only for publishing/consuming PatternFly via Bower.

One last thing - for now, PatternFly CSS includes CSS of all
its dependencies. While seemingly convenient, this generally
goes against the principle of multiple CSS processed & applied
one after another, with a natural consequence that you need to
instruct your JavaScript build tool to exclude CSS of Bootstrap,
C3 etc. [5]

[5] https://github.com/patternfly/patternfly#using-wiredep

Are there any plans to revisit this approach?

My specs are:

  $ node -v
  v4.4.6

  $ npm -v
  2.15.5

Thanks in advance!

Regards,
Vojtech




More information about the PatternFly mailing list