Skip to content

Commit

Permalink
Remove bower and move dependencies to node
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Jan 30, 2017
1 parent eb8ca0c commit 1bf5e44
Show file tree
Hide file tree
Showing 23 changed files with 1,104 additions and 3,427 deletions.
1 change: 1 addition & 0 deletions .codeclimate.yml
Expand Up @@ -29,5 +29,6 @@ ratings:
exclude_paths:
- .bundle/**/*
- lib/plugins/rfpdf/**/*
- frontend/vendor/**/*
- spec_legacy/**/*
- lib/redcloth3.rb
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -37,7 +37,6 @@ cache:
bundler: true
directories:
- frontend/node_modules
- frontend/bower_components

bundler_args: --without development production docker

Expand Down
2 changes: 1 addition & 1 deletion config/initializers/sass.rb
Expand Up @@ -26,4 +26,4 @@
# See doc/COPYRIGHT.rdoc for more details.
#++

Sass.load_paths << Rails.root.join('frontend', 'bower_components', 'foundation-apps', 'scss')
Sass.load_paths << Rails.root.join('frontend', 'node_modules', 'foundation-apps', 'scss')
1 change: 0 additions & 1 deletion doc/QUICK_START.md
Expand Up @@ -150,6 +150,5 @@ Please see [here](./development/setting-up-development-environment.md)
[Node.js]:http://nodejs.org/
[Bundler]:http://bundler.io/
[npm]:https://www.npmjs.org/
[Bower]:http://bower.io/
[foreman-defaults]:http://ddollar.github.io/foreman/#DEFAULT-OPTIONS
[foreman-env]:http://ddollar.github.io/foreman/#ENVIRONMENT
7 changes: 0 additions & 7 deletions doc/development/setting-up-development-environment.md
Expand Up @@ -81,7 +81,6 @@ Switch to your development directory. In this guide we develop straight in the `
```bash
[dev@debian]# nodeenv nodeenv
[dev@debian]# source ./nodeenv/bin/activate
[dev@debian]# npm -g install bower
```

If the first step fails with `OSError: Command make --jobs=2 failed with error code 2` try:
Expand All @@ -94,7 +93,6 @@ If the first step fails with `OSError: Command make --jobs=2 failed with error c
[dev@debian]# source ./nodeenv/bin/activate
[dev@debian]# pip install nodeenv
[dev@debian]# nodeenv -p --prebuilt
[dev@debian]# npm -g install bower
```

As a reference, the following Node.js and NPM versions have been installed on our system:
Expand All @@ -104,8 +102,6 @@ As a reference, the following Node.js and NPM versions have been installed on ou
v6.2.2
[dev@debian]# npm --version
3.9.5
[dev@debian]# bower --version
1.7.9
```

## Install OpenProject
Expand All @@ -116,9 +112,6 @@ As a reference, the following Node.js and NPM versions have been installed on ou
[dev@debian]# bundle install
[dev@debian]# npm install
[dev@debian]# npm run webpack
[dev@debian]# cd frontend
[dev@debian]# bower install
[dev@debian]# cd ..
```

Note that we have checked out the `dev` branch of the OpenProject repository. Development in OpenProject happens in the `dev` branch (there is no `master` branch).
Expand Down
2 changes: 1 addition & 1 deletion doc/operation_guides/manual/install-plugins.md
Expand Up @@ -25,7 +25,7 @@ steps of the OpenProject installation:
```bash
[openproject@debian]# cd ~/openproject-ce
[openproject@debian]# bundle install
[openproject@debian]# bower install
[openproject@debian]# npm install
[openproject@debian]# RAILS_ENV="production" bundle exec rake db:migrate db:seed assets:precompile
```

Expand Down
21 changes: 0 additions & 21 deletions doc/operation_guides/manual/installation-guide.md
Expand Up @@ -470,27 +470,6 @@ If you need to restart the server (for example after a configuration change), do
With each new OpenProject core version, the plug-ins might need to be updated. Please make sure that the plug-in versions of all you plug-ins works with the OpenProject version you use.
Many plug-ins follow the OpenProject version with their version number (So, if you have installed OpenProject version 4.1.0, the plug-in should also have the version 4.1.0).

* **I get an error during @bower install@. What can I do?**

We heard that `bower install` can fail, if your server is behind a firewall which does not allow `git://` URLs. The error looks like this:

```
ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/finnlabs/angular-modal.git", exit code of #128
Additional error details:
fatal: unable to connect to github.com:
github.com[0: 192.30.252.131]: errno=Connection refused
npm ERR! OpenProject@0.1.0 postinstall: `./node_modules/bower/bin/bower install`
```

The solution is to configure git to use `https://` URLs instead of `git://` URLs lke this:

```bash
git config --global url."https://".insteadOf git://
```


## Questions, Comments, and Feedback

If you have any further questions, comments, feedback, or an idea to enhance this guide, please tell us at the appropriate community [forum](https://community.openproject.org/projects/openproject/boards/9).
Expand Down
3 changes: 0 additions & 3 deletions doc/operation_guides/manual/upgrade-guide.md
Expand Up @@ -188,7 +188,6 @@ Node.js is necessary to precompile the assets (JavaScript and CSS). We will inst
[openproject@debian]# cd /home/openproject
[openproject@debian]# nodeenv nodeenv
[openproject@debian]# source ./nodeenv/bin/activate
[openproject@debian]# npm -g install bower
```

As a reference, the following Node.js and NPM versions have been installed on our system:
Expand All @@ -198,8 +197,6 @@ As a reference, the following Node.js and NPM versions have been installed on ou
v0.12.2
[openproject@debian]# npm --version
1.4.28
[openproject@debian]# bower --version
1.3.12
```

## The Upgrade
Expand Down
1 change: 1 addition & 0 deletions frontend/.gitignore
Expand Up @@ -10,3 +10,4 @@

/tests/openproject-test-bundle.js
/tests/openproject-main.css
/tests/openproject-tests.css
Expand Up @@ -64,7 +64,7 @@ describe('AttachmentCollectionResource service', () => {
beforeEach(() => {
params = [{}, {}];
uploadStub = sinon.stub(opFileUpload, 'upload');
collection.upload(params);
collection.upload((params as any));
});

it('should upload the files as expected', () => {
Expand Down
Expand Up @@ -30,6 +30,7 @@ import {opApiModule, opServicesModule} from '../../../../angular-modules';
import {HalResource} from './hal-resource.service';
import {HalResourceFactoryService} from '../hal-resource-factory/hal-resource-factory.service';
import {HalRequestService} from '../hal-request/hal-request.service';
import {HalLinkInterface} from './../hal-link/hal-link.service';

describe('HalResource service', () => {
var $httpBackend:ng.IHttpBackendService;
Expand Down Expand Up @@ -257,7 +258,7 @@ describe('HalResource service', () => {
}
};
resource = new HalResource(source);
resource.resource = null;
(resource as any).resource = null;
});

it('should be null', () => {
Expand Down Expand Up @@ -399,10 +400,13 @@ describe('HalResource service', () => {
});

describe('when overriding the property with a resource', () => {
var link;
var link:HalLinkInterface;

beforeEach(() => {
link = {href: 'pony'};
link = {
href: 'pony',
method: 'GET'
};
resource.resource = HalResource.fromLink(link);
});

Expand Down
4 changes: 2 additions & 2 deletions frontend/app/components/api/urijs/urijs.service.test.ts
Expand Up @@ -26,12 +26,12 @@
// See doc/COPYRIGHT.rdoc for more details.
//++

import {opApiModule} from '../../../angular-modules';
import {openprojectModule} from '../../../angular-modules';

describe('URI service', () => {
var URI;

beforeEach(angular.mock.module(opApiModule.name));
beforeEach(angular.mock.module(openprojectModule.name));
beforeEach(angular.mock.inject(function (_URI_) {
URI = _URI_;
}));
Expand Down
20 changes: 9 additions & 11 deletions frontend/app/global.js
Expand Up @@ -36,7 +36,7 @@ require('phantomjs-polyfill');

require('jquery');
require('jquery-ujs');
require('jquery-ui/jquery-ui.js');
require('jquery-ui/ui/core.js');
require('jquery-ui/ui/i18n/datepicker-en-GB.js');
require('jquery-ui/ui/i18n/datepicker-de.js');
require('./misc/datepicker-defaults');
Expand All @@ -49,26 +49,24 @@ require('jquery-ui/themes/base/datepicker.css');
// TODO: move require to backlogs plugin
require('jquery-ui/themes/base/dialog.css');

require('moment');
require('expose?moment!moment');
require('moment/locale/en-gb.js');
require('moment/locale/de.js');

require('moment-timezone/moment-timezone.js');
require('moment-timezone/moment-timezone-data.js');
require('jquery.caret');
require('at.js/jquery.atwho.min.js');
require('at.js/jquery.atwho.min.css');

require('jquery.atwho/dist/js/jquery.atwho.js');
require('jquery.atwho/dist/css/jquery.atwho.css');
require('moment-timezone/builds/moment-timezone-with-data.min.js');

require('Caret.js/src/jquery.caret.js');

require('select2/select2.js');
require('select2/select2.min.js');
require('select2/select2.css');

require('angular');
require('angular-sanitize');

require('angular-ui-select/dist/select');
require('angular-ui-select/dist/select.css');
require('ui-select/dist/select.min.js');
require('ui-select/dist/select.min.css');

require('ng-dialog/js/ngDialog.min.js');
require('ng-dialog/css/ngDialog.min.css');
Expand Down
2 changes: 2 additions & 0 deletions frontend/app/openproject-tests.js
Expand Up @@ -27,6 +27,8 @@
//++

require('./init-app');
require('angular-mocks/ngMock');
require('jquery-mockjax')(jQuery, window);

var requireComponent;

Expand Down
44 changes: 0 additions & 44 deletions frontend/bower.json

This file was deleted.

2 changes: 0 additions & 2 deletions frontend/karma.conf.js
Expand Up @@ -62,8 +62,6 @@ module.exports = function (config) {
'../app/assets/javascripts/date-en-US.js',

'tests/unit/lib/rosie.js',
'bower_components/angular-mocks/angular-mocks.js',
'bower_components/jquery-mockjax/src/jquery.mockjax.js',
'tests/unit/tests/asset_functions.js',

'tests/openproject-test-bundle.js'
Expand Down

0 comments on commit 1bf5e44

Please sign in to comment.