Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ node_modules

# Optional REPL history
.node_repl_history

# Generated folders and files
cap
records
3 changes: 3 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"preset": "airbnb"
}
64 changes: 64 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"predef" : ["gs", "g_form", "g_user", "angular"],
"bitwise": true,
"curly": true,
"eqeqeq": true,
"forin": true,
"immed": false,
"latedef": false,
"newcap": true,
"noarg": true,
"noempty": true,
"camelcase" : true,
"nonew": false,
"plusplus": false,
"regexp": false,
"undef": true,
"strict": true,
"trailing": false,
"asi": false,
"boss": false,
"debug": false,
"eqnull": false,
"evil": false,
"expr": false,
"unused": true,
"indent": 2,
"funcscope": false,
"globalstrict": false,
"iterator": false,
"lastsemic": false,
"laxbreak": false,
"laxcomma": false,
"loopfunc": false,
"multistr": false,
"onecase": true,
"proto": false,
"regexdash": false,
"scripturl": false,
"smarttabs": true,
"shadow": false,
"sub": false,
"supernew": false,
"validthis": true,
"browser": true,
"couch": false,
"devel": false,
"dojo": false,
"jquery": false,
"mootools": false,
"node": false,
"nonstandard": false,
"prototypejs": false,
"rhino": false,
"wsh": false,
"nomen": false,
"onevar": true,
"passfail": false,
"white": true,
"maxlen": 80,
"maxparams" : 5,
"maxdepth" : 5,
"maxstatements" : false,
"maxerr": 100
}
172 changes: 172 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
{
"roots": {
"C:/Users/laitlaar/Documents/codesquare/sn-filesync/records": {
"host": "dev11936.service-now.com",
"auth": "YWRtaW46Ymlzc21pbGxhaA=="
}
},
"search": {
"mine": {
"query": "active=true^sys_updated_by=javascript:gs.getUserName()^ORsys_created_by=javascript:gs.getUserName()^ORDERBYDESCsys_updated_on",
"records_per_search": "10"
},
"my_app": {
"query": "sys_scope=61bde7134fd122009d184a318110c761",
"records_per_search": "100",
"download": true
},
"script_includes": {
"table": "sys_script_include",
"query": "sys_scope=61bde7134fd122009d184a318110c761",
"records_per_search": "50",
"download": true
},
"ui_script": {
"table": "sys_ui_script",
"query": "sys_scope=61bde7134fd122009d184a318110c761",
"records_per_search": "50",
"download": true
},
"business_rules": {
"table": "sys_script",
"query": "sys_scope=61bde7134fd122009d184a318110c761",
"records_per_search": "50",
"download": true
}
},
"debug": false,
"folders": {
"business_rules": {
"table": "sys_script",
"key": "name",
"fields": {
"js": "script"
},
"subDirPattern": "collection/when",
"_custom": true
},
"client_scripts": {
"table": "sys_script_client",
"key": "name",
"fields": {
"js": "script"
},
"subDirPattern": "table/type",
"_custom": true
},
"processors": {
"table": "sys_processor",
"key": "name",
"fields": {
"js": "script"
},
"_custom": true
},
"script_actions": {
"table": "sysevent_script_action",
"key": "name",
"fields": {
"js": "script"
},
"subDirPattern": "event_name",
"_custom": true
},
"script_includes": {
"table": "sys_script_include",
"key": "name",
"fields": {
"js": "script"
},
"subDirPattern": "client_<client_callable>",
"_custom": true
},
"style_sheets": {
"table": "content_css",
"key": "name",
"fields": {
"css": "style"
},
"_custom": true
},
"ui_actions": {
"table": "sys_ui_action",
"key": "name",
"fields": {
"js": "script"
},
"subDirPattern": "table/client_<client>",
"_custom": true
},
"ui_macros": {
"table": "sys_ui_macro",
"key": "name",
"fields": {
"xhtml": "xml"
},
"subDirPattern": "category",
"_custom": true
},
"ui_pages": {
"table": "sys_ui_page",
"key": "name",
"fields": {
"xhtml": "html",
"client.js": "client_script",
"server.js": "processing_script"
},
"subDirPattern": "category",
"_custom": true
},
"ui_scripts": {
"table": "sys_ui_script",
"key": "name",
"fields": {
"js": "script"
},
"_custom": true
},
"dynamic_content_blocks": {
"table": "content_block_programmatic",
"key": "name",
"fields": {
"xhtml": "programmatic_content"
},
"subDirPattern": "category",
"_custom": true
},
"email_templates": {
"table": "sysevent_email_template",
"key": "name",
"fields": {
"html": "message_html"
},
"subDirPattern": "collection",
"_custom": true
},
"fix_scripts": {
"table": "sys_script_fix",
"key": "name",
"fields": {
"js": "script"
},
"_custom": true
},
"catalog_client_scripts": {
"table": "catalog_script_client",
"key": "name",
"fields": {
"js": "script"
},
"subDirPattern": "applies_to_<applies_to>/type",
"_custom": true
},
"sys_web_service": {
"table": "sys_web_service",
"key": "name",
"fields": {
"js": "script"
},
"_custom": true
}
}
}
37 changes: 37 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var gulp = require('gulp'),
shell = require('gulp-shell'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
runSequence = require('run-sequence');

var options = require('minimist')(process.argv.slice(2));

gulp.task('default', function() {
//run a sequence of tasks
});

gulp.task('jshint-client', function () {
return gulp.src(['./lib/*.js', './sncapappsfrancedev/ui_scripts/*.js', './sncapappsfrancedev/business_rules/*.js'])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});

gulp.task('jshint-server', function () {
return gulp.src(['./lib/*.js','./sncapappsfrancedev/script_includes/*.js'])
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});

gulp.task('jshint', function (callback) {
/**
* This will run in this order:
* jshint-client
* jshint-client and jshint-server in parallel
* jshint-server
* Finally call the callback function
*/
runSequence('jshint-client',
//['jshint-client', 'jshint-server'],
'jshint-server',
callback);
})
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@
"engines": {
"node": ">=4.2.6 || >=5.0"
},
"devDependencies": {},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-jshint": "^2.0.1",
"gulp-shell": "^0.5.2",
"jscs": "^3.0.7",
"jshint": "^2.9.3",
"jshint-stylish": "^2.2.1",
"run-sequence": "^1.2.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down