Skip to content

Commit 4eba149

Browse files
committed
Added missing front-end build files.
1 parent 1c4c2d8 commit 4eba149

File tree

3 files changed

+103
-73
lines changed

3 files changed

+103
-73
lines changed

.gitignore

Lines changed: 1 addition & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,9 @@
1111
[Dd]ebug/
1212
[Rr]elease/
1313
x64/
14-
build/
1514
[Bb]in/
1615
[Oo]bj/
1716

18-
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
19-
!packages/*/build/
20-
21-
# MSTest test Results
22-
[Tt]est[Rr]esult*/
23-
[Bb]uild[Ll]og.*
24-
2517
*_i.c
2618
*_p.c
2719
*.ilk
@@ -46,49 +38,10 @@ build/
4638
*.log
4739
*.scc
4840

49-
# Visual C++ cache files
50-
ipch/
51-
*.aps
52-
*.ncb
53-
*.opensdf
54-
*.sdf
55-
*.cachefile
56-
57-
# Visual Studio profiler
58-
*.psess
59-
*.vsp
60-
*.vspx
61-
62-
# Guidance Automation Toolkit
63-
*.gpState
64-
6541
# ReSharper is a .NET coding add-in
6642
_ReSharper*/
6743
*.[Rr]e[Ss]harper
6844

69-
# TeamCity is a build add-in
70-
_TeamCity*
71-
72-
# DotCover is a Code Coverage Tool
73-
*.dotCover
74-
75-
# NCrunch
76-
*.ncrunch*
77-
.*crunch*.local.xml
78-
79-
# Installshield output folder
80-
[Ee]xpress/
81-
82-
# DocProject is a documentation generator add-in
83-
DocProject/buildhelp/
84-
DocProject/Help/*.HxT
85-
DocProject/Help/*.HxC
86-
DocProject/Help/*.hhc
87-
DocProject/Help/*.hhk
88-
DocProject/Help/*.hhp
89-
DocProject/Help/Html2
90-
DocProject/Help/html
91-
9245
# Click-Once directory
9346
publish/
9447

@@ -100,17 +53,7 @@ publish/
10053
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
10154
packages/
10255

103-
# Windows Azure Build Output
104-
csx
105-
*.build.csdef
106-
107-
# Windows Store app package directory
108-
AppPackages/
109-
11056
# Others
111-
sql/
112-
*.Cache
113-
ClientBin/
11457
[Ss]tyle[Cc]op.*
11558
~$*
11659
*~
@@ -119,16 +62,6 @@ ClientBin/
11962
*.pfx
12063
*.publishsettings
12164

122-
# RIA/Silverlight projects
123-
Generated_Code/
124-
125-
# Backup & report files from converting an old project file to a newer
126-
# Visual Studio version. Backup files are not needed, because we have git ;-)
127-
_UpgradeReport_Files/
128-
Backup*/
129-
UpgradeLog*.XML
130-
UpgradeLog*.htm
131-
13265
# SQL Server files
13366
App_Data/*.mdf
13467
App_Data/*.ldf
@@ -141,12 +74,6 @@ App_Data/*.ldf
14174
Thumbs.db
14275
ehthumbs.db
14376

144-
# Folder config file
145-
Desktop.ini
146-
147-
# Recycle Bin used on file shares
148-
$RECYCLE.BIN/
149-
15077
# Mac crap
15178
.DS_Store
15279

@@ -155,3 +82,4 @@ src/.vs
15582
# Cake Build
15683
/tools
15784
/artifacts
85+
node_modules/
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
module.exports = function(grunt) {
2+
3+
"use strict";
4+
5+
grunt.initConfig({
6+
pkg: grunt.file.readJSON('package.json'),
7+
8+
watch: {
9+
errors : {
10+
files: [
11+
'../Plugins/Admin/Modules/Errors/Js/**/*.js'
12+
],
13+
tasks: ['concat:errors', 'uglify:errors']
14+
},
15+
errorsHTML : {
16+
files: [
17+
'../Plugins/Admin/Modules/Errors/Js/**/*.html'
18+
],
19+
tasks: ['concat:errorsHTML']
20+
},
21+
options: {
22+
spawn: false
23+
}
24+
},
25+
26+
concat: {
27+
errors: {
28+
src: [
29+
'../Plugins/Admin/Modules/Errors/Js/Bootstrap/*.js',
30+
'../Plugins/Admin/Modules/Errors/Js/DataServices/*.js',
31+
'../Plugins/Admin/Modules/Errors/Js/UIComponents/*.js',
32+
'../Plugins/Admin/Modules/Errors/Js/Routes/*.js',
33+
],
34+
dest: '../Plugins/Admin/Modules/Errors/Content/js/errors.js'
35+
},
36+
errorsHTML: getHtmlTemplateConfig('Errors'),
37+
},
38+
39+
uglify: {
40+
options: {
41+
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
42+
},
43+
errors: {
44+
src: '../Plugins/Admin/Modules/Errors/Content/js/errors.js',
45+
dest: '../Plugins/Admin/Modules/Errors/Content/js/errors_min.js'
46+
},
47+
}
48+
});
49+
50+
grunt.loadNpmTasks('grunt-contrib-watch');
51+
grunt.loadNpmTasks('grunt-contrib-uglify');
52+
grunt.loadNpmTasks('grunt-contrib-concat');
53+
54+
grunt.registerTask('default', ['bundleJS']);
55+
grunt.registerTask('bundleJS', [
56+
57+
'concat:errors',
58+
'concat:errorsHTML',
59+
'uglify',
60+
]);
61+
62+
63+
function getHtmlTemplateConfig(moduleName) {
64+
return {
65+
options: {
66+
banner: "angular.module('cms." + camelize(moduleName) + "').run(['$templateCache',function(t){",
67+
footer: "}]);",
68+
process: function(src, filepath) {
69+
var removeSpaces = src.replace(/[\t\n\r]/gm, "");
70+
var escapeQuotes = removeSpaces.replace(/'/g, "\\'");
71+
var splitPath = filepath.split('..');
72+
var formattedSrc = "t.put('" + splitPath[1] + "','" + escapeQuotes + "');";
73+
74+
return formattedSrc;
75+
}
76+
},
77+
src: [
78+
'../Plugins/Admin/Modules/' + moduleName + '/Js/Routes/*.html',
79+
'../Plugins/Admin/Modules/' + moduleName + '/Js/Routes/**/*.html',
80+
'../Plugins/Admin/Modules/' + moduleName + '/Js/UIComponents/*.html',
81+
'../Plugins/Admin/Modules/' + moduleName + '/Js/UIComponents/**/*.html'
82+
],
83+
dest: '../Plugins/Admin/Modules/' + moduleName + '/Content/js/' + moduleName.toLowerCase() + '_templates.js'
84+
}
85+
}
86+
87+
function camelize(string) {
88+
return string.charAt(0).toLowerCase() + string.slice(1);
89+
}
90+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "BasicTestSite",
3+
"version": "0.1.0",
4+
"devDependencies": {
5+
"grunt": "^0.4.5",
6+
"grunt-contrib-concat": "~0.5.1",
7+
"grunt-contrib-jshint": "^0.10.0",
8+
"grunt-contrib-nodeunit": "~0.2.0",
9+
"grunt-contrib-uglify": "~0.2.2",
10+
"grunt-contrib-watch": "^0.6.1"
11+
}
12+
}

0 commit comments

Comments
 (0)