Skip to content

Commit 50e9a1e

Browse files
committed
Merge branch 'master' into architecture-design-doc
2 parents e3e9dde + c8ac166 commit 50e9a1e

23 files changed

+229
-146
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020
# Explicitly set the environment to be container-based. This makes the builds faster.
2121
sudo: false
22+
# Cache downloaded Node.JS modules in the node_modules directory for faster builds.
23+
cache:
24+
directories:
25+
- node_modules
2226
# Use Node.js as primary language because Gulp is the build system used in the project.
2327
language: node_js
2428
before_script:

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
# Kubernetes Console
2-
Kubernetes Console is a general purpose, web-based UI for Kubernetes clusters. It allows to manage applications running in the cluster, troubleshoot them, as well as, manage the cluster itself.
1+
# Kubernetes Dashboard
2+
Kubernetes Dashboard is a general purpose, web-based UI for Kubernetes clusters. It allows to
3+
manage applications running in the cluster, troubleshoot them, as well as, manage the cluster
4+
itself.
35

4-
The console is currently under active development and is not ready for production use (yet!).
6+
The dashboard is currently under active development and is not ready for production use (yet!).
57

6-
# Contribute:
8+
# Contribute
79

8-
Wish to contribute !! Great start [here](https://github.com/kubernetes/console/blob/master/CONTRIBUTING.md).
10+
Wish to contribute !! Great start [here](CONTRIBUTING.md).
911

10-
# License:
12+
# License
1113

12-
The work done has been licensed under Apache License 2.0.The license file can be found [here](https://github.com/kubernetes/console/blob/master/LICENSE). You can find out more about license,at
14+
The work done has been licensed under Apache License 2.0. The license file can be found
15+
[here](LICENSE). You can find out more about the license at:
1316

1417
http://www.apache.org/licenses/LICENSE-2.0

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"//": "Specification of this file can be found at:",
33
"//": "https://github.com/bower/spec/blob/master/json.md",
44

5-
"name": "kubernetes-console",
5+
"name": "kubernetes-dashboard",
66
"version": "0.0.1",
77
"dependencies": {
88
"angular": "~1.4.2",

build/backend.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,27 +69,27 @@ function spawnGoProcess(args, doneFn, opt_env) {
6969

7070

7171
/**
72-
* Compiles backend application in development mode and places 'console' binary in the serve
72+
* Compiles backend application in development mode and places the binary in the serve
7373
* directory.
7474
*/
7575
gulp.task('backend', ['backend-dependencies'], function(doneFn) {
7676
spawnGoProcess([
7777
'build',
78-
'-o', path.join(conf.paths.serve, 'console'),
79-
path.join(conf.paths.backendSrc, 'console.go'),
78+
'-o', path.join(conf.paths.serve, 'dashboard'),
79+
path.join(conf.paths.backendSrc, 'dashboard.go'),
8080
], doneFn);
8181
});
8282

8383

8484
/**
85-
* Compiles backend application in production mode and places 'console' binary in the dist
85+
* Compiles backend application in production mode and places the binary in the dist
8686
* directory.
8787
*
8888
* The production binary difference from development binary is only that it contains all
8989
* dependencies inside it and is targeted for Linux.
9090
*/
9191
gulp.task('backend:prod', ['backend-dependencies'], function(doneFn) {
92-
let outputBinaryPath = path.join(conf.paths.dist, 'console');
92+
let outputBinaryPath = path.join(conf.paths.dist, 'dashboard');
9393
// Delete output binary first. This is required because prod build does not override it.
9494
del(outputBinaryPath)
9595
.then(function() {
@@ -98,7 +98,7 @@ gulp.task('backend:prod', ['backend-dependencies'], function(doneFn) {
9898
'-a',
9999
'-installsuffix', 'cgo',
100100
'-o', outputBinaryPath,
101-
path.join(conf.paths.backendSrc, 'console.go'),
101+
path.join(conf.paths.backendSrc, 'dashboard.go'),
102102
], doneFn, {
103103
// Disable cgo package. Required to run on scratch docker image.
104104
CGO_ENABLED: '0',

build/conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default {
3535
/**
3636
* The name of the Docker image with the application.
3737
*/
38-
imageName: 'kubernetes/console',
38+
imageName: 'kubernetes/dashboard',
3939
},
4040

4141
/**
@@ -45,7 +45,7 @@ export default {
4545
/**
4646
* The name of the root Angular module, i.e., the module that bootstraps the application.
4747
*/
48-
rootModuleName: 'kubernetesConsole',
48+
rootModuleName: 'kubernetesDashboard',
4949
},
5050

5151
/**

build/script.js

Lines changed: 55 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -20,59 +20,32 @@ import gulpAngularTemplatecache from 'gulp-angular-templatecache';
2020
import gulpClosureCompiler from 'gulp-closure-compiler';
2121
import gulpEslint from 'gulp-eslint';
2222
import gulpMinifyHtml from 'gulp-minify-html';
23-
import lodash from 'lodash';
2423
import path from 'path';
24+
import webpackStream from 'webpack-stream';
2525

2626
import conf from './conf';
2727

2828

29-
/**
30-
* Base Closure Compiler config to be extended in, e.g., prod or dev config.
31-
*/
32-
const closureCompilerBaseConfig = {
33-
// "foo_flag: null" means that a flag is enabled.
34-
compilerFlags: {
35-
angular_pass: null,
36-
closure_entry_point: 'module$src$app$frontend$index_module',
37-
export_local_property_definitions: null,
38-
generate_exports: null,
39-
js_module_root: conf.paths.frontendSrc,
40-
language_in: 'ECMASCRIPT6_STRICT',
41-
language_out: 'ECMASCRIPT3',
42-
manage_closure_dependencies: true,
43-
},
44-
compilerPath: path.join(conf.paths.nodeModules, 'google-closure-compiler/compiler.jar'),
45-
// This makes the compiler faster. Requires Java 7+.
46-
tieredCompilation: true,
47-
};
48-
49-
5029
/**
5130
* Compiles frontend JavaScript files into development bundle located in {conf.paths.serve}
5231
* directory. This has to be done because currently browsers do not handle ES6 syntax and
5332
* modules correctly.
5433
*
55-
* Note that 'create-serve-folders' task is required because closure compiler source maps function
56-
* requires the folders to exist upfront.
34+
* Only dependencies of root application module are included in the bundle.
5735
*/
5836
gulp.task('scripts', ['create-serve-folders'], function() {
59-
let bundleBaseName = 'app-dev';
60-
let closureCompilerConfig = lodash.merge({
61-
fileName: `${bundleBaseName}.js`,
62-
compilerFlags: {
63-
// WHITESPACE_ONLY is not an option because it leaves ES6 modules unmodified. ES6 modules
64-
// arent handled by browsers correctly (yet).
65-
compilation_level: 'SIMPLE_OPTIMIZATIONS',
66-
create_source_map: path.join(conf.paths.serve, `${bundleBaseName}.js.map`),
67-
// Make source map URLs relative to frontend source directory.
68-
source_map_location_mapping: path.relative(conf.paths.base, conf.paths.frontendSrc) + '|',
69-
// Include source map in the output bundle.
70-
output_wrapper: '%output%\n//# sourceMappingURL=' + `${bundleBaseName}.js.map`,
71-
},
72-
}, closureCompilerBaseConfig);
73-
74-
return gulp.src(path.join(conf.paths.frontendSrc, '**/*.js'))
75-
.pipe(gulpClosureCompiler(closureCompilerConfig))
37+
let webpackOptions = {
38+
devtool: 'inline-source-map',
39+
module: {
40+
// ES6 modules have to be preprocessed with Babel loader to work in browsers.
41+
loaders: [{test: /\.js$/, exclude: /node_modules/, loaders: ['babel-loader']}],
42+
},
43+
output: {filename: 'app-dev.js'},
44+
quiet: true,
45+
};
46+
47+
return gulp.src(path.join(conf.paths.frontendSrc, 'index.module.js'))
48+
.pipe(webpackStream(webpackOptions))
7649
.pipe(gulp.dest(conf.paths.serve))
7750
});
7851

@@ -82,33 +55,47 @@ gulp.task('scripts', ['create-serve-folders'], function() {
8255
* directory.
8356
*/
8457
gulp.task('scripts:prod', ['angular-templates'], function() {
85-
let closureCompilerConfig = lodash.merge({
86-
fileName: 'app.js',
87-
compilerFlags: {
88-
compilation_level: 'ADVANCED_OPTIMIZATIONS',
89-
externs: [
90-
path.join(conf.paths.nodeModules,
91-
'google-closure-compiler/contrib/externs/angular-1.4.js'),
92-
path.join(conf.paths.nodeModules,
93-
'google-closure-compiler/contrib/externs/angular-1.4-http-promise_templated.js'),
94-
path.join(conf.paths.nodeModules,
95-
'google-closure-compiler/contrib/externs/angular-1.4-q_templated.js'),
96-
path.join(conf.paths.nodeModules,
97-
'google-closure-compiler/contrib/externs/angular_ui_router.js'),
98-
path.join(conf.paths.externs, '**/*.js'),
99-
],
100-
// Enable all compiler checks by default and make them errors.
101-
jscomp_error: '*',
102-
// Disable checks that are not applicable to the project.
103-
jscomp_off: [
104-
// This check does not work correctly with ES6.
105-
'inferredConstCheck',
106-
// Let ESLint handle all lint checks.
107-
'lintChecks',
108-
],
109-
use_types_for_optimization: null,
110-
},
111-
}, closureCompilerBaseConfig);
58+
let closureCompilerConfig = {
59+
fileName: 'app.js',
60+
// "foo_flag: null" means that a flag is enabled.
61+
compilerFlags: {
62+
angular_pass: null,
63+
closure_entry_point: 'module$src$app$frontend$index_module',
64+
compilation_level: 'ADVANCED_OPTIMIZATIONS',
65+
export_local_property_definitions: null,
66+
externs: [
67+
path.join(conf.paths.nodeModules,
68+
'google-closure-compiler/contrib/externs/angular-1.4.js'),
69+
path.join(conf.paths.nodeModules,
70+
'google-closure-compiler/contrib/externs/angular-1.4-http-promise_templated.js'),
71+
path.join(conf.paths.nodeModules,
72+
'google-closure-compiler/contrib/externs/angular-1.4-q_templated.js'),
73+
path.join(conf.paths.nodeModules,
74+
'google-closure-compiler/contrib/externs/angular-material.js'),
75+
path.join(conf.paths.nodeModules,
76+
'google-closure-compiler/contrib/externs/angular_ui_router.js'),
77+
path.join(conf.paths.externs, '**/*.js'),
78+
],
79+
generate_exports: null,
80+
js_module_root: conf.paths.frontendSrc,
81+
// Enable all compiler checks by default and make them errors.
82+
jscomp_error: '*',
83+
// Disable checks that are not applicable to the project.
84+
jscomp_off: [
85+
// This check does not work correctly with ES6.
86+
'inferredConstCheck',
87+
// Let ESLint handle all lint checks.
88+
'lintChecks',
89+
],
90+
language_in: 'ECMASCRIPT6_STRICT',
91+
language_out: 'ECMASCRIPT3',
92+
manage_closure_dependencies: true,
93+
use_types_for_optimization: null,
94+
},
95+
compilerPath: path.join(conf.paths.nodeModules, 'google-closure-compiler/compiler.jar'),
96+
// This makes the compiler faster. Requires Java 7+.
97+
tieredCompilation: true,
98+
};
11299

113100
return gulp.src([
114101
// Application source files.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"//": "Specification of this file can be found at: https://docs.npmjs.com/files/package.json",
33
"//": "When a dependency is not needed it should be removed from the list.",
4-
5-
"name": "kubernetes-console",
4+
"name": "kubernetes-dashboard",
65
"version": "0.0.1",
76
"devDependencies": {
87
"babel": "~5.8.23",
98
"babel-core": "~5.8.25",
9+
"babel-loader": "~5.3.2",
1010
"babelify": "~6.3.0",
1111
"browserify": "~11.2.0",
1212
"browser-sync": "~2.9.2",
@@ -49,6 +49,7 @@
4949
"karma-sourcemap-loader": "~0.3.6",
5050
"lodash": "~3.10.1",
5151
"uglify-save-license": "~0.4.1",
52+
"webpack-stream": "~2.1.1",
5253
"wiredep": "~2.2.2",
5354
"wrench": "~1.5.8"
5455
},

0 commit comments

Comments
 (0)