Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a40b3de

Browse files
committedMay 29, 2015
Merge pull request #72 from appirio-tech/qa
Release
2 parents bc9b1b6 + 617fa3e commit a40b3de

File tree

162 files changed

+14650
-1314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+14650
-1314
lines changed
 

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dist
44
.sass-cache
55
bower_components
66
.DS_Store
7+
app/app.constants.coffee

‎Gruntfile.js

Lines changed: 144 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Generated on 2015-03-12 using generator-angular 0.11.1
21
'use strict';
32

43
// # Globbing
@@ -20,12 +19,15 @@ module.exports = function (grunt) {
2019
app : require('./bower.json').appPath || 'app',
2120
dist : 'dist',
2221
cdnPath : 's3.amazonaws.com/abc123',
23-
API_URL : 'https://api.topcoder-dev.com/v3',
24-
API_URL_V2 : 'https://api.topcoder-dev.com/v2',
25-
clientId : 'JFDo7HMkf0q2CkVFHojy3zHWafziprhT',
26-
domain : 'topcoder-dev.com',
27-
auth0Domain : 'topcoder-dev.auth0.com',
28-
submissionDownloadPath: '/review/actions/DownloadContestSubmission?uid='
22+
API_URL : process.env.API_URL || 'https://api.topcoder-dev.com/v3',
23+
API_URL_V2 : process.env.API_URL_V2 || 'https://api.topcoder-dev.com/v2',
24+
clientId : process.env.CLIENT_ID || 'JFDo7HMkf0q2CkVFHojy3zHWafziprhT',
25+
domain : process.env.DOMAIN || 'topcoder-dev.com',
26+
auth0Domain : process.env.AUTH0_DOMAIN || 'topcoder-dev.auth0.com',
27+
auth0Callback : 'no-callback-needed-without-social-login',
28+
submissionDownloadPath: '/review/actions/DownloadContestSubmission?uid=',
29+
photoLinkLocation : process.env.PHOTO_LINK_LOCATION || 'http://community.topcoder.com',
30+
LIME_PROGRAM_ID : 3445
2931
};
3032

3133
// Define the configuration for all the tasks
@@ -35,26 +37,46 @@ module.exports = function (grunt) {
3537
yeoman: appConfig,
3638

3739
ngconstant: {
38-
// Options for all targets
3940
options: {
4041
space: ' ',
4142
wrap : '"use strict";\n\n {%= __ngModule %}',
4243
name : 'app.config',
4344
},
44-
// Environment targets
4545
development: {
4646
options: {
4747
dest: '<%= yeoman.app %>/app.constants.js'
4848
},
4949
constants: {
5050
ENV: {
5151
name : 'development',
52-
API_URL : process.env.API_URL || appConfig.API_URL,
52+
API_URL : appConfig.API_URL,
5353
API_URL_V2 : appConfig.API_URL_V2,
5454
clientId : appConfig.clientId,
5555
domain : appConfig.domain,
5656
auth0Domain : appConfig.auth0Domain,
57-
submissionDownloadPath: appConfig.submissionDownloadPath
57+
auth0Callback : appConfig.auth0Callback,
58+
submissionDownloadPath: appConfig.submissionDownloadPath,
59+
photoLinkLocation : appConfig.photoLinkLocation,
60+
LIME_PROGRAM_ID : appConfig.LIME_PROGRAM_ID
61+
}
62+
}
63+
},
64+
qa: {
65+
options: {
66+
dest: '<%= yeoman.app %>/app.constants.js'
67+
},
68+
constants: {
69+
ENV: {
70+
name : 'qa',
71+
API_URL : 'https://api.topcoder-qa.com/v3',
72+
API_URL_V2 : 'https://api.topcoder-qa.com/v2',
73+
clientId : 'EVOgWZlCtIFlbehkq02treuRRoJk12UR',
74+
domain : 'topcoder-qa.com',
75+
auth0Domain : 'topcoder-qa.auth0.com',
76+
auth0Callback : appConfig.auth0Callback,
77+
submissionDownloadPath: appConfig.submissionDownloadPath,
78+
photoLinkLocation : appConfig.photoLinkLocation,
79+
LIME_PROGRAM_ID : appConfig.LIME_PROGRAM_ID
5880
}
5981
}
6082
},
@@ -65,26 +87,25 @@ module.exports = function (grunt) {
6587
constants: {
6688
ENV: {
6789
name : 'production',
68-
API_URL : process.env.API_URL || appConfig.API_URL,
69-
API_URL_V2 : appConfig.API_URL_V2,
70-
clientId : appConfig.clientId,
71-
domain : appConfig.domain,
72-
auth0Domain : appConfig.auth0Domain,
73-
submissionDownloadPath: appConfig.submissionDownloadPath
90+
API_URL : 'https://api.topcoder.com/v3',
91+
API_URL_V2 : 'https://api.topcoder.com/v2',
92+
clientId : '6ZwZEUo2ZK4c50aLPpgupeg5v2Ffxp9P',
93+
domain : 'topcoder.com',
94+
auth0Domain : 'topcoder.auth0.com',
95+
auth0Callback : appConfig.auth0Callback,
96+
submissionDownloadPath: appConfig.submissionDownloadPath,
97+
photoLinkLocation : appConfig.photoLinkLocation,
98+
LIME_PROGRAM_ID : appConfig.LIME_PROGRAM_ID
7499
}
75100
}
76101
}
77102
},
78103

79104
// Watches files for changes and runs tasks based on the changed files
80105
watch: {
81-
bower: {
82-
files: ['bower.json'],
83-
tasks: ['wiredep']
84-
},
85106
jade: {
86107
files: ['<%= yeoman.app %>/**/*.jade'],
87-
tasks: ['newer:jade:compile']
108+
tasks: ['newer:jade:compile', 'jade:index']
88109
},
89110
coffee: {
90111
files: ['<%= yeoman.app %>/**/*.coffee'],
@@ -95,7 +116,7 @@ module.exports = function (grunt) {
95116
tasks: ['newer:coffee:test', 'karma:unit']
96117
},
97118
sass: {
98-
files: ['<%= yeoman.app %>/content/css/*.scss'],
119+
files: ['<%= yeoman.app %>/content/css/**/*.scss'],
99120
tasks: ['sass']
100121
},
101122
gruntfile: {
@@ -116,7 +137,7 @@ module.exports = function (grunt) {
116137
// The actual grunt server settings
117138
connect: {
118139
options: {
119-
port: 9001,
140+
port: 9002,
120141
// Change this to '0.0.0.0' to access the server from outside.
121142
hostname: 'localhost',
122143
livereload: 35730
@@ -142,7 +163,7 @@ module.exports = function (grunt) {
142163
},
143164
test: {
144165
options: {
145-
port: 9001,
166+
port: 9002,
146167
middleware: function (connect) {
147168
return [
148169
connect.static('.tmp'),
@@ -194,6 +215,23 @@ module.exports = function (grunt) {
194215
ext : '.html'
195216
}
196217
]
218+
},
219+
index: {
220+
options: {
221+
pretty: true,
222+
data: {
223+
debug: false
224+
}
225+
},
226+
files: [
227+
{
228+
expand: true,
229+
cwd : '<%= yeoman.app %>',
230+
src : 'index.jade',
231+
dest : '.tmp',
232+
ext : '.html'
233+
}
234+
]
197235
}
198236
},
199237

@@ -234,6 +272,34 @@ module.exports = function (grunt) {
234272
}
235273
},
236274

275+
coffeelint: {
276+
app: {
277+
files: {
278+
src: ['<%= yeoman.app %>/**/*.coffee']
279+
},
280+
options: {
281+
'max_line_length': {
282+
'level': 'ignore'
283+
},
284+
'no_interpolation_in_single_quotes': {
285+
'level': 'error'
286+
},
287+
'no_unnecessary_double_quotes': {
288+
'level': 'error'
289+
},
290+
'prefer_english_operator': {
291+
'level': 'warn'
292+
},
293+
'space_operators': {
294+
'level': 'error'
295+
},
296+
'spacing_after_comma': {
297+
'level': 'error'
298+
}
299+
}
300+
}
301+
},
302+
237303
// Empties folders to start fresh
238304
clean: {
239305
dist: {
@@ -276,21 +342,6 @@ module.exports = function (grunt) {
276342
}
277343
},
278344

279-
// Automatically inject Bower components into the app
280-
wiredep: {
281-
options: {
282-
cwd: ''
283-
},
284-
app: {
285-
src: ['.tmp/index.html'],
286-
ignorePath: /\.\.\//
287-
},
288-
sass: {
289-
src: ['<%= yeoman.app %>/content/css/{,*/}*.{scss,sass}'],
290-
ignorePath: /(\.\.\/){1,2}bower_components\//
291-
}
292-
},
293-
294345
sass: {
295346
options: {
296347
sourceMap : true,
@@ -352,8 +403,7 @@ module.exports = function (grunt) {
352403
flow: {
353404
html: {
354405
steps: {
355-
// js: ['concat', 'uglifyjs'],
356-
js: ['concat'],
406+
js: ['concat', 'uglifyjs'],
357407
css: ['cssmin']
358408
},
359409
post: {}
@@ -370,14 +420,19 @@ module.exports = function (grunt) {
370420
options: {
371421
assetsDirs: [
372422
'<%= yeoman.dist %>',
423+
'<%= yeoman.dist %>/challenges',
424+
'<%= yeoman.dist %>/confirmNewsletter',
373425
'<%= yeoman.dist %>/content/css',
374-
'<%= yeoman.dist %>/edit-review/',
375-
'<%= yeoman.dist %>/review-status/',
376-
'<%= yeoman.dist %>/completed-review/'
426+
'<%= yeoman.dist %>/content/images',
427+
'<%= yeoman.dist %>/landing',
428+
'<%= yeoman.dist %>/learn',
429+
'<%= yeoman.dist %>/login',
430+
'<%= yeoman.dist %>/register'
377431
],
378432
patterns: {
379433
js: [
380-
[/(\/[-\w]+\.html)/gm, 'Update JS files to reference revved html files.']
434+
[/(\/[-\w]+\.html)/gm, 'Update JS files to reference revved html files.'],
435+
[/(\/[-\w]+\.png)/gm, 'Update image files to reference revved html files.']
381436
// [/(locales\/\w+\.json)/gm, 'Update JS files to reference revved locale files.']
382437
]
383438
}
@@ -434,16 +489,17 @@ module.exports = function (grunt) {
434489
cwd : '<%= yeoman.app %>',
435490
dest : '<%= yeoman.dist %>',
436491
src : [
437-
// 'content/images/**/*',
438492
'content/fonts/**/*',
439-
'content/locales/**/*'
493+
'content/locales/**/*',
494+
'content/data/**/*'
440495
]
441496
}, {
442497
expand: true,
498+
flatten: true,
443499
cwd : '<%= yeoman.app %>',
444500
dest : '<%= yeoman.dist %>',
445501
src : [
446-
'content/images/favicon.ico'
502+
'content/icons/**/*'
447503
]
448504
}, {
449505
expand: true,
@@ -468,6 +524,12 @@ module.exports = function (grunt) {
468524
cwd : '<%= yeoman.app %>/content/images',
469525
dest : '.tmp/content/images/',
470526
src : ['*.png', '*.ico', '*.gif']
527+
},
528+
scripts: {
529+
expand: true,
530+
cwd : '<%= yeoman.app %>/content/scripts',
531+
dest : '.tmp/content/scripts/',
532+
src : '{,*/}*.js'
471533
}
472534
},
473535

@@ -477,12 +539,13 @@ module.exports = function (grunt) {
477539
'sass',
478540
'coffee:dist',
479541
'jade:compile',
480-
'copy:images'
542+
'copy:images',
543+
'copy:scripts'
481544
],
482545
test: [
483546
'coffee',
484547
'sass',
485-
'jade',
548+
'jade:compile',
486549
],
487550
dist: [
488551
'coffee',
@@ -508,16 +571,20 @@ module.exports = function (grunt) {
508571

509572

510573
grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
511-
if (target === 'dist') {
574+
if (target === 'prod') {
512575
return grunt.task.run(['build', 'connect:dist:keepalive']);
576+
} else if (target === 'qa') {
577+
return grunt.task.run(['build-qa', 'connect:dist:keepalive']);
578+
} else if (target === 'dev') {
579+
return grunt.task.run(['build-dev', 'connect:dist:keepalive']);
513580
}
514581

515582
grunt.task.run([
583+
'coffeelint:app',
516584
'clean:server',
517585
'ngconstant:development',
518586
'js2coffee',
519587
'clean:constants',
520-
'wiredep',
521588
'concurrent:server',
522589
'autoprefixer:server',
523590
'connect:livereload',
@@ -538,20 +605,17 @@ module.exports = function (grunt) {
538605
'karma:unit'
539606
]);
540607

541-
grunt.registerTask('build', [
542-
'clean:dist',
543-
'ngconstant:production',
608+
grunt.registerTask('build-release', [
544609
'js2coffee',
545610
'clean:constants',
546611
'concurrent:dist',
547-
'wiredep',
548612
'useminPrepare',
549613
'autoprefixer',
550614
'concat:generated',
551615
'copy:dist',
552616
'cssmin:generated',
553-
// 'uglify:generated',
554-
// 'filerev',
617+
'uglify:generated',
618+
'filerev',
555619
'usemin',
556620
'htmlmin'
557621
// 'string-replace:cdnify'
@@ -562,4 +626,25 @@ module.exports = function (grunt) {
562626
'test',
563627
'build'
564628
]);
629+
630+
grunt.registerTask('build-dev', [
631+
'coffeelint:app',
632+
'clean:dist',
633+
'ngconstant:development',
634+
'build-release'
635+
]);
636+
637+
grunt.registerTask('build-qa', [
638+
'coffeelint:app',
639+
'clean:dist',
640+
'ngconstant:qa',
641+
'build-release'
642+
]);
643+
644+
grunt.registerTask('build', [
645+
'coffeelint:app',
646+
'clean:dist',
647+
'ngconstant:production',
648+
'build-release'
649+
]);
565650
};

0 commit comments

Comments
 (0)
This repository has been archived.