Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hawtio dependency #316

Merged
merged 1 commit into from
Mar 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
"ansi_up": false,
"c3": false,
"d3": false,
"hawtioPluginLoader": false,
"HawtioCore": false,
"Logger" : false,
"LabelSelector": false,
"ResourceGroupVersion": false,
Expand Down
63 changes: 55 additions & 8 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,51 @@ module.exports = function (grunt) {
},
concat: {
options: {
separator: ';'
separator: ';\n'
},
ui: {
src: ['src/**/*UI.module.js', 'dist/scripts/templates.js', 'src/components/**/*.js', 'src/filters/**/*.js', 'src/ui-services/**/*.js'],
src: [
'src/pluginLoader.js',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pondering whether pluginLoader fits better under services over ui, or if it should be in both. We consume the dist, so I don't think it can break the console, loading it twice probably overwrites one version, but its hard to tell if this thing has any internal caches that would cause memory leaks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I could tell, these files are intended to be consumed individually and not together. If you only need UI components, you don't have to consume the Services file and vice versa, and if you need both you just consume the origin-web-common.js file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other option would be to just leave it out of the concatenated files, then leave it to the consumer to load the pluginLoader script before the others.

'src/*UI.module.js',
'dist/scripts/templates.js',
'src/components/**/*.js',
'src/filters/**/*.js',
'src/ui-services/**/*.js'
],
dest: 'dist/origin-web-common-ui.js'
},
services: {
src: ['src/**/*Services.module.js', 'src/services/**/*.js', 'src/constants/**/*.js'],
src: [
'src/pluginLoader.js',
'src/*Services.module.js',
'src/services/**/*.js',
'src/constants/**/*.js'
],
dest: 'dist/origin-web-common-services.js'
},
dist: {
src: ['src/**/*.module.js', 'dist/scripts/templates.js', 'src/**/*.js'],
src: [
'src/pluginLoader.js',
'src/*.module.js',
'dist/scripts/templates.js',
'src/constants/**/*.js',
'src/filters/**/*.js',
'src/services/**/*.js',
'src/ui-services/**/*.js',
'src/components/**/*.js'
],
dest: 'dist/origin-web-common.js'
}
},
copy: {
main: {
files: [
{expand: true, cwd: 'src/styles/', src: ['*'], dest: 'dist/less/'}
{
expand: true,
cwd: 'src/styles/',
src: ['*'],
dest: 'dist/less/'
}
]
}
},
Expand All @@ -71,7 +97,10 @@ module.exports = function (grunt) {
},
options: {
cleancss: true,
paths: ['src/styles', 'bower_components/']
paths: [
'src/styles',
'bower_components/'
]
}
}
},
Expand Down Expand Up @@ -129,17 +158,35 @@ module.exports = function (grunt) {
src: 'dist/origin-web-common.js',
dest: 'dist/origin-web-common.min.js'
}

}
});

// You can specify which modules to build as arguments of the build task.
grunt.registerTask('build', 'Create bootstrap build files', function () {
grunt.task.run(['clean', 'ngtemplates', 'concat', 'copy', 'ngAnnotate', 'less', 'uglify:build', 'test']);
grunt.task.run([
'clean',
'ngtemplates',
'concat',
'copy',
'ngAnnotate',
'less',
'uglify:build',
'test'
]);
});

// Runs all the tasks of build with the exception of tests
grunt.registerTask('deploy', 'Prepares the project for deployment. Does not run unit tests', function () {
grunt.task.run(['clean', 'ngtemplates', 'concat', 'copy', 'ngAnnotate', 'less', 'uglify:build']);
grunt.task.run([
'clean',
'ngtemplates',
'concat',
'copy',
'ngAnnotate',
'less',
'uglify:build'
]);
});

grunt.registerTask('default', ['build']);
Expand Down
3 changes: 1 addition & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@
"angular": "~1.5.11",
"angular-sanitize": "~1.5.11",
"angular-utf8-base64": "~0.0.5",
"hawtio-core": "~2.0.37",
"hawtio-extension-service": "~2.0.2",
"hopscotch": "~0.2.7",
"jquery": "~3.2.1",
"js-logger": "~0.9.14",
"kubernetes-label-selector": "~2.1.1",
"lodash": "~4.17.4",
"patternfly": ">=3.27.2 <4.0",
Expand Down
Loading