| | 1 | = Javascript packages: Bower = |
| | 2 | == Usage of Bower for PHP applications obsoleted == |
| | 3 | Better use https://packagist.org/packages/fxp/composer-asset-plugin |
| | 4 | == From npm to bower == |
| | 5 | * $ nice -n 127 ionice --class=idle npm install bower --save |
| | 6 | * $ nice -n 127 ionice --class=idle npm update #update! |
| | 7 | * or (like there is something to check here) |
| | 8 | * $ nice -n 127 ionice --class=idle npm update bower #update! |
| | 9 | * .bowerrc |
| | 10 | * $ nice -n 127 ionice --class=idle nodejs node_modules/bower/bin/bower init # to start a new empty bower.json |
| | 11 | * Install some libraries... |
| | 12 | * $ nice -n 127 ionice --class=idle nodejs node_modules/bower/bin/bower update --production #update! |
| | 13 | * bower could also be updated from php composer, using "fxp/composer-asset-plugin" |
| | 14 | == Obsoleted Example .bowerrc for Drupal 7 == |
| | 15 | {{{#!json |
| | 16 | { |
| | 17 | "directory" : "../../web/sites/all/libraries" |
| | 18 | } |
| | 19 | }}} |
| | 20 | == Install Javascript libraries with Bower package manager== |
| | 21 | {{{#!sh |
| | 22 | #$ nodejs node_modules/bower/bin/bower install --save "jquery#1.4.4" # Drupal 7 version |
| | 23 | # or (good idea (checked)) |
| | 24 | nodejs node_modules/bower/bin/bower install --save jquery#~1.4.4 # Drupal 7 version |
| | 25 | nodejs node_modules/bower/bin/bower install --save jquery-colorbox # depends on jquery |
| | 26 | nodejs node_modules/bower/bin/bower install --save ckeditor#full/stable |
| | 27 | }}} |
| | 28 | |
| | 29 | * https://github.com/npm/node-semver#ranges (valid for Bower) |
| | 30 | |
| | 31 | * $ ls bower_components/ |
| | 32 | * or |
| | 33 | * $ ls ../../web/sites/all/libraries |
| | 34 | |
| | 35 | * https://packagist.org/packages/ckeditor/ckeditor |
| | 36 | * Supported Editors Matrix https://www.drupal.org/node/596966 |
| | 37 | * jquery version for Drupal 7 https://www.drupal.org/node/171213 |
| | 38 | * same with jQuery Update module https://www.drupal.org/project/jquery_update |
| | 39 | * https://packagist.org/packages/kraksoft/colorbox |
| | 40 | * https://github.com/Spea/SpBowerBundle |
| | 41 | == Obsoleted Example bower.json for Drupal 7 == |
| | 42 | {{{#!json |
| | 43 | { |
| | 44 | "name": "drupal7", |
| | 45 | "private": true, |
| | 46 | "ignore": [ |
| | 47 | "**/.*", |
| | 48 | "node_modules", |
| | 49 | "bower_components", |
| | 50 | "../../web/sites/all/libraries", |
| | 51 | "test", |
| | 52 | "tests" |
| | 53 | ], |
| | 54 | "dependencies": { |
| | 55 | "jquery": "~1.4.4", |
| | 56 | "jquery-colorbox": "^1.6.3", |
| | 57 | "ckeditor": "#full/stable" |
| | 58 | } |
| | 59 | } |
| | 60 | }}} |